Skip to content

Commit 96cab67

Browse files
Merge pull request #26 from Exabyte-io/update/SOF-6186
SOF-6186: Add Project schema class + Add schemaId error handler
2 parents e30d12b + 0279f83 commit 96cab67

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"@babel/preset-react": "7.16.7",
4949
"@babel/register": "^7.16.0",
5050
"@babel/runtime-corejs3": "7.16.8",
51-
"@exabyte-io/esse.js": "2022.9.6-0",
51+
"@exabyte-io/esse.js": "2022.10.10-0",
5252
"crypto-js": "^4.1.1",
5353
"json-schema-merge-allof": "^0.8.1",
5454
"lodash": "^4.17.21",

src/JSONSchemasInterface.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ export class JSONSchemasInterface {
1212
if (!schemasCache.has(schemaId)) {
1313
const originalSchema = schemas.find((schema) => schema.schemaId === schemaId);
1414

15+
if (!originalSchema) {
16+
throw new Error(`Schema not found: ${schemaId}`);
17+
}
18+
1519
const schema = mergeAllOf(originalSchema, {
1620
resolvers: {
1721
defaultResolver: mergeAllOf.options.resolvers.title,

src/utils/schemas.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export const baseSchemas = {
2222
ReduceUnit: "workflow/unit/reduce",
2323
SubworkflowUnit: "workflow/unit",
2424
Unit: "workflow/unit",
25+
Project: "project",
2526
};
2627

2728
export const entityMix = [
@@ -54,6 +55,8 @@ export const flavorMix = ["system/is-multi-material"];
5455

5556
export const systemEntityMix = ["system/entity"];
5657

58+
export const projectMix = ["system/status"];
59+
5760
export const mixSchemas = {
5861
Entity: [...entityMix],
5962
Material: [...entityMix],
@@ -76,6 +79,7 @@ export const mixSchemas = {
7679
ReduceUnit: [...unitMix],
7780
SubworkflowUnit: [...unitMix],
7881
Unit: [...unitMix],
82+
Project: [...entityMix, ...systemEntityMix, ...projectMix],
7983
};
8084

8185
export function getSchemaByClassName(className) {

0 commit comments

Comments
 (0)