Skip to content

Commit 5ee9213

Browse files
authored
Move Tiers, Notifications and Site Replication out of Settings Menu (#1975)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
1 parent 6be7527 commit 5ee9213

File tree

8 files changed

+50
-86
lines changed

8 files changed

+50
-86
lines changed

portal-ui/src/screens/Console/Configurations/ConfigurationPanels/ConfigurationOptions.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const ConfigurationOptions = ({ classes, match }: IConfigurationOptions) => {
7777

7878
return (
7979
<Fragment>
80-
<PageHeader label={"Settings"} />
80+
<PageHeader label={"Configurations"} />
8181

8282
<PageLayout>
8383
<Grid item xs={12}>
@@ -124,7 +124,7 @@ const ConfigurationOptions = ({ classes, match }: IConfigurationOptions) => {
124124
</Grid>
125125
<Grid item xs={12} sx={{ paddingTop: "15px" }}>
126126
<HelpBox
127-
title={"Learn more about SETTINGS"}
127+
title={"Learn more about CONFIGURATIONS"}
128128
iconComponent={<SettingsIcon />}
129129
help={
130130
<Fragment>

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

Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,35 @@ export const validRoutes = (
212212
},
213213
],
214214
},
215+
216+
{
217+
component: NavLink,
218+
to: IAM_PAGES.NOTIFICATIONS_ENDPOINTS,
219+
name: "Notifications",
220+
icon: LambdaIcon,
221+
id: "lambda",
222+
},
223+
{
224+
component: NavLink,
225+
to: IAM_PAGES.TIERS,
226+
name: "Tiers",
227+
icon: TiersIcon,
228+
id: "tiers",
229+
},
230+
{
231+
component: NavLink,
232+
to: IAM_PAGES.SITE_REPLICATION,
233+
name: "Site Replication",
234+
icon: RecoverIcon,
235+
id: "sitereplication",
236+
},
237+
{
238+
component: NavLink,
239+
to: IAM_PAGES.SETTINGS,
240+
name: "Configurations",
241+
id: "configurations",
242+
icon: SettingsIcon,
243+
},
215244
{
216245
component: NavLink,
217246
to: IAM_PAGES.LICENSE,
@@ -220,41 +249,6 @@ export const validRoutes = (
220249
icon: LicenseIcon,
221250
forceDisplay: true,
222251
},
223-
{
224-
name: "Settings",
225-
id: "settings",
226-
icon: SettingsIcon,
227-
children: [
228-
{
229-
component: NavLink,
230-
to: IAM_PAGES.SETTINGS,
231-
name: "Configurations",
232-
id: "configurations",
233-
icon: SettingsIcon,
234-
},
235-
{
236-
component: NavLink,
237-
to: IAM_PAGES.NOTIFICATIONS_ENDPOINTS,
238-
name: "Notifications",
239-
icon: LambdaIcon,
240-
id: "lambda",
241-
},
242-
{
243-
component: NavLink,
244-
to: IAM_PAGES.TIERS,
245-
name: "Tiers",
246-
icon: TiersIcon,
247-
id: "tiers",
248-
},
249-
{
250-
component: NavLink,
251-
to: IAM_PAGES.SITE_REPLICATION,
252-
name: "Site Replication",
253-
icon: RecoverIcon,
254-
id: "sitereplication",
255-
},
256-
],
257-
},
258252
{
259253
type: "item",
260254
component: NavLink,

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616

1717
import * as roles from "../utils/roles";
1818
import * as elements from "../utils/elements";
19-
import {
20-
notificationEndpointsElement,
21-
settingsElement,
22-
} from "../utils/elements-menu";
19+
import { notificationEndpointsElement } from "../utils/elements-menu";
2320

2421
fixture("For user with Notification Endpoints permissions")
2522
.page("http://localhost:9090")
@@ -28,12 +25,7 @@ fixture("For user with Notification Endpoints permissions")
2825
});
2926

3027
test("Notification Endpoints sidebar item exists", async (t) => {
31-
await t
32-
.expect(settingsElement.exists)
33-
.ok()
34-
.click(settingsElement)
35-
.expect(notificationEndpointsElement.exists)
36-
.ok();
28+
await t.expect(notificationEndpointsElement.exists).ok();
3729
});
3830

3931
test("Add Notification Target button exists", async (t) => {

portal-ui/tests/permissions-2/settings.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import * as roles from "../utils/roles";
1818
import * as elements from "../utils/elements";
19-
import { configurationsElement, settingsElement } from "../utils/elements-menu";
19+
import { configurationsElement } from "../utils/elements-menu";
2020

2121
fixture("For user with Settings permissions")
2222
.page("http://localhost:9090")
@@ -25,12 +25,7 @@ fixture("For user with Settings permissions")
2525
});
2626

2727
test("Settings sidebar item exists", async (t) => {
28-
await t
29-
.expect(settingsElement.exists)
30-
.ok()
31-
.click(settingsElement)
32-
.expect(configurationsElement.exists)
33-
.ok();
28+
await t.expect(configurationsElement.exists).ok();
3429
});
3530

3631
test("Settings window exists in Settings page", async (t) => {

portal-ui/tests/permissions-2/site-replication.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

1717
import * as roles from "../utils/roles";
18-
import { settingsElement } from "../utils/elements-menu";
1918
import { IAM_PAGES } from "../../src/common/SecureComponent/permissions";
2019
import { Selector } from "testcafe";
2120

2221
let testDomainUrl = "http://localhost:9090";
2322
const screenUrl = `${testDomainUrl}${IAM_PAGES.SITE_REPLICATION}`;
24-
const siteReplicationEl = Selector("span").withText("Site Replication");
23+
const siteReplicationEl = Selector(".MuiPaper-root")
24+
.find("ul")
25+
.child("#sitereplication");
2526
export const addSitesBtn = Selector("button").withText("Add Sites");
2627

2728
/* Begin Local Testing config block */
@@ -36,12 +37,7 @@ fixture("Site Replication Status for user with Admin permissions")
3637
});
3738

3839
test("Site replication sidebar item exists", async (t) => {
39-
await t
40-
.expect(settingsElement.exists)
41-
.ok()
42-
.click(settingsElement)
43-
.expect(siteReplicationEl.exists)
44-
.ok();
40+
await t.expect(siteReplicationEl.exists).ok();
4541
});
4642

4743
test("Add Sites button exists", async (t) => {

portal-ui/tests/permissions-2/tiers.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import * as roles from "../utils/roles";
1818
import * as elements from "../utils/elements";
19-
import { settingsElement, tiersElement } from "../utils/elements-menu";
19+
import { tiersElement } from "../utils/elements-menu";
2020

2121
fixture("For user with Tiers permissions")
2222
.page("http://localhost:9090")
@@ -25,12 +25,7 @@ fixture("For user with Tiers permissions")
2525
});
2626

2727
test("Tiers sidebar item exists", async (t) => {
28-
await t
29-
.expect(settingsElement.exists)
30-
.ok()
31-
.click(settingsElement)
32-
.expect(tiersElement.exists)
33-
.ok();
28+
await t.expect(tiersElement.exists).ok();
3429
});
3530

3631
test("Add Tier button exists", async (t) => {

portal-ui/tests/permissions-3/admin.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import {
2525
monitoringElement,
2626
notificationEndpointsElement,
2727
serviceAcctsElement,
28-
settingsElement,
2928
supportElement,
3029
tiersElement,
3130
usersElement,
@@ -58,9 +57,6 @@ test("All sidebar items exist", async (t) => {
5857
.ok()
5958
.expect(iamPoliciesElement.exists)
6059
.ok()
61-
.expect(settingsElement.exists)
62-
.ok()
63-
.click(settingsElement)
6460
.expect(notificationEndpointsElement.exists)
6561
.ok()
6662
.expect(tiersElement.exists)

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

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
// You should have received a copy of the GNU Affero General Public License
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17-
import * as constants from "./constants";
1817
import { Selector } from "testcafe";
1918
import { IAM_PAGES } from "../../src/common/SecureComponent/permissions";
2019

@@ -69,20 +68,17 @@ export const iamPoliciesElement = sidebarItem.withAttribute(
6968
"/access/policies"
7069
);
7170

72-
export const settingsElement = Selector(".MuiPaper-root")
71+
export const configurationsElement = Selector(".MuiPaper-root")
7372
.find("ul")
74-
.child("#settings");
75-
export const settingsChildren = Selector("#settings-children");
73+
.child("#configurations");
7674

77-
export const configurationsElement = settingsChildren
78-
.find("a")
79-
.withAttribute("href", "/settings/configurations");
80-
export const notificationEndpointsElement = settingsChildren
81-
.find("a")
82-
.withAttribute("href", "/settings/notification-endpoints");
83-
export const tiersElement = settingsChildren
84-
.find("a")
85-
.withAttribute("href", "/settings/tiers");
75+
export const notificationEndpointsElement = Selector(".MuiPaper-root")
76+
.find("ul")
77+
.child("#lambda");
78+
79+
export const tiersElement = Selector(".MuiPaper-root")
80+
.find("ul")
81+
.child("#tiers");
8682

8783
export const supportElement = Selector(".MuiPaper-root")
8884
.find("ul")

0 commit comments

Comments
 (0)