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

[3815] Child creation descriptions are locale independent #3837

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ As a result, the following maven modules have been deleted: `sirius-web-sample-a

* The `String` attribute `org.eclipse.sirius.components.collaborative.diagrams.dto.InvokeSingleClickOnDiagramElementToolInput#selectedObjectId` has been replaced by the attribute `variables` of type `List<ToolVariable>`
- https://github.com/eclipse-sirius/sirius-web/issues/3437[#3437] [core] Migrate frontend to MUI 5, if you contributed React componenent that use MUI, you should upgrade them to use MUI 5.
- https://github.com/eclipse-sirius/sirius-web/issues/2204[#2204] [core, tree] Added `getStyledLabel` in `IDefaultLabelService` and `IObjectService`, you must implement this method if you have custom implementation of these interface.
- https://github.com/eclipse-sirius/sirius-web/issues/2204[#2204] [core] Added `getStyledLabel` in `IDefaultLabelService` and `IObjectService`, you must implement this method if you have custom implementation of these interface.
- https://github.com/eclipse-sirius/sirius-web/issues/3815[#3815] [core] Make child creation descriptions locale independent

=== Dependency update

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/cypress/e2e/project/deck/deck.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ describe('Verify the Deck Representation', () => {
});
it('We create a new daily tag to verify that the deck is properly refreshed', () => {
const explorer = new Explorer();
explorer.createObject('Daily Project Dev', 'Tag');
explorer.createObject('Daily Project Dev', 'ownedTags-TaskTag');
explorer.select('::');
const details = new Details();
details.getTextField('Prefix').type('daily{enter}');
Expand Down
90 changes: 44 additions & 46 deletions integration-tests/cypress/e2e/project/details/form.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,47 +11,47 @@
* Obeo - initial API and implementation
*******************************************************************************/

import { Project } from "../../../pages/Project";
import { Flow } from "../../../usecases/Flow";
import { Studio } from "../../../usecases/Studio";
import { Details } from "../../../workbench/Details";
import { Explorer } from "../../../workbench/Explorer";
import { Project } from '../../../pages/Project';
import { Flow } from '../../../usecases/Flow';
import { Studio } from '../../../usecases/Studio';
import { Details } from '../../../workbench/Details';
import { Explorer } from '../../../workbench/Explorer';

describe('/projects/:projectId/edit - Form', () => {
context('Given a Form Description', () => {
let studioProjectId: string = '';

before(() =>
new Studio().createBlankStudioProjectWithView().then((createdProjectData) => {
studioProjectId = createdProjectData.projectId;
new Project().visit(createdProjectData.projectId);
const explorer = new Explorer();
explorer.expand('ViewDocument');
explorer.expand('View');
explorer.createObject('View', 'Form Description');
explorer.select('New Form Description');
const details = new Details();
details.getTextField('Domain Type').type('flow::System');
details.getTextField('Name').type('{selectall}').type('ReadOnlyRepresentation');
details.getTextField('Title Expression').type('{selectall}').type('ReadOnlyRepresentation');
explorer.expand('ReadOnlyRepresentation');
explorer.expand('PageDescription');
explorer.select('GroupDescription')
details.getTextField('Name').type('Group ReadOnly{enter}');
explorer.createObject('Group ReadOnly', 'Widgets Button Description');
details.getTextField('Button Label Expression').type('Test Button');
details.getTextField('Is Enabled Expression').type('aql:self.temperature==0');
explorer.createObject('Group ReadOnly', 'Widgets Flexbox Container Description');
details.getTextField('Name').invoke('text').should('eq', '');
details.getTextField('Name').type('Flexbox Container');
details.getTextField('Label Expression').type('Test flexbox container');
details.getTextField('Is Enabled Expression').type("aql:self.name='NewSystem'");
new Studio().createBlankStudioProjectWithView().then((createdProjectData) => {
studioProjectId = createdProjectData.projectId;
new Project().visit(createdProjectData.projectId);
const explorer = new Explorer();
explorer.expand('ViewDocument');
explorer.expand('View');
explorer.createObject('View', 'descriptions-FormDescription');
explorer.select('New Form Description');
const details = new Details();
details.getTextField('Domain Type').type('flow::System');
details.getTextField('Name').type('{selectall}').type('ReadOnlyRepresentation');
details.getTextField('Title Expression').type('{selectall}').type('ReadOnlyRepresentation');
explorer.expand('ReadOnlyRepresentation');
explorer.expand('Page Description');
explorer.select('Group Description');
details.getTextField('Name').type('Group ReadOnly{enter}');
explorer.createObject('Group ReadOnly', 'children-ButtonDescription');
details.getTextField('Button Label Expression').type('Test Button');
details.getTextField('Is Enabled Expression').type('aql:self.temperature==0');
explorer.createObject('Group ReadOnly', 'children-FlexboxContainerDescription');
details.getTextField('Name').invoke('text').should('eq', '');
details.getTextField('Name').type('Flexbox Container');
details.getTextField('Label Expression').type('Test flexbox container');
details.getTextField('Is Enabled Expression').type("aql:self.name='NewSystem'");

explorer.createObject('Flexbox Container', 'Textfield Description');
details.getTextField('Name').invoke('text').should('eq', '');
details.getTextField('Label Expression').type('Name');
details.getTextField('Value Expression').type('aql:self.name');
})
explorer.createObject('Flexbox Container', 'children-TextfieldDescription');
details.getTextField('Name').invoke('text').should('eq', '');
details.getTextField('Label Expression').type('Name');
details.getTextField('Value Expression').type('aql:self.name');
})
);
after(() => cy.deleteProject(studioProjectId));

Expand All @@ -68,16 +68,16 @@ describe('/projects/:projectId/edit - Form', () => {
afterEach(() => cy.deleteProject(flowProjectId));

it('check widget read-only mode in form', () => {
const explorer = new Explorer();
explorer.expand('FlowNewModel');
explorer.createRepresentation('NewSystem', 'ReadOnlyRepresentation', 'ReadOnlyRepresentation');
cy.getByTestId('Test Button').should('exist').should('not.be.disabled');
explorer.select('NewSystem');
const details = new Details();
details.getTextField('Temperature').type('{selectall}2{enter}');
cy.getByTestId('Test Button').should('be.disabled');
details.getTextField('Temperature').type('{selectall}0{enter}');
cy.getByTestId('Test Button').should('not.be.disabled');
const explorer = new Explorer();
explorer.expand('FlowNewModel');
explorer.createRepresentation('NewSystem', 'ReadOnlyRepresentation', 'ReadOnlyRepresentation');
cy.getByTestId('Test Button').should('exist').should('not.be.disabled');
explorer.select('NewSystem');
const details = new Details();
details.getTextField('Temperature').type('{selectall}2{enter}');
cy.getByTestId('Test Button').should('be.disabled');
details.getTextField('Temperature').type('{selectall}0{enter}');
cy.getByTestId('Test Button').should('not.be.disabled');
});

it('check the flexbox read-only mode is dispatched to children', () => {
Expand All @@ -90,7 +90,5 @@ describe('/projects/:projectId/edit - Form', () => {
cy.getByTestId('page').findByTestId('input-Name').should('be.disabled');
});
});


});
});
6 changes: 3 additions & 3 deletions integration-tests/cypress/e2e/project/diagrams/collapse.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('Diagram - collapsible node', () => {
cy.get('[title="domain::Domain"]').then(($div) => {
domainName = $div.data().testid;
explorer.expand(domainName);
explorer.createObject('Entity1', 'Relation');
explorer.createObject('Entity1', 'relations-Relation');
details.getCheckBox('Containment').check();
details.openReferenceWidgetOptions('Target Type');
details.selectReferenceWidgetOption('Entity2');
Expand Down Expand Up @@ -78,8 +78,8 @@ describe('Diagram - collapsible node', () => {
const explorer = new Explorer();
const diagram = new Diagram();
const details = new Details();
explorer.createObject('Root', 'Entity1s Entity1');
explorer.createObject('Entity1', 'Relation Entity2');
explorer.createObject('Root', 'entity1s-Entity1');
explorer.createObject('Entity1', 'relation-Entity2');
explorer.select('Entity1');
details.getTextField('Name').type('Entity1{enter}');
explorer.createRepresentation('Root', `${domainName} Diagram Description`, 'diagram');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('/projects/:projectId/edit - Custom Shape', () => {
cy.getByTestId('childCreationDescription').children('[role="combobox"]').invoke('text').should('have.length.gt', 1);
cy.getByTestId('childCreationDescription').click();
cy.getByTestId('childCreationDescription')
.get('[data-value="Ellipse Node Style Description"]')
.get('[data-value="style-EllipseNodeStyleDescription"]')
.should('exist')
.click();
cy.getByTestId('create-object').click();
Expand Down Expand Up @@ -77,7 +77,7 @@ describe('/projects/:projectId/edit - Custom Shape', () => {
cy.getByTestId('new-object').click();
cy.getByTestId('childCreationDescription').children('[role="combobox"]').invoke('text').should('have.length.gt', 1);
cy.getByTestId('childCreationDescription').click();
cy.getByTestId('childCreationDescription').get('[data-value="Entity1s Entity1"]').should('exist').click();
cy.getByTestId('childCreationDescription').get('[data-value="entity1s-Entity1"]').should('exist').click();
cy.getByTestId('create-object').click();

cy.getByTestId('Ellipse - ').should('have.css', 'border-radius', '50%');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,22 +106,22 @@ describe('/projects/:projectId/edit - Robot Diagram', () => {
cy.getByTestId('treeitem-contextmenu').findByTestId('rename-tree-item').click();
cy.getByTestId('name-edit').type('Diagram Description{enter}');

cy.createChildObject('DiagramPalette', 'Diagram Tool Section');
cy.createChildObject('Palette', 'toolSections-DiagramToolSection');
cy.getByTestId('Tool Section').click();
cy.getByTestId('Name').type('{selectAll}section1');
cy.createChildObject('DiagramPalette', 'Diagram Tool Section');
cy.createChildObject('Palette', 'toolSections-DiagramToolSection');
cy.getByTestId('Tool Section').click();
cy.getByTestId('Name').type('{selectAll}section2');
cy.createChildObject('section1', 'Node Tool');
cy.createChildObject('section1', 'nodeTools-NodeTool');
cy.getByTestId('Tool').click();
cy.getByTestId('Name').type('{selectAll}tool1_section1');
cy.createChildObject('section1', 'Node Tool');
cy.createChildObject('section1', 'nodeTools-NodeTool');
cy.getByTestId('Tool').click();
cy.getByTestId('Name').type('{selectAll}tool2_section1');
cy.createChildObject('section2', 'Node Tool');
cy.createChildObject('section2', 'nodeTools-NodeTool');
cy.getByTestId('Tool').click();
cy.getByTestId('Name').type('{selectAll}tool1_section2');
cy.createChildObject('section2', 'Node Tool');
cy.createChildObject('section2', 'nodeTools-NodeTool');
cy.getByTestId('Tool').click();
cy.getByTestId('Name').type('{selectAll}tool2_section2');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ describe('Diagram - inside outside labels', () => {
explorer.expand('Entity1 Node');
explorer.select('aql:self.name');
details.getTextField('Label Expression').type('{selectAll}InsideLabelNode1{enter}');
explorer.createObject('Entity1 Node', 'Outside Label Description');
explorer.createObject('Entity1 Node', 'outsideLabels-OutsideLabelDescription');
explorer.select('aql:self.name');
details.getTextField('Label Expression').type('{selectAll}OutsideLabelNode1{enter}');
explorer.collapse('Entity1 Node');
explorer.expand('Entity2 Node');
explorer.select('aql:self.name');
details.getTextField('Label Expression').type('{selectAll}InsideLabelNode2{enter}');
explorer.createObject('Entity2 Node', 'Outside Label Description');
explorer.createObject('Entity2 Node', 'outsideLabels-OutsideLabelDescription');
explorer.select('aql:self.name');
details.getTextField('Label Expression').type('{selectAll}OutsideLabelNode2{enter}');
explorer.delete('RectangularNodeStyleDescription');
explorer.createObject('Entity2 Node', 'Style Image');
explorer.createObject('Entity2 Node', 'style-ImageNodeStyleDescription');
details.selectValue('Shape', 'camera');
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('Diagram - Direct edit label', () => {

it('Then we cannot perform the direct edition of the node without the direct edit tool', () => {
const explorer = new Explorer();
explorer.createObject('Root', 'Entity1s Entity1');
explorer.createObject('Root', 'entity1s-Entity1');
explorer.getTreeItemByLabel('Entity1').click();

const details = new Details();
Expand All @@ -87,7 +87,7 @@ describe('Diagram - Direct edit label', () => {

it('Then we can perform the edition of the label of the node with the direct edit tool', () => {
const explorer = new Explorer();
explorer.createObject('Root', 'Entity2s Entity2');
explorer.createObject('Root', 'entity2s-Entity2');
explorer.getTreeItemByLabel('Entity2').click();

const details = new Details();
Expand All @@ -105,7 +105,7 @@ describe('Diagram - Direct edit label', () => {

it('Then during edit triggering escape cancelled the current edition', () => {
const explorer = new Explorer();
explorer.createObject('Root', 'Entity2s Entity2');
explorer.createObject('Root', 'entity2s-Entity2');
explorer.getTreeItemByLabel('Entity2').click();

const details = new Details();
Expand All @@ -124,7 +124,7 @@ describe('Diagram - Direct edit label', () => {

it('Then we can set the correct name when typing directly', () => {
const explorer = new Explorer();
explorer.createObject('Root', 'Entity2s Entity2');
explorer.createObject('Root', 'entity2s-Entity2');
const details = new Details();
details.getTextField('Name').type('Entity2{Enter}');

Expand All @@ -135,8 +135,8 @@ describe('Diagram - Direct edit label', () => {

it('Then we can use direct edit on edge', () => {
const explorer = new Explorer();
explorer.createObject('Root', 'Entity1s Entity1');
explorer.createObject('Root', 'Entity2s Entity2');
explorer.createObject('Root', 'entity1s-Entity1');
explorer.createObject('Root', 'entity2s-Entity2');
explorer.select('Entity2');
const details = new Details();
details.getTextField('Name').type('Entity2');
Expand All @@ -155,7 +155,7 @@ describe('Diagram - Direct edit label', () => {

it('Then during the direct edition, the palette is hidden', () => {
const explorer = new Explorer();
explorer.createObject('Root', 'Entity2s Entity2');
explorer.createObject('Root', 'entity2s-Entity2');
explorer.getTreeItemByLabel('Entity2').click();

const details = new Details();
Expand Down Expand Up @@ -223,8 +223,8 @@ describe('Diagram - Direct edit label', () => {

it('Then we can not use direct edit on edge', () => {
const explorer = new Explorer();
explorer.createObject('Root', 'Entity1s Entity1');
explorer.createObject('Root', 'Entity2s Entity2');
explorer.createObject('Root', 'entity1s-Entity1');
explorer.createObject('Root', 'entity2s-Entity2');
explorer.select('Entity2');
const details = new Details();
details.getTextField('Name').type('Entity2');
Expand Down
14 changes: 7 additions & 7 deletions integration-tests/cypress/e2e/project/diagrams/edges.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('Diagram - edges', () => {
cy.get('[title="domain::Domain"]').then(($div) => {
domainName = $div.data().testid;
explorer.expand(`${domainName}`);
explorer.createObject('Entity1', 'Relation');
explorer.createObject('Entity1', 'relations-Relation');
const details = new Details();
details.getCheckBox('Containment').check();
details.openReferenceWidgetOptions('Target Type');
Expand Down Expand Up @@ -67,9 +67,9 @@ describe('Diagram - edges', () => {
const details = new Details();
const diagram = new Diagram();

explorer.createObject('Root', 'Entity1s Entity1');
explorer.createObject('Root', 'entity1s-Entity1');
details.getTextField('Name').type('Entity1{Enter}');
explorer.createObject('Entity1', 'Relation Entity2');
explorer.createObject('Entity1', 'relation-Entity2');

details.getTextField('Name').should('have.value', '');
details.getTextField('Name').type('Entity2{Enter}');
Expand Down Expand Up @@ -111,7 +111,7 @@ describe('Diagram - edges', () => {
details.getTextField('Default Width Expression').type('300{enter}');
details.getTextField('Default Height Expression').type('50{enter}');
explorer.delete('RectangularNodeStyleDescription');
explorer.createObject('Entity1 Node', 'Ellipse Node Style Description');
explorer.createObject('Entity1 Node', 'style-EllipseNodeStyleDescription');
});
})
);
Expand All @@ -135,12 +135,12 @@ describe('Diagram - edges', () => {
const details = new Details();
const diagram = new Diagram();

explorer.createObject('Root', 'Entity1s Entity1');
explorer.createObject('Root', 'entity1s-Entity1');
details.getTextField('Name').type('Entity1{Enter}');
explorer.createObject('Root', 'Entity2s Entity2');
explorer.createObject('Root', 'entity2s-Entity2');
details.getTextField('Name').should('have.value', '');
details.getTextField('Name').type('Entity2{Enter}');
explorer.createObject('Root', 'Entity2s Entity2');
explorer.createObject('Root', 'entity2s-Entity2');
details.getTextField('Name').should('have.value', '');
details.getTextField('Name').type('Entity2.bis{Enter}');
explorer.select('Entity1');
Expand Down
Loading