[6243] Add documentation in the new representation modal#6245
[6243] Add documentation in the new representation modal#6245
Conversation
c0365f8 to
25e0949
Compare
25e0949 to
5829ce2
Compare
| /> | ||
| <InputLabel id="newRepresentationModalRepresentationDescriptionLabel">{t('type.label')}</InputLabel> | ||
| <Select | ||
| <TextField |
There was a problem hiding this comment.
I used this PR as an excuse to uniformize the rendering of input labels in this modal. See below the before/after comparison.
Note that I aligned the font on the smaller label (name), which makes the difference between the helper text and the label a bit difficult to distinguish. Let me know if I should change that.
There was a problem hiding this comment.
The label of the field should not look like the helper text of the previous field. It should be bigger. Have a look at the label / helper text in the new project page for example.
There was a problem hiding this comment.
Ok, I'll do the same thing as in the duplicate object dialog then
| * | ||
| * @author arichard | ||
| */ | ||
| public record RepresentationDescriptionMetadataDTO(String id, String label, String defaultName, String description) { |
There was a problem hiding this comment.
As discussed, I renamed this class to RepresentationDescriptionMetadataDTO (and moved it to the DTO package).
Note that I also transformed the class into a record.
| if (viewRepresentationDescription.isPresent()) { | ||
| String defaultName = viewRepresentationDescription.map(view -> this.getDefaultName(view, editingContext, object)).orElse(representationDescription.getLabel()); | ||
| result.add(new RepresentationDescriptionMetadata(representationDescription.getId(), representationDescription.getLabel(), defaultName)); | ||
| String documentation = viewRepresentationDescription.map(RepresentationDescription::getDescription).orElse(""); |
There was a problem hiding this comment.
I don't think that this will have the content you imagine. The field RepresentationDescription#description in the View DSL will contain some sort of internal description of the representation. Think of it as multiple paragraphs of content similar to a Javadoc. This will not have some short documentation for the end user. It has not been exposed to the frontend on purpose.
In Sirius Desktop, there are both:
- https://github.com/eclipse-sirius/sirius-desktop/blob/master/plugins/org.eclipse.sirius.model/src-gen/org/eclipse/sirius/viewpoint/description/DocumentedElement.java
- https://github.com/eclipse-sirius/sirius-desktop/blob/master/plugins/org.eclipse.sirius.model/src-gen/org/eclipse/sirius/viewpoint/description/EndUserDocumentedElement.java
And they are clearly identified.
There was a problem hiding this comment.
I rebased this PR on #6249, which adds RepresentationDescription#endUserDocumentation.
This piece of code now uses this new field instead of the description.
5829ce2 to
99187f7
Compare
Bug: #6248 Signed-off-by: Gwendal Daniel <gwendal.daniel@obeosoft.com>
Bug: #6243 Signed-off-by: Gwendal Daniel <gwendal.daniel@obeosoft.com>
99187f7 to
414f803
Compare
| .name("Domain") | ||
| .domainType("domain::Domain") | ||
| .titleExpression("aql:'Domain'") | ||
| .endUserDocumentation("A diagram showing the entities of a domain and their relations.") |
There was a problem hiding this comment.
We don't really need this, I added it to visually test the feature, but the integration test relies on a test-specific TestRepresentationDescriptionsProvider.

Bug: #6243
Pull request template
General purpose
What is the main goal of this pull request?
Project management
priority:andpr:labels been added to the pull request? (In case of doubt, start with the labelspriority: lowandpr: to review later)area:,difficulty:,type:)CHANGELOG.adocbeen updated to reference the relevant issues?CHANGELOG.adoc? (Including changes in the GraphQL API)CHANGELOG.adoc? For example indoc/screenshots/2022.5.0-my-new-feature.pngArchitectural decision records (ADR)
[doc]?CHANGELOG.adoc?Dependencies
CHANGELOG.adoc?CHANGELOG.adoc?Frontend
This section is not relevant if your contribution does not come with changes to the frontend.
General purpose
Typing
We need to improve the typing of our code, as such, we require every contribution to come with proper TypeScript typing for both changes contributing new files and those modifying existing files.
Please ensure that the following statements are true for each file created or modified (this may require you to improve code outside of your contribution).
useMutation<DATA_TYPE, VARIABLE_TYPE>(…)useQuery<DATA_TYPE, VARIABLE_TYPE>(…)useSubscription<DATA_TYPE, VARIABLE_TYPE>(…)useMachine<CONTEXT_TYPE, EVENTS_TYPE>(…)useState<STATE_TYPE>(…)?.(if the GraphQL API specifies that a field cannot benull, do not treat it has potentiallynullfor example)let diagram: Diagram | null = null;)Backend
This section is not relevant if your contribution does not come with changes to the backend.
General purpose
Architecture
Review
How to test this PR?
Please describe here the various use cases to test this pull request