-
Notifications
You must be signed in to change notification settings - Fork 2.7k
only first admin sees preparing-workspace screen #9897
Conversation
const userIds = Object.keys(users); | ||
for (const userId of userIds) { | ||
const user = users[userId]; |
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.
Looks like this could be replaced by a for (const user of users)
- do I miss something?
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 can almost do that. JS doesn't allow for...of object iteration , but we can iterate on the Object.values
which I think is cleaner code and has the perks of being faster: https://jsbench.me/6il02vjfuw/1
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.
…eys and always accessing through the id
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.
LGTM, thanks for taking the time to make a benchmark :)
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.
Looks good!
@@ -168,6 +170,7 @@ export default function PreparingWorkspace(props: Props) { | |||
const [submitError, setSubmitError] = useState<string | null>(null); | |||
useEffect(() => { | |||
showOnMountTimeout.current = setTimeout(() => setShowFirstPage(true), 40); | |||
props.actions.getProfiles(0, General.PROFILE_CHUNK_SIZE, {roles: General.SYSTEM_ADMIN_ROLE}); |
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 assume it'll be very unlikely to hit a 101 system admin profiles in a system.
Also, that this service does not support any kind of sorting by creation or similar, right?
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.
Good questions! I also assume it will be very unlikely to have 101 system admin profiles in any system. The service does support sorting by creation. However, most uses of the selectors don't read the data directly from the server, but from redux, which doesn't retain the sort order since we store it in redux as an object.
Thanks @neallred
|
Test server destroyed |
Test server destroyed |
/cherry-pick cloud |
Cherry pick is scheduled. |
* only first admin sees preparing-workspace screen (cherry picked from commit aa48d7d)
* only first admin sees preparing-workspace screen (cherry picked from commit aa48d7d) Co-authored-by: Nathaniel Allred <[email protected]>
Summary
Second admin should not see use case onboarding.
Ticket Link
https://mattermost.atlassian.net/browse/MM-42103 , but only the
First admin vs second admin scenario:
scenario listed in the QA description.Related Pull Requests
Not related in the code sense, but there is a separate server PR that addresses the
>= 10
posts part of the bug:Screenshots
first-admin-vs-second-admin.mp4
Release Note