Skip to content

Commit

Permalink
UIBULKED-575:"Something went wrong" toast notifications when starting…
Browse files Browse the repository at this point in the history
… bulk edit
  • Loading branch information
UladzislauKutarkin committed Oct 30, 2024
1 parent 3eb1e32 commit 866bb9a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,13 @@ export const BulkEditInApp = ({
const isHoldingsRecordType = currentRecordType === CAPABILITIES.HOLDING;
const isInstanceRecordType = currentRecordType === CAPABILITIES.INSTANCE;

const { data: tenants, isLoading } = useBulkOperationTenants(bulkOperationId);
console.log(tenants)

Check warning on line 61 in src/components/BulkEditPane/BulkEditListResult/BulkEditInApp/BulkEditInApp.js

View workflow job for this annotation

GitHub Actions / github-actions-ci

Unexpected console statement

Check failure on line 61 in src/components/BulkEditPane/BulkEditListResult/BulkEditInApp/BulkEditInApp.js

View workflow job for this annotation

GitHub Actions / github-actions-ci

Missing semicolon
const { itemNotes, isItemNotesLoading } = useItemNotes({ enabled: isItemRecordType });
const { holdingsNotes, isHoldingsNotesLoading } = useHoldingsNotes({ enabled: isHoldingsRecordType });
const { instanceNotes, isInstanceNotesLoading } = useInstanceNotes({ enabled: isInstanceRecordType });
const { data: tenants } = useBulkOperationTenants(bulkOperationId);
const { notesEsc: itemNotesEsc, isFetching: isItemsNotesEscLoading } = useItemNotesEsc(tenants, 'option', { enabled: isItemRecordType && isCentralTenant });
const { notesEsc: holdingsNotesEsc, isFetching: isHoldingsNotesEscLoading } = useHoldingsNotesEsc(tenants, 'option', { enabled: isHoldingsRecordType && isCentralTenant });
const { notesEsc: itemNotesEsc, isFetching: isItemsNotesEscLoading } = useItemNotesEsc(tenants, 'option', { enabled: isItemRecordType && isCentralTenant && !isLoading });
const { notesEsc: holdingsNotesEsc, isFetching: isHoldingsNotesEscLoading } = useHoldingsNotesEsc(tenants, 'option', { enabled: isHoldingsRecordType && isCentralTenant && !isLoading });

const options = useMemo(() => ({
[CAPABILITIES.ITEM]: getItemsOptions(formatMessage, removeDuplicatesByValue(isCentralTenant ? itemNotesEsc : itemNotes, tenants)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const ValuesColumn = ({ action, allActions, actionIndex, onChange, option
currentRecordType,
} = useSearchParams();
const { id: bulkOperationId } = usePathParams('/bulk-edit/:id');
const isCentralTenant = checkIfUserInCentralTenant(stripes);
const isCentralTenant = checkIfUserInCentralTenant(stripes)

Check failure on line 73 in src/components/BulkEditPane/BulkEditListResult/BulkEditInApp/ContentUpdatesForm/ValuesColumn.js

View workflow job for this annotation

GitHub Actions / github-actions-ci

Missing semicolon

const isUserCapability = currentRecordType === CAPABILITIES.USER;
const isItemCapability = currentRecordType === CAPABILITIES.ITEM;
Expand Down
1 change: 1 addition & 0 deletions src/hooks/api/useBulkOperationTenants.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const useBulkOperationTenants = (id, options = {}) => {
queryKey: [namespace],
queryFn: () => ky.get(`bulk-operations/used-tenants/${id}`).json(),
keepPreviousData: true,
enabled: !!id,
...options,
});

Expand Down

0 comments on commit 866bb9a

Please sign in to comment.