Skip to content

Commit

Permalink
Deselect all planning items after request finish
Browse files Browse the repository at this point in the history
  • Loading branch information
thecalcc committed May 2, 2024
1 parent 45e721f commit 627d3f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions client/actions/multiSelect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {MULTISELECT, ITEM_TYPE, MODALS} from '../constants';
import eventsUi from './events/ui';
import planningUi from './planning/ui';
import {getItemType, gettext, getItemInArrayById, getErrorMessage, lockUtils} from '../utils';
import {planningApi} from '../superdeskApi';

/**
* Action Dispatcher to select an/all Event(s)
Expand Down Expand Up @@ -180,6 +181,12 @@ const downloadEvents = (url, data) => {
req.send(JSON.stringify(data));
};

const bulkAddPlanningCoveragesToWorkflow = (items) => (
(dispatch) => planningApi.planning.coverages.bulkAddCoverageToWorkflow(items)
.then(() => dispatch({
type: MULTISELECT.ACTIONS.DESELECT_ALL_PLANNINGS,
}))
);

const exportAsArticle = (items = [], download) => (
(dispatch, getState, {api, notify, gettext, superdesk, $location, $interpolate, desks}) => {
Expand Down Expand Up @@ -312,6 +319,7 @@ const self = {
itemBulkSpikeModal,
itemBulkUnSpikeModal,
exportAsArticle,
bulkAddPlanningCoveragesToWorkflow,
};

export default self;
4 changes: 2 additions & 2 deletions client/components/MultiSelectActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {eventUtils, planningUtils, gettext} from '../utils';
import {MAIN} from '../constants';
import {SlidingToolBar} from './UI/SubNav';
import {Button} from './UI';
import {planningApi} from '../superdeskApi';

export class MultiSelectActionsComponent extends React.PureComponent {
constructor(props) {
Expand Down Expand Up @@ -95,7 +94,7 @@ export class MultiSelectActionsComponent extends React.PureComponent {
key={0}
hollow={true}
onClick={() => {
planningApi.planning.coverages.bulkAddCoverageToWorkflow(this.getItemList());
this.props.addToWorkflow(this.getItemList());

Check failure on line 97 in client/components/MultiSelectActions.tsx

View workflow job for this annotation

GitHub Actions / client (14.x)

'addToWorkflow' is missing in props validation
}}
text={gettext('Add to workflow')}
/>
Expand Down Expand Up @@ -312,6 +311,7 @@ const mapDispatchToProps = (dispatch) => ({
spikeItems: (items) => dispatch(actions.multiSelect.itemBulkSpikeModal(items)),
unspikeItems: (items) => dispatch(actions.multiSelect.itemBulkUnSpikeModal(items)),
exportAsArticle: (items, download) => dispatch(actions.multiSelect.exportAsArticle(items, download)),
addToWorkflow: (items) => dispatch(actions.multiSelect.bulkAddPlanningCoveragesToWorkflow(items)),
});


Expand Down

0 comments on commit 627d3f9

Please sign in to comment.