Skip to content

Commit

Permalink
feat: roles unification (#3999)
Browse files Browse the repository at this point in the history
https://linear.app/unleash/issue/2-1137/roles-unification-on-the-ui

Root and project roles should be managed in a similar manner, which
means using the same roles route and tab for both.

Additionally, this includes a big revamp to the project roles to align
them more closely with the modern and standardized custom root roles
that were recently developed. They mostly use the same components.

There are still more things we want to improve and unify, but we've left
some of that out of this PR due to PR size concerns.
  • Loading branch information
nunogois committed Jun 19, 2023
1 parent 60f4ce3 commit eb8f16d
Show file tree
Hide file tree
Showing 26 changed files with 387 additions and 1,104 deletions.
11 changes: 1 addition & 10 deletions frontend/src/component/admin/Admin.tsx
Expand Up @@ -13,10 +13,7 @@ import { InstanceAdmin } from './instance-admin/InstanceAdmin';
import { MaintenanceAdmin } from './maintenance';
import AdminMenu from './menu/AdminMenu';
import { Network } from './network/Network';
import CreateProjectRole from './projectRoles/CreateProjectRole/CreateProjectRole';
import EditProjectRole from './projectRoles/EditProjectRole/EditProjectRole';
import { Roles } from './roles/Roles';
import ProjectRoles from './projectRoles/ProjectRoles/ProjectRoles';
import { ServiceAccounts } from './serviceAccounts/ServiceAccounts';
import CreateUser from './users/CreateUser/CreateUser';
import EditUser from './users/EditUser/EditUser';
Expand All @@ -28,11 +25,6 @@ export const Admin = () => (
<AdminMenu />
<Routes>
<Route path="users" element={<UsersAdmin />} />
<Route path="project-roles/new" element={<CreateProjectRole />} />
<Route
path="project-roles/:id/edit"
element={<EditProjectRole />}
/>
<Route path="api" element={<ApiTokenPage />} />
<Route path="api/create-token" element={<CreateApiToken />} />
<Route path="users/:id/edit" element={<EditUser />} />
Expand All @@ -46,8 +38,7 @@ export const Admin = () => (
element={<EditGroupContainer />}
/>
<Route path="groups/:groupId" element={<Group />} />
<Route path="roles" element={<Roles />} />
<Route path="project-roles" element={<ProjectRoles />} />
<Route path="roles/*" element={<Roles />} />
<Route path="instance" element={<InstanceAdmin />} />
<Route path="network/*" element={<Network />} />
<Route path="maintenance" element={<MaintenanceAdmin />} />
Expand Down
12 changes: 1 addition & 11 deletions frontend/src/component/admin/menu/AdminMenu.tsx
Expand Up @@ -55,7 +55,7 @@ function AdminMenu() {
}
/>
)}
{flags.customRootRoles && (
{isEnterprise() && (
<Tab
value="roles"
label={
Expand All @@ -65,16 +65,6 @@ function AdminMenu() {
}
/>
)}
{flags.RE && (
<Tab
value="project-roles"
label={
<CenteredNavLink to="/admin/project-roles">
<span>Project roles</span>
</CenteredNavLink>
}
/>
)}
<Tab
value="api"
label={
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit eb8f16d

Please sign in to comment.