Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
vashjs committed Feb 12, 2024
1 parent b7e8f8b commit 7a9ed03
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
7 changes: 6 additions & 1 deletion src/components/BulkEditList/BulkEditList.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ export const BulkEditList = () => {

const { isActionMenuShown } = useBulkPermissions();
const { id: bulkOperationId } = usePathParams('/bulk-edit/:id');
const { step, capabilities, criteria, initialFileName } = useSearchParams();
const {
step,
capabilities,
criteria,
initialFileName
} = useSearchParams();
const identifierFilters = Object.values(IDENTIFIER_FILTERS).map((el) => search.getAll(el));
const queryFilters = Object.values(QUERY_FILTERS).map((el) => search.getAll(el));
const logsFilters = Object.values(LOGS_FILTERS).map((el) => search.getAll(el));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import React, { useCallback, useContext, useMemo, useState } from 'react';
import React, {
useCallback,
useContext,
useMemo,
useState
} from 'react';
import { buildSearch, useShowCallout } from '@folio/stripes-acq-components';
import { FormattedMessage } from 'react-intl';
import { useHistory, useLocation } from 'react-router-dom';
Expand All @@ -23,7 +28,9 @@ import { RootContext } from '../../../../context/RootContext';
export const IdentifierTab = () => {
const history = useHistory();
const location = useLocation();
const showCallout = useShowCallout();
const permissions = useBulkPermissions();

const {
isFileUploaded,
setIsFileUploaded,
Expand All @@ -37,10 +44,8 @@ export const IdentifierTab = () => {
capabilities,
identifier
} = useSearchParams();
const showCallout = useShowCallout();

const [isDropZoneActive, setDropZoneActive] = useState(false);

const { fileUpload, isLoading } = useUpload();
const { bulkOperationStart } = useBulkOperationStart();

Expand All @@ -56,8 +61,8 @@ export const IdentifierTab = () => {

const [recordType] = activeFilters[IDENTIFIER_FILTERS.CAPABILITIES] || [];
const [recordIdentifier] = activeFilters[IDENTIFIER_FILTERS.IDENTIFIER] || [];

const isDropZoneDisabled = isFileUploaded || !recordIdentifier || initialFileName;
const capabilitiesFilterOptions = getCapabilityOptions(criteria, permissions);

const {
isSelectIdentifiersDisabled,
Expand All @@ -67,9 +72,6 @@ export const IdentifierTab = () => {
hasInAppEditPerms,
} = permissions;

const capabilitiesFilterOptions = getCapabilityOptions(criteria, permissions);


const isRecordIdentifierSelectDisabled = getIsDisabledByPerm(
recordType,
isSelectIdentifiersDisabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ import { RootContext } from '../../../../context/RootContext';

export const QueryTab = () => {
const history = useHistory();
const { queryRecordType, criteria, step, initialFileName } = useSearchParams();
const {
queryRecordType,
criteria,
step,
initialFileName
} = useSearchParams();
const { setVisibleColumns } = useContext(RootContext);
const { recordTypes } = useRecordTypes();
const permissions = useBulkPermissions();
Expand Down

0 comments on commit 7a9ed03

Please sign in to comment.