Skip to content

Commit 5533096

Browse files
authored
Move Access to Policies under Identity (#2348)
Signed-off-by: Daniel Valdivia
1 parent a3b8856 commit 5533096

File tree

4 files changed

+27
-22
lines changed

4 files changed

+27
-22
lines changed

portal-ui/src/common/SecureComponent/permissions.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,9 @@ export const IAM_PAGES = {
128128
ACCOUNT: "/identity/account",
129129
ACCOUNT_ADD: "/identity/account/new-account",
130130
USER_SA_ACCOUNT_ADD: "/identity/users/new-user-sa/:userName",
131-
132-
/* Access */
133-
POLICIES: "/access/policies",
134-
POLICY_ADD: "/access/add-policy",
135-
POLICIES_VIEW: "/access/policies/*",
131+
POLICIES: "/identity/policies",
132+
POLICY_ADD: "/identity/add-policy",
133+
POLICIES_VIEW: "/identity/policies/*",
136134
/* Monitoring */
137135
TOOLS_LOGS: "/tools/logs",
138136
TOOLS_AUDITLOGS: "/tools/audit-logs",

portal-ui/src/screens/Console/valid-routes.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,15 @@ export const validRoutes = (
107107
icon: AccountsMenuIcon,
108108
forceDisplay: true,
109109
},
110+
{
111+
name: "Policies",
112+
component: NavLink,
113+
id: "policies",
114+
to: IAM_PAGES.POLICIES,
115+
icon: AccessMenuIcon,
116+
},
110117
],
111118
},
112-
{
113-
name: "Access",
114-
component: NavLink,
115-
id: "access",
116-
to: IAM_PAGES.POLICIES,
117-
icon: AccessMenuIcon,
118-
},
119119

120120
{
121121
name: "Monitoring",

portal-ui/tests/permissions-1/iamPolicies.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ import * as roles from "../utils/roles";
1818
import * as elements from "../utils/elements";
1919
import * as constants from "../utils/constants";
2020
import { Selector } from "testcafe";
21-
import { iamPoliciesElement } from "../utils/elements-menu";
21+
import {
22+
iamPoliciesElement,
23+
identityElement,
24+
usersElement,
25+
} from "../utils/elements-menu";
2226

2327
const iamPolicyListItem = Selector(
2428
".ReactVirtualized__Table__rowColumn"
@@ -37,7 +41,12 @@ fixture("For user with IAM Policies permissions")
3741

3842
test("IAM Policies sidebar item exists", async (t) => {
3943
const iamPoliciesExist = iamPoliciesElement.exists;
40-
await t.expect(iamPoliciesExist).ok();
44+
await t
45+
.expect(identityElement.exists)
46+
.ok()
47+
.click(identityElement)
48+
.expect(iamPoliciesExist)
49+
.ok();
4150
});
4251

4352
test("Create Policy button exists", async (t) => {

portal-ui/tests/utils/elements-menu.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,16 @@ export const identityChildren = Selector("#identity-children");
5555

5656
export const usersElement = identityChildren
5757
.find("a")
58-
.withAttribute("href", "/identity/users");
58+
.withAttribute("href", IAM_PAGES.USERS);
5959
export const groupsElement = identityChildren
6060
.find("a")
61-
.withAttribute("href", "/identity/groups");
61+
.withAttribute("href", IAM_PAGES.GROUPS);
6262
export const serviceAcctsElement = identityChildren
6363
.find("a")
64-
.withAttribute("href", "/identity/account");
65-
66-
export const iamPoliciesElement = sidebarItem.withAttribute(
67-
"href",
68-
"/access/policies"
69-
);
64+
.withAttribute("href", IAM_PAGES.ACCOUNT);
65+
export const iamPoliciesElement = identityChildren
66+
.find("a")
67+
.withAttribute("href", IAM_PAGES.POLICIES);
7068

7169
export const configurationsElement = Selector(".MuiPaper-root")
7270
.find("ul")

0 commit comments

Comments
 (0)