-
Notifications
You must be signed in to change notification settings - Fork 29
Rework organization page #8679
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
Rework organization page #8679
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
- Updated the navbar link for managing organizations to point to the overview page. - Replaced `AccountSettingsTitle` with `SettingsTitle` in multiple views for consistency. - Introduced `SettingsCard` component for better organization of settings-related UI. - Added new views for organization notifications and overview, enhancing the organization management experience. - Cleaned up unused code and improved the structure of organization-related components.
- Updated the CustomPlanUpgradeCard to include a MailOutlined icon and improved layout with responsive columns. - Modified OrganizationNotificationsView to dispatch the updated organization state after saving notification settings. - Added organization name editing functionality in OrganizationOverviewView with validation and state management. - Refactored organization overview stats display for better readability and structure. - Improved imports in organization-related components for consistency.
- Updated OrganizationController to include the current user's identity in the organization JSON response. - Modified organization cards to export components for better reusability. - Improved the upgrade plan modal by wrapping components in a ConfigProvider for consistent theming and layout adjustments. - Refactored the modal body to use responsive columns for displaying upgrade options. These changes aim to improve the user experience and maintainability of the organization management interface.
@philippotto I branched of the account settings page PR for this feature to reuse some components. Please focus the review only on the updated orga page for now. |
@@ -71,7 +73,12 @@ export function extendPricingPlan(organization: APIOrganization) { | |||
} | |||
|
|||
export function upgradeUserQuota() { | |||
renderIndependently((destroyCallback) => <UpgradeUserQuotaModal destroy={destroyCallback} />); | |||
renderIndependently((destroyCallback) => ( | |||
<ConfigProvider theme={getAntdTheme(getSystemColorTheme())}> |
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.
This is a bit dirty. It would be cleaner to fetch the user and apply the correct light/dark theme. This workaround, however, at least applies the right theme colors for primary buttons etc and is a close enough heuristic to match the OS appearance.
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 don't understand why this is necessary. renderIndependently
uses GlobalThemeProvider
which reads the user object from the store and also creates a ConfigProvider wrapper?
@@ -630,7 +630,17 @@ class ReactRouter extends React.Component<Props> { | |||
<SecuredRouteWithErrorBoundary | |||
isAuthenticated={isAuthenticated} | |||
path="/organizations/:organizationId" | |||
render={() => <OrganizationEditView />} | |||
render={() => <Redirect to="/organization" />} |
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 left the legacy frontend route for backward compatibility. Maybe that is not really needed though.
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.
cool stuff 👍 I really like the overall look. I left some comments and found this during testing:
I'm in the basic plan. I cannot really see what other plans are available and what they offer. the box at the bottom probably describes all power features? but what about the team features? also the point "Everything from Power, Team and Basic plans" seems incorrect, because there is nothing better than power, right?
I don't understand this box. the label sas "plan & subscription", the tooltip talks about notification and the content is my name?
ideally, this would look similar to how the orga name can be edited.
renderIndependently((destroyCallback) => ( | ||
<ConfigProvider theme={getAntdTheme(getSystemColorTheme())}> | ||
{" "} | ||
…<UpgradeUserQuotaModal destroy={destroyCallback} /> |
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.
is … on purpose here?
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.
Done
@@ -71,7 +73,12 @@ export function extendPricingPlan(organization: APIOrganization) { | |||
} | |||
|
|||
export function upgradeUserQuota() { | |||
renderIndependently((destroyCallback) => <UpgradeUserQuotaModal destroy={destroyCallback} />); | |||
renderIndependently((destroyCallback) => ( | |||
<ConfigProvider theme={getAntdTheme(getSystemColorTheme())}> |
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 don't understand why this is necessary. renderIndependently
uses GlobalThemeProvider
which reads the user object from the store and also creates a ConfigProvider wrapper?
<Col span={12}> | ||
<TeamPlanUpgradeCard | ||
teamUpgradeCallback={() => { | ||
sendUpgradePricingPlanEmail(PricingPlanEnum.Team); |
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.
shouldn't these calls be awaited before a success toast is shown?
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.
Done.
okButtonCallback={okButtonCallback} | ||
destroy={destroyCallback} | ||
/> | ||
<ConfigProvider theme={getAntdTheme(getSystemColorTheme())}> |
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.
upgradeStorageQuota
does the same, too? is it really necessary?
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.
Yes, you were riright about renderIndepently
. Maybe I was confused why light/dark mode was not working (perhaps I did not refresh the page... ) Anyway, they are not needed. Good reviewer!
return ( | ||
<Layout | ||
style={{ | ||
minHeight: "calc(100vh - 64px)", |
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.
couldn't DEFAULT_NAVBAR_HEIGHT be used? if not: shouldn't we extract the 64?
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.
done
@@ -0,0 +1,66 @@ | |||
import { SettingsCard } from "admin/account/helpers/settings_card"; |
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.
the file name should use danger_zone
to be consistent with the casing in the module.
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.
done
@@ -0,0 +1,95 @@ | |||
import { MailOutlined, SaveOutlined } from "@ant-design/icons"; |
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.
this file exists with and without _view
. one should probably be deleted?
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.
deleted
} | ||
|
||
async function setOrganizationName(newOrgaName: string) { | ||
const OrgaNameRegexPattern = /^[A-Za-z0-9\\-_\\. ß]+$/; |
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.
can be moved to top level. casing is weird. should probably be UPPER_CASE.
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.
done
{ | ||
key: "owner", | ||
title: "Owner", | ||
value: "John Doe", |
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.
oopsie daisy
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 catch. Done
Co-authored-by: Philipp Otto <philippotto@users.noreply.github.com>
…sos into orga-settings-page
That is odd. I can't reproduce that. my Basic plan looks like in the PR description...
All the Cards on this page are about notifications. Who receives notifications about these different things. In some cases you can edit them; in other cases they are just informative. Ideally, this would show the email address of the owner. But that is another fetch of the user and lookup. Let's see... what can be done. |
probably because I used the dev instance and iswkorg was not true. |
still, this should show sensible stuff (e.g., for self-hosted instances). |
@philippotto I think I addressed all your feedback. Regarding "custom" plans: I decided against showing any ad card for the moment. There are too many installation variations covered by "custom", so getting the wording right is hard. We can always add something later if we have a better understadning of the situation. |
You have to explicitly set these values in the DB. There are columns in the Organisation table for that. Otherwise it defaults to null, i.e. infinity |
This is intentional. There is no clear definition on how to get to custom. There is not straight path "Power" --> "Custom". |
@philippotto I think I addressed all your points. |
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.
nice, lgtm, only see the one typo I commented.
Co-authored-by: Philipp Otto <philippotto@users.noreply.github.com>
This PR adds a new "Account Settings" page to host various other sub-pages for: - changing email (soon) - changing password - appearance/theme - passkeys (future) - API Auth Token <img width="1269" alt="Screenshot 2025-06-25 at 10 45 45" src="https://github.com/user-attachments/assets/848cc79b-b636-4de1-b495-e15059e7d452" /> <img width="1268" alt="Screenshot 2025-06-25 at 10 45 54" src="https://github.com/user-attachments/assets/fcfb3c08-8a58-450e-b50d-96bd58ed9f1a" /> <img width="1269" alt="Screenshot 2025-06-25 at 10 46 01" src="https://github.com/user-attachments/assets/4a7da90e-a2ed-4a60-ac9b-ebff65d8e140" /> ### URL of deployed dev instance (used for testing): - https://accountsettingspage.webknossos.xyz/ ### Steps to test: - Go to new Account settings page - Change PW - Try dark/light mode ### Issues: - Blocked by #8671 - Blocked by #8679 - fixes #5408 ------ (Please delete unneeded items, merge only when none are left open) - [x] Updated [changelog](../blob/master/CHANGELOG.unreleased.md#unreleased) - [ ] Updated [migration guide](../blob/master/MIGRATIONS.unreleased.md#unreleased) if applicable - [ ] Updated [documentation](../blob/master/docs) if applicable - [ ] Adapted [wk-libs python client](https://github.com/scalableminds/webknossos-libs/tree/master/webknossos/webknossos/client) if relevant API parts change - [ ] Removed dev-only changes like prints and application.conf edits - [x] Considered [common edge cases](../blob/master/.github/common_edge_cases.md) - [ ] Needs datastore update after deployment --------- Co-authored-by: Philipp Otto <philippotto@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Philipp Otto <philipp.4096@gmail.com>
This PR refreshes the layout and styling of the organization page to be in inline with the account setting page.
URL of deployed dev instance (used for testing):
Steps to test:
Issues:
(Please delete unneeded items, merge only when none are left open)