18219: Unifies collection/project create/update properties handling actions.
[arvados-workbench2.git] / src / store / collections / collection-update-actions.ts
index 0096bc4828c1642926c3f00c0a4fa3b604a22935..2caaf88a23db6de2ae8552c75cc7889d10790576 100644 (file)
@@ -4,7 +4,6 @@
 
 import { Dispatch } from "redux";
 import {
-    change,
     FormErrors,
     formValueSelector,
     initialize,
@@ -23,8 +22,6 @@ import { updateResources } from "../resources/resources-actions";
 import { loadDetailsPanel } from "../details-panel/details-panel-action";
 import { getResource } from "store/resources/resources";
 import { CollectionProperties } from "./collection-create-actions";
-import { ResourcePropertiesFormData } from "views-components/resource-properties-form/resource-properties-form";
-import { addProperty, deleteProperty } from "lib/resource-properties";
 
 export interface CollectionUpdateFormDialogData {
     uuid: string;
@@ -83,23 +80,3 @@ export const updateCollection = (collection: CollectionUpdateFormDialogData) =>
             }
         );
     };
-
-export const addPropertyToUpdateCollectionForm = (data: ResourcePropertiesFormData) =>
-    (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
-        const properties = { ...COLLECTION_UPDATE_FORM_SELECTOR(getState(), 'properties') };
-        const key = data.keyID || data.key;
-        const value =  data.valueID || data.value;
-        dispatch(change(
-            COLLECTION_UPDATE_FORM_NAME,
-            'properties',
-            addProperty(properties, key, value)));
-    };
-
-export const removePropertyFromUpdateCollectionForm = (key: string, value: string) =>
-    (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
-        const properties = { ...COLLECTION_UPDATE_FORM_SELECTOR(getState(), 'properties') };
-        dispatch(change(
-            COLLECTION_UPDATE_FORM_NAME,
-            'properties',
-            deleteProperty(properties, key, value)));
-    };