Skip to content

Commit

Permalink
remove unused variables + redundant fn
Browse files Browse the repository at this point in the history
  • Loading branch information
vashjs committed Feb 14, 2024
1 parent 21c70d1 commit 744a62b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ export const NoResultsMessage = () => {
const {
criteria,
identifier,
capabilities,
queryRecordType,
currentRecordType,
} = useSearchParams();

const message = useMemo(() => {
Expand All @@ -28,16 +27,8 @@ export const NoResultsMessage = () => {
return '';
};

const getKey = () => {
if (criteria === CRITERIA.QUERY) {
return queryRecordType;
}

return capabilities;
};

return <FormattedMessage id={`ui-bulk-edit.list.result.emptyMessage${TRANSLATION_SUFFIX[getKey()]}${getPostfix()}`} />;
}, [identifier, criteria, capabilities, queryRecordType]);
return <FormattedMessage id={`ui-bulk-edit.list.result.emptyMessage${TRANSLATION_SUFFIX[currentRecordType]}${getPostfix()}`} />;
}, [identifier, criteria, currentRecordType]);

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export const IdentifierTab = () => {
step: EDITING_STEPS.UPLOAD,
});

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

history.replace({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext } from 'react';
import React from 'react';
import {
useHistory,
useLocation
Expand All @@ -17,7 +17,6 @@ import {
} from '../../../../hooks';
import { getCapabilityOptions } from '../../../../utils/helpers';
import { CRITERIA, QUERY_FILTERS } from '../../../../constants';
import { RootContext } from '../../../../context/RootContext';

export const QueryTab = () => {
const history = useHistory();
Expand All @@ -28,7 +27,6 @@ export const QueryTab = () => {
step,
initialFileName
} = useSearchParams();
const { setVisibleColumns } = useContext(RootContext);
const { recordTypes } = useRecordTypes();
const permissions = useBulkPermissions();
const {
Expand Down Expand Up @@ -71,12 +69,8 @@ export const QueryTab = () => {
pathname: '/bulk-edit',
search: buildSearch({
queryRecordType: e.target.value,
step: null,
fileName: null,
}, history.location.search),
});

setVisibleColumns(null);
};

const onQueryRunSuccess = ({ id }) => {
Expand Down

0 comments on commit 744a62b

Please sign in to comment.