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

feat(display-edit): disable delete depending on cardinality (DSP-1814) #329

Merged
merged 4 commits into from Aug 12, 2021

Conversation

mdelez
Copy link
Contributor

@mdelez mdelez commented Aug 11, 2021

resolves DSP-1814

@mdelez mdelez added the enhancement New feature or request label Aug 11, 2021
@mdelez mdelez self-assigned this Aug 11, 2021
@mdelez
Copy link
Contributor Author

mdelez commented Aug 11, 2021

@kilchenmann should we remove the delete button from the UI in the event the user cannot delete the value or should we disable the button with a hint why it can't be deleted?

@kilchenmann
Copy link
Contributor

kilchenmann commented Aug 11, 2021

@kilchenmann should we remove the delete button from the UI in the event the user cannot delete the value or should we disable the button with a hint why it can't be deleted?

We should disable it. Because the user expects the button. It could be confusing if the button is there in some cases but in other cases not.
Btw if the button is disabled the matTooltip will not work. In this case you have to surround (?) it with span tags, where you add the matTooltip. Here's an example how I did it in the ontology-editor: https://github.com/dasch-swiss/dsp-app/blob/fb6c36890f78ea7612f86c2a2978d9c6908b890d/src/app/project/ontology/ontology.component.html#L103 (Lines 103-109)

@mdelez mdelez changed the title feat(display-edit): disallow delete depending on cardinality (DSP-1814) feat(display-edit): disable delete depending on cardinality (DSP-1814) Aug 12, 2021
Copy link
Contributor

@kilchenmann kilchenmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@mdelez mdelez merged commit 933bb13 into main Aug 12, 2021
@mdelez mdelez deleted the wip/DSP-1814-disable-delete-cardinality-1 branch August 12, 2021 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants