Menu Tweaks and Rename Notifications to Events (#2639)

- Rename notifications to events.
- Add categories to event destinations
- Menu changes

Co-authored-by: jinapurapu <65002498+jinapurapu@users.noreply.github.com>
This commit is contained in:
Daniel Valdivia
2023-02-07 21:19:17 -08:00
committed by GitHub
parent 894f6ce131
commit c0e47bafa4
31 changed files with 200 additions and 235 deletions

View File

@@ -204,10 +204,9 @@ export const IAM_PAGES = {
/* Documentation **/
DOCUMENTATION: "/documentation",
/* TBD ? */
NOTIFICATIONS_ENDPOINTS: "/settings/notification-endpoints",
NOTIFICATIONS_ENDPOINTS_ADD: "/settings/notification-endpoints/add",
NOTIFICATIONS_ENDPOINTS_ADD_SERVICE:
"/settings/notification-endpoints/add/:service",
EVENT_DESTINATIONS: "/settings/event-destinations",
EVENT_DESTINATIONS_ADD: "/settings/event-destinations/add",
EVENT_DESTINATIONS_ADD_SERVICE: "/settings/event-destinations/add/:service",
TIERS: "/settings/tiers",
TIERS_ADD: "/settings/tiers/add",
TIERS_ADD_SERVICE: "/settings/tiers/add/:service",
@@ -412,15 +411,15 @@ export const IAM_PAGES_PERMISSIONS = {
[IAM_PAGES.SETTINGS_VIEW]: [
IAM_SCOPES.ADMIN_CONFIG_UPDATE, // displays configuration list
],
[IAM_PAGES.NOTIFICATIONS_ENDPOINTS_ADD_SERVICE]: [
[IAM_PAGES.EVENT_DESTINATIONS_ADD_SERVICE]: [
IAM_SCOPES.ADMIN_SERVER_INFO,
IAM_SCOPES.ADMIN_CONFIG_UPDATE,
],
[IAM_PAGES.NOTIFICATIONS_ENDPOINTS_ADD]: [
[IAM_PAGES.EVENT_DESTINATIONS_ADD]: [
IAM_SCOPES.ADMIN_SERVER_INFO,
IAM_SCOPES.ADMIN_CONFIG_UPDATE,
],
[IAM_PAGES.NOTIFICATIONS_ENDPOINTS]: [
[IAM_PAGES.EVENT_DESTINATIONS]: [
IAM_SCOPES.ADMIN_SERVER_INFO, // displays notifications endpoints
IAM_SCOPES.ADMIN_CONFIG_UPDATE, // displays create notification button
],

View File

@@ -1,40 +0,0 @@
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// 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 React from "react";
import { Box } from "@mui/material";
type Props = {
children: React.ReactNode;
};
const ContentBox: React.FC<Props> = ({ children }) => {
return (
<Box
sx={{
border: "1px solid #eaeaea",
padding: {
lg: "40px",
xs: "15px",
},
}}
>
{children}
</Box>
);
};
export default ContentBox;

View File

@@ -18,7 +18,7 @@ import React from "react";
import { useLocation } from "react-router-dom";
import Grid from "@mui/material/Grid";
import { configurationElements } from "../utils";
import EditConfiguration from "../../NotificationEndpoints/CustomForms/EditConfiguration";
import EditConfiguration from "../../EventDestinations/CustomForms/EditConfiguration";
const ConfigurationsList = () => {
const { pathname = "" } = useLocation();

View File

@@ -69,14 +69,14 @@ const RegisterOperator = React.lazy(() => import("./Support/RegisterOperator"));
const AddTenant = React.lazy(() => import("./Tenants/AddTenant/AddTenant"));
const NotificationEndpoints = React.lazy(
() => import("./NotificationEndpoints/NotificationEndpoints")
const EventDestinations = React.lazy(
() => import("./EventDestinations/EventDestinations")
);
const AddNotificationEndpoint = React.lazy(
() => import("./NotificationEndpoints/AddNotificationEndpoint")
const AddEventDestination = React.lazy(
() => import("./EventDestinations/AddEventDestination")
);
const NotificationTypeSelector = React.lazy(
() => import("./NotificationEndpoints/NotificationTypeSelector")
const EventTypeSelector = React.lazy(
() => import("./EventDestinations/EventTypeSelector")
);
const ListTiersConfiguration = React.lazy(
@@ -425,16 +425,16 @@ const Console = ({ classes }: IConsoleProps) => {
path: IAM_PAGES.SETTINGS,
},
{
component: AddNotificationEndpoint,
path: IAM_PAGES.NOTIFICATIONS_ENDPOINTS_ADD_SERVICE,
component: AddEventDestination,
path: IAM_PAGES.EVENT_DESTINATIONS_ADD_SERVICE,
},
{
component: NotificationTypeSelector,
path: IAM_PAGES.NOTIFICATIONS_ENDPOINTS_ADD,
component: EventTypeSelector,
path: IAM_PAGES.EVENT_DESTINATIONS_ADD,
},
{
component: NotificationEndpoints,
path: IAM_PAGES.NOTIFICATIONS_ENDPOINTS,
component: EventDestinations,
path: IAM_PAGES.EVENT_DESTINATIONS,
},
{
component: AddTierConfiguration,

View File

@@ -29,7 +29,7 @@ import {
notifyMysql,
notifyPostgres,
removeEmptyFields,
servicesList,
destinationList,
} from "./utils";
import {
modalBasic,
@@ -110,7 +110,7 @@ interface IAddNotificationEndpointProps {
classes: any;
}
const AddNotificationEndpoint = ({
const AddEventDestination = ({
saveAndRefresh,
classes,
}: IAddNotificationEndpointProps) => {
@@ -134,7 +134,7 @@ const AddNotificationEndpoint = ({
.then(() => {
setSaving(false);
dispatch(setServerNeedsRestart(true));
navigate(IAM_PAGES.NOTIFICATIONS_ENDPOINTS);
navigate(IAM_PAGES.EVENT_DESTINATIONS);
})
.catch((err: ErrorResponseHandler) => {
setSaving(false);
@@ -175,7 +175,7 @@ const AddNotificationEndpoint = ({
}
}
const targetElement = servicesList.find(
const targetElement = destinationList.find(
(element) => element.actionTrigger === service
);
@@ -186,7 +186,7 @@ const AddNotificationEndpoint = ({
<Fragment>
<BackLink
label="Notification Endpoint"
onClick={() => navigate(IAM_PAGES.NOTIFICATIONS_ENDPOINTS_ADD)}
onClick={() => navigate(IAM_PAGES.EVENT_DESTINATIONS_ADD)}
/>
</Fragment>
}
@@ -230,7 +230,7 @@ const AddNotificationEndpoint = ({
type="submit"
variant="callAction"
disabled={saving}
label={"Save Notification Target"}
label={"Save Event Destination"}
/>
</Grid>
</div>
@@ -242,4 +242,4 @@ const AddNotificationEndpoint = ({
);
};
export default withStyles(styles)(AddNotificationEndpoint);
export default withStyles(styles)(AddEventDestination);

View File

@@ -3,7 +3,7 @@ import ConfirmDialog from "../Common/ModalWrapper/ConfirmDialog";
import { ConfirmModalIcon } from "mds";
import { DialogContentText } from "@mui/material";
const ConfirmDeleteTargetModal = ({
const ConfirmDeleteDestinationModal = ({
onConfirm,
onClose,
serviceName,
@@ -36,4 +36,4 @@ const ConfirmDeleteTargetModal = ({
);
};
export default ConfirmDeleteTargetModal;
export default ConfirmDeleteDestinationModal;

View File

@@ -20,16 +20,16 @@ import React, { Fragment } from "react";
import withSuspense from "../Common/Components/withSuspense";
const ListNotificationEndpoints = withSuspense(
React.lazy(() => import("./ListNotificationEndpoints"))
React.lazy(() => import("./ListEventDestinations"))
);
const NotificationEndpoints = () => {
const EventDestinations = () => {
return (
<Fragment>
<PageHeader label="Notification Endpoints" />
<PageHeader label="Event Destinations" />
<ListNotificationEndpoints />
</Fragment>
);
};
export default NotificationEndpoints;
export default EventDestinations;

View File

@@ -19,14 +19,13 @@ import { Theme } from "@mui/material/styles";
import { useNavigate } from "react-router-dom";
import createStyles from "@mui/styles/createStyles";
import withStyles from "@mui/styles/withStyles";
import { servicesList } from "./utils";
import { destinationList, DestType } from "./utils";
import {
settingsCommon,
typesSelection,
} from "../Common/FormComponents/common/styleLibrary";
import PageLayout from "../Common/Layout/PageLayout";
import { IAM_PAGES } from "../../../common/SecureComponent/permissions";
import ContentBox from "../Common/ContentBox";
import { Box } from "@mui/material";
import NotificationEndpointTypeSelectorHelpBox from "../Account/NotificationEndpointTypeSelectorHelpBox";
import { BackLink, PageHeader } from "mds";
@@ -35,7 +34,16 @@ interface INotificationTypeSelector {
classes: any;
}
const withLogos = servicesList.filter((elService) => elService.logo !== "");
const withLogos = destinationList.filter((elService) => elService.logo !== "");
const database = withLogos.filter(
(elService) => elService.category === DestType.DB
);
const queue = withLogos.filter(
(elService) => elService.category === DestType.Queue
);
const functions = withLogos.filter(
(elService) => elService.category === DestType.Func
);
const styles = (theme: Theme) =>
createStyles({
@@ -43,7 +51,7 @@ const styles = (theme: Theme) =>
...typesSelection,
});
const NotificationTypeSelector = ({ classes }: INotificationTypeSelector) => {
const EventTypeSelector = ({ classes }: INotificationTypeSelector) => {
const navigate = useNavigate();
return (
<Fragment>
@@ -51,8 +59,8 @@ const NotificationTypeSelector = ({ classes }: INotificationTypeSelector) => {
label={
<Fragment>
<BackLink
label={"Notification Targets"}
onClick={() => navigate(IAM_PAGES.NOTIFICATIONS_ENDPOINTS)}
label={"Event Destinations"}
onClick={() => navigate(IAM_PAGES.EVENT_DESTINATIONS)}
/>
</Fragment>
}
@@ -62,8 +70,8 @@ const NotificationTypeSelector = ({ classes }: INotificationTypeSelector) => {
<Box
sx={{
display: "grid",
padding: "25px",
gap: "25px",
padding: "16px",
gap: "8px",
gridTemplateColumns: {
md: "2fr 1.2fr",
xs: "1fr",
@@ -71,19 +79,19 @@ const NotificationTypeSelector = ({ classes }: INotificationTypeSelector) => {
border: "1px solid #eaeaea",
}}
>
<ContentBox>
<div>
<div style={{ fontSize: 16, fontWeight: 600, paddingBottom: 15 }}>
Select Target Type
Queue
</div>
<div className={classes.iconContainer}>
{withLogos.map((item) => {
{queue.map((item) => {
return (
<button
key={`icon-${item.targetTitle}`}
className={classes.lambdaNotif}
onClick={() => {
navigate(
`${IAM_PAGES.NOTIFICATIONS_ENDPOINTS_ADD}/${item.actionTrigger}`
`${IAM_PAGES.EVENT_DESTINATIONS_ADD}/${item.actionTrigger}`
);
}}
>
@@ -102,7 +110,67 @@ const NotificationTypeSelector = ({ classes }: INotificationTypeSelector) => {
);
})}
</div>
</ContentBox>
<div style={{ fontSize: 16, fontWeight: 600, paddingBottom: 15 }}>
Database
</div>
<div className={classes.iconContainer}>
{database.map((item) => {
return (
<button
key={`icon-${item.targetTitle}`}
className={classes.lambdaNotif}
onClick={() => {
navigate(
`${IAM_PAGES.EVENT_DESTINATIONS_ADD}/${item.actionTrigger}`
);
}}
>
<div className={classes.lambdaNotifIcon}>
<img
src={item.logo}
className={classes.logoButton}
alt={item.targetTitle}
/>
</div>
<div className={classes.lambdaNotifTitle}>
<b>{item.targetTitle}</b>
</div>
</button>
);
})}
</div>
<div style={{ fontSize: 16, fontWeight: 600, paddingBottom: 15 }}>
Functions
</div>
<div className={classes.iconContainer}>
{functions.map((item) => {
return (
<button
key={`icon-${item.targetTitle}`}
className={classes.lambdaNotif}
onClick={() => {
navigate(
`${IAM_PAGES.EVENT_DESTINATIONS_ADD}/${item.actionTrigger}`
);
}}
>
<div className={classes.lambdaNotifIcon}>
<img
src={item.logo}
className={classes.logoButton}
alt={item.targetTitle}
/>
</div>
<div className={classes.lambdaNotifTitle}>
<b>{item.targetTitle}</b>
</div>
</button>
);
})}
</div>
</div>
<NotificationEndpointTypeSelectorHelpBox />
</Box>
</PageLayout>
@@ -110,4 +178,4 @@ const NotificationTypeSelector = ({ classes }: INotificationTypeSelector) => {
);
};
export default withStyles(styles)(NotificationTypeSelector);
export default withStyles(styles)(EventTypeSelector);

View File

@@ -51,7 +51,7 @@ import {
setServerNeedsRestart,
} from "../../../systemSlice";
import { useAppDispatch } from "../../../store";
import ConfirmDeleteTargetModal from "./ConfirmDeleteTargetModal";
import ConfirmDeleteDestinationModal from "./ConfirmDeleteDestinationModal";
import TooltipWrapper from "../Common/TooltipWrapper/TooltipWrapper";
interface IListNotificationEndpoints {
@@ -82,7 +82,7 @@ const styles = (theme: Theme) =>
},
});
const ListNotificationEndpoints = ({ classes }: IListNotificationEndpoints) => {
const ListEventDestinations = ({ classes }: IListNotificationEndpoints) => {
const dispatch = useAppDispatch();
const navigate = useNavigate();
//Local States
@@ -191,7 +191,7 @@ const ListNotificationEndpoints = ({ classes }: IListNotificationEndpoints) => {
<div className={classes.rightActionItems}>
<TooltipWrapper tooltip={"Refresh List"}>
<Button
id={"reload-notification-endpoints"}
id={"reload-event-destinations"}
label={"Refresh"}
variant="regular"
icon={<RefreshIcon />}
@@ -200,14 +200,14 @@ const ListNotificationEndpoints = ({ classes }: IListNotificationEndpoints) => {
}}
/>
</TooltipWrapper>
<TooltipWrapper tooltip={"Add Notification Target"}>
<TooltipWrapper tooltip={"Add Event Destination"}>
<Button
id={"add-notification-target"}
label={" Add Notification Target"}
label={"Add Event Destination"}
variant="callAction"
icon={<AddIcon />}
onClick={() => {
navigate(IAM_PAGES.NOTIFICATIONS_ENDPOINTS_ADD);
navigate(IAM_PAGES.EVENT_DESTINATIONS_ADD);
}}
/>
</TooltipWrapper>
@@ -274,7 +274,7 @@ const ListNotificationEndpoints = ({ classes }: IListNotificationEndpoints) => {
>
<Grid item xs={8}>
<HelpBox
title={"Notification Targets"}
title={"Event Destinations"}
iconComponent={<LambdaIcon />}
help={
<Fragment>
@@ -288,10 +288,10 @@ const ListNotificationEndpoints = ({ classes }: IListNotificationEndpoints) => {
To get started,{" "}
<AButton
onClick={() => {
navigate(IAM_PAGES.NOTIFICATIONS_ENDPOINTS_ADD);
navigate(IAM_PAGES.EVENT_DESTINATIONS_ADD);
}}
>
Add a Notification Target
Add an Event Destination
</AButton>
.
</Fragment>
@@ -304,7 +304,7 @@ const ListNotificationEndpoints = ({ classes }: IListNotificationEndpoints) => {
)}
{isDelConfirmOpen ? (
<ConfirmDeleteTargetModal
<ConfirmDeleteDestinationModal
onConfirm={() => {
resetNotificationConfig(selNotifyEndPoint);
}}
@@ -320,4 +320,4 @@ const ListNotificationEndpoints = ({ classes }: IListNotificationEndpoints) => {
);
};
export default withStyles(styles)(ListNotificationEndpoints);
export default withStyles(styles)(ListEventDestinations);

View File

@@ -42,56 +42,72 @@ export const notificationTransform = (
});
};
export const servicesList = [
export class DestType {
static DB: string = "database";
static Queue: string = "queue";
static Func: string = "functions";
}
export const destinationList = [
{
actionTrigger: notifyPostgres,
targetTitle: "PostgreSQL",
logo: "/postgres-logo.svg",
category: DestType.DB,
},
{
actionTrigger: notifyKafka,
targetTitle: "Kafka",
logo: "/kafka-logo.svg",
category: DestType.Queue,
},
{
actionTrigger: notifyAmqp,
targetTitle: "AMQP",
logo: "/amqp-logo.svg",
category: DestType.Queue,
},
{
actionTrigger: notifyMqtt,
targetTitle: "MQTT",
logo: "/mqtt-logo.svg",
category: DestType.Queue,
},
{
actionTrigger: notifyRedis,
targetTitle: "Redis",
logo: "/redis-logo.svg",
category: DestType.Queue,
},
{
actionTrigger: notifyNats,
targetTitle: "NATS",
logo: "/nats-logo.svg",
category: DestType.Queue,
},
{
actionTrigger: notifyMysql,
targetTitle: "Mysql",
logo: "/mysql-logo.svg",
category: DestType.DB,
},
{
actionTrigger: notifyElasticsearch,
targetTitle: "Elastic Search",
logo: "/elasticsearch-logo.svg",
category: DestType.DB,
},
{
actionTrigger: notifyWebhooks,
targetTitle: "Webhook",
logo: "/webhooks-logo.svg",
category: DestType.Func,
},
{
actionTrigger: notifyNsq,
targetTitle: "NSQ",
logo: "/nsq-logo.svg",
category: DestType.Queue,
},
];

View File

@@ -232,8 +232,8 @@ export const validRoutes = (
{
group: "Administrator",
component: NavLink,
to: IAM_PAGES.NOTIFICATIONS_ENDPOINTS,
name: "Notifications",
to: IAM_PAGES.EVENT_DESTINATIONS,
name: "Events",
icon: LambdaIcon,
id: "lambda",
},
@@ -241,7 +241,7 @@ export const validRoutes = (
group: "Administrator",
component: NavLink,
to: IAM_PAGES.TIERS,
name: "Tiers",
name: "Tiering",
icon: TiersIcon,
id: "tiers",
},
@@ -285,44 +285,38 @@ export const validRoutes = (
name: "Support",
id: "support",
icon: SupportMenuIcon,
children: [
{
name: "Health",
id: "diagnostics",
component: NavLink,
icon: HealthMenuIcon,
to: IAM_PAGES.TOOLS_DIAGNOSTICS,
},
{
name: "Performance",
id: "performance",
component: NavLink,
icon: PerformanceMenuIcon,
to: IAM_PAGES.TOOLS_SPEEDTEST,
},
{
name: "Profile",
id: "profile",
component: NavLink,
icon: ProfileMenuIcon,
to: IAM_PAGES.PROFILE,
},
// {
// name: "Call Home",
// id: "callhome",
// component: NavLink,
// icon: CallHomeMenuIcon,
// to: IAM_PAGES.CALL_HOME,
// },
{
name: "Inspect",
id: "inspectObjects",
to: IAM_PAGES.SUPPORT_INSPECT,
icon: InspectMenuIcon,
component: NavLink,
},
],
},
{
group: "Subscription",
name: "Health",
id: "diagnostics",
component: NavLink,
icon: HealthMenuIcon,
to: IAM_PAGES.TOOLS_DIAGNOSTICS,
},
{
group: "Subscription",
name: "Performance",
id: "performance",
component: NavLink,
icon: PerformanceMenuIcon,
to: IAM_PAGES.TOOLS_SPEEDTEST,
},
{
group: "Subscription",
name: "Profile",
id: "profile",
component: NavLink,
icon: ProfileMenuIcon,
to: IAM_PAGES.PROFILE,
},
{
group: "Subscription",
name: "Inspect",
id: "inspectObjects",
to: IAM_PAGES.SUPPORT_INSPECT,
icon: InspectMenuIcon,
component: NavLink,
},
];

View File

@@ -16,7 +16,6 @@
import * as roles from "../../utils/roles";
import * as elements from "../../utils/elements";
import { diagnosticsElement, supportElement } from "../../utils/elements-menu";
fixture("For user with default permissions").page("http://localhost:9090");

View File

@@ -29,15 +29,15 @@ test("Notification Endpoints sidebar item exists", async (t) => {
});
test("Add Notification Target button exists", async (t) => {
const addNotifTargetButtonExists = elements.addNotifTargetButton.exists;
const addNotifTargetButtonExists = elements.addEventDestination.exists;
await t
.navigateTo("http://localhost:9090/settings/notification-endpoints")
.navigateTo("http://localhost:9090/settings/event-destinations")
.expect(addNotifTargetButtonExists)
.ok();
});
test("Add Notification Target button is clickable", async (t) => {
await t
.navigateTo("http://localhost:9090/settings/notification-endpoints")
.click(elements.addNotifTargetButton);
.navigateTo("http://localhost:9090/settings/event-destinations")
.click(elements.addEventDestination);
});

View File

@@ -94,17 +94,9 @@ fixture("For user with Inspect permissions")
test("Inspect page can be opened", async (t) => {
await t.navigateTo(inspectScreenUrl);
});
test("Inspect sidebar item exists", async (t) => {
await t.expect(supportSidebarEl.exists).ok();
});
test("Inspect link exists in Menu list", async (t) => {
await t
.expect(supportSidebarEl.exists)
.ok()
.click(supportSidebarEl)
.expect(inspectEl.exists)
.ok();
await t.expect(inspectEl.exists).ok();
});
test("Form Input states verification", async (t) => {

View File

@@ -25,7 +25,6 @@ import {
monitoringElement,
notificationEndpointsElement,
serviceAcctsElement,
supportElement,
tiersElement,
usersElement,
} from "../utils/elements-menu";
@@ -61,9 +60,6 @@ test("All sidebar items exist", async (t) => {
.ok()
.expect(tiersElement.exists)
.ok()
.expect(supportElement.exists)
.ok()
.click(supportElement)
.expect(elements.diagnosticsElement.exists)
.ok()
.expect(elements.performanceElement.exists)

View File

@@ -16,11 +16,7 @@
import * as roles from "../utils/roles";
import * as elements from "../utils/elements";
import {
logsElement,
monitoringElement,
supportElement,
} from "../utils/elements-menu";
import { logsElement, monitoringElement } from "../utils/elements-menu";
fixture("For user with Logs permissions")
.page("http://localhost:9090")

View File

@@ -16,13 +16,9 @@
import * as roles from "../utils/roles";
import * as elements from "../utils/elements";
import * as functions from "../utils/functions";
import {
watchElement,
monitoringElement,
supportElement,
} from "../utils/elements-menu";
import { bucketDropdownOptionFor } from "../utils/elements";
import * as functions from "../utils/functions";
import { monitoringElement, watchElement } from "../utils/elements-menu";
fixture("For user with Watch permissions")
.page("http://localhost:9090")

View File

@@ -16,23 +16,13 @@
import * as roles from "../utils/roles";
import * as elements from "../utils/elements";
import { diagnosticsElement, supportElement } from "../utils/elements-menu";
import { diagnosticsElement } from "../utils/elements-menu";
import { ClientFunction } from "testcafe";
fixture("For user with Diagnostics permissions").page("http://localhost:9090");
test("Support sidebar item exists", async (t) => {
await t.useRole(roles.diagnostics).expect(supportElement.exists).ok();
});
test("Diagnostics link exists in Tools page", async (t) => {
await t
.useRole(roles.diagnostics)
.expect(supportElement.exists)
.ok()
.click(supportElement)
.expect(diagnosticsElement.exists)
.ok();
await t.useRole(roles.diagnostics).expect(diagnosticsElement.exists).ok();
});
test("Diagnostics page can be opened", async (t) => {

View File

@@ -16,13 +16,9 @@
import * as roles from "../utils/roles";
import * as elements from "../utils/elements";
import * as functions from "../utils/functions";
import {
drivesElement,
monitoringElement,
supportElement,
} from "../utils/elements-menu";
import { bucketDropdownOptionFor } from "../utils/elements";
import * as functions from "../utils/functions";
import { drivesElement, monitoringElement } from "../utils/elements-menu";
fixture("For user with Heal permissions")
.page("http://localhost:9090")

View File

@@ -82,22 +82,14 @@ export const tiersElement = Selector(".MuiPaper-root")
.find("ul")
.child("#tiers");
export const supportElement = Selector(".MuiPaper-root")
export const diagnosticsElement = Selector(".MuiPaper-root")
.find("ul")
.child("#support");
export const supportChildren = Selector("#support-children");
export const diagnosticsElement = supportChildren
.find("a")
.withAttribute("href", "/support/diagnostics");
export const performanceElement = supportChildren
.find("a")
.withAttribute("href", "/support/speedtest");
export const callHomeElement = supportChildren
.find("a")
.withAttribute("href", "/support/call-home");
export const profileElement = supportChildren
.find("a")
.withAttribute("href", "/support/profile");
.child("#diagnostics");
export const performanceElement = Selector(".MuiPaper-root")
.find("ul")
.child("#performance");
export const profileElement = Selector(".MuiPaper-root")
.find("ul")
.child("#profile");
export const licenseElement = sidebarItem.withAttribute("href", "/license");

View File

@@ -16,7 +16,6 @@
import * as constants from "./constants";
import { Selector } from "testcafe";
import { IAM_PAGES } from "../../src/common/SecureComponent/permissions";
//----------------------------------------------------
// Buttons
//----------------------------------------------------
@@ -32,35 +31,16 @@ export const createPolicyButton =
Selector("button:enabled").withText("Create Policy");
export const saveButton = Selector("button:enabled").withText("Save");
export const deleteButton = Selector("button:enabled").withExactText("Delete");
export const deleteIconButton = Selector("button:enabled").withAttribute(
"aria-label",
"Delete"
);
export const deleteIconButtonAlt = Selector("button:enabled").withAttribute(
"aria-label",
"delete"
);
export const configureBucketButton = Selector(
'span[class*="MuiIconButton-root"]'
).withAttribute("aria-label", "Configure Bucket");
export const addNotifTargetButton = Selector("button:enabled").withText(
"Add Notification Target"
export const addEventDestination = Selector("button:enabled").withText(
"Add Event Destination"
);
export const createTierButton =
Selector("button:enabled").withText("Create Tier");
export const createBucketButton =
Selector("button:enabled").withText("Create Bucket");
export const deleteBucketButton =
Selector("button:enabled").withText("Delete Bucket");
export const createUserButton =
Selector("button:enabled").withText("Create User");
export const createGroupButton =
Selector("button:enabled").withText("Create Group");
export const deleteGroupIconButton = Selector("span")
.withAttribute("aria-label", "Delete Group")
.find("button:enabled");
export const editMembersButton =
Selector("button:enabled").withText("Edit Members");
export const addAccessRuleButton =
Selector("button:enabled").withText("Add Access Rule");
export const startDiagnosticButton =
@@ -68,17 +48,8 @@ export const startDiagnosticButton =
export const startNewDiagnosticButton = Selector("#start-new-diagnostic");
export const downloadButton = Selector("button:enabled").withText("Download");
export const startButton = Selector("button:enabled").withText("Start");
export const stopButton = Selector("button:enabled").withText("Stop");
export const assignPoliciesButton =
Selector("button:enabled").withText("Assign Policies");
//----------------------------------------------------
// Links
//----------------------------------------------------
export const logsLink = Selector("a").withText("Logs");
export const watchLink = Selector("a").withText("Watch");
export const traceLink = Selector("a").withText("Trace");
export const healLink = Selector("a").withText("Heal");
export const diagnosticsLink = Selector("a").withText("Diagnostics");
//----------------------------------------------------
// Switches