- added 'maintenance' state logic;
This commit is contained in:
@@ -38,6 +38,10 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&[disabled] {
|
||||||
|
background: var(--message-info-background);
|
||||||
|
}
|
||||||
|
|
||||||
span {
|
span {
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
font-size: 17.25px;
|
font-size: 17.25px;
|
||||||
|
|||||||
@@ -25,17 +25,18 @@ const Login = () => {
|
|||||||
const errorMsgs = useRef(null);
|
const errorMsgs = useRef(null);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [visibleCacheFaq, setVisibleCacheFaq] = useState(false);
|
const [visibleCacheFaq, setVisibleCacheFaq] = useState(false);
|
||||||
|
const [isMaintenance] = useState(true);
|
||||||
let [searchParams] = useSearchParams();
|
let [searchParams] = useSearchParams();
|
||||||
const { origin } = window.location;
|
const { origin } = window.location;
|
||||||
|
|
||||||
const loginWithSpid = () => {
|
const loginWithSpid = () => {
|
||||||
/*if (!loading) {
|
if (!loading && !isMaintenance) {
|
||||||
if (APP_HUB_ID) {
|
if (APP_HUB_ID) {
|
||||||
window.location.replace(`${API_BASE_URL}/saml2/authenticate/loginumbria?hubId=${APP_HUB_ID}`);
|
window.location.replace(`${API_BASE_URL}/saml2/authenticate/loginumbria?hubId=${APP_HUB_ID}`);
|
||||||
} else {
|
} else {
|
||||||
window.location.replace(`${API_BASE_URL}/saml2/authenticate/loginumbria`);
|
window.location.replace(`${API_BASE_URL}/saml2/authenticate/loginumbria`);
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const validateCallback = (data) => {
|
const validateCallback = (data) => {
|
||||||
@@ -46,6 +47,7 @@ const Login = () => {
|
|||||||
userData: data.data.user
|
userData: data.data.user
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
if (errorMsgs.current) {
|
||||||
errorMsgs.current.show([
|
errorMsgs.current.show([
|
||||||
{
|
{
|
||||||
sticky: true, severity: 'error', summary: '',
|
sticky: true, severity: 'error', summary: '',
|
||||||
@@ -54,10 +56,12 @@ const Login = () => {
|
|||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
const validateError = (err) => {
|
const validateError = (err) => {
|
||||||
|
if (errorMsgs.current) {
|
||||||
errorMsgs.current.show([
|
errorMsgs.current.show([
|
||||||
{
|
{
|
||||||
sticky: true, severity: 'error', summary: '',
|
sticky: true, severity: 'error', summary: '',
|
||||||
@@ -65,6 +69,7 @@ const Login = () => {
|
|||||||
closable: true
|
closable: true
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
}
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,6 +82,20 @@ const Login = () => {
|
|||||||
setVisibleCacheFaq(false);
|
setVisibleCacheFaq(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (isMaintenance) {
|
||||||
|
if (errorMsgs.current) {
|
||||||
|
errorMsgs.current.show([
|
||||||
|
{
|
||||||
|
sticky: true, severity: 'info', summary: '',
|
||||||
|
detail: __('Piattaforma in manutenzione', 'gepafin'),
|
||||||
|
closable: false
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [isMaintenance])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isEmpty(token)) {
|
if (!isEmpty(token)) {
|
||||||
window.location.replace('/')
|
window.location.replace('/')
|
||||||
@@ -103,7 +122,7 @@ const Login = () => {
|
|||||||
|
|
||||||
<Messages ref={errorMsgs}/>
|
<Messages ref={errorMsgs}/>
|
||||||
|
|
||||||
<button className="appPageLogin__spidBtn" onClick={loginWithSpid} disabled={true}>
|
<button className="appPageLogin__spidBtn" onClick={loginWithSpid} disabled={isMaintenance}>
|
||||||
<svg width="31" height="31" viewBox="0 0 31 31" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg width="31" height="31" viewBox="0 0 31 31" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<g clipPath="url(#clip0_1156_13356)">
|
<g clipPath="url(#clip0_1156_13356)">
|
||||||
<path
|
<path
|
||||||
|
|||||||
Reference in New Issue
Block a user