mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 00:03:56 +00:00
[SM-896] When org is disabled disable the logic and show warning symbols (#6225)
* When org is disabled disable the logic and show warning symbols * fixing org enabled logic * removing unused code * Adding route gaurd logic and new org suspended page * fixing lint issue * fixing issues * Requested changes * adding back code that was accidentally removed from organization-switcher * Update bitwarden_license/bit-web/src/app/secrets-manager/shared/org-suspended.component.ts Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com> * Removing unused code and updating storybook to set enabled:true * removing onDestroy * Will's suggestions * will's suggested change * fix nav-item color in story * Thomas Rittson's suggested changes * adding back removed spaces * Adding back white space * updating guard * Update bitwarden_license/bit-web/src/app/secrets-manager/guards/sm-org-enabled.guard.ts Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com> * removing ununsed data * Updating incorrect messages --------- Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com> Co-authored-by: William Martin <contact@willmartian.com> Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
This commit is contained in:
@@ -47,9 +47,10 @@ export class ProductSwitcherContentComponent {
|
||||
map(([orgs, paramMap]) => {
|
||||
const routeOrg = orgs.find((o) => o.id === paramMap.get("organizationId"));
|
||||
// If the active route org doesn't have access to SM, find the first org that does.
|
||||
const smOrg = routeOrg?.canAccessSecretsManager
|
||||
? routeOrg
|
||||
: orgs.find((o) => o.canAccessSecretsManager);
|
||||
const smOrg =
|
||||
routeOrg?.canAccessSecretsManager && routeOrg?.enabled == true
|
||||
? routeOrg
|
||||
: orgs.find((o) => o.canAccessSecretsManager && o.enabled == true);
|
||||
|
||||
/**
|
||||
* We can update this to the "satisfies" type upon upgrading to TypeScript 4.9
|
||||
|
||||
@@ -131,5 +131,5 @@ OrgWithoutSecretsManager.args = {
|
||||
|
||||
export const OrgWithSecretsManager = Template.bind({});
|
||||
OrgWithSecretsManager.args = {
|
||||
mockOrgs: [{ id: "b", canAccessSecretsManager: true }],
|
||||
mockOrgs: [{ id: "b", canAccessSecretsManager: true, enabled: true }],
|
||||
};
|
||||
|
||||
@@ -3638,6 +3638,18 @@
|
||||
"organizationIsDisabled": {
|
||||
"message": "Organization suspended"
|
||||
},
|
||||
"secretsAccessSuspended": {
|
||||
"message": "Suspended organizations cannot be accessed. Please contact your organization owner for assistance."
|
||||
},
|
||||
"secretsCannotCreate": {
|
||||
"message": "Secrets cannot be created in suspended organizations. Please contact your organization owner for assistance."
|
||||
},
|
||||
"projectsCannotCreate": {
|
||||
"message": "Projects cannot be created in suspended organizations. Please contact your organization owner for assistance."
|
||||
},
|
||||
"serviceAccountsCannotCreate": {
|
||||
"message": "Service accounts cannot be created in suspended organizations. Please contact your organization owner for assistance."
|
||||
},
|
||||
"disabledOrganizationFilterError": {
|
||||
"message": "Items in suspended organizations cannot be accessed. Contact your organization owner for assistance."
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user