LDAP: fix progress status
This commit is contained in:
parent
9145c1b725
commit
3a91cdd65a
@ -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));
|
||||
|
@ -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,
|
||||
};
|
||||
|
||||
|
@ -78,7 +78,7 @@ const ProgressBar = ({
|
||||
as="p"
|
||||
title={error || status}
|
||||
>
|
||||
{error || `${percent}% ${status}`}
|
||||
{error || status}
|
||||
</Text>
|
||||
)}
|
||||
</StyledProgressBarContainer>
|
||||
|
Loading…
Reference in New Issue
Block a user