Skip to content

Commit

Permalink
UIBULKED-210: rebase on master
Browse files Browse the repository at this point in the history
  • Loading branch information
UladzislauKutarkin committed Feb 14, 2024
1 parent ed51ca8 commit acdaa25
Showing 1 changed file with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Capabilities } from '../../../shared/Capabilities/Capabilities';
import { ListSelect } from '../../../shared/ListSelect/ListSelect';
import {
CRITERIA,
EDITING_STEPS,
EDITING_STEPS, ERRORS,
IDENTIFIER_FILTERS,
JOB_STATUSES,
TRANSLATION_SUFFIX
Expand Down Expand Up @@ -133,11 +133,12 @@ export const IdentifierTab = () => {
identifierType: recordIdentifier,
});

const { status } = await bulkOperationStart({
const { status, errorMessage } = await bulkOperationStart({
id,
step: EDITING_STEPS.UPLOAD,
});

if (errorMessage.includes(ERRORS.TOKEN)) throw Error(ERRORS.TOKEN);
if (status === JOB_STATUSES.FAILED) throw Error();

history.replace({
Expand All @@ -147,10 +148,17 @@ export const IdentifierTab = () => {

setIsFileUploaded(true);
} catch ({ message }) {
showCallout({
message: <FormattedMessage id="ui-bulk-edit.error.uploadedFile" />,
type: 'error',
});
if (message === ERRORS.TOKEN) {
showCallout({
message: <FormattedMessage id="ui-bulk-edit.error.incorrectFormatted" values={{ fileName:fileToUpload.name }} />,
type: 'error',
});
} else {
showCallout({
message: <FormattedMessage id="ui-bulk-edit.error.uploadedFile" />,
type: 'error',
});
}
}
};

Expand Down

0 comments on commit acdaa25

Please sign in to comment.