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

Composer usability improvements #5707

Closed
Closed
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
6 changes: 6 additions & 0 deletions changelogs/unreleased/5691-composer-improvements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
description: "Change information in the Composer's Form Modal to be more adequate when no instance is chosen, Make expand/collapse button action area bigger in the Instances on the Instance Composer Canvas."
issue-nr: 5691
change-type: patch
destination-branches: [master, iso7]
sections:
minor-improvement: "{{description}}"
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@
"webpack-merge": "^5.10.0",
"webpack-version-file": "^0.1.7"
},
"browser": {
"crypto": false
},
"dependencies": {
"@inmanta/rappid": "^4.0.0",
"@joint/layout-directed-graph": "^4.0.1",
Expand Down
6 changes: 5 additions & 1 deletion src/UI/Components/Diagram/components/FormModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,11 @@ const FormModal = ({
<Alert
variant="info"
isInline
title={words("inventory.editInstance.noAttributes")}
title={
cellView
? words("inventory.editInstance.noAttributes")
: words("inventory.addInstance.unselectedEntity")
}
/>
</FlexItem>
)}
Expand Down
1 change: 1 addition & 0 deletions src/UI/Components/Diagram/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export default function diagramInit(
const bbox = elementAsShape.getBBox();
elementAsShape.attr("toggleButton/y", bbox.height - 24);
elementAsShape.attr("spacer/y", bbox.height - 33);
elementAsShape.attr("buttonBody/y", bbox.height - 32);

elementAsShape.set("isCollapsed", !isCollapsed);
},
Expand Down
14 changes: 13 additions & 1 deletion src/UI/Components/Diagram/shapes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ export class ServiceEntityBlock extends shapes.standard.HeaderedRecord {
tagName: "rect",
selector: "spacer",
},
{
tagName: "rect",
selector: "buttonBody",
},
{
tagName: "image",
selector: "toggleButton",
Expand Down Expand Up @@ -309,7 +313,15 @@ export class ServiceEntityBlock extends shapes.standard.HeaderedRecord {
height: 1,
cursor: "default",
});

this.attr("buttonBody", {
event: "element:toggleButton:pointerdown",
preserveAspectRatio: "none",
cursor: "pointer",
opacity: 0,
y: bbox.height - 32,
width: 264,
height: 32,
});
this.attr("toggleButton", {
event: "element:toggleButton:pointerdown",
"xlink:href": expandButton,
Expand Down
2 changes: 2 additions & 0 deletions src/UI/words.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ const dict = {
"inventory.editInstance.failed": "Editing instance failed",
"inventory.editInstance.noAttributes":
"There are no attributes to edit. Click confirm to move into the update state",
"inventory.addInstance.unselectedEntity":
"Please select an entity to fill attributes values",
"inventory.editInstance.header": (instanceId: string) =>
`Change attributes of instance ${instanceId}`,
"inventory.duplicateInstance.header": (instanceId: string) =>
Expand Down
Loading