Skip to content

Commit

Permalink
UIBULKED-210: Improve user errors for invalid data - IncorrectTokenCo…
Browse files Browse the repository at this point in the history
…untException error
  • Loading branch information
UladzislauKutarkin committed Feb 16, 2024
1 parent f538dc6 commit 3cb1179
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/ProgressBar/ProgressBar.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useContext, useEffect } from 'react';
import React, { useContext, useEffect } from 'react';
import { useParams } from 'react-router';
import { useLocation } from 'react-router-dom';
import { FormattedMessage, useIntl } from 'react-intl';
Expand All @@ -8,7 +8,7 @@ import { Icon, Loading } from '@folio/stripes/components';
import { useShowCallout } from '@folio/stripes-acq-components';

import { useBulkOperationDetails } from '../../hooks/api';
import { JOB_STATUSES } from '../../constants';
import { ERRORS, JOB_STATUSES } from '../../constants';
import { getBulkOperationStep } from './utils';

import css from './ProgressBar.css';
Expand All @@ -33,14 +33,17 @@ export const ProgressBar = () => {
});

const status = bulkDetails?.status;
const errorMessage = bulkDetails?.errorMessage;
const progressPercentage = bulkDetails
? (bulkDetails.processedNumOfRecords / bulkDetails.totalNumOfRecords) * 100
: 0;

const swwCallout = () => {
callout({
type: 'error',
message: intl.formatMessage({ id: 'ui-bulk-edit.error.sww' }),
message:errorMessage?.includes(ERRORS.TOKEN) ? <FormattedMessage id="ui-bulk-edit.error.incorrectFormatted" values={{ fileName:title }} />
:
intl.formatMessage({ id: 'ui-bulk-edit.error.sww' }),
});
};

Expand Down

0 comments on commit 3cb1179

Please sign in to comment.