Skip to content

Commit

Permalink
Add Create workspace wizard (#1715)
Browse files Browse the repository at this point in the history
* fix: fix User groups tab name

* fix: improve Users and User groups loading states

* feat: add translations for create workspace wizard

* fix: fix UserGroups loading

* feat: add create workspace wizard UI

* feat: add basic create workspace wizart tests

* fix: fix lint issues

* feat: hook create workspace wizard to the API

* feat: add helper texts per latest mockups

* chore: update translations
  • Loading branch information
fhlavac authored Dec 10, 2024
1 parent 90a1c4f commit b36a4c8
Show file tree
Hide file tree
Showing 23 changed files with 1,525 additions and 85 deletions.
60 changes: 60 additions & 0 deletions cypress/e2e/create-workspace.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
describe('Workspaces page', () => {
it('Displays create workspace button', () => {
cy.login();

cy.intercept('GET', '**/api/rbac/v2/workspaces/', {
statusCode: 200,
body: { data: [], meta: {} },
}).as('getWorkspaces');

cy.visit('/iam/access-management/workspaces');
cy.wait('@getWorkspaces', { timeout: 30000 });

// check if Workspaces heading exists on the page
cy.contains('Workspaces').should('exist');

cy.get('button[data-ouia-component-id="create-workspace-button"]').should('exist');
});

it('Opens the create workspace wizard', () => {
cy.login();

cy.intercept('GET', '**/api/rbac/v2/workspaces/', {
statusCode: 200,
body: { data: [], meta: {} },
}).as('getWorkspaces');

cy.visit('/iam/access-management/workspaces');
cy.wait('@getWorkspaces', { timeout: 30000 });

cy.contains('Workspaces').should('exist');

cy.get('button[data-ouia-component-id="create-workspace-button"]').click();

cy.contains('Create new workspace').should('be.visible');
cy.contains('Workspace name').should('be.visible');
cy.contains('Workspace description').should('be.visible');
});

it('Closes the create workspace wizard on cancel', () => {
cy.login();

cy.intercept('GET', '**/api/rbac/v2/workspaces/', {
statusCode: 200,
body: { data: [], meta: {} },
}).as('getWorkspaces');

cy.visit('/iam/access-management/workspaces');
cy.wait('@getWorkspaces', { timeout: 30000 });

cy.contains('Workspaces').should('exist');

cy.get('button[data-ouia-component-id="create-workspace-button"]').click();

cy.get('div[data-ouia-component-id="create-workspace-wizard"]').should('exist');

cy.contains('Cancel').click();

cy.get('div[data-ouia-component-id="create-workspace-wizard"]').should('not.exist');
});
});
130 changes: 125 additions & 5 deletions locales/translation-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@
"defaultMessage": "Associating service accounts",
"description": "Adding service accounts label"
},
"availableFeatures": {
"defaultMessage": "Available feature(s)",
"description": "Available features label"
},
"backToPreviousPage": {
"defaultMessage": "Back to previous page",
"description": "Back to previous page label"
Expand All @@ -307,6 +311,10 @@
"defaultMessage": "Begin Quick start",
"description": "Begin Quick start link"
},
"billingAccount": {
"defaultMessage": "Billing account",
"description": "Billing account label"
},
"bindingsServiceCardDescription": {
"defaultMessage": "Grant access to your workspaces. This connects roles and user groups to specific workspaces. These bindings determine who can access what, and the actions they're allowed to perform.",
"description": "bindings service card description"
Expand Down Expand Up @@ -395,6 +403,10 @@
"defaultMessage": "Copy to all",
"description": "Copy to all label"
},
"cores": {
"defaultMessage": "Cores",
"description": "Cores label"
},
"createAnotherGroup": {
"defaultMessage": "Create another group",
"description": "Create another group message"
Expand All @@ -411,6 +423,10 @@
"defaultMessage": "Create group",
"description": "Create group wizard title"
},
"createNewWorkspace": {
"defaultMessage": "Create new workspace",
"description": "Create newworkspace action label"
},
"createRole": {
"defaultMessage": "Create role",
"description": "Create role label"
Expand All @@ -427,6 +443,26 @@
"defaultMessage": "Create a role from scratch",
"description": "Create role from scratch option"
},
"createUserGroup": {
"defaultMessage": "Create user group",
"description": "create user group button label"
},
"createWorkspace": {
"defaultMessage": "Create workspace",
"description": "Create workspace action label"
},
"createWorkspaceErrorDescription": {
"defaultMessage": "The workspace was not created successfuly.",
"description": "Create workspace error notification description"
},
"createWorkspaceErrorTitle": {
"defaultMessage": "Failed creating {name} workspace",
"description": "Create workspace error notification title"
},
"createWorkspaceSuccessTitle": {
"defaultMessage": "New {name} workspace have been successfully created",
"description": "Create workspace success notification title"
},
"creatingGroup": {
"defaultMessage": "Creating a group",
"description": "Creating group label"
Expand Down Expand Up @@ -488,7 +524,7 @@
"description": "Delete button text"
},
"deleteCustomRoleModalBody": {
"defaultMessage": "Deleting the <strong>{name}</strong> may remove acess to certain user groups in your organization",
"defaultMessage": "Deleting the {count, plural, one {the <b>{name}</b> role} other {{count} roles}} may remove acess to certain user groups in your organization",
"description": "Modal body text for deleting custom role"
},
"deleteCustomRoleModalHeader": {
Expand Down Expand Up @@ -523,6 +559,18 @@
"defaultMessage": "Delete role?",
"description": "Delete role question message"
},
"deleteRolesAction": {
"defaultMessage": "Delete Roles",
"description": "delete roles"
},
"deleteUserGroupModalBody": {
"defaultMessage": "Deleting {count, plural, one {the <b>{name}</b> user group} other {{count} user groups}} will impact user access configuration.",
"description": "Modal body text for delete user group"
},
"deleteUserGroupModalTitle": {
"defaultMessage": "Delete user {count, plural, one {group} other {groups}}?",
"description": "Title for delete user group modal"
},
"deleteUserModalBody": {
"defaultMessage": "will lose all the roles associated with the user groups it belongs to.",
"description": "Modal body text for delete user"
Expand Down Expand Up @@ -551,6 +599,14 @@
"defaultMessage": "All inputs will be discarded",
"description": "Warning saying that all inputs will be discarded"
},
"earMark": {
"defaultMessage": "Ear mark",
"description": "Ear mark label"
},
"earMarkOfFeatures": {
"defaultMessage": "Ear mark of feature(s)",
"description": "Ear mark of features label"
},
"edit": {
"defaultMessage": "Edit",
"description": "Edit button text"
Expand Down Expand Up @@ -1134,6 +1190,10 @@
"defaultMessage": "Page you are looking for does not exist.",
"description": "Placeholder text for non existing page"
},
"parentWorkspace": {
"defaultMessage": "Parent workspace",
"description": "Parent workspace label"
},
"permission": {
"defaultMessage": "Permission",
"description": "Permission label"
Expand Down Expand Up @@ -1446,10 +1506,18 @@
"defaultMessage": "Review details",
"description": "Review details label"
},
"reviewNewWorkspace": {
"defaultMessage": "Review new workspace",
"description": "Review new workspace label"
},
"reviewRoleDetails": {
"defaultMessage": "Review and confirm the details for your role, or click Back to revise.",
"description": "Review role details text"
},
"reviewWorkspaceDescription": {
"defaultMessage": "Review the information below to make sure everything is correct before creating a new workspace.",
"description": "Review workspace description"
},
"role": {
"defaultMessage": "role",
"description": "Role singular"
Expand Down Expand Up @@ -1510,6 +1578,10 @@
"defaultMessage": "Select applications to view your personal permissions.",
"description": "Select applications to view your personal permissions message"
},
"selectFeatures": {
"defaultMessage": "Select feature(s)",
"description": "Select features label"
},
"selectGroups": {
"defaultMessage": "Select groups",
"description": "Select groups label"
Expand Down Expand Up @@ -1558,6 +1630,10 @@
"defaultMessage": "Service Accounts admin page",
"description": "Service accounts page message"
},
"setEarmark": {
"defaultMessage": "Set ear mark for {bundle} features",
"description": "Set ear mark step label"
},
"status": {
"defaultMessage": "Status",
"description": "Status label"
Expand All @@ -1578,6 +1654,10 @@
"defaultMessage": "To manage users, go to your",
"description": "To manage users text"
},
"totalAccountAvailability": {
"defaultMessage": "Total availability from {billingAccount}: {count} Cores",
"description": "Total account availability text"
},
"triggerMyCatalog": {
"defaultMessage": "Trigger my catalog",
"description": "Trigger my catalog text"
Expand All @@ -1602,10 +1682,6 @@
"defaultMessage": "user",
"description": "User label"
},
"user-groups": {
"defaultMessage": "User group",
"description": "User group singular"
},
"userAccessAdmin": {
"defaultMessage": "User Access Admin",
"description": "User Access Admin name"
Expand All @@ -1618,6 +1694,14 @@
"defaultMessage": "{username}'s roles, groups and permissions.",
"description": "User description text"
},
"userGroup": {
"defaultMessage": "User group",
"description": "User group singular"
},
"userGroups": {
"defaultMessage": "User groups",
"description": "User groups plural"
},
"userGroupsEmptyStateSubtitle": {
"defaultMessage": "This filter criteria matches no user groups.{br}Try changing your filter input.",
"description": "Empty state subtitle User groups"
Expand Down Expand Up @@ -1758,6 +1842,42 @@
"defaultMessage": "Workspace assignment (TBD)",
"description": "column header for assigned user groups table"
},
"workspaceBillingAccountHelperText": {
"defaultMessage": "The default billing account is based on the parent workspace's billing account. You can switch to a different billing account as needed. This change is independent of the workspace hierarchy.",
"description": "Workspace billing account field helper text"
},
"workspaceDescription": {
"defaultMessage": "Workspace description",
"description": "Create newworkspace action label"
},
"workspaceDescriptionMaxLength": {
"defaultMessage": "The first {count} characters will appear in the description field.",
"description": "Workspace description max length helper text"
},
"workspaceDetails": {
"defaultMessage": "Workspace details",
"description": "Workspace details label"
},
"workspaceDetailsDescription": {
"defaultMessage": "Complete the fields to create a workspace.",
"description": "Workspace details step description"
},
"workspaceDetailsTitle": {
"defaultMessage": "Provide details for a workspace",
"description": "Workspace details step title"
},
"workspaceName": {
"defaultMessage": "Workspace name",
"description": "Workspace name label"
},
"workspaceNamingGuidelines": {
"defaultMessage": "{link} about the guidelines for naming your workspaces.",
"description": "Workspace naming guidelines hint"
},
"workspaceParentHelperText": {
"defaultMessage": "This workspace will inherit access control settings, such as user groups and associated roles, from its parent workspace.",
"description": "Workspace parent field helper text"
},
"workspaces": {
"defaultMessage": "Workspaces",
"description": "Workspaces heading"
Expand Down
Loading

0 comments on commit b36a4c8

Please sign in to comment.