Skip to content

Commit

Permalink
Fix reference type in schema and support angular 15
Browse files Browse the repository at this point in the history
* if a json schema element has a link to reference type
and `title` or `description`, these
elements overwrite `title` and `description`
from reference type.
* jsonforms supports angular 15, in order we can safe
upgrade angular in frontend.

[REG-35516](https://jira.regnology.net/browse/REG-35516)
[REG-35573](https://jira.regnology.net/browse/REG-35573)
  • Loading branch information
Dmitrii Ponomarev committed Apr 5, 2023
1 parent 0f0470f commit 654777a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
18 changes: 9 additions & 9 deletions packages/angular-material/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@
]
},
"peerDependencies": {
"@angular/animations": "^12.0.0 || ^13.0.0 || ^14.0.0",
"@angular/cdk": "^12.0.0 || ^13.0.0 || ^14.0.0",
"@angular/common": "^12.0.0 || ^13.0.0 || ^14.0.0",
"@angular/core": "^12.0.0 || ^13.0.0 || ^14.0.0",
"@angular/flex-layout": "^12.0.0-beta || ^13.0.0-beta || ^14.0.0-beta",
"@angular/forms": "^12.0.0 || ^13.0.0 || ^14.0.0",
"@angular/material": "^12.0.0 || ^13.0.0 || ^14.0.0",
"@angular/platform-browser": "^12.0.0 || ^13.0.0 || ^14.0.0",
"@angular/router": "^12.0.0 || ^13.0.0 || ^14.0.0",
"@angular/animations": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0",
"@angular/cdk": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0",
"@angular/common": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0",
"@angular/core": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0",
"@angular/flex-layout": "^12.0.0-beta || ^13.0.0-beta || ^14.0.0-beta || ^15.0.0-beta",
"@angular/forms": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0",
"@angular/material": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0",
"@angular/platform-browser": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0",
"@angular/router": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0",
"@jsonforms/angular": "3.0.0-rc.0",
"@jsonforms/core": "3.0.0-rc.0",
"core-js": "^2.5.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
]
},
"peerDependencies": {
"@angular/core": "^12.0.0 || ^13.0.0 || ^14.0.0",
"@angular/forms": "^12.0.0 || ^13.0.0 || ^14.0.0",
"@angular/core": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0",
"@angular/forms": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0",
"@jsonforms/core": "3.0.0-rc.0",
"rxjs": "^6.4.0"
},
Expand Down
7 changes: 7 additions & 0 deletions packages/core/src/util/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,14 @@ const resolveSchemaWithSegments = (
}

if (schema.$ref) {
const originalSchema: JsonSchema = schema;
schema = resolveSchema(rootSchema, schema.$ref, rootSchema);
if (originalSchema.title) {
schema.title = originalSchema.title;
}
if (originalSchema.description) {
schema.description = originalSchema.description;
}
}

if (!pathSegments || pathSegments.length === 0) {
Expand Down

0 comments on commit 654777a

Please sign in to comment.