diff --git a/portal-ui/src/screens/Console/Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper.tsx b/portal-ui/src/screens/Console/Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper.tsx
index f8c228923..f21ec50e6 100644
--- a/portal-ui/src/screens/Console/Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper.tsx
+++ b/portal-ui/src/screens/Console/Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper.tsx
@@ -52,9 +52,6 @@ const styles = (theme: Theme) =>
width: "320px",
padding: "20px",
},
- errorBlock: {
- color: "red",
- },
tableToolbar: {
paddingLeft: theme.spacing(2),
paddingRight: theme.spacing(0),
diff --git a/portal-ui/src/screens/Console/Common/UsageBarWrapper/UsageBarWrapper.tsx b/portal-ui/src/screens/Console/Common/UsageBarWrapper/UsageBarWrapper.tsx
index cc6cf0450..fdadd8d9e 100644
--- a/portal-ui/src/screens/Console/Common/UsageBarWrapper/UsageBarWrapper.tsx
+++ b/portal-ui/src/screens/Console/Common/UsageBarWrapper/UsageBarWrapper.tsx
@@ -4,6 +4,7 @@ import { LinearProgress } from "@material-ui/core";
import Paper from "@material-ui/core/Paper";
import Grid from "@material-ui/core/Grid";
import CircularProgress from "@material-ui/core/CircularProgress";
+import ErrorBlock from "../../../shared/ErrorBlock";
interface IProgressBar {
maxValue: number;
@@ -32,9 +33,6 @@ const styles = (theme: Theme) =>
centerItem: {
textAlign: "center",
},
- error: {
- color: "#9c9c9c",
- },
});
const BorderLinearProgress = withStyles((theme) => ({
@@ -65,9 +63,7 @@ const UsageBarWrapper = ({
const renderComponent = () => {
if (!loading) {
return error !== "" ? (
-
- {error}
-
+
) : (
diff --git a/portal-ui/src/screens/Console/Configurations/ConfigurationPanels/ConfigurationsList.tsx b/portal-ui/src/screens/Console/Configurations/ConfigurationPanels/ConfigurationsList.tsx
index 5ae8aa1a0..04727d3b8 100644
--- a/portal-ui/src/screens/Console/Configurations/ConfigurationPanels/ConfigurationsList.tsx
+++ b/portal-ui/src/screens/Console/Configurations/ConfigurationPanels/ConfigurationsList.tsx
@@ -38,9 +38,6 @@ interface IListConfiguration {
const styles = (theme: Theme) =>
createStyles({
- errorBlock: {
- color: "red",
- },
strongText: {
fontWeight: 700,
},
diff --git a/portal-ui/src/screens/Console/Configurations/ConfigurationPanels/WebhookPanel.tsx b/portal-ui/src/screens/Console/Configurations/ConfigurationPanels/WebhookPanel.tsx
index 5642e5a84..92ec5e5f0 100644
--- a/portal-ui/src/screens/Console/Configurations/ConfigurationPanels/WebhookPanel.tsx
+++ b/portal-ui/src/screens/Console/Configurations/ConfigurationPanels/WebhookPanel.tsx
@@ -43,9 +43,6 @@ interface IWebhook {
const styles = (theme: Theme) =>
createStyles({
- errorBlock: {
- color: "red",
- },
strongText: {
fontWeight: 700,
},
diff --git a/portal-ui/src/screens/Console/Configurations/CustomForms/EditConfiguration.tsx b/portal-ui/src/screens/Console/Configurations/CustomForms/EditConfiguration.tsx
index 4d60adc94..c3241c001 100644
--- a/portal-ui/src/screens/Console/Configurations/CustomForms/EditConfiguration.tsx
+++ b/portal-ui/src/screens/Console/Configurations/CustomForms/EditConfiguration.tsx
@@ -20,7 +20,6 @@ import { connect } from "react-redux";
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
import { Button, LinearProgress } from "@material-ui/core";
import Grid from "@material-ui/core/Grid";
-import Typography from "@material-ui/core/Typography";
import api from "../../../../common/api";
import ConfTargetGeneric from "../ConfTargetGeneric";
import { serverNeedsRestart } from "../../../../actions";
@@ -30,14 +29,12 @@ import {
} from "../../Common/FormComponents/common/styleLibrary";
import { fieldsConfigurations, removeEmptyFields } from "../utils";
import { IConfigurationElement, IElementValue } from "../types";
+import ErrorBlock from "../../../shared/ErrorBlock";
const styles = (theme: Theme) =>
createStyles({
...fieldBasic,
...settingsCommon,
- errorBlock: {
- color: "red",
- },
strongText: {
fontWeight: 700,
},
@@ -154,13 +151,7 @@ const EditConfiguration = ({
)}
{errorConfig !== "" && (
-
- {errorConfig}
-
+
)}
createStyles({
...modalBasic,
...settingsCommon,
- errorBlock: {
- color: "red",
- },
strongText: {
fontWeight: 700,
},
@@ -157,13 +154,7 @@ const AddNotificationEndpoint = ({
{addError !== "" && (
-
- {addError}
-
+
)}
{srvComponent}
diff --git a/portal-ui/src/screens/Console/Configurations/NotificationEndpoints/ListNotificationEndpoints.tsx b/portal-ui/src/screens/Console/Configurations/NotificationEndpoints/ListNotificationEndpoints.tsx
index b6d324eb0..0425b0c9f 100644
--- a/portal-ui/src/screens/Console/Configurations/NotificationEndpoints/ListNotificationEndpoints.tsx
+++ b/portal-ui/src/screens/Console/Configurations/NotificationEndpoints/ListNotificationEndpoints.tsx
@@ -43,6 +43,7 @@ import {
import SlideOptions from "../../Common/SlideOptions/SlideOptions";
import BackSettingsIcon from "../../../../icons/BackSettingsIcon";
import NotificationTypeSelector from "./NotificationTypeSelector";
+import ErrorBlock from "../../../shared/ErrorBlock";
interface IListNotificationEndpoints {
classes: any;
@@ -54,9 +55,6 @@ const styles = (theme: Theme) =>
...searchField,
...settingsCommon,
...containerForHeader(theme.spacing(4)),
- errorBlock: {
- color: "red",
- },
strongText: {
fontWeight: 700,
},
@@ -186,7 +184,11 @@ const ListNotificationEndpoints = ({ classes }: IListNotificationEndpoints) => {
- {error !== "" && {error}}
+ {error !== "" && (
+
+
+
+ )}
createStyles({
@@ -200,7 +201,11 @@ const Dashboard = ({ classes }: IDashboardProps) => {
- {error !== "" && {error}}
+ {error !== "" && (
+
+
+
+ )}
{loading ? (
diff --git a/portal-ui/src/screens/Console/Groups/AddGroup.tsx b/portal-ui/src/screens/Console/Groups/AddGroup.tsx
index 692865225..a56085b24 100644
--- a/portal-ui/src/screens/Console/Groups/AddGroup.tsx
+++ b/portal-ui/src/screens/Console/Groups/AddGroup.tsx
@@ -18,7 +18,6 @@ import React, { useEffect, useState } from "react";
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
import { Button, LinearProgress } from "@material-ui/core";
import Grid from "@material-ui/core/Grid";
-import Typography from "@material-ui/core/Typography";
import { modalBasic } from "../Common/FormComponents/common/styleLibrary";
import api from "../../../common/api";
import UsersSelectors from "./UsersSelectors";
@@ -26,6 +25,7 @@ import ModalWrapper from "../Common/ModalWrapper/ModalWrapper";
import InputBoxWrapper from "../Common/FormComponents/InputBoxWrapper/InputBoxWrapper";
import FormSwitchWrapper from "../Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper";
import PredefinedList from "../Common/FormComponents/PredefinedList/PredefinedList";
+import ErrorBlock from "../../shared/ErrorBlock";
interface IGroupProps {
open: boolean;
@@ -42,9 +42,6 @@ interface MainGroupProps {
const styles = (theme: Theme) =>
createStyles({
- errorBlock: {
- color: "red",
- },
strongText: {
fontWeight: 700,
},
@@ -193,13 +190,7 @@ const AddGroup = ({
{addError !== "" && (
-
- {addError}
-
+
)}
diff --git a/portal-ui/src/screens/Console/Groups/DeleteGroup.tsx b/portal-ui/src/screens/Console/Groups/DeleteGroup.tsx
index 13858acef..002f78b02 100644
--- a/portal-ui/src/screens/Console/Groups/DeleteGroup.tsx
+++ b/portal-ui/src/screens/Console/Groups/DeleteGroup.tsx
@@ -14,8 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see .
-import React, { useState, useEffect } from "react";
-import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
+import React, { useEffect, useState } from "react";
import {
Button,
Dialog,
@@ -26,28 +25,19 @@ import {
LinearProgress,
} from "@material-ui/core";
import api from "../../../common/api";
-import Typography from "@material-ui/core/Typography";
import { UsersList } from "../Users/types";
+import ErrorBlock from "../../shared/ErrorBlock";
interface IDeleteGroup {
selectedGroup: string;
deleteOpen: boolean;
closeDeleteModalAndRefresh: any;
- classes: any;
}
-const styles = (theme: Theme) =>
- createStyles({
- errorBlock: {
- color: "red",
- },
- });
-
const DeleteGroup = ({
selectedGroup,
deleteOpen,
closeDeleteModalAndRefresh,
- classes,
}: IDeleteGroup) => {
const [isDeleting, setDeleteLoading] = useState(false);
const [deleteError, setError] = useState("");
@@ -94,18 +84,7 @@ const DeleteGroup = ({
{isDeleting && }
Are you sure you want to delete group {selectedGroup}?
- {deleteError !== "" && (
-
-
-
- {deleteError}
-
-
- )}
+ {deleteError !== "" && }
@@ -127,4 +106,4 @@ const DeleteGroup = ({
);
};
-export default withStyles(styles)(DeleteGroup);
+export default DeleteGroup;
diff --git a/portal-ui/src/screens/Console/Groups/Groups.tsx b/portal-ui/src/screens/Console/Groups/Groups.tsx
index 04308a08e..a942174ea 100644
--- a/portal-ui/src/screens/Console/Groups/Groups.tsx
+++ b/portal-ui/src/screens/Console/Groups/Groups.tsx
@@ -35,6 +35,7 @@ import {
searchField,
} from "../Common/FormComponents/common/styleLibrary";
import PageHeader from "../Common/PageHeader/PageHeader";
+import ErrorBlock from "../../shared/ErrorBlock";
interface IGroupsProps {
classes: any;
@@ -56,9 +57,6 @@ const styles = (theme: Theme) =>
width: "320px",
padding: "20px",
},
- errorBlock: {
- color: "red",
- },
tableToolbar: {
paddingLeft: theme.spacing(2),
paddingRight: theme.spacing(0),
@@ -189,7 +187,11 @@ const Groups = ({ classes }: IGroupsProps) => {
- {error !== "" ? {error} : }
+ {error !== "" && (
+
+
+
+ )}
width: "320px",
padding: "20px",
},
- errorBlock: {
- color: "red",
- },
tableToolbar: {
paddingLeft: theme.spacing(2),
paddingRight: theme.spacing(0),
@@ -182,7 +180,9 @@ const UsersSelectors = ({
{loading && }
- {error !== "" ? {error}
: }
+ {error !== "" && (
+
+ )}
{records != null && records.length > 0 ? (
diff --git a/portal-ui/src/screens/Console/ObjectBrowser/BrowseBuckets.tsx b/portal-ui/src/screens/Console/ObjectBrowser/BrowseBuckets.tsx
index 6201dc986..7cab0ff86 100644
--- a/portal-ui/src/screens/Console/ObjectBrowser/BrowseBuckets.tsx
+++ b/portal-ui/src/screens/Console/ObjectBrowser/BrowseBuckets.tsx
@@ -37,6 +37,7 @@ import BrowserBreadcrumbs from "./BrowserBreadcrumbs";
import TableWrapper from "../Common/TableWrapper/TableWrapper";
import AddBucket from "../Buckets/ListBuckets/AddBucket";
import api from "../../../common/api";
+import ErrorBlock from "../../shared/ErrorBlock";
const styles = (theme: Theme) =>
createStyles({
@@ -53,9 +54,6 @@ const styles = (theme: Theme) =>
width: "320px",
padding: "20px",
},
- errorBlock: {
- color: "red",
- },
tableToolbar: {
paddingLeft: theme.spacing(2),
paddingRight: theme.spacing(0),
@@ -220,7 +218,9 @@ const BrowseBuckets = ({
- {error !== "" && {error}}
+ {error !== "" && (
+
+ )}
createStyles({
- errorBlock: {
- color: "red",
- },
jsonPolicyEditor: {
minHeight: 400,
width: "100%",
@@ -129,13 +126,7 @@ const AddPolicy = ({
{addError !== "" && (
-
- {addError}
-
+
)}
diff --git a/portal-ui/src/screens/Console/Policies/DeletePolicy.tsx b/portal-ui/src/screens/Console/Policies/DeletePolicy.tsx
index 3ece81326..cf245f19c 100644
--- a/portal-ui/src/screens/Console/Policies/DeletePolicy.tsx
+++ b/portal-ui/src/screens/Console/Policies/DeletePolicy.tsx
@@ -14,7 +14,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see .
-import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
import React, { useState } from "react";
import {
Button,
@@ -27,29 +26,15 @@ import {
} from "@material-ui/core";
import api from "../../../common/api";
import { PolicyList } from "./types";
-import Typography from "@material-ui/core/Typography";
-
-const styles = (theme: Theme) =>
- createStyles({
- errorBlock: {
- color: "red",
- },
- });
+import ErrorBlock from "../../shared/ErrorBlock";
interface IDeletePolicyProps {
- classes: any;
closeDeleteModalAndRefresh: (refresh: boolean) => void;
deleteOpen: boolean;
selectedPolicy: string;
}
-interface IDeletePolicyState {
- deleteLoading: boolean;
- deleteError: string;
-}
-
const DeletePolicy = ({
- classes,
closeDeleteModalAndRefresh,
deleteOpen,
selectedPolicy,
@@ -89,18 +74,7 @@ const DeletePolicy = ({
{deleteLoading && }
Are you sure you want to delete policy {selectedPolicy}?.
- {deleteError !== "" && (
-
-
-
- {deleteError}
-
-
- )}
+ {deleteError !== "" && }
@@ -128,4 +102,4 @@ const DeletePolicy = ({
);
};
-export default withStyles(styles)(DeletePolicy);
+export default DeletePolicy;
diff --git a/portal-ui/src/screens/Console/Policies/Policies.tsx b/portal-ui/src/screens/Console/Policies/Policies.tsx
index f0da6373d..500d74e7c 100644
--- a/portal-ui/src/screens/Console/Policies/Policies.tsx
+++ b/portal-ui/src/screens/Console/Policies/Policies.tsx
@@ -34,6 +34,7 @@ import {
searchField,
} from "../Common/FormComponents/common/styleLibrary";
import PageHeader from "../Common/PageHeader/PageHeader";
+import ErrorBlock from "../../shared/ErrorBlock";
const styles = (theme: Theme) =>
createStyles({
@@ -50,9 +51,6 @@ const styles = (theme: Theme) =>
width: "320px",
padding: "20px",
},
- errorBlock: {
- color: "red",
- },
tableToolbar: {
paddingLeft: theme.spacing(2),
paddingRight: theme.spacing(0),
@@ -211,7 +209,7 @@ const Policies = ({ classes }: IPoliciesProps) => {
{error && (
- {error}
+
)}
diff --git a/portal-ui/src/screens/Console/Policies/PolicySelectors.tsx b/portal-ui/src/screens/Console/Policies/PolicySelectors.tsx
index 1309dfc25..b721a6380 100644
--- a/portal-ui/src/screens/Console/Policies/PolicySelectors.tsx
+++ b/portal-ui/src/screens/Console/Policies/PolicySelectors.tsx
@@ -30,6 +30,7 @@ import {
selectorsCommon,
} from "../Common/FormComponents/common/styleLibrary";
import { PolicyList } from "./types";
+import ErrorBlock from "../../shared/ErrorBlock";
interface ISelectPolicyProps {
classes: any;
@@ -53,9 +54,6 @@ const styles = (theme: Theme) =>
width: "320px",
padding: "20px",
},
- errorBlock: {
- color: "red",
- },
tableToolbar: {
paddingLeft: theme.spacing(2),
paddingRight: theme.spacing(0),
@@ -161,7 +159,9 @@ const PolicySelectors = ({
{loading && }
- {error !== "" && {error}
}
+ {error !== "" && (
+
+ )}
{records != null && records.length > 0 ? (
diff --git a/portal-ui/src/screens/Console/Policies/SetPolicy.tsx b/portal-ui/src/screens/Console/Policies/SetPolicy.tsx
index 44667f725..6988246e0 100644
--- a/portal-ui/src/screens/Console/Policies/SetPolicy.tsx
+++ b/portal-ui/src/screens/Console/Policies/SetPolicy.tsx
@@ -25,6 +25,7 @@ import ModalWrapper from "../Common/ModalWrapper/ModalWrapper";
import api from "../../../common/api";
import PolicySelectors from "./PolicySelectors";
import PredefinedList from "../Common/FormComponents/PredefinedList/PredefinedList";
+import ErrorBlock from "../../shared/ErrorBlock";
interface ISetPolicyProps {
classes: any;
@@ -129,7 +130,11 @@ const SetPolicy = ({
modalOpen={open}
title="Set Policies"
>
- {error !== "" && {error}}
+ {error !== "" && (
+
+
+
+ )}
createStyles({
- errorBlock: {
- color: "red",
- },
buttonContainer: {
textAlign: "right",
},
@@ -2129,13 +2126,7 @@ const AddTenant = ({
{addError !== "" && (