Move Tiers, Notifications and Site Replication out of Settings Menu (#1975)

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
This commit is contained in:
Daniel Valdivia
2022-05-11 12:41:56 -07:00
committed by GitHub
parent 6be7527424
commit 5ee9213ad0
8 changed files with 50 additions and 86 deletions

View File

@@ -77,7 +77,7 @@ const ConfigurationOptions = ({ classes, match }: IConfigurationOptions) => {
return (
<Fragment>
<PageHeader label={"Settings"} />
<PageHeader label={"Configurations"} />
<PageLayout>
<Grid item xs={12}>
@@ -124,7 +124,7 @@ const ConfigurationOptions = ({ classes, match }: IConfigurationOptions) => {
</Grid>
<Grid item xs={12} sx={{ paddingTop: "15px" }}>
<HelpBox
title={"Learn more about SETTINGS"}
title={"Learn more about CONFIGURATIONS"}
iconComponent={<SettingsIcon />}
help={
<Fragment>

View File

@@ -212,6 +212,35 @@ export const validRoutes = (
},
],
},
{
component: NavLink,
to: IAM_PAGES.NOTIFICATIONS_ENDPOINTS,
name: "Notifications",
icon: LambdaIcon,
id: "lambda",
},
{
component: NavLink,
to: IAM_PAGES.TIERS,
name: "Tiers",
icon: TiersIcon,
id: "tiers",
},
{
component: NavLink,
to: IAM_PAGES.SITE_REPLICATION,
name: "Site Replication",
icon: RecoverIcon,
id: "sitereplication",
},
{
component: NavLink,
to: IAM_PAGES.SETTINGS,
name: "Configurations",
id: "configurations",
icon: SettingsIcon,
},
{
component: NavLink,
to: IAM_PAGES.LICENSE,
@@ -220,41 +249,6 @@ export const validRoutes = (
icon: LicenseIcon,
forceDisplay: true,
},
{
name: "Settings",
id: "settings",
icon: SettingsIcon,
children: [
{
component: NavLink,
to: IAM_PAGES.SETTINGS,
name: "Configurations",
id: "configurations",
icon: SettingsIcon,
},
{
component: NavLink,
to: IAM_PAGES.NOTIFICATIONS_ENDPOINTS,
name: "Notifications",
icon: LambdaIcon,
id: "lambda",
},
{
component: NavLink,
to: IAM_PAGES.TIERS,
name: "Tiers",
icon: TiersIcon,
id: "tiers",
},
{
component: NavLink,
to: IAM_PAGES.SITE_REPLICATION,
name: "Site Replication",
icon: RecoverIcon,
id: "sitereplication",
},
],
},
{
type: "item",
component: NavLink,

View File

@@ -16,10 +16,7 @@
import * as roles from "../utils/roles";
import * as elements from "../utils/elements";
import {
notificationEndpointsElement,
settingsElement,
} from "../utils/elements-menu";
import { notificationEndpointsElement } from "../utils/elements-menu";
fixture("For user with Notification Endpoints permissions")
.page("http://localhost:9090")
@@ -28,12 +25,7 @@ fixture("For user with Notification Endpoints permissions")
});
test("Notification Endpoints sidebar item exists", async (t) => {
await t
.expect(settingsElement.exists)
.ok()
.click(settingsElement)
.expect(notificationEndpointsElement.exists)
.ok();
await t.expect(notificationEndpointsElement.exists).ok();
});
test("Add Notification Target button exists", async (t) => {

View File

@@ -16,7 +16,7 @@
import * as roles from "../utils/roles";
import * as elements from "../utils/elements";
import { configurationsElement, settingsElement } from "../utils/elements-menu";
import { configurationsElement } from "../utils/elements-menu";
fixture("For user with Settings permissions")
.page("http://localhost:9090")
@@ -25,12 +25,7 @@ fixture("For user with Settings permissions")
});
test("Settings sidebar item exists", async (t) => {
await t
.expect(settingsElement.exists)
.ok()
.click(settingsElement)
.expect(configurationsElement.exists)
.ok();
await t.expect(configurationsElement.exists).ok();
});
test("Settings window exists in Settings page", async (t) => {

View File

@@ -15,13 +15,14 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import * as roles from "../utils/roles";
import { settingsElement } from "../utils/elements-menu";
import { IAM_PAGES } from "../../src/common/SecureComponent/permissions";
import { Selector } from "testcafe";
let testDomainUrl = "http://localhost:9090";
const screenUrl = `${testDomainUrl}${IAM_PAGES.SITE_REPLICATION}`;
const siteReplicationEl = Selector("span").withText("Site Replication");
const siteReplicationEl = Selector(".MuiPaper-root")
.find("ul")
.child("#sitereplication");
export const addSitesBtn = Selector("button").withText("Add Sites");
/* Begin Local Testing config block */
@@ -36,12 +37,7 @@ fixture("Site Replication Status for user with Admin permissions")
});
test("Site replication sidebar item exists", async (t) => {
await t
.expect(settingsElement.exists)
.ok()
.click(settingsElement)
.expect(siteReplicationEl.exists)
.ok();
await t.expect(siteReplicationEl.exists).ok();
});
test("Add Sites button exists", async (t) => {

View File

@@ -16,7 +16,7 @@
import * as roles from "../utils/roles";
import * as elements from "../utils/elements";
import { settingsElement, tiersElement } from "../utils/elements-menu";
import { tiersElement } from "../utils/elements-menu";
fixture("For user with Tiers permissions")
.page("http://localhost:9090")
@@ -25,12 +25,7 @@ fixture("For user with Tiers permissions")
});
test("Tiers sidebar item exists", async (t) => {
await t
.expect(settingsElement.exists)
.ok()
.click(settingsElement)
.expect(tiersElement.exists)
.ok();
await t.expect(tiersElement.exists).ok();
});
test("Add Tier button exists", async (t) => {

View File

@@ -25,7 +25,6 @@ import {
monitoringElement,
notificationEndpointsElement,
serviceAcctsElement,
settingsElement,
supportElement,
tiersElement,
usersElement,
@@ -58,9 +57,6 @@ test("All sidebar items exist", async (t) => {
.ok()
.expect(iamPoliciesElement.exists)
.ok()
.expect(settingsElement.exists)
.ok()
.click(settingsElement)
.expect(notificationEndpointsElement.exists)
.ok()
.expect(tiersElement.exists)

View File

@@ -14,7 +14,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import * as constants from "./constants";
import { Selector } from "testcafe";
import { IAM_PAGES } from "../../src/common/SecureComponent/permissions";
@@ -69,20 +68,17 @@ export const iamPoliciesElement = sidebarItem.withAttribute(
"/access/policies"
);
export const settingsElement = Selector(".MuiPaper-root")
export const configurationsElement = Selector(".MuiPaper-root")
.find("ul")
.child("#settings");
export const settingsChildren = Selector("#settings-children");
.child("#configurations");
export const configurationsElement = settingsChildren
.find("a")
.withAttribute("href", "/settings/configurations");
export const notificationEndpointsElement = settingsChildren
.find("a")
.withAttribute("href", "/settings/notification-endpoints");
export const tiersElement = settingsChildren
.find("a")
.withAttribute("href", "/settings/tiers");
export const notificationEndpointsElement = Selector(".MuiPaper-root")
.find("ul")
.child("#lambda");
export const tiersElement = Selector(".MuiPaper-root")
.find("ul")
.child("#tiers");
export const supportElement = Selector(".MuiPaper-root")
.find("ul")