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

Be able to define collapsed by default groups in an element template #3807

Closed
igpetrov opened this issue Aug 28, 2023 · 12 comments · Fixed by #3939
Closed

Be able to define collapsed by default groups in an element template #3807

igpetrov opened this issue Aug 28, 2023 · 12 comments · Fixed by #3939
Assignees
Labels
element templates enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@igpetrov
Copy link

Problem you would like to solve

Consider any connectors element template, i.e. HTTP REST.

All properties are structured within Groups. All groups are expanded by default. Requesting to add a flag to the group element that would indicate that a specific group is collapsed by default.

Proposed solution

The following construct should make My Collapsed Group collapsed by default:

"groups": [
    {
      "id": "myCollapsedGroup",
      "label": "My Collapsed Group",
      "collapsedByDefault": true
    },
...
]

Alternatives considered

Since our use-case is epic-related, we could dedicate one specific group for the task definition type property and hardcode it being collapsed by default but I would not recommend taking this route.

Additional context

Via discussion: https://camunda.slack.com/archives/CKGH9LR40/p1693222832075709?thread_ts=1692785474.018059&cid=CKGH9LR40.

This FR is related to the epic, and is a feature gap related to the epic. See related explanation.

@igpetrov igpetrov added the enhancement New feature or request label Aug 28, 2023
@igpetrov
Copy link
Author

@nikku FYI. Please let me know if I can update the ticket with additional information. Thank you!

@nikku nikku changed the title Feature Request: Connector element template group collapsable by default Be able to define collapsed by default groups in an element template Aug 29, 2023
@nikku
Copy link
Member

nikku commented Aug 29, 2023

This sounds reasonable, and gives template authors much more freedom to decide which parts of an element template are "initially relevant". This is something we as framework authors cannot and do not want to know.

@marstamm Do you recall where we implement the "initially all open" behavior? I'd imagine this could be a fairly straight forward thing to contribute, depending on how we built "always open".

@marstamm
Copy link
Member

The default state is defined by a toggle in the Group configuration

https://github.com/bpmn-io/bpmn-js-element-templates/blob/117f64d4c4734a4375efe35eea22748dd5fb170a/src/cloud-element-templates/properties/CustomProperties.js#L111

Currently, it is always true for element templates. This would be easy to implement.

@marstamm
Copy link
Member

marstamm commented Aug 29, 2023

However, with the way persistence is implemented, the collapsed state of the group is shared across different templates. So if multiple templates have a Authentication group with the same ID and I open them in one element, it will be open in the others as well.

If we want to change this, we would need to add the template-id to the element template group id

@nikku
Copy link
Member

nikku commented Aug 29, 2023

However, with the way persistence is implemented, the collapsed state of the group is shared across different templates.

I think we want to keep this. It is a good feature. Otherwise there is no way to semantically group UI sections across templates.

@nikku nikku added the good first issue Good for newcomers label Aug 29, 2023
@nikku
Copy link
Member

nikku commented Aug 29, 2023

@igpetrov Happy to take a contribution to implement collapsedByDefault behavior, cf. #3807 (comment).

Thanks @marstamm for investigating.

@marstamm
Copy link
Member

marstamm commented Aug 29, 2023

Otherwise there is no way to semantically group UI sections across templates

I agree. If you don't want shared state for your template, you can always namespace the group-id in your template to decouple it.

@igpetrov
Copy link
Author

Thanks a lot @nikku @marstamm!

Maybe @bastiankoerber can jump in and also share own thoughts on behalf of the Customers?

@nikku nikku added the backlog Queued in backlog label Aug 29, 2023
@bastiankoerber
Copy link

@igpetrov from a framework perspective this is absolut fine, we (as consumer) can then decide which behaviour
we are prefering. In general i like the same behaviour by group, so i am ok with it :-)

@nikku
Copy link
Member

nikku commented Oct 5, 2023

@marstamm Let's tackle documentation as a follow up / part of this issue.

@marstamm
Copy link
Member

marstamm commented Oct 6, 2023

Created a Draft PR for the docs to be merged after integration: camunda/camunda-docs#2706

@nikku
Copy link
Member

nikku commented Oct 10, 2023

Fixed upstream via bpmn-io/bpmn-js-element-templates#18 and camunda/element-templates-json-schema#114.

@nikku nikku added fixed upstream Requires integration of upstream change and removed needs review Review pending labels Oct 12, 2023
@nikku nikku added this to the M70 milestone Oct 13, 2023
@bpmn-io-tasks bpmn-io-tasks bot added needs review Review pending and removed fixed upstream Requires integration of upstream change labels Oct 20, 2023
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
element templates enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants