Skip to content

Commit

Permalink
UIBULKED-583 Include tenants array into request if there is "final" a…
Browse files Browse the repository at this point in the history
…ction selected (#649)
  • Loading branch information
vashjs authored Nov 14, 2024
1 parent c26c31b commit 49d3f57
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* [UIPQB-126](https://folio-org.atlassian.net/browse/UIPQB-126) Use tenant timezone for building queries (adds use of permission `configuration.entries.collection.get`).
* [UIBULKED-582](https://folio-org.atlassian.net/browse/UIBULKED-582) Temporarily remove error handling from publish-coordinator related logic.
* [UIBULKED-581](https://folio-org.atlassian.net/browse/UIBULKED-581) "Something went wrong" error notification displays
* [UIBULKED-583](https://folio-org.atlassian.net/browse/UIBULKED-583) Include tenants array into request if there is "final" action selected.

## [4.2.0](https://github.com/folio-org/ui-bulk-edit/tree/v4.2.0) (2024-10-31)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {

import {
ACTIONS,
FINAL_ACTIONS,
OPTIONS
} from '../../../../../constants';
import css from '../../../BulkEditPane.css';
Expand Down Expand Up @@ -224,8 +225,10 @@ export const ContentUpdatesForm = ({

const actionParameters = actions.find(action => Boolean(action?.parameters))?.parameters;
const filteredTenants = actionTenants.filter(Boolean);
// final action is the action which doesn't require any additional data after it
const isSecondActionFinal = FINAL_ACTIONS.includes(actions[1]?.name);

const activeTenants = filteredTenants.length === 1
const activeTenants = isSecondActionFinal || filteredTenants.length === 1
? filteredTenants.flat()
: filteredTenants
.flat()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import { FormattedMessage } from 'react-intl';
import { useHistory } from 'react-router-dom';
import { useQueryClient } from 'react-query';
import PropTypes from 'prop-types';

import { Modal } from '@folio/stripes/components';
Expand All @@ -13,7 +14,7 @@ import {
FILE_KEYS,
JOB_STATUSES,
} from '../../../../constants';
import { useBulkOperationStart } from '../../../../hooks/api';
import { BULK_OPERATION_DETAILS_KEY, useBulkOperationStart } from '../../../../hooks/api';
import { BulkEditPreviewModalFooter } from './BulkEditPreviewModalFooter';
import { useSearchParams } from '../../../../hooks';
import { BulkEditPreviewModalList } from './BulkEditPreviewModalList';
Expand All @@ -32,6 +33,7 @@ export const BulkEditPreviewModal = ({
const { criteria, approach } = useSearchParams();
const { showErrorMessage } = useErrorMessages();
const { bulkOperationStart } = useBulkOperationStart();
const queryClient = useQueryClient();

const hasLinkForDownload = bulkDetails?.[FILE_KEYS.PROPOSED_CHANGES_LINK_MARC] || bulkDetails?.[FILE_KEYS.PROPOSED_CHANGES_LINK];

Expand All @@ -47,6 +49,8 @@ export const BulkEditPreviewModal = ({
step: EDITING_STEPS.COMMIT,
});

queryClient.resetQueries(BULK_OPERATION_DETAILS_KEY);

onChangesCommited();

history.replace({
Expand Down
1 change: 0 additions & 1 deletion src/hooks/useConfirmChanges.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export const useConfirmChanges = ({

const closePreviewModal = () => {
setIsPreviewModalOpened(false);
queryClient.resetQueries(BULK_OPERATION_DETAILS_KEY);
};

const confirmChanges = (payload) => {
Expand Down

0 comments on commit 49d3f57

Please sign in to comment.