-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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: Shows user charts by default when editing a dashboard #23547
feat: Shows user charts by default when editing a dashboard #23547
Conversation
@kasiazjc Can you please review the proposed control? My thinking was to treat it as another filter, hence the checkbox. Any improvements are welcome 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the proposed change - having this checkbox will give us the best of both worlds. Curious to hear thoughts on the wording here, as I think it's important to be as precise as possible.
Thanks @michael-s-molina ❤️ I agree this is a good change! In general I think that for now the checkbox makes sense - I was thinking that at some point we could have full on filters that would be hidden in a button (like "more filters" in horizontal navbar), so that you could filter by owner, dataset etc. But it's a long way to go. In terms of styling:
In terms of behavior: Also - is the selection you made in the checkbox saved for the future or you have to click each time? Curious to hear your thoughts @michael-s-molina @villebro 😌 |
Will do!
I think "Show my charts only" is an interesting suggestion and maybe even easier to understand than "Show all charts I have access to". @john-bodley did a similar suggestion but in his scenario, "Show only my charts" would be selected by default and the user could uncheck it. The advantage is this point:
Great idea. The tooltip will be helpful.
Currently, it's not persisted but I think it's a great idea because it would allow us to default to user charts but give them the option to change this default. @villebro @kasiazjc @john-bodley In summary, are you all ok with changing the checkbox to "Show only my charts" , which is checked by default, has a tooltip, and persists its state in the local storage so users can change it? |
I think it makes sense! Thank you @michael-s-molina 😌 |
Codecov Report
@@ Coverage Diff @@
## master #23547 +/- ##
========================================
Coverage 67.68% 67.69%
========================================
Files 1914 1916 +2
Lines 73958 74061 +103
Branches 8029 8052 +23
========================================
+ Hits 50060 50132 +72
- Misses 21852 21878 +26
- Partials 2046 2051 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 4 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
/testenv up |
@michael-s-molina Ephemeral environment spinning up at http://34.220.124.153:8080. Credentials are |
@kasiazjc @villebro @john-bodley I implemented the suggestions and spun a test environment. |
Thanks! for some reason test env doesn't work for me, nor @yousoph, not sure why :( could you add a screenshot? |
I'm not sure why the test env is not working 😢 but here's a video showing the feature: Screen.Recording.2023-04-04.at.14.38.26.mov |
@@ -751,8 +751,8 @@ describe('Dashboard edit', () => { | |||
cy.getBySel('dashboard-component-chart-holder').should('have.length', 1); | |||
}); | |||
|
|||
it('should remove added charts', () => { | |||
dragComponent('Pivot Table'); | |||
it.only('should remove added charts', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only
🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
showOnlyMyCharts, | ||
), | ||
})); | ||
setItem( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it won't store the value when showOnlyMyCharts
is true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean, the first time? If that's the case, it's not a problem because the constructor defaults to true
.
showOnlyMyCharts: getItem(
LocalStorageKeys.dashboard__editor_show_only_my_charts,
true,
),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh my mistake. I understood this operation under if (!showOnlyMyCharts) { ... }
but it's not. it looks good
Thank you for the video 😌 I had one other change that I was sure I have posted, but haven't - sorry! Because the filter will be persisted now I'm thinking about changing the copy to something like:
wdyt? otherwise I think it's good to go |
I like it. I'll only remove the workspace term because it's a Preset thing 😉 |
@rusackas @eschutho @jinghua-qa @betodealmeida @geido Can any of you, Cypress owners, stamp it so I can merge the PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E2E tests approved. Thanks!
Ephemeral environment shutdown and build artifacts deleted. |
@michael-s-molina Would it be possible to apply this PR in Branch 2.1? I would really appreciate it. |
@qlands @rusackas Given that this is a feature, it should be added to 2.2 or 3.0 according to semantic versioning. |
@michael-s-molina I understand, however, this feature is so important and missing in 2.X that it would help many deployments if merged sooner into 2.X. I will try to merge it on my own fork for now—many thanks for the great work. |
3.0 will be right on the heels of 2.1.1, so we'll be sure to get this into that major release. |
SUMMARY
#20684 introduced a change to allow a user to add charts owned/created by others to their dashboards. While this is a reasonable use case, the way it was implemented was to always display all charts accessible to the user which resulted in problems for organizations that contain many charts. From this comment, we can see some of the user feedback:
This PR modifies the dashboard editor to show by default only the charts owned or created by the user and gives the user an option to show other charts that are accessible to them. The reason for showing user charts by default is because it's more likely they will interact with their own charts and also for performance reasons, as we don't need to load all the metadata associated with a big number of charts upfront.
This PR also:
actions/sliceEntities
using Typescript to improve type checking and also simplify its logicWhile developing, it was clear that we should also rewrite
components/SliceAdder
to simplify its logic and get rid of thereact-virtualized-auto-sizer
andreact-search-input
dependencies but I'll leave this to a follow up to simplify the review process.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Screen.Recording.2023-03-31.at.16.28.08.mov
TESTING INSTRUCTIONS
1 - Edit a dashboard
2 - Make sure it displays by default only charts owned or created by the user
3 - Select the option to view other charts
4 - Make sure it displays all charts accessible to the user
ADDITIONAL INFORMATION