import { navigateTo } from 'store/navigation/navigation-action';
import { loadDetailsPanel } from 'store/details-panel/details-panel-action';
import { addProperty, deleteProperty } from "lib/resource-properties";
+import { getResource } from "store/resources/resources";
export const collectionPanelActions = unionize({
SET_COLLECTION: ofType<CollectionResource>(),
dispatch(resourcesActions.SET_RESOURCES([collection]));
if (collection.fileCount <= COLLECTION_PANEL_LOAD_FILES_THRESHOLD &&
!getState().collectionPanel.loadBigCollections) {
- // dispatch<any>(loadCollectionFiles(collection.uuid));
}
return collection;
};
const properties = Object.assign({}, item.properties);
const key = data.keyID || data.key;
const value = data.valueID || data.value;
+ const cachedCollection = getResource<CollectionResource>(item.uuid)(getState().resources);
services.collectionService.update(
item.uuid, {
properties: addProperty(properties, key, value)
}
).then(updatedCollection => {
+ updatedCollection = {...cachedCollection, ...updatedCollection};
dispatch(collectionPanelActions.SET_COLLECTION(updatedCollection));
dispatch(resourcesActions.SET_RESOURCES([updatedCollection]));
dispatch(snackbarActions.OPEN_SNACKBAR({
if (!item) { return; }
const properties = Object.assign({}, item.properties);
+ const cachedCollection = getResource<CollectionResource>(item.uuid)(getState().resources);
services.collectionService.update(
item.uuid, {
properties: deleteProperty(properties, key, value)
}
).then(updatedCollection => {
+ updatedCollection = {...cachedCollection, ...updatedCollection};
dispatch(collectionPanelActions.SET_COLLECTION(updatedCollection));
dispatch(resourcesActions.SET_RESOURCES([updatedCollection]));
dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Tag has been successfully deleted.", hideDuration: 2000, kind: SnackbarKind.SUCCESS }));
import { snackbarActions, SnackbarKind } from "../snackbar/snackbar-actions";
import { updateResources } from "../resources/resources-actions";
import { loadDetailsPanel } from "../details-panel/details-panel-action";
+import { getResource } from "store/resources/resources";
export interface CollectionUpdateFormDialogData {
uuid: string;
dispatch(startSubmit(COLLECTION_UPDATE_FORM_NAME));
dispatch(progressIndicatorActions.START_WORKING(COLLECTION_UPDATE_FORM_NAME));
+ const cachedCollection = getResource<CollectionResource>(collection.uuid)(getState().resources);
services.collectionService.update(uuid, {
name: collection.name,
storageClassesDesired: collection.storageClassesDesired,
description: collection.description }
).then(updatedCollection => {
+ updatedCollection = {...cachedCollection, ...updatedCollection};
dispatch(collectionPanelActions.LOAD_COLLECTION_SUCCESS({ item: updatedCollection as CollectionResource }));
dispatch(dialogActions.CLOSE_DIALOG({ id: COLLECTION_UPDATE_FORM_NAME }));
dispatch(progressIndicatorActions.STOP_WORKING(COLLECTION_UPDATE_FORM_NAME));