Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIBULKED-583 Include tenants array into request if there is "final" action selected #649

Merged
merged 6 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading