Skip to content

Commit

Permalink
Change information in the Composer's Form Modal to be more adequate w…
Browse files Browse the repository at this point in the history
…hen no instance is chosen, Make expand/collapse button action area bigger in the Instances on the Instance Composer Canvas. (Issue #5691, PR #5707)

# Description

* Short description here *

closes #5690 #5691

# Self Check:

Strike through any lines that are not applicable (`~~line~~`) then check the box

- [ ] Attached issue to pull request
- [ ] Changelog entry
- [ ] Code is clear and sufficiently documented
- [ ] Sufficient test cases (reproduces the bug/tests the requested feature)
- [ ] Correct, in line with design
- [ ] End user documentation is included or an issue is created for end-user documentation (add ref to issue here: )

https://github.com/inmanta/web-console/assets/113331659/e0a1b3df-d5a9-4198-aac5-5d0a97b91bdf
  • Loading branch information
matborowczyk authored and inmantaci committed Apr 30, 2024
1 parent 0e77e64 commit f97c50c
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 2 deletions.
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

0 comments on commit f97c50c

Please sign in to comment.