Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

editor: add schema example in the demo application #249

Merged
merged 1 commit into from
Nov 27, 2020

Conversation

jma
Copy link
Contributor

@jma jma commented Sep 1, 2020

  • Adds a new link in the application demo to show the editor with a
    specific JSONSchema to demonstrate all the possibilities of the editor.
  • Makes JSONSchema and editorSettings as Input for the editor component.
  • Cleans the empty values in the emitted model.
  • Set the defauls model and JSONSchema values if the URL do not contains
    the record type.
  • Closes Create an example of the editor with a local JSONSchema #115.

Co-Authored-by: Johnny Mariéthoz Johnny.Mariethoz@rero.ch

Why are you opening this PR?

  • To diagnose easily the editor.

How to test?

  • Start the demo application and go to the record menu and click on the editor entry.

Note: the editor component file has been re-indented. Sorry for the review.

Code review check list

  • Commit message template compliance.
  • Commit message without typos.
  • File names.
  • Functions names.
  • Functions docstrings.
  • Unnecessary commited files?
  • Extracted translations?

@iGormilhit iGormilhit added the f: editor Concerns editor based on JSON schema AND custom editor label Sep 9, 2020
@jma jma force-pushed the maj-schema-example branch 6 times, most recently from 585124c to 182a4ed Compare November 23, 2020 14:10
@jma jma changed the title editor: schema example editor: add schema example in the demo application Nov 23, 2020
@jma jma marked this pull request as ready for review November 23, 2020 14:12
@jma jma requested review from sebdeleze and Garfield-fr November 23, 2020 14:13
Model
</div>
<div class="card-body">
<pre>{{model | json}}</pre>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space after {and before }

Copy link

@iGormilhit iGormilhit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit message is fine.

Otherwise, it's juste a matter of coherence in the JSON schema.

{
"schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"title": "Test Editor",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"title": "Test Editor",
"title": "Test editor",

"additionnalProperties": "false",
"oneOf": [
{
"title": "prop1",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"title": "prop1",
"title": "Proposition 1",

],
"properties": {
"name": {
"title": "name",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"title": "name",
"title": "Name",

}
},
"hidden": {
"title": "hidden name",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"title": "hidden name",
"title": "Hidden name",

}
},
"type": {
"title": "type",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"title": "type",
"title": "Type",

}
},
"array_of_array": {
"title": "Array Of Array",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"title": "Array Of Array",
"title": "Array of array",

}
},
"array_of_object_of_object": {
"title": "Array of Object of Object",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"title": "Array of Object of Object",
"title": "Array of object of object",

"type": "array",
"minItems": 0,
"items": {
"title": "Object of Object",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"title": "Object of Object",
"title": "Object of object",

],
"properties": {
"object1": {
"title": "Object1",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"title": "Object1",
"title": "Object 1",

@@ -0,0 +1,37 @@
import { HttpClientTestingModule } from '@angular/common/http/testing';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Header is missing

@Component({
selector: 'app-editor',
templateUrl: './editor.component.html',
styleUrls: ['./editor.component.scss']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove styleUrls property as it's not used, and the scss file, too.

@jma jma force-pushed the maj-schema-example branch 2 times, most recently from 58cffb2 to 7b4a995 Compare November 24, 2020 09:28
@jma jma requested review from iGormilhit and sebdeleze November 24, 2020 09:29
@iGormilhit iGormilhit added this to the v0.15.0 milestone Nov 25, 2020
Copy link

@iGormilhit iGormilhit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention #115 in the commit message please.

@iGormilhit iGormilhit linked an issue Nov 26, 2020 that may be closed by this pull request
@iGormilhit iGormilhit added the dev: documentation About changelog, release notes, installation procedures, gh templates... label Nov 26, 2020
* Adds a new link in the application demo to show the editor with a
  specific JSONSchema to demonstrate all the possibilities of the editor.
* Makes JSONSchema and editorSettings as Input for the editor component.
* Cleans the empty values in the emitted model.
* Set the defauls model and JSONSchema values if the URL do not contains
  the record type.
* Closes rero#115.

Co-Authored-by: Johnny Mariéthoz <Johnny.Mariethoz@rero.ch>
@sebdeleze sebdeleze dismissed iGormilhit’s stale review November 27, 2020 08:16

Mention added to commit message!

@sebdeleze sebdeleze merged commit 7d65a71 into rero:dev Nov 27, 2020
@jma jma deleted the maj-schema-example branch December 13, 2021 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev: documentation About changelog, release notes, installation procedures, gh templates... f: editor Concerns editor based on JSON schema AND custom editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create an example of the editor with a local JSONSchema
4 participants