mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Containing Group/Sub-Group relationships (#5105)
* Add UI support for setting containing groups * Show containing groups in group details panel * Move tag hierarchical filter code into separate type * Add depth to scene_count and add sub_group_count * Add sub-groups tab to groups page * Add containing groups to edit groups dialog * Show containing group description in sub-group view * Show group scene number in group scenes view * Add ability to drag move grid cards * Add sub group order option * Add reorder sub-groups interface * Separate page size selector component * Add interfaces to add and remove sub-groups to a group * Separate MultiSet components * Allow setting description while setting containing groups
This commit is contained in:
@@ -1388,6 +1388,60 @@ export const useGroupsDestroy = (input: GQL.GroupsDestroyMutationVariables) =>
|
||||
},
|
||||
});
|
||||
|
||||
export function useReorderSubGroupsMutation() {
|
||||
return GQL.useReorderSubGroupsMutation({
|
||||
update(cache) {
|
||||
evictQueries(cache, [
|
||||
GQL.FindGroupsDocument, // various filters
|
||||
]);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export const useAddSubGroups = () => {
|
||||
const [addSubGroups] = GQL.useAddGroupSubGroupsMutation({
|
||||
update(cache, result) {
|
||||
if (!result.data?.addGroupSubGroups) return;
|
||||
|
||||
evictTypeFields(cache, groupMutationImpactedTypeFields);
|
||||
evictQueries(cache, groupMutationImpactedQueries);
|
||||
},
|
||||
});
|
||||
|
||||
return (containingGroupId: string, toAdd: GQL.GroupDescriptionInput[]) => {
|
||||
return addSubGroups({
|
||||
variables: {
|
||||
input: {
|
||||
containing_group_id: containingGroupId,
|
||||
sub_groups: toAdd,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
export const useRemoveSubGroups = () => {
|
||||
const [removeSubGroups] = GQL.useRemoveGroupSubGroupsMutation({
|
||||
update(cache, result) {
|
||||
if (!result.data?.removeGroupSubGroups) return;
|
||||
|
||||
evictTypeFields(cache, groupMutationImpactedTypeFields);
|
||||
evictQueries(cache, groupMutationImpactedQueries);
|
||||
},
|
||||
});
|
||||
|
||||
return (containingGroupId: string, removeIds: string[]) => {
|
||||
return removeSubGroups({
|
||||
variables: {
|
||||
input: {
|
||||
containing_group_id: containingGroupId,
|
||||
sub_group_ids: removeIds,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
const sceneMarkerMutationImpactedTypeFields = {
|
||||
Tag: ["scene_marker_count"],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user