Skip to content

Commit 620ea28

Browse files
authored
Merge branch 'processing:main' into code-of-conduct
2 parents 421309b + 5a6de3d commit 620ea28

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+213
-162
lines changed

public/reference/data.json

Lines changed: 36 additions & 36 deletions
Large diffs are not rendered by default.

public/search-indices/en.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

public/search-indices/es.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

public/search-indices/hi.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

public/search-indices/ko.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

public/search-indices/zh-Hans.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/api/OpenProcessing.ts

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const openProcessingEndpoint = "https://openprocessing.org/api/";
1010
* Currently a placeholder (https://openprocessing.org/curation/78544/)
1111
*/
1212
const curationId = "87649";
13+
const newCurationId = "89576";
1314

1415
/**
1516
* API Response from a call to the Curation Sketches endpoint
@@ -43,14 +44,38 @@ export const getCurationSketches = memoize(async (
4344
limit?: number,
4445
): Promise<OpenProcessingCurationResponse> => {
4546
const limitParam = limit ? `limit=${limit}` : "";
46-
const response = await fetch(
47+
const response1 = await fetch(
4748
`${openProcessingEndpoint}curation/${curationId}/sketches?${limitParam}`,
4849
);
49-
if(!response.ok){ //log error instead of throwing error to not cache result in memoize
50-
console.error('getCurationSketches', response.status, response.statusText)
50+
if(!response1.ok){ //log error instead of throwing error to not cache result in memoize
51+
console.error('getCurationSketches', response1.status, response1.statusText)
5152
}
52-
const payload = await response.json();
53-
return payload as OpenProcessingCurationResponse;
53+
const payload1 = await response1.json();
54+
55+
const response2 = await fetch(
56+
`${openProcessingEndpoint}curation/${newCurationId}/sketches?${limitParam}`,
57+
);
58+
if(!response2.ok){ //log error instead of throwing error to not cache result in memoize
59+
console.error('getCurationSketches', response2.status, response2.statusText)
60+
}
61+
const payload2 = await response2.json();
62+
63+
// Selected Sketches from the 2025 curation
64+
const priorityIds = ['2690038', '2484739', '2688829', '2689119', '2690571', '2690405','2684408' , '2693274', '2693345', '2691712']
65+
66+
const prioritySketches = payload2.filter(
67+
(sketch: OpenProcessingCurationResponse[number]) => priorityIds.includes(String(sketch.visualID)))
68+
.sort((a: OpenProcessingCurationResponse[number], b: OpenProcessingCurationResponse[number]) => priorityIds.indexOf(String(a.visualID)) - priorityIds.indexOf(String(b.visualID)));
69+
70+
71+
const finalSketches = [
72+
...prioritySketches.map((sketch: OpenProcessingCurationResponse[number]) => ({ ...sketch, curation: '2025' })),
73+
...payload1.map((sketch: OpenProcessingCurationResponse[number]) => ({ ...sketch, curation: '2024' })),
74+
];
75+
76+
return [
77+
...finalSketches,
78+
] as OpenProcessingCurationResponse;
5479
});
5580

5681
/**

src/api/images/2484739.png

927 KB

src/api/images/2684408.png

2.21 MB

src/api/images/2688829.png

194 KB

0 commit comments

Comments
 (0)