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: Move settings from individual pages into one settings modal #2502

Merged
merged 96 commits into from
Jul 23, 2024

Conversation

Mikehrn
Copy link
Contributor

@Mikehrn Mikehrn commented Jul 12, 2024

Description

In preparation for workspace settings (and additional settings like multiple emails) we are moving from individual settings pages to one modal where all settings can live. In order to make this work a few changes had to be made:

Changes

  • All component have been moved form individual folders to components/settings, for now split into user and server and a SettingsDialog that consumes them. Most of the logic has been reused from the previous implementation with just some tweaks.

  • Routing; even though the settings dialog is not actually a page it is kind of behaving as one. When switching between settings "pages" the URLs should update, but because these are not "actual" pages so I've done the history manipulation outside of the router to avoid rerenders. This way also the original content behind the modal stays alive (so you don't lose your view in for example the viewer). However, these page should be available as directly URLs as well, but then render on top of the home page, so I added the routes programmatically and used the dashboard component for rendering.

  • In addition some small tweaks to existing dialogs, the dialog/sidebar component and copy in various places

Screenshot 2024-07-10 at 16 05 19 Screenshot 2024-07-10 at 16 02 41

@fabis94
Copy link
Contributor

fabis94 commented Jul 19, 2024

also - there's merge conflicts, you should merge in main

@Mikehrn Mikehrn requested a review from fabis94 July 19, 2024 11:44
@Mikehrn
Copy link
Contributor Author

Mikehrn commented Jul 19, 2024

also - there's merge conflicts, you should merge in main

Merged master back and addressed all the comments :) Thanks for the quick review

Copy link
Contributor

@fabis94 fabis94 left a comment

Choose a reason for hiding this comment

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

Nearly there, the biggest issue is with the User type that you're requiring in props of various components - the way it's built currently it's asking for a type that will never exist during runtime and as such they're impossible to use without ignoring/overriding TS errors

}

const infiniteLoad = async (state: InfiniteLoaderState) => {
const cursor = extraPagesResult.value?.admin?.userList.cursor || null
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't have to change this, but in the future I suggest using usePaginatedQuery() which handles a lot of this stuff internally

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I will change that in a follow-up :) We have a bunch of them still in this way, so I think I'll just address them all at once

packages/frontend-2/components/settings/user/Profile.vue Outdated Show resolved Hide resolved
@Mikehrn Mikehrn requested a review from fabis94 July 22, 2024 08:58
fabis94
fabis94 previously approved these changes Jul 22, 2024
packages/frontend-2/components/settings/user/Profile.vue Outdated Show resolved Hide resolved
fabis94
fabis94 previously approved these changes Jul 22, 2024
@Mikehrn
Copy link
Contributor Author

Mikehrn commented Jul 23, 2024

@fabis94 Sorry had to add one more small thing, a check to see if you have access to the server settings (else they would always show in the sidebar)

@Mikehrn Mikehrn merged commit 65c7dbd into main Jul 23, 2024
21 of 23 checks passed
@Mikehrn Mikehrn deleted the mike/workspace-settings branch July 23, 2024 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants