import * as actionTypes from './actionTypes';

export const openPopup = popupId => ({
  type: actionTypes.PROJECT_BROWSER_OPEN_POPUP,
  payload: { popupId },
});
export const closePopup = popupId => ({
  type: actionTypes.PROJECT_BROWSER_CLOSE_POPUP,
  payload: { popupId },
});

export const closeAllPopups = () => ({
  type: actionTypes.PROJECT_BROWSER_CLOSE_ALL_POPUPS,
});

@@ -1,8 +1,31 @@
+import R from 'ramda';%0A
 import *
@@ -66,33 +66,308 @@
 s';%0A
-%0Aexport const openPopup =
+import %7B POPUP_ID %7D from './constants';%0A%0Aconst validPopupIds = new Set(R.values(POPUP_ID));%0Aconst validatePopupId = (popupId) =%3E %7B%0A  if (!validPopupIds.has(popupId)) %7B%0A    throw new Error(%60Unknown popup id $%7BpopupId%7D%60);%0A  %7D%0A%0A  return popupId;%0A%7D;%0A%0Aexport const openPopup = R.pipe(%0A  validatePopupId,%0A 
  pop
@@ -369,32 +369,34 @@
   popupId =%3E (%7B%0A
+  
   type: actionTy
@@ -421,32 +421,34 @@
 R_OPEN_POPUP,%0A  
+ 
+ 
 payload: %7B popup
@@ -453,17 +453,21 @@
 upId %7D,%0A
-%7D
+  %7D)%0A
 );%0Aexpor
@@ -486,16 +486,45 @@
 ePopup =
+ R.pipe(%0A  validatePopupId,%0A 
  popupId
@@ -526,24 +526,26 @@
 pupId =%3E (%7B%0A
+  
   type: acti
@@ -581,16 +581,18 @@
 _POPUP,%0A
+  
   payloa
@@ -607,17 +607,21 @@
 upId %7D,%0A
-%7D
+  %7D)%0A
 );%0A%0Aexpo
@@ -713,8 +713,92 @@
 PS,%0A%7D);%0A
+%0Aexport const startCreatingPatch = R.partial(openPopup, %5BPOPUP_ID.CREATING_PATCH%5D);%0A

validate popupId in relevant action creators