LDAP: fix progress status

This commit is contained in:
Alexey Safronov 2024-06-05 13:24:34 +04:00
parent 9145c1b725
commit 3a91cdd65a
3 changed files with 15 additions and 11 deletions

View File

@ -5,19 +5,20 @@ import { useTranslation } from "react-i18next";
import { Box } from "@docspace/shared/components/box";
import { ProgressBar } from "@docspace/shared/components/progress-bar";
const ProgressContainer = ({
inProgress,
percents,
completed,
error,
source,
}) => {
const ProgressContainer = ({ inProgress, percents, error, source, status }) => {
const { t } = useTranslation(["Settings", "Common"]);
let progressStatus = status || source ? `${percents}%` : "";
if (!!progressStatus) {
status && (progressStatus += " " + status);
source && (progressStatus += (!!status ? ": " : " ") + source);
}
return (
inProgress && (
<Box className="ldap_progress-container">
<ProgressBar percent={percents} status={source} error={error} />
<ProgressBar percent={percents} status={progressStatus} error={error} />
</Box>
)
);
@ -28,17 +29,17 @@ export default inject(({ ldapStore }, { operation }) => {
const {
percents = 0,
completed = false,
error = "",
source = "",
status = "",
operationType,
} = progressStatus;
return {
inProgress: (inProgress || error) && operation == operationType,
percents,
completed,
error,
source,
status,
};
})(observer(ProgressContainer));

View File

@ -69,6 +69,7 @@ class LdapFormStore {
completed: false,
error: "",
source: "",
status: "",
};
isCertificateDialogVisible = false;
@ -302,6 +303,7 @@ class LdapFormStore {
completed: false,
error: "",
source: "",
status: "",
operationType: LDAPOpeation.Sync,
};
@ -333,6 +335,7 @@ class LdapFormStore {
completed: false,
error: "",
source: "",
status: "",
operationType: LDAPOpeation.SaveAndSync,
};

View File

@ -78,7 +78,7 @@ const ProgressBar = ({
as="p"
title={error || status}
>
{error || `${percent}% ${status}`}
{error || status}
</Text>
)}
</StyledProgressBarContainer>