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

VariantManagament: Unable to switch to default view after creating new one #6616

Closed
1 task done
superdyzio opened this issue Nov 13, 2024 · 6 comments · Fixed by #6641
Closed
1 task done

VariantManagament: Unable to switch to default view after creating new one #6616

superdyzio opened this issue Nov 13, 2024 · 6 comments · Fixed by #6641

Comments

@superdyzio
Copy link
Contributor

Describe the bug

On some of our views we have analytical tables with VariantManagament. Whenever user enters such view for the first time he/she gets the default, hardcoded variant called Standard. When user introduces some change in the column config then Save as button becomes active, user saves the view as Standard2 (name doesn't matter here) with Set as default checkbox checked. After this action user gets to the Standard2 variant and it's not possible to change the variant back to Standard. Also, it looks like Standard is still selected.

In the scenario when user have more variants, only the previously selected one is blocked - other variants can be accessed and when user switches to one of them then Standard would get unblocked.

Isolated Example

No response

Reproduction steps

Prerequisite: only default variant present in variant manager

  1. Introduce a change
  2. Save as new variant
  3. Try to navigate back to previous variant (doesn't work)
  4. Introduce next change
  5. Create third variant
  6. Try to navigate to second variant (doesn't work)
  7. Try to navigate to first variant (works)
  8. Try to navigate to second variant (now works)

Expected Behaviour

All of the variants are selectable and working no matter if user just created a new variant.

Screenshots or Videos

image

UI5 Web Components for React Version

2.1.1

UI5 Web Components Version

2.2.0

Browser

Chrome

Operating System

MacOS Sequoia 15.1

Additional Context

Analytical tables used with the VariantManagament are very big, up to almost 300 columns and god-knows-how-many rows.

Relevant log output

No response

Organization

SAP Fioneer

Declaration

  • I’m not disclosing any internal or sensitive information.
@Lukas742
Copy link
Contributor

Hi @superdyzio

I wasn't able to reproduce this issue. Please add an isolated example preferably by leveraging StackBlitz. You can either use the example I've created when trying to reproduce the issue, or our template.

@superdyzio
Copy link
Contributor Author

@Lukas742 I used your example and was able to reproduce it and I'm a bit confused - I didn't change a thing in the stackblitz example code

Screen.Recording.2024-11-17.at.20.58.53.mov

@Lukas742
Copy link
Contributor

Lukas742 commented Nov 20, 2024

@superdyzio there was a mistake in my example. I didn't update the isDefault property of the first VariantItem, which causes multiple default variants after saving (not supported).

Here's the updated example:
https://stackblitz.com/edit/ui5wcr-vm-saveas-lnktd4?file=src%2FApp.tsx
Could you check again if this works for you now?

Edit: Found another problem... I'll update this issue once this is fixed as well.

This PR will add a note explaining which props need to be unique for each VariantManagement and will also fix some more issues with internal boolean value assignments.

@superdyzio
Copy link
Contributor Author

@Lukas742 I see, we'll make sure that we always have only one default variant, thanks for the investigation! we're waiting for your remaining fixes and looking forward to the release including our recent bugfixes 🎉

@Lukas742
Copy link
Contributor

The issue I found previously will also be resolved by the linked PR. In some cases the isDefault value was not reflected correctly in the manage or save view dialog.

Apart from that I've edited my example from above to include all necessities:

  • The isDefault prop is now updated accordingly.
  • Selection change is now handled by the React state as well (via the onSelect event)

https://stackblitz.com/edit/ui5wcr-vm-saveas-gewoqx?file=src%2FApp.tsx

@ui5-webcomponents-react-bot
Copy link
Contributor

🎉 This issue has been resolved in version v2.5.0 🎉

The release is available on v2.5.0

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🆕 New
Development

Successfully merging a pull request may close this issue.

3 participants