Skip to content

Invalidate child nodes when copying resources to a topic node, updating the quality evaluation average #2441

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,19 @@ const SettingsMenuDropdownType = ({ rootNodeId, node, onCurrentNodeChanged, node
onCurrentNodeChanged={onCurrentNodeChanged}
/>
)}
<CopyNodeResources currentNode={node} editModeHandler={editModeHandler} type="copyResources" />
<CopyNodeResources
currentNode={node}
editModeHandler={editModeHandler}
type="copyResources"
rootNodeId={rootNodeId}
/>
{isTaxonomyAdmin && (
<CopyNodeResources currentNode={node} editModeHandler={editModeHandler} type="cloneResources" />
<CopyNodeResources
currentNode={node}
editModeHandler={editModeHandler}
type="cloneResources"
rootNodeId={rootNodeId}
/>
)}
{isTaxonomyAdmin && <SetResourcesPrimary node={node} editModeHandler={editModeHandler} recursive />}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ interface Props {
currentNode: Node;
editModeHandler: EditModeHandler;
type: ActionType;
rootNodeId: string;
}

const StyledSpinner = styled(Spinner)`
Expand Down Expand Up @@ -71,7 +72,7 @@ const StyledDone = styled(Done)`
color: green;
`;

const CopyNodeResources = ({ editModeHandler: { editMode, toggleEditMode }, currentNode, type }: Props) => {
const CopyNodeResources = ({ editModeHandler: { editMode, toggleEditMode }, currentNode, type, rootNodeId }: Props) => {
const {
t,
i18n: { language },
Expand Down Expand Up @@ -117,6 +118,12 @@ const CopyNodeResources = ({ editModeHandler: { editMode, toggleEditMode }, curr
taxonomyVersion,
}),
});
qc.invalidateQueries({
queryKey: nodeQueryKeys.childNodes({
id: rootNodeId,
taxonomyVersion,
}),
});
};

const doAction = async (res: NodeChild, action: (res: NodeChild) => Promise<string>) => {
Expand Down
Loading