From 3825bf7b17089e0dbd5156cc67e4d5fdb4aa5011 Mon Sep 17 00:00:00 2001 From: Shane Melton Date: Mon, 11 Jul 2022 17:13:10 -0700 Subject: [PATCH] Create initial 'Groups' tab --- .../app/modules/loose-components.module.ts | 4 +- .../group-add-edit.component.html | 0 .../group-add-edit.component.ts | 0 .../groups/groups.component.html | 79 +++++++++++++++++++ .../{manage => groups}/groups.component.ts | 2 +- .../manage/groups.component.html | 77 ------------------ .../organization-routing.module.ts | 20 ++--- 7 files changed, 92 insertions(+), 90 deletions(-) rename apps/web/src/app/organizations/{manage => groups}/group-add-edit.component.html (100%) rename apps/web/src/app/organizations/{manage => groups}/group-add-edit.component.ts (100%) create mode 100644 apps/web/src/app/organizations/groups/groups.component.html rename apps/web/src/app/organizations/{manage => groups}/groups.component.ts (98%) delete mode 100644 apps/web/src/app/organizations/manage/groups.component.html diff --git a/apps/web/src/app/modules/loose-components.module.ts b/apps/web/src/app/modules/loose-components.module.ts index 2831824d345..10d23cf62ef 100644 --- a/apps/web/src/app/modules/loose-components.module.ts +++ b/apps/web/src/app/modules/loose-components.module.ts @@ -27,12 +27,12 @@ import { FooterComponent } from "../layouts/footer.component"; import { FrontendLayoutComponent } from "../layouts/frontend-layout.component"; import { NavbarComponent } from "../layouts/navbar.component"; import { UserLayoutComponent } from "../layouts/user-layout.component"; +import { GroupAddEditComponent as OrgGroupAddEditComponent } from "../organizations/groups/group-add-edit.component"; +import { GroupsComponent as OrgGroupsComponent } from "../organizations/groups/groups.component"; import { OrganizationLayoutComponent } from "../organizations/layouts/organization-layout.component"; import { CollectionAddEditComponent as OrgCollectionAddEditComponent } from "../organizations/manage/collection-add-edit.component"; import { CollectionsComponent as OrgManageCollectionsComponent } from "../organizations/manage/collections.component"; import { EventsComponent as OrgEventsComponent } from "../organizations/manage/events.component"; -import { GroupAddEditComponent as OrgGroupAddEditComponent } from "../organizations/manage/group-add-edit.component"; -import { GroupsComponent as OrgGroupsComponent } from "../organizations/manage/groups.component"; import { ManageComponent as OrgManageComponent } from "../organizations/manage/manage.component"; import { PoliciesComponent as OrgPoliciesComponent } from "../organizations/manage/policies.component"; import { PolicyEditComponent as OrgPolicyEditComponent } from "../organizations/manage/policy-edit.component"; diff --git a/apps/web/src/app/organizations/manage/group-add-edit.component.html b/apps/web/src/app/organizations/groups/group-add-edit.component.html similarity index 100% rename from apps/web/src/app/organizations/manage/group-add-edit.component.html rename to apps/web/src/app/organizations/groups/group-add-edit.component.html diff --git a/apps/web/src/app/organizations/manage/group-add-edit.component.ts b/apps/web/src/app/organizations/groups/group-add-edit.component.ts similarity index 100% rename from apps/web/src/app/organizations/manage/group-add-edit.component.ts rename to apps/web/src/app/organizations/groups/group-add-edit.component.ts diff --git a/apps/web/src/app/organizations/groups/groups.component.html b/apps/web/src/app/organizations/groups/groups.component.html new file mode 100644 index 00000000000..72c6c2ee115 --- /dev/null +++ b/apps/web/src/app/organizations/groups/groups.component.html @@ -0,0 +1,79 @@ +
+ + + + {{ "loading" | i18n }} + + +

{{ "noGroupsInList" | i18n }}

+ + + + + + + +
+ {{ g.name }} + + +
+
+ + +
diff --git a/apps/web/src/app/organizations/manage/groups.component.ts b/apps/web/src/app/organizations/groups/groups.component.ts similarity index 98% rename from apps/web/src/app/organizations/manage/groups.component.ts rename to apps/web/src/app/organizations/groups/groups.component.ts index 2df4c79b183..b9f368ea76e 100644 --- a/apps/web/src/app/organizations/manage/groups.component.ts +++ b/apps/web/src/app/organizations/groups/groups.component.ts @@ -49,7 +49,7 @@ export class GroupsComponent implements OnInit { ) {} async ngOnInit() { - this.route.parent.parent.params.subscribe(async (params) => { + this.route.parent.params.subscribe(async (params) => { this.organizationId = params.organizationId; const organization = await this.organizationService.get(this.organizationId); if (organization == null || !organization.useGroups) { diff --git a/apps/web/src/app/organizations/manage/groups.component.html b/apps/web/src/app/organizations/manage/groups.component.html deleted file mode 100644 index 050307b8539..00000000000 --- a/apps/web/src/app/organizations/manage/groups.component.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - {{ "loading" | i18n }} - - -

{{ "noGroupsInList" | i18n }}

- - - - - - - -
- {{ g.name }} - - -
-
- - diff --git a/apps/web/src/app/organizations/organization-routing.module.ts b/apps/web/src/app/organizations/organization-routing.module.ts index 91a19e6c5f7..31f167ab43d 100644 --- a/apps/web/src/app/organizations/organization-routing.module.ts +++ b/apps/web/src/app/organizations/organization-routing.module.ts @@ -6,11 +6,11 @@ import { Permissions } from "@bitwarden/common/enums/permissions"; import { OrganizationVaultModule } from "../modules/vault/modules/organization-vault/organization-vault.module"; +import { GroupsComponent } from "./groups/groups.component"; import { PermissionsGuard } from "./guards/permissions.guard"; import { OrganizationLayoutComponent } from "./layouts/organization-layout.component"; import { CollectionsComponent } from "./manage/collections.component"; import { EventsComponent } from "./manage/events.component"; -import { GroupsComponent } from "./manage/groups.component"; import { ManageComponent } from "./manage/manage.component"; import { PoliciesComponent } from "./manage/policies.component"; import { MembersComponent } from "./members/members.component"; @@ -143,15 +143,6 @@ const routes: Routes = [ permissions: [Permissions.AccessEventLogs], }, }, - { - path: "groups", - component: GroupsComponent, - canActivate: [PermissionsGuard], - data: { - titleId: "groups", - permissions: [Permissions.ManageGroups], - }, - }, { path: "policies", component: PoliciesComponent, @@ -198,6 +189,15 @@ const routes: Routes = [ permissions: [Permissions.ManageUsers, Permissions.ManageUsersPassword], }, }, + { + path: "groups", + component: GroupsComponent, + canActivate: [PermissionsGuard], + data: { + titleId: "groups", + permissions: [Permissions.ManageGroups], + }, + }, ], }, ];