-
Notifications
You must be signed in to change notification settings - Fork 117
feat(ui-concerto): Improve rendering for relationship values #164
feat(ui-concerto): Improve rendering for relationship values #164
Conversation
Signed-off-by: Matt Roberts <code@rbrts.uk>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously this just appeared as a standard input field. I'm trying to find a way to distinguish between values and relationships (https://docs.accordproject.org/docs/model-relationships.html). In the latest iteration, I've added a popup to give more explanation |
…ference Signed-off-by: Matt Roberts <code@rbrts.uk>
434a245
to
6eb8819
Compare
Signed-off-by: Matt Roberts <code@rbrts.uk>
Signed-off-by: Matt Roberts <code@rbrts.uk>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✨
As a developer, I really love the arrow and resource syntax under the field. I think it looks very nice. |
Signed-off-by: Matt Roberts <code@rbrts.uk>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -58,6 +58,7 @@ | |||
"scripts": { | |||
"storybook": "start-storybook -p 9009 -s public", | |||
"build-storybook": "NODE_OPTIONS='--max-old-space-size=4096' build-storybook -s public --quiet", | |||
"build-storybook:watch": "NODE_OPTIONS='--max-old-space-size=4096' build-storybook -w -s public --quiet", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The README
says to use npm run storybook
.. does this do something different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is helpful when developing to have the storybook auto-rebuild when the code changes. The README is correct, but personally I prefer to work like this.
Summary
This PR improves the formatting for relationship fields to better support relationship URIs (e.g.
resource:test.AnAsset#49253
). The internal URI format is difficult to understand for a novice user and the current field doesn't enforce the URI format when editing, this can easily lead to mistakes.Changes
ConcertoRelationship
component which understands the relationship URI. This is instead of theConcertoInput
component which is used elsewhere.ConcertoRelationship
component now hides the URI protocol and namespace from the path. The Type is shown in a label, and only the identifier value is editable.Flags
concerto
doesn't allow empty identifiers (https://github.com/accordproject/concerto/blob/f2d9942d1bda59797216468404d21e545d4d1e07/packages/concerto-core/lib/model/resourceid.js#L48) and because empty string is falsy in JavaScript, the behavior when you try to delete the last character is a little odd. If the value is empty, we have to fall back to using a non-empty default value (I've chosenresource1
).Screenshots or Video
Author Checklist
Extend the documentation, if necessarymaster
fromfork:branchname