-
Notifications
You must be signed in to change notification settings - Fork 449
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
UI - use new db user settings to persist user's host table column preferences #25185
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #25185 +/- ##
==========================================
- Coverage 63.85% 63.84% -0.01%
==========================================
Files 1616 1616
Lines 153833 153847 +14
Branches 3939 3993 +54
==========================================
- Hits 98231 98229 -2
- Misses 47789 47805 +16
Partials 7813 7813
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
773cdf3
to
cd8e467
Compare
@@ -675,27 +675,24 @@ const generateAvailableTableHeaders = ({ | |||
return allHostTableHeaders.reduce( | |||
(columns: Column<IHost>[], currentColumn: Column<IHost>) => { | |||
// skip over column headers that are not shown in free observer tier | |||
if (isFreeTier && isOnlyObserver) { | |||
if (isFreeTier) { |
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.
All changes in this file are cleanup, no logic updates
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.
Tested locally, works great 👍
Can you say more about the updates to the registration and team management pages?
const hostHiddenColumns = localStorage.getItem("hostHiddenColumns"); | ||
const storedHiddenColumns = hostHiddenColumns | ||
? JSON.parse(hostHiddenColumns) | ||
: null; |
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'm a bit torn on this, as it means breaking existing functionality for users. I confirmed that we're not clearing localstorage on logout, so the columns do persist between sessions (just not between browsers, or in incognito mode). On the other hand we wouldn't want to support this forever as eventually everyone will be using the new strategy. If it sparks a riot we can put it back in a patch, but likely no one will notice.
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.
That was my thinking too. We could include fallback behavior to use local storage, but I don't really see the scenario where the user has logged in, is actively using Fleet, and suddenly the server is somehow unavailable for this specific functionality.
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 wasn't think of it as fallback behavior as much as, people right now have their columns set up and they're going to disappear when this deploys.
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.
Aaah, I see
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.
We need a UI migration 🙂
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.
We could, in this initial rollout, check for local storage settings, and if present, immediately send them to the server to persist and set them as current UI context, then down the line remove that code
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.
(or not remove it I suppose, but there would be no reason for anything to present in local storage after not too long)
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.
We could, in this initial rollout, check for local storage settings, and if present, immediately send them to the server to persist and set them as current UI context, then down the line remove that code
This is probably the way. It seems a bit heavy handed but considering the original ask, we'd ideally like the user to see the columns they expect and then also see them in another browser / incognito mode, without having to do any action to trigger persistence.
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.
Sounds like a plan
@sgress454 since they're already making calls to the |
For #25032
Add new
include_ui_settings
query param toGET
/me
callsUse new
settings
in response to set settings into UI contextOn hosts page, use that context, if present, to set which columns are hidden. Fallback to a default set of hidden columns.
When updating visible columns, persist preference via
PATCH
to/users/:id
with a newsettings
payloadChanges file added for user-visible changes in
changes/
Manual QA for all new/changed functionality