diff --git a/src/components/SaveButton.css b/src/components/SaveButton.css index 78e75e3..fa55749 100644 --- a/src/components/SaveButton.css +++ b/src/components/SaveButton.css @@ -10,8 +10,7 @@ bottom: 2%; left: 2%; } - -.notif.orange { +.notif { position: fixed; left: 50%; padding: 2px; @@ -21,20 +20,16 @@ justify-items: center; top: 65px; align-content: center; +} +.notif.orange { background-color: rgb(255, 220, 192); } .notif.green { - position: fixed; - left: 50%; - padding: 2px; - transform: translateX(-50%); - height: 25px; - border-radius: 5px; - justify-items: center; - top: 65px; - align-content: center; background-color: rgb(199, 255, 192); } +.notif.red { + background-color: rgb(255, 192, 192); +} .notif.hidden { visibility: hidden; diff --git a/src/components/SaveButton.tsx b/src/components/SaveButton.tsx index 2fe69a4..cd8f65c 100644 --- a/src/components/SaveButton.tsx +++ b/src/components/SaveButton.tsx @@ -1,29 +1,49 @@ import { t } from "i18next"; import "./SaveButton.css"; import { useState } from "react"; -import { useAppDispatch } from "../app/hooks"; +import { useAppDispatch, useAppSelector } from "../app/hooks"; import { getConfigAsync, saveConfigCall } from "../features/config/configSlice"; +import { ruleOIDC, ruleSAML } from "../utils/rules"; export default function SaveButton() { const [openSavePopup, setOpenSavePopup] = useState(false); const [openSavingPopup, setOpenSavingPopup] = useState(false); + const [openErrorPopup, setOpenErrorPopup] = useState(false); const dispatch = useAppDispatch(); - + const data = useAppSelector((state) => state.config.data.config); return (
- {t("confSaved")} + {t("successfullySaved")} +
+
+ {t("Cannot save with app warnings")}
); diff --git a/src/components/applicationsComponents/OIDCApp.tsx b/src/components/applicationsComponents/OIDCApp.tsx index 4b46649..b75da17 100644 --- a/src/components/applicationsComponents/OIDCApp.tsx +++ b/src/components/applicationsComponents/OIDCApp.tsx @@ -12,6 +12,7 @@ import { updateOidcMetaDataOptions, updateOidcRPMetaDataExportedVars, } from "../../features/config/configSlice"; +import attributes from "../../static/attributes.json"; function updateExpAttr(tableID: string) { const attrList: Record = {}; @@ -136,7 +137,45 @@ export function OIDCApp({ name }: { name: string }) { - + + + + + + - - - - - + .oidcRPMetaDataOptionsClientSecret !== "" + ? "" + : "⚠️" + : "⚠️"} +
{t("oidcRPMetaDataOptionsPublic")} + {t("oidcRPMetaDataOptionsClientID")}{" "} + {data.oidcRPMetaDataOptions[name] + .oidcRPMetaDataOptionsClientID === "" + ? "⚠️" + : ""} + + { + dispatch( + updateOidcMetaDataOptions({ + name, + option: "oidcRPMetaDataOptionsClientID", + value: e.target.value, + }) + ); + }} + /> +
+ {t("oidcRPMetaDataOptionsPublic")} + {data.oidcRPMetaDataOptions[name] + ? data.oidcRPMetaDataOptions[name] + .oidcRPMetaDataOptionsPublic || + data.oidcRPMetaDataOptions[name] + .oidcRPMetaDataOptionsClientSecret !== "" + ? "" + : "⚠️" + : "⚠️"} +
{t("oidcRPMetaDataOptionsClientID")} - + {t("oidcRPMetaDataOptionsClientSecret")} + {data.oidcRPMetaDataOptions[name] + ? data.oidcRPMetaDataOptions[name] + .oidcRPMetaDataOptionsPublic || data.oidcRPMetaDataOptions[name] - .oidcRPMetaDataOptionsClientID - )} - onChange={(e) => { - dispatch( - updateOidcMetaDataOptions({ - name, - option: "oidcRPMetaDataOptionsClientID", - value: e.target.value, - }) - ); - }} - /> -
{t("oidcRPMetaDataOptionsClientSecret")} {t("oidcRPMetaDataOptionsRedirectUris")} {t("oidcRPMetaDataOptionsAuthMethod")} {t("oidcRPMetaDataOptionsIcon")} {name}
- {t("samlSPMetaDataXML")} + + {t("samlSPMetaDataXML")}{" "} + {name + ? data.samlSPMetaDataXML[name] + ? data.samlSPMetaDataXML[name].samlSPMetaDataXML === "" + ? "⚠️" + : "" + : "⚠️" + : "⚠️"} +