{"version":3,"sources":["assets/flowcode_white.png","assets/NoData.svg","serviceWorker.ts","Contexts/EditModalContext.tsx","Contexts/CreateModalContext.tsx","Reducers/SidenavToggle.tsx","Reducers/ActionTypes.tsx","Contexts/SideNavToggle.tsx","Graqhql/Authenticated.tsx","Graqhql/Brands/BrandQuery.tsx","Graqhql/Brands/BrandsMutations.tsx","Constants/dateTime.tsx","Utilities/ErrorBoundary.tsx","Components/Navbars/SideNavMenu.tsx","HOC/LayoutWrap.tsx","Components/Reusable_UI/Forms/SearchField.tsx","Components/Reusable_UI/Headers_Titles/PageTitles.tsx","Constants/Brands/BrandsList.tsx","Components/Reusable_UI/NoData/NoData.tsx","Components/BrandsList/BrandsListTable.tsx","Utilities/Validate.tsx","Components/Reusable_UI/Forms/FormFields.tsx","Components/Brands/Create_Edit_BrandsForm.tsx","Components/Reusable_UI/Modal/ModalFormWrap.tsx","Components/Reusable_UI/Alerts/ErrorAlerts.tsx","Containers/Brands/CreateBrands.tsx","Components/Reusable_UI/Loaders_Spinners/LoadingSpinner.tsx","Containers/Brands/EditBrands.tsx","Components/Reusable_UI/Alerts/SuccessAlerts.tsx","Containers/BrandsList/Brands.tsx","Graqhql/Experiment/QueryExperiment.tsx","Graqhql/Experiment/MutationExperiment.tsx","Components/Reusable_UI/Forms/Toggle/ToggleWrapper.tsx","Components/Reusable_UI/Forms/Toggle/Input.tsx","Components/Reusable_UI/Forms/Toggle/InputSelect.tsx","Components/Reusable_UI/Forms/Toggle/ListSelect.tsx","Components/Reusable_UI/Forms/Toggle/TreeSelect.tsx","Utilities/FeaturesTree.tsx","Utilities/Format.tsx","Utilities/SplitDateTime.tsx","Utilities/Experiment.tsx","Components/Experiment/Create_Edit_ExperimentForm.tsx","Containers/Experiment/CreateExperiment/CreateExperiment.tsx","Constants/Experiment/ExperimentListColumns.tsx","Components/ExperimentsList/ExperimentListTable.tsx","Containers/ExperimentsList/ExperimenstList.tsx","Containers/Experiment/EditExperiment/EditExperiment.tsx","Contexts/CreateFolderModalContext.tsx","Contexts/EditFolderModalContext.tsx","Contexts/DownloadModalContext.tsx","Components/Experiment/ViewExperimentForm/ViewAndEditExperiment.tsx","Graqhql/Folders/FoldersQuery.tsx","Graqhql/Folders/FolderMutations.tsx","Components/Folders/Create_Edit_FoldersForm.tsx","Containers/Folders/CreateFolder.tsx","Constants/Folders/FoldersList.tsx","Components/FoldersList/FoldersListTable.tsx","Containers/Folders/EditFolder.tsx","Containers/Folders/FoldersList.tsx","Utilities/RESTSetup.tsx","Utilities/EnvironmentURL.tsx","Graqhql/Permutations/MutationPermutation.tsx","Graqhql/Permutations/QueryPermutation.tsx","Components/Reusable_UI/Forms/SelectWithVal.tsx","Constants/Flowcodes/Flowcodes.tsx","Constants/Permutations/PermutationsTableColumns.tsx","Components/Permutations/ViewPermutationTable.tsx","Utilities/Permutation.tsx","Utilities/CheckNumeric.tsx","Components/Permutations/Create_Edit_Permutation.tsx","Containers/Permutations/CreatePermutation.tsx","Components/Build/CsvFile.tsx","Containers/Build/DownloadCSV.tsx","Containers/Permutations/PermutationsList.tsx","Components/Experiment/ExperimentAnalytics.tsx","Containers/Experiment/ViewExperiment/ViewExperiment.tsx","Graqhql/Features/FeatureQuery.tsx","Graqhql/Features/FeatureMutation.tsx","Constants/Features/FeatureValueType.tsx","Constants/Features/FeaturesList.tsx","Components/Feature/Create_FeatureForm.tsx","Containers/Feature/CreateFeature.tsx","Components/FeaturesList/FeaturesListTable.tsx","Components/Feature/Edit_FeatureForm.tsx","Containers/Feature/EditFeature.tsx","Containers/FeaturesList/Features.tsx","Contexts/BuildModalContext.tsx","Components/Permutations/ViewPermutationDetails.tsx","Graqhql/Flowcodes/FlowcodesQuery.tsx","Graqhql/Flowcodes/FlowcodesMutation.tsx","Components/Flowcodes/FlowcodesTable.tsx","Utilities/Flowcode.tsx","Constants/Flowcodes/FlowcodesType.tsx","Components/Flowcodes/Create_Edit_Flowcode.tsx","Components/Reusable_UI/Forms/InputNumber.tsx","Components/Build/BuildQuantity.tsx","Containers/Flowcodes/SaveBuildBatch.tsx","Containers/Flowcodes/CreateFlowcodes.tsx","Containers/Flowcodes/EditFlowcodes.tsx","Containers/Build/BuildBatch.tsx","Containers/Flowcodes/PreviewQR.tsx","Containers/Flowcodes/FlowcodesList.tsx","Containers/Permutations/ViewPermutation.tsx","Graqhql/Login.tsx","Components/Login/LoginForm.tsx","Containers/Login/Login.tsx","Graqhql/Register.tsx","Constants/auth.tsx","Components/Register/RegisteForm.tsx","Containers/Register/Register.tsx","Routes/AppRoutes.tsx","App.tsx","Utilities/Logout.tsx","Utilities/ApolloSetup.tsx","index.tsx"],"names":["module","exports","Boolean","window","location","hostname","match","EditModalCTX","createContext","EditModalProvider","props","useState","editSuccess","setEditSuccess","editError","setEditError","editErrorMsg","setEditErrorMsg","viewEditFormModal","setViewEditFormModal","useEffect","timeout","setTimeout","clearTimeout","Provider","value","handleVisible","prevState","children","CreateModalCTX","CreateModalProvider","createSuccess","setCreateSuccess","createError","setCreateError","createErrorMsg","setCreateErrorMsg","viewCreateFormModal","setCreateViewFormModal","toggleSideNav","state","action","type","collapsed","SideNavCtx","initialState","SideNavCtxProvider","useReducer","dispatch","IS_AUTHENTICATED","gql","GET_BRAND","GET_BRANDS","Format","CREATE_BRAND","DELETE_BRAND","EDIT_BRAND","ErrorBoundary","hasError","this","message","showIcon","Component","MenuItem","Item","SidebarMenu","Logout","mode","theme","selectedKeys","key","to","style","fontSize","onClick","Header","Content","Sider","logoDiv","padding","background","transition","collapsedLogoDiv","logoIcon","height","header","boxShadow","paddingLeft","display","alignItems","content","margin","minHeight","paddingBottom","collapsedIcon","LayoutWrap","client","useApolloClient","useContext","pathname","data","useQuery","authenticated","isAuthenticated","collapsible","trigger","position","role","aria-label","src","Logo","alt","SideNavMenu","localStorage","removeItem","resetStore","title","arrowPointAtCenter","placement","Search","SearchField","handleSearch","placeholderVal","disabled","placeholder","width","onChange","e","target","Title","PageTitle","titleName","level","marginBottom","columnsNames","NoData","loading","textAlign","NoDataSvg","opacity","top","left","BrandsListTable","brandData","listLoading","setEditBrandId","deleteLoading","deleteId","handleBrandDelete","marginTop","className","map","item","rowItems","rowIndex","name","primaryBrandContact","customerSuccessRep","id","overlay","menu","length","validateEmail","errors","test","validateRequired","validateRequiredArray","ignoreValidation","validateLength","FormItem","Option","CreateAntField","AntComponent","field","form","hasFeedback","label","extra","selectOptions","submitCount","setFieldValue","touched","submitted","submittedError","touchedError","help","validateStatus","spellCheck","onBlur","setFieldTouched","includes","isValueInputType","index","AntSelect","AntDatePicker","AntTimePicker","AntInput","AntInputPassword","Password","AntTextarea","TextArea","createFolderForm","allowClear","validate","component","ModalWrap","buttons","submitForm","viewFormModal","visible","confirmLoading","onCancel","footer","okText","cancelText","onConfirm","buttonName","ErrorAlert","onErrorClose","close","transform","zIndex","maxWidth","description","onClose","closable","initialFieldValues","CreateBrand","resetRef","useRef","current","click","useMutation","onCompleted","onError","error","refetchQueries","query","createBrand","initialValues","onSubmit","values","variables","input","validateOnBlur","isSubmitting","handleReset","ref","LoadingSpinner","tip","EditBrand","editBrandId","brandInfoError","setBrandInfoError","brandInfo","setBrandInfo","brandLoading","brand","editBrand","enableReinitialize","SuccessAlert","confirm","titleDiv","justifyContent","searchAddDiv","flexBasis","BrandBreadcrumb","BrandsList","setBrandData","setDeleteId","deleteError","setDeleteError","brands","deleteBrand","filteredItem","filter","shape","icon","brandId","brandName","okType","onOk","GET_EXPERIMENTS","Math","ceil","innerHeight","GET_EXPERIMENT_OPTIONS","GET_EDIT_EXPERIMENT","GET_EXPERIMENT_ANALYTICS","CREATE_EXPERIMENT","UPDATE_EXPERIMENT","DELETE_EXPERIMENT","ToggleWrapper","editable","editableEl","staticEl","elRef","autoFocus","focus","ToggleEditInput","formattedValue","onElBlur","prefix","disableInput","isEdit","setIsEdit","node","ToggleSelect","displayValue","selectValue","fieldValue","options","optionValue","optionName","setValue","disableSelect","toUpperCase","slice","o","ToggleListSelect","onElChange","optionFilterProp","formField","disableList","bordered","dataSource","renderItem","Panel","DescItem","ToggleTreeSelect","onToggle","filterProp","treeData","showCheckedStrategy","disableEdit","selectedItems","defaultActiveKey","showArrow","toLowerCase","layout","size","previewItem","featureName","featureId","discreteValues","searchPlaceholder","treeCheckable","onDropdownVisibleChange","open","treeNodeFilterProp","GetFeaturesTree","inputData","feature","i","discrete","numberWithCommas","x","toString","split","join","replace","removeCommas","formatPermutationName","brandsList","permutationData","medium","find","experimentDiscreteSet","experiment","features","variableId","experimentDiscreteValue","discreteValue","channel","pad","getDateValue","timestamp","newDate","Date","getMonth","getDate","getFullYear","getTimeValue","getHours","getMinutes","submitEditExperiment","initialBrands","initialFeatures","updateExperiment","experimentId","startDate","startTime","endDate","endTime","startDateTimeUTC","endDateTimeUTC","moment","format","convertUTCDateFormat","timeFormat","toISOString","deleteBrands","addBrands","some","deleteDiscreteValues","addDiscreteValues","initFeature","experiment_identifier","channels","mediums","manager","isCac","createExperimentFormData","expData","experimentBrandSet","dateFormat","experimentIdentifier","experimentData","accumulateFeatures2","reduce","acc","obj","filterDiscreteValues","featureItem","objIndex","findIndex","accItem","filteredFeature","push","outputPara","border","borderRadius","lineHeight","CreateEditExperimentForm","submitLoading","nested","clickToEdit","totalImpressions","totalCost","owner","isChanged","initalDataReady","setInitialDataReady","featureTreeData","setFeatureTreeData","selectedFeaturesPreview","setSelectedFeaturePreview","setChannels","setMediums","channelsUpdated","setChannelsUpdated","featureUpdated","setfeatureUpdate","brandUpdated","setBrandUpdate","brandNames","setBrandNames","editSection","setEditSection","showSubmit","setShowSubmit","filteredFeatures","archived","featuresTree","customFeatureData","experimentName","filteredMedium","objItem","flat","uniqMedium","Array","from","Set","filteredValuesMedium","readOnly","suffix","gutter","xs","span","dtxcloudUsers","user","username","checked","undefined","CreateExperimentBreadcrumb","CreateExperiement","expError","setExpError","expLoading","createExperiment","history","createLoading","minWidth","antIcon","spin","ExperimenTable","experimentsData","onLoadMore","hasNextPage","handleDeleteExperiment","dataLength","next","hasMore","loader","indicator","overflow","overflowX","substring","timeStamp","toLocaleString","numberFolders","numberPermutations","stopPropagation","color","cursor","ExperiementList","fetchError","setFetchError","fetchErrorMsg","setFetchErrorMsg","searchVal","setSearchVal","queryConfig","searchParam","fetchMore","setExperimentsData","experiments","edges","deleteExperiment","decodedId","atob","pageInfo","after","endCursor","updateQuery","previousResult","fetchMoreResult","newEdges","__typename","catch","EditExperiement","setExperimentData","updateError","setUpdateError","setInitialBrands","setInitialFeatures","params","decodedExperimentId","updateLoading","EditExperimentBreadcrumb","CreateFolderModalCTX","CreateFolderModalProvider","createFolderSuccess","setCreateFolderSuccess","createFolderError","setCreateFolderError","createFolderErrorMsg","setCreateFolderErrorMsg","createFolderFormModal","setViewFolderFormModal","EditFolderModalCTX","EditFolderModalProvider","editFolderSuccess","setEditFolderSuccess","editFolderError","setEditFolderError","editFolderErrorMsg","setEditFolderErrorMsg","editFolderFormModal","setEditFolderFormModal","DownloadModalContext","DownloadModalProvider","downloadSuccess","setDownloadSuccess","downloadError","setDownloadError","downloadErrorMsg","setDownloadErrorMsg","viewDownloadFormModal","setDownloadViewFormModal","toogleIconDiv","toggleIcon","ViewExperimentDetails","expDecodedId","showForm","setShowForm","expName","setExpName","_","isEqual","impressionsToDate","spendToDate","GET_FOLDERS","GET_FOLDER","CREATE_FOLDER","EDIT_FOLDER","DELETE_FOLDER","CreateFolderForm","CreateFolder","FoldersListTable","folderListData","setEditFolderId","deleteFolderId","handleDeleteFolder","folders","permutationCount","EditFolder","editFolderId","getFolderError","setGetFolderError","getFolder","getFolderLoading","editFolder","editLoading","folder","FolderList","foldersListError","setFoldersListError","setDeleteFolderId","deleteFolderError","setDeleteFolderError","deleteFolder","instance","axios","create","baseURL","CancelToken","isCancel","CREATE_PERMUTATION","EDIT_PERMUTATION","DELETE_PERMUTATION","GET_PERMUTATIONS_OPTIONS","GET_PERMUTATIONS_LIST","GET_EDIT_PERMUTATION","moreStyle","dropdownOptionStyle","ViewPermutationsTable","deletePermutationId","handleDeletePermutation","handleClonePermutation","handleDownloadCSV","showCount","setShowCount","showMoreRowId","setShowMoreRowID","variable","rowID","featuresListCount","showCountTemp","showMoreFeatures","flowcodeCount","reduceDiscreteSet","object","objDiscreteValues","AntSelectWithVal","filterPropName","filterOption","data-searchkey","checkNumericVal","inputVal","Number","SHOW_CHILD","DescriptionsItem","CreateEditPermutation","featureTreeOptionalData","setFeatureTreeOptionalData","featureTreeExpData","setFeatureTreeExpData","optFeatureUpdated","setOptFeatureUpdate","expFeatureUpdated","setExpFeatureUpdate","selectedExpFeaturesPreview","setSelectedExpFeaturePreview","selectedOptFeaturesPreview","setSelectedOptFeaturePreview","setBrandsList","showISCS","setShowISCS","clonePermutationValues","Object","keys","forEach","permutationValue","permutationName","date","utc","customBrandsList","optionalFeaturesTree","customExpFeatureData","expFeaturesTree","inputValue","expFeatureData","attributes","optFeatureData","handleCost","fieldName","checkCostVal","preventDefault","sm","md","lg","dropdownStyle","maxHeight","iscs","estCost","actualCost","estImpressions","actualImpressions","notes","CreatePermutation","clonePermutationId","setClonePermutationId","createAndClone","setCreateAndClone","clonePermutationDataLoading","setClonePermutationDataLoading","createPermutationInitialValues","setCreatePermutationInitialValues","permutationOptionsError","setPermutationOptionsError","permutationCloneError","setPermutationCloneError","handleCreateAndClone","closeModal","permutationDataOpt","permutationLoading","createPermutation","useLazyQuery","permutation","clonePermutationData","formatNumber","val","parseFloat","attribute","formatPermutationData","getClonePermutationData","clonePermutationDataFetchLoading","permutationID","newVariables","v","d","CsvFileForm","fileName","DownloadCSV","permutationId","formFields","setFormFields","downloadingCsv","setDownloadingCsv","downloadCsvErrorMsg","setDownloadCsvErrorMsg","fileNameUpdate","buttonsDownload","API","get","headers","responseType","then","response","link","document","createElement","href","URL","createObjectURL","Blob","setAttribute","body","appendChild","status","detail","CsvFile","PermutationList","setPermutationData","setDeletePermutationId","deletePermutationError","setDeletePermutationError","selectedPermutationId","setSelectedPermutationId","selectedPermutationName","setSelectedPermutationName","permutationListError","setPermutationListError","downloadFlowcodesError","setDownloadFlowcodesError","isDownloadFlowcodesLoading","setIsDownloadFlowcodesLoading","isDownloadPermutationsLoading","setIsDownloadPermutationsLoading","filterMenuItems","setFilterMenuItems","filterMenuItemCount","setFilterMenuItemCount","filterFolderInfo","setFilterFolderInfo","searchField","setSearchField","isDownloadFlowcodesModalOpen","setIsDownloadFlowcodesModalOpen","flowcodeColor","setFlowcodeColor","permutationsList","hasFlowcodes","hasPermutations","permutations","uniquePermutations","pushedItem","deletePermutation","clearFolderFilter","handleDownloadFlowcodes","a","permutationIds","ids","defaultColor","objectURL","filename","request","getResponseHeader","revokeObjectURL","handleDownloadPermutations","url","filteredUniq","searchFieldResult","indexOf","folderFilterResult","filteredSearch","filteredFolder","filterMenu","handleFolderFilter","FileExcelFilled","triangle","onChangeComplete","hex","ExperimentAnalytics","React","setError","analytics","names","costPerScan","scans","cps","scanCount","chartData","datasets","fill","borderColor","backgroundColor","pointBorderColor","pointBackgroundColor","pointHoverBackgroundColor","pointHoverBorderColor","yAxisID","hoverBackgroundColor","hoverBorderColor","responsive","tooltips","elements","line","scales","maxBarThickness","xAxes","labels","gridLines","ticks","callback","substr","yAxes","stepSize","beginAtZero","toFixed","folderDiv","ViewExperimentComponents","folderView","setFolderView","ViewExperimentBreadcrumb","ViewAndEditExperiment","marginLeft","GET_FEATURE","GET_FEATURES","GET_CHANNEL_CHOICES","CREATE_FEATURE","UPDATE_FEATURE","DELETE_FEATURE","ValueType","Freetext","Numerical","TypeValue","string","boolean","number","typeChoices","featureCategories","CreateFeatureForm","channelChoices","isBooleanType","setIsBooleanType","handleValuesEnter","onPressEnter","removeFeature","handleClose","category","CreateFeature","fetchChannelsError","setFetchChannelsError","setChannelChoices","createFeature","channelChoicesData","channelChoicesLoading","FeaturesListTable","featuresData","tableLoading","setEditFeatureId","handleArchive","archiveLoading","archivedId","EditFeatureForm","marginRight","updateValue","tempFeatureNames","handleValueUpdate","deleteValue","handleDeleteValue","EditFeature","editFeatureId","featureError","setFeatureError","featureInfo","setfeatureInfo","initialDiscreteValues","setinitialDiscreteValues","featureData","featureLoading","tempInitialVal","editFeature","addValues","initialFeature","updateValues","deleteValues","deleteItem","FeatureBreadcrumb","FeaturesList","setFeatures","featuresDataError","setFeaturesDataError","activeData","setActiveData","inactiveData","setInactiveData","activeKey","setActiveKey","setArchivedId","archiveError","setArchiveError","active","inactive","updateArchive","BuildModalCTX","BuildModalProvider","buildSuccess","setBuildSuccess","buildError","setBuildError","buildErrorMsg","setBuildErrorMsg","buildFormModal","toggleIconDiv","ViewPermutationDetails","permutationDetails","updatePermutation","expFeatures","variablesTreeData","setVariablesTreeData","attributesTreeData","setAttributesTreeData","showHideFormToggle","getFeaturesList","accumulateFeatures3","submitChanges","finalNumber","hasFolder","showSave","autoSize","resize","f","b","br","objects","discreteFeature","getFeaturesVariables","featureObject","getFeaturesAttributes","GET_FLOWCODES_OPTIONS","GET_FLOWCODES_LIST","GET_FLOWCODES_EDIT","CREATE_BATCH","DELETE_BATCH","UPDATE_FLOWCODES","UPDATE_BATCH","BUILD_BATCH","BUILD_ALL","menuStyle","TableHeaderTitleCenter","ViewFlowcodesTable","flowcodeData","setPreviewQRId","deleteBatchId","handleDeleteBatch","setEditBatchId","setBuildBatchId","downloadQRId","downloadQRLoading","handleDownloadQR","buildHandleVisible","colSpan","permutationBatches","charAt","batchFlowcodes","flowcode","shorturl","redirectValue","featuresHash","prev","curr","renderFlowcodeFeatures","batch","flowcodeBrandSet","permutationBrand","isScan","isBuilt","rowItemsId","batchFlowcodesId","flowcodeId","urlPatternStart","urlPatternSplit","constructRedirectValue","redirectValue1","redirectValue2","redirectValue3","redirectValue4","redirectValue5","redirectValue6","FlowcodesType","AddRemoveButton","displayPlusButton","displayMinusButton","handleAddBtnClick","handleMinusBtnClick","CreateEditFlowcode","flowcodesData","flowcodeType","initialDataReady","setFeatureUpdated","1","2","3","4","5","6","visibleLandingPages","setVisibleLandingPages","toggleVisibleLandingPage","page","isOpen","validateRedirectValue","getLandingPageType","landingPageValidator","requireProtocol","isLandingPageTwoVisible","isLandingPageThreeVisible","isLandingPageFourVisible","isLandingPageFiveVisible","isLandingPageSixVisible","permutationBrandSet","filteredDiscrete","customFeature","AntInputNumber","checkNumeric","InputNumber","BuildQuantityForm","quantity","SaveBuildBatch","batchId","saveAndBuild","handleSaveBuild","setCreateComplete","buildBatch","buildBatchLoading","BuildQuantity","CreateFlowcodes","setSaveAndBuild","createComplete","setBatchId","flowcodesFetchError","setFlowcodesFetchError","flowcodesLoading","createBatch","nonOneButtons","oneTypeButtons","EditFlowcodes","updateId","flowcodesFields","setFlowcodesFields","initialAttributes","setInitialAttributes","initialBrandsSet","setInitialBrandsSet","initialAttributesSet","setInitialAttributesSet","redirectValues","urls","ind","search","trim","splitURLs","initialData","batchDiscreteSet","updateBatch","updateBatchLoading","updateFlowcodes","updateFlowcodeLoading","inputBatch","deleteAttributes","filterAttribute","addAttributes","inputFlowcode","filterBrand","addBrand","BuildBatch","buildAll","downloadCsv","setDownloadCsv","buildAllBatch","buildAllBatchLoading","buttonsBuild","Text","PreviewQR","previewBatchId","imageLink","setImageLink","imageFileName","setImageFileName","setDownloadQRErrorMsg","setDownloadQRLoading","unmounted","source","config","cancel","flowcodes","FlowcodesList","flowcodesList","setFlowcodesList","batchesPresent","setBatchesPresent","setFlowcodeType","setDeleteBatchId","deleteBatchError","setDeleteBatchError","editBatchId","buildBatchId","setBuildAll","downloadQRErrorMsg","setDownloadQRId","previewQRId","flowcodesListError","setFlowcodesListError","isDownloadFlowcodeModalOpen","setIsDownloadFlowcodeModalOpen","flowcodesListData","flowcodeslistLoading","batchesPresentTemp","flowcodeTypeTemp","deleteBatch","downloadBatchId","onCloseDeleteError","filteredBatch","downloadbatchId","ViewPermutation","staticContext","setExpFeatures","exp","loading2","editPermutation","isLoading","dataComplete","initialVariables","permutationVariableSet","permutationAttributeSet","addVariable","va","experimentDiscrete","deleteVariable","addAttribute","att","deleteAttribute","LOGIN_USER","LoginForm","htmlType","password","Login","loginError","setLoginError","tokenAuth","setItem","token","writeData","justify","Auth","REGISTER_USER","RegisterForm","email","Register","registerError","setRegisterError","createUser","withRouter","path","ViewExperiment","Features","EditExperiment","CreateExperiment","App","cache","InMemoryCache","getAuthToken","getItem","AUTH_TOKEN","httpLink","HttpLink","uri","unAuthorizedMessages","LOGOUT_TOKEN","valueOf","INVALID_TOKEN","unAuthorizedInterceptor","graphQLErrors","requestMiddleware","ApolloLink","operation","forward","setContext","authorization","ApolloClient","defaultOptions","watchQuery","fetchPolicy","resolvers","ReactDOM","render","getElementById","navigator","serviceWorker","ready","registration","unregister"],"mappings":"mIAAAA,EAAOC,QAAU,kiF,oBCAjBD,EAAOC,QAAU,IAA0B,oC,wJCYvBC,QACW,cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,2D,WCVOC,EAAoBC,wBAAc,IAiDhCC,EA/C0B,SAAAC,GAAU,IAAD,EACVC,oBAAS,GADC,mBACzCC,EADyC,KAC5BC,EAD4B,OAEdF,oBAAS,GAFK,mBAEzCG,EAFyC,KAE9BC,EAF8B,OAGRJ,mBAAS,IAHD,mBAGzCK,EAHyC,KAG3BC,EAH2B,OAKEN,oBAAS,GALX,mBAKzCO,EALyC,KAKtBC,EALsB,KAQhDC,qBAAU,WACR,IAAMC,EAAUC,YAAW,WACrBV,GACFC,GAAe,KAEhB,KAEH,OAAO,WAEL,OAAOU,aAAaF,MAErB,CAACT,IAUJ,OACE,kBAACL,EAAaiB,SAAd,CACEC,MAAO,CACLP,oBACAQ,cAZgB,WAChBR,IACFH,GAAa,GACbE,EAAgB,KAElBE,GAAqB,SAAAQ,GAAS,OAAKA,MAQ/Bf,cACAC,iBACAC,YACAC,eACAC,eACAC,oBAGDP,EAAMkB,WC5CAC,EAAsBrB,wBAAc,IAgDlCsB,EA9C4B,SAAApB,GAAU,IAAD,EACRC,oBAAS,GADD,mBAC3CoB,EAD2C,KAC5BC,EAD4B,OAEZrB,oBAAS,G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AL,GAAqBhhC,SAASqhC,EAAc,GAAGvpC,WDxDjDqD,aAAaC,WAAW,SACxBlB,GAAOmB,iBC+DHimC,GAAoB,IAAIC,MAAW,SAACC,EAAWC,GAOnD,OALAD,EAAUE,WAAW,CACnBpe,QAAS,CACPqe,cAAejB,QAGZe,EAAQD,MAIJtnC,GAAS,IAAI0nC,KAAa,CAErCle,KAAMjS,aAAK,CAAC6vB,GAAmBF,GAAyBP,KACxDL,SACAqB,eA5C0B,CAC1BC,WAAY,CACVC,YAAa,qBAEfh/B,MAAO,CACLg/B,YAAa,iBAwCfC,UAAW,KAIbxB,GAAMjB,UAAU,CACdjlC,KAAM,CACJG,kBAAmBimC,KACnB9qB,WAAY,UCrEhBqsB,IAASC,OAEP,kBAAC,IAAD,CAAgBhoC,OAAQA,IAEtB,kBAAC,IAAD,KAEE,kBAAC,EAAD,KACE,kBAAC,EAAD,KACE,kBAAC,EAAD,KACE,kBAAC,GAAD,WAMVypB,SAASwe,eAAe,ShHmGpB,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAM9e,MAAK,SAAA+e,GACjCA,EAAaC,kB","file":"static/js/main.d7ec9231.chunk.js","sourcesContent":["module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG8AAABwCAMAAAAnm94cAAACalBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////EfdF5AAAAzXRSTlMAAQIDBAUGBwkKCwwNDg8QERIVFhcZGhscHR4fICEiIyQmJygpLC0uLzAxMjM1Nzg5Ojs8PT5AQUJDREVHSElKS0xNTk9QUVJTVFVXWFlaW1xdX2BhYmNlZmdoaWxtb3BxcnN1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W5CRVE3hGwRW2/2FXdB6oM8ATz8zigXQY1o45F3/2E1uZvFlWMIV5KYmLiasf1uSpKmPxX3J1Fk5I/o/jQFQbKjaSlN1yQvCyADLn/xC/cXjmWfJszwyPzqTCFeMVxuT8oEFyIN320MEce2YLbdofyBlEp4/kBQLwsmyTWXoMe75PtHGq87OJvnh7vyi9584fU2jQvMIrKJJJ7APy04QTYoPPkMGofGmbb7S+Z4JQH46tbbwrpyOhHA2oWCqNCOUgee3We4UirQ1OszX6tNKe5toEHfurWX5tklMu8RN2qIYviSxZaKuQhMFLo6ErpfGsM6LyGy6MB7HhzhYWTc1iUZr70RgmZx3fNN2nnYZAon4ZioBAW7VOcccr27Iw4b6mnph47nDSctFdUVITZbA5S3YNnaPYT0DbpdbfWu7MAAAAASUVORK5CYII=\"","module.exports = __webpack_public_path__ + \"static/media/NoData.36385a0f.svg\";","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n)\n\ntype Config = {\n onSuccess?: (registration: ServiceWorkerRegistration) => void\n onUpdate?: (registration: ServiceWorkerRegistration) => void\n}\n\nexport function register(config?: Config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(\n (process as { env: { [key: string]: string } }).env.PUBLIC_URL,\n window.location.href\n )\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config)\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n )\n })\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config)\n }\n })\n }\n}\n\nfunction registerValidSW(swUrl: string, config?: Config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing\n if (installingWorker == null) {\n return\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n )\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration)\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.')\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration)\n }\n }\n }\n }\n }\n })\n .catch(error => {\n console.error('Error during service worker registration:', error)\n })\n}\n\nfunction checkValidServiceWorker(swUrl: string, config?: Config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type')\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload()\n })\n })\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config)\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n )\n })\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister()\n })\n }\n}\n","//this is the context to handle the modal interaction & states between a container/component buttons and modal.\n//Edit modal is used by table/list component and a \"Edit\" modal component.\n\n//note - context cannot be used in two or more differnt components from the same form/page\n\nimport React, { createContext, useState, useEffect } from 'react'\n\n//create context\nexport const EditModalCTX: any = createContext({})\n\nconst EditModalProvider: React.FC = props => {\n const [editSuccess, setEditSuccess] = useState(false)\n const [editError, setEditError] = useState(false)\n const [editErrorMsg, setEditErrorMsg] = useState('')\n //show or hide state of modal\n const [viewEditFormModal, setViewEditFormModal] = useState(false)\n\n // mount timer and unmount cleanup - set timer for 2secs and remove timer when the component is unmounted\n useEffect(() => {\n const timeout = setTimeout(() => {\n if (editSuccess) {\n setEditSuccess(false)\n }\n }, 2000)\n\n return () => {\n // clear timeout\n return clearTimeout(timeout)\n }\n }, [editSuccess])\n\n const handleVisible = () => {\n if (viewEditFormModal) {\n setEditError(false)\n setEditErrorMsg('')\n }\n setViewEditFormModal(prevState => !prevState)\n }\n\n return (\n \n {props.children}\n \n )\n}\n\nexport default EditModalProvider\n","//This is the context to handle the modal interaction & states between a container/component buttons and modal.\n//Create modal is used by table/list component and a \"create\" modal component.\n\n//note - context cannot be used in two or more differnt components from the same form/page\n\nimport React, { createContext, useState, useEffect } from 'react'\n\n//create context\nexport const CreateModalCTX: any = createContext({})\n\nconst CreateModalProvider: React.FC = props => {\n const [createSuccess, setCreateSuccess] = useState(false)\n const [createError, setCreateError] = useState(false)\n const [createErrorMsg, setCreateErrorMsg] = useState('')\n //show or hide state of modal\n const [viewCreateFormModal, setCreateViewFormModal] = useState(false)\n\n // mount timer and unmount cleanup - set timer for 2secs and remove timer when the component is unmounted\n useEffect(() => {\n const timeout = setTimeout(() => {\n if (createSuccess) {\n setCreateSuccess(false)\n }\n }, 2000)\n\n return () => {\n // clear timeout\n return clearTimeout(timeout)\n }\n }, [createSuccess])\n\n const handleVisible = () => {\n if (viewCreateFormModal) {\n setCreateError(false)\n setCreateErrorMsg('')\n }\n setCreateViewFormModal(prevState => !prevState)\n }\n return (\n \n {props.children}\n \n )\n}\n\nexport default CreateModalProvider\n","//Reducer to store the state of side nav across pages\n\nimport * as actions from './ActionTypes'\n\nexport const toggleSideNav = (state: any, action: any) => {\n switch (action.type) {\n case actions.TOGGLE_SIDENAV:\n return {\n collapsed: action.collapsed\n }\n default:\n return state\n }\n}\n","//Reducers action types\n\n//Toggle side nav\nexport const TOGGLE_SIDENAV = 'TOGGLE_SIDENAV'\n","import React, { createContext, useReducer } from 'react'\nimport { toggleSideNav } from '../Reducers/SidenavToggle'\n\n//This context will provide the expanded or collapsed state of the side nav to the children components\n//from local reducer\nexport const SideNavCtx: any = createContext({})\n\n//Reducer inital state\nconst initialState = {\n collapsed: false\n}\n\nconst SideNavCtxProvider = (props: any) => {\n const [{ collapsed }, dispatch] = useReducer(toggleSideNav, initialState)\n\n return (\n \n {props.children}\n \n )\n}\n\nexport default SideNavCtxProvider\n","//This query will fetch the authenticated state of the user from local cache\n\nimport gql from 'graphql-tag'\n\nexport const IS_AUTHENTICATED = gql`\n query IsUserAuthenticated {\n isAuthenticated @client\n }\n`\n","//Query - Brand\n\nimport gql from 'graphql-tag'\n\n//get brand by brand id\nexport const GET_BRAND = gql`\n query($id: UUID) {\n brand(id: $id) {\n id\n name\n description\n primaryBrandContact\n customerSuccessRep\n }\n }\n`\n\n//get brands\nexport const GET_BRANDS = gql`\n query {\n brands {\n id\n name\n description\n primaryBrandContact\n customerSuccessRep\n }\n }\n`\n\nexport const GET_BRANDS_LIST = gql`\n query {\n brands {\n id\n name\n }\n }\n`\n","//Mutations - Brands\n\nimport gql from 'graphql-tag'\n\n//create brand\nexport const CREATE_BRAND = gql`\n mutation($input: BrandInputType) {\n createBrand(input: $input) {\n brand {\n name\n description\n customerSuccessRep\n primaryBrandContact\n }\n }\n }\n`\n\n//delete brand\nexport const DELETE_BRAND = gql`\n mutation($id: UUID!) {\n deleteBrand(id: $id) {\n ok\n }\n }\n`\n\n//edit brand\nexport const EDIT_BRAND = gql`\n mutation($input: BrandInputType, $id: UUID!) {\n updateBrand(input: $input, id: $id) {\n brand {\n name\n }\n }\n }\n`\n","//Date time format\n\nexport enum Format {\n dateFormat = 'MM-DD-YYYY',\n timeFormat = 'HH:mm',\n convertUTCDateFormat = 'YYYY-MM-DD'\n}\n","//This component will catch the errors from the children component and\n//prevent the app from crashing by displaying a\nimport React, { Component } from 'react'\n\n//ant design components\nimport { Alert } from 'antd'\n\ntype ErrorState = {\n hasError: boolean\n}\n\n//hooks does not support getDerivedStateFromError yet.\nclass ErrorBoundary extends Component<{}, ErrorState> {\n state = { hasError: false }\n\n static getDerivedStateFromError() {\n // Update state so the next render will show the fallback UI.\n return { hasError: true }\n }\n\n render() {\n if (this.state.hasError) {\n // You can render any custom fallback UI\n return (\n \n )\n }\n\n return this.props.children\n }\n}\n\nexport default ErrorBoundary\n","//This has the menu items to be displayed in the side navabar of all authenticated pages.\n//Refer HOC > LayoutWrap.tsx\n//This component uses current url \"location\" to show the active menu state\n\nimport React from 'react'\nimport { NavLink } from 'react-router-dom'\n\n//styled components\nimport { Menu, Icon } from 'antd'\n\n//ant d components\nconst MenuItem = Menu.Item\n\n//typescript\ninterface Props {\n location: string\n Logout: () => void\n}\n\n//JSX\n\nconst SidebarMenu = ({ location, Logout }: Props) => {\n return (\n \n \n \n \n Experiments\n \n \n\n \n \n \n Features\n \n \n\n \n \n \n Brands\n \n \n\n \n
\n \n Logout\n
\n
\n
\n )\n}\n\nexport default SidebarMenu\n","//This is a wrapper component wrapping the main content. It consists of a header, sidenav & footer.\n\nimport React, { Fragment, useContext } from 'react'\nimport { Link } from 'react-router-dom'\nimport { useQuery } from '@apollo/react-hooks'\nimport { useApolloClient } from '@apollo/react-hooks'\n\n//styled components\nimport { Layout, Icon, Tooltip } from 'antd'\n\n//contexts\nimport { SideNavCtx } from '../Contexts/SideNavToggle'\nimport * as actions from '../Reducers/ActionTypes'\n\n//utils\nimport { IS_AUTHENTICATED } from '../Graqhql/Authenticated'\nimport ErrorBoundary from '../Utilities/ErrorBoundary'\n\n//images - logo\n//import Logo from '../assets/dtx-company.png';\nimport Logo from '../assets/flowcode_white.png'\n\n//functional component\nimport SideNavMenu from '../Components/Navbars/SideNavMenu'\n\n\n//destructuring ant design components\nconst { Header, Content, Sider } = Layout\n\n// inline styles\nconst logoDiv = {\n padding: '12px 14px',\n background: '#002140',\n transition: '0.1s all linear'\n}\n\nconst collapsedLogoDiv = {\n padding: '12px 21px',\n background: '#002140',\n transition: '0.1s all linear'\n}\n\nconst logoIcon = {\n height: '40px'\n}\n\nconst header = {\n boxShadow: '0 2px 8px #d0d8e3',\n background: 'none',\n paddingLeft: 15,\n display: 'flex',\n alignItems: 'center'\n}\n\nconst content = {\n margin: '32px 50px',\n minHeight: `calc(100vh)`,\n paddingBottom: 80\n}\n\nconst collapsedIcon = {\n fontSize: '18px'\n}\n\n//JSX\nconst LayoutWrap: React.FC = ({ props, children }) => {\n //apollo clients\n const client = useApolloClient()\n\n //contexts\n const { collapsed, dispatch } = useContext(SideNavCtx)\n\n //pathname\n const pathname = props.location.pathname\n\n // get authenticated state to display the sidebar only in authenticated components\n const { data } = useQuery(IS_AUTHENTICATED)\n const authenticated = data ? data.isAuthenticated : false\n\n const toggleSider = () => {\n dispatch({ type: actions.TOGGLE_SIDENAV, collapsed: !collapsed })\n }\n\n //logout function\n const Logout = () => {\n localStorage.removeItem('token')\n client.resetStore()\n }\n\n return (\n
\n \n \n \n
\n \"the\n
\n \n\n {/* if authenticated list the sider / side nav menu items */}\n {authenticated && (\n \n \n \n )}\n \n\n \n
\n \n \n \n
\n\n \n \n {children}\n \n \n
\n
\n
\n )\n}\n\nexport default LayoutWrap\n","//This component will create input search field using ant d.\nimport React from 'react'\n\n//styled components\nimport { Input } from 'antd'\n\n//ant d components\nconst { Search } = Input\n\n//props to receive\ninterface Props {\n handleSearch: (value: string) => void\n placeholderVal: string\n disabled: boolean\n}\n\nexport const SearchField = ({\n handleSearch,\n placeholderVal,\n disabled\n}: Props) => {\n const handleChange = (e: any) => {\n handleSearch(e.target.value)\n }\n\n return (\n \n )\n}\n","//This is the component for generating the title in all pages,\n//any changes here will reflect in all pages\n\nimport React from 'react'\n\n//styled components\nimport { Typography } from 'antd'\n\n//Ant d components\nconst { Title } = Typography\n\n//props type\ninterface title {\n titleName: string\n}\n\nconst PageTitle = ({ titleName }: title) => {\n return (\n \n {titleName}\n \n )\n}\n\nexport default PageTitle\n","//typescript table columns\nimport { TableColumns } from \"../../TypeScript_Types/TableColumns\";\n\n//this is the names of the columns in brands list table\n\nexport const columnsNames: Readonly = [\n {\n title: 'Brand Name',\n key: 'name'\n },\n {\n title: 'Brand Contact',\n key: 'contact'\n },\n {\n title: 'Customer Success Rep',\n key: 'customer'\n },\n {\n title: 'Actions',\n key: 'actions'\n }\n]","//This component will be rendered when the table data is being fetched (loading state)\n//or the data is empty\n\nimport React from 'react'\nimport { Spin } from 'antd'\n\n//asset\nimport NoDataSvg from '../../../assets/NoData.svg'\n\n//props\ninterface Props {\n loading: boolean\n}\n\nconst NoData = ({ loading }: Props) => {\n return (\n \n
\n \"No\n

No Data

\n
\n {loading && (\n \n \n \n )}\n \n )\n}\n\nexport default NoData\n","//This coponent will display the list of brands in a table\n\nimport React, { useContext } from 'react'\n\n//styled components\nimport { Menu, Dropdown, Icon } from 'antd'\n\n//stylesheet\nimport '../Reusable_UI/Styles.less'\n\n//constants\nimport { columnsNames } from '../../Constants/Brands/BrandsList'\n\n//context\nimport { EditModalCTX } from '../../Contexts/EditModalContext'\n\n//typeScript\nimport { BrandsTableProps } from '../../TypeScript_Types/Brands'\n\n//functional components\nimport NoData from '../Reusable_UI/NoData/NoData'\n\n//React FC - JSX\nconst BrandsListTable = ({\n brandData,\n listLoading,\n setEditBrandId,\n deleteLoading,\n deleteId,\n handleBrandDelete\n}: BrandsTableProps) => {\n //context\n const { handleVisible } = useContext(EditModalCTX)\n\n // pop up action menu\n const menu = (rowItems: any) => {\n return (\n \n {\n setEditBrandId(rowItems.id)\n handleVisible()\n }}\n >\n Edit\n \n handleBrandDelete(rowItems.id, rowItems.name)}\n >\n Delete\n \n \n )\n }\n\n return (\n
\n \n \n \n {columnsNames.map((item: any) => (\n \n ))}\n \n \n\n {/* table list */}\n\n \n {brandData &&\n brandData.map((rowItems: any, rowIndex) => {\n return (\n \n \n \n \n \n \n )\n })}\n \n
{item.title}
{rowItems.name}{rowItems.primaryBrandContact}{rowItems.customerSuccessRep}\n {rowItems.id === deleteId && deleteLoading ? (\n \n ) : (\n menu(rowItems)}\n trigger={['click']}\n >\n \n \n )}\n
\n\n {/* no data or loading state */}\n {((brandData && brandData.length === 0) ||\n (!brandData && listLoading)) && }\n
\n )\n}\n\nexport default BrandsListTable\n","//These are the validation rules for the form input fields\n\n//validate email\nexport const validateEmail = (value: string): string | undefined => {\n let errors\n\n if (!value) {\n errors = 'Email is required.'\n } else if (!/^\\w+([.-]?\\w+)*@\\w+([.-]?\\w+)*(\\.\\w{2,3})+$/.test(value)) {\n errors = 'Invalid email address!'\n }\n\n return errors\n}\n\n//validate required value => min 1 char\nexport const validateRequired = (value: any): string | undefined => {\n let errors\n\n if (!value) {\n errors = 'Cannot be empty.'\n return errors\n }\n}\n\n//validate required for arrays\nexport const validateRequiredArray = (\n value: any,\n ignoreValidation?: boolean\n): string | undefined => {\n let errors\n\n if (ignoreValidation) return\n\n if (value.length === 0) {\n errors = 'Cannot be empty.'\n return errors\n }\n}\n\n//validate value length => min 5 char, mainly used for password\nexport const validateLength = (value: string): string | undefined => {\n const MIN_LENGTH = 5\n let errors\n\n if (value.length < MIN_LENGTH) {\n errors = 'Must be at least 5 characters long.'\n }\n return errors\n}\n","//This component will create formik based input fields using ant d.\n\n//NOTE - type=\"text\" is necessary for \"Input\" type fields\n\nimport React from 'react'\nimport { FieldProps } from 'formik'\n\n//styled component\nimport { Form, Input, TimePicker, DatePicker, Select } from 'antd'\n\n//Ant d component destructuring\nconst FormItem = Form.Item\nconst { Option } = Select\n\nconst isValueInputType = (value: string): boolean =>\n ['Numerical', 'Freetext', 'Boolean'].includes(value)\n\n//typescript for form fields\ninterface formFields {\n prefix: React.ReactNode\n label: string\n extra?: string\n hasFeedback?: boolean\n selectOptions: Array\n type: string\n submitCount: number\n setFieldValue?: (name: string, value: any) => void\n}\n\n//type class\ntype Class = { new (...args: any[]): any }\n\n//JSX\nconst CreateAntField = (AntComponent: Class) => ({\n field,\n form,\n hasFeedback,\n label,\n extra,\n selectOptions,\n type,\n submitCount,\n setFieldValue,\n ...props\n}: FieldProps & formFields) => {\n const touched = form.touched[field.name]\n const submitted = submitCount > 0\n const hasError = form.errors[field.name]\n const submittedError = hasError && submitted\n const touchedError = hasError && touched\n\n const onInputChange = ({ target: { value } }: any) =>\n form.setFieldValue(field.name, value)\n\n const onChange = (value: any) => {\n if (isValueInputType(value) && setFieldValue) {\n setFieldValue('discreteValues', [])\n\n if (value === 'Boolean')\n {\n setFieldValue('discreteValues', [{ value: 'TRUE' }, { value: 'FALSE' }])\n }\n }\n form.setFieldValue(field.name, value)\n }\n\n const onBlur = () => form.setFieldTouched(field.name, true) \n return (\n
\n \n \n {selectOptions &&\n selectOptions.map((name, index) => (\n \n ))}\n \n \n
\n )\n}\n\n//components\nexport const AntSelect = CreateAntField(Select)\nexport const AntDatePicker = CreateAntField(DatePicker)\nexport const AntTimePicker = CreateAntField(TimePicker)\nexport const AntInput = CreateAntField(Input)\nexport const AntInputPassword = CreateAntField(Input.Password)\nexport const AntTextarea = CreateAntField(Input.TextArea)\n","import React from 'react'\n\n//form handler\nimport { Form, Field } from 'formik'\n\n//utitlities\nimport { validateRequired } from '../../Utilities/Validate'\n\n//functional components\nimport { AntInput, AntTextarea } from '../Reusable_UI/Forms/FormFields'\n\n//typeScript\ninterface Props {\n isSubmitting: boolean\n submitCount: number\n}\n\nconst createFolderForm = ({ submitCount }: Props) => {\n return (\n
\n {/* brand name */}\n \n\n {/* brand description */}\n \n\n {/* contact */}\n \n\n {/* customer success rep */}\n \n \n )\n}\n\nexport default createFolderForm\n","//This will wrap child component to render it in a modal form.\n\nimport React from 'react'\nimport { Modal, Button, Popconfirm } from 'antd'\n\n// typescript types\ninterface Props {\n title: string\n buttons: Array<{}>\n submitForm: () => Promise\n loading: boolean\n viewFormModal: boolean\n handleVisible: () => void\n}\n\n//JSX\nconst ModalWrap: React.FC = props => {\n //props\n const {\n title,\n buttons,\n submitForm,\n loading,\n viewFormModal,\n handleVisible\n } = props\n\n return (\n \n Cancel\n ,\n\n //other buttons\n buttons.map((item: any) => (\n {\n item.action && item.action()\n submitForm()\n }}\n >\n \n \n ))\n ]}\n >\n {props.children}\n \n )\n}\n\nexport default ModalWrap\n","//This component is used to display error altert, during occurence of an error\n//Note - error alert rendered on fetching form details will not be closeable\n//close alerts are for create/edit operations\n\nimport React from 'react'\n\n//styled component\nimport { Alert } from 'antd'\n\ninterface Props {\n message: string;\n onErrorClose?: () => void;\n close?: boolean;\n\n}\n\nconst ErrorAlert = ({ message, onErrorClose, close = false}: Props) => {\n return (\n \n \n \n )\n}\n\nexport default ErrorAlert\n","//Container - create brand\n\nimport React, { Fragment, useContext, useRef, useEffect } from 'react'\nimport { Formik } from 'formik'\nimport { useMutation } from '@apollo/react-hooks'\n\n//graphql\nimport { CREATE_BRAND } from '../../Graqhql/Brands/BrandsMutations'\nimport { GET_BRANDS } from '../../Graqhql/Brands/BrandQuery'\n\n//context\nimport { CreateModalCTX } from '../../Contexts/CreateModalContext'\n\n//typescript types\nimport { BrandsFormValues } from '../../TypeScript_Types/Brands'\n\n//utilities\nimport ErrorBoundary from '../../Utilities/ErrorBoundary'\n\n//functional components\nimport CreateBrandsForm from '../../Components/Brands/Create_Edit_BrandsForm'\nimport ModalWrap from '../../Components/Reusable_UI/Modal/ModalFormWrap'\nimport ErrorAlert from '../../Components/Reusable_UI/Alerts/ErrorAlerts'\n\n//const form fields initial state\nconst initialFieldValues: BrandsFormValues = {\n name: '',\n description: '',\n primaryBrandContact: '',\n customerSuccessRep: ''\n}\n\n//const modal buttons\nconst buttons = [\n {\n buttonName: 'Create',\n key: 'create'\n }\n]\n\n//JSX\nconst CreateBrand: React.FC = () => {\n //ref to call reset form\n const resetRef: any = useRef(null)\n\n //context\n const {\n viewCreateFormModal,\n handleVisible,\n setCreateSuccess,\n createError,\n setCreateError,\n createErrorMsg,\n setCreateErrorMsg\n } = useContext(CreateModalCTX)\n\n //resetForm when there is changed in the view state of the modal,\n //do not move the reference click to handleVisible function, it will change the animation direction of the modal\n useEffect(() => {\n resetRef.current && resetRef.current.click()\n }, [viewCreateFormModal])\n\n //create brand graphql mutation\n const [createBrand, { loading }] = useMutation(CREATE_BRAND, {\n onCompleted() {\n //on success set the sucess state to true and close the modal\n setCreateSuccess(true)\n handleVisible()\n },\n onError(error: any) {\n setCreateError(true)\n setCreateErrorMsg(error.message)\n },\n refetchQueries: [{ query: GET_BRANDS }]\n })\n\n // create brand submit\n const handleSubmit = (values: BrandsFormValues) => {\n createBrand({ variables: { input: values } })\n }\n\n //handle modal visible or hidden and reset state\n return (\n \n \n {({ isSubmitting, submitCount, submitForm, handleReset }) => (\n \n {/* error alert */}\n {createError && (\n {\n setCreateError(false)\n setCreateErrorMsg('')\n }}\n />\n )}\n\n {/* create brands form */}\n \n \n \n\n {/* reset form div ref */}\n
\n \n )}\n \n \n )\n}\n\nexport default CreateBrand\n","//This component will display a spinning wheel with 'loading...' text\n\nimport React from 'react'\n\n//functional components\nimport { Spin } from 'antd'\n\nexport const LoadingSpinner = () => {\n return (\n
\n
\n \n
\n
\n )\n}\n","//container - edit brand.\nimport React, { Fragment, useContext, useRef, useEffect, useState } from 'react'\nimport { Formik } from 'formik'\nimport { useMutation, useQuery } from '@apollo/react-hooks'\n\n//graphql\nimport { EDIT_BRAND } from '../../Graqhql/Brands/BrandsMutations'\nimport { GET_BRANDS, GET_BRAND } from '../../Graqhql/Brands/BrandQuery'\n\n//context\nimport { EditModalCTX } from '../../Contexts/EditModalContext'\n\n//typescript types\nimport { BrandsFormValues } from '../../TypeScript_Types/Brands'\n\n//utilities\nimport ErrorBoundary from '../../Utilities/ErrorBoundary'\n\n//functional components\nimport EditBrandsForm from '../../Components/Brands/Create_Edit_BrandsForm'\nimport ModalWrap from '../../Components/Reusable_UI/Modal/ModalFormWrap'\nimport ErrorAlert from '../../Components/Reusable_UI/Alerts/ErrorAlerts'\nimport { LoadingSpinner } from '../../Components/Reusable_UI/Loaders_Spinners/LoadingSpinner'\n\n//initial fields\nlet initialFieldValues: BrandsFormValues = {\n name: '',\n description: '',\n primaryBrandContact: '',\n customerSuccessRep: ''\n}\n\ninterface Props {\n editBrandId: string\n}\n\n//const modal buttons\nconst buttons = [\n {\n buttonName: 'Edit',\n key: 'edit'\n }\n]\n\n//JSX\nconst EditBrand: React.FC = ({ editBrandId }) => {\n //local states\n const [brandInfoError, setBrandInfoError] = useState()\n const [brandInfo, setBrandInfo] = useState(initialFieldValues)\n\n //context\n const {\n handleVisible,\n setEditSuccess,\n setEditErrorMsg,\n editError,\n setEditError,\n editErrorMsg,\n viewEditFormModal\n } = useContext(EditModalCTX)\n\n //get brand details\n const { data: brandData, loading: brandLoading } = useQuery(GET_BRAND, {\n variables: { id: editBrandId },\n onError(error) {\n setBrandInfoError(error)\n }\n })\n\n //update intial state\n useEffect(() => {\n if (brandData) {\n setBrandInfo(brandData.brand)\n }\n }, [brandData])\n\n //ref\n const resetRef: any = useRef(null)\n\n //useEffect - resetForm do not move calling ref to handleVisible function it will change the transform origin of the modal\n useEffect(() => {\n if (viewEditFormModal) {\n resetRef.current && resetRef.current.click()\n }\n }, [viewEditFormModal])\n\n //graphql mutation\n const [editBrand, { loading }] = useMutation(EDIT_BRAND, {\n onCompleted() {\n setEditSuccess(true)\n handleVisible()\n },\n onError(error) {\n setEditErrorMsg(error.message)\n setEditError(true)\n },\n refetchQueries: [{ query: GET_BRANDS }]\n })\n\n //call mutation and submit form\n const handleSubmit = (values: BrandsFormValues) => {\n //mutation input arg\n let input = {\n name: values.name,\n description: values.description,\n primaryBrandContact: values.primaryBrandContact,\n customerSuccessRep: values.customerSuccessRep\n }\n\n editBrand({ variables: { input, id: editBrandId } })\n }\n\n return (\n \n {/* edit brand form */}\n \n {({ isSubmitting, submitCount, submitForm, handleReset }) => (\n \n {/* error alert mutation request, NOTE - success is handled in the parent component */}\n {editError && (\n {\n setEditError(false)\n setEditErrorMsg('')\n }}\n />\n )}\n\n {/* error fetch the brand info */}\n {brandInfoError ? (\n \n ) : (\n \n {/* display css loader while the brand details are getting downloaded */}\n {brandLoading ? (\n \n ) : (\n \n \n \n )}\n \n )}\n\n {/* reset form div ref */}\n
\n \n )}\n \n \n )\n}\n\nexport default EditBrand\n","//This component is used to display success alert, after a request is successful\n\nimport React from 'react'\n\n//styled component\nimport { Alert } from 'antd'\n\ninterface Props {\n message: string\n title: string\n closable: boolean\n}\n\nconst SuccessAlert = ({ message, closable, title }: Props) => {\n return (\n \n \n
\n )\n}\n\nexport default SuccessAlert\n","//container - brands list\n//This is the parent container for wrapping the components of the brands in the edit and create context provider\n\nimport React, { useState, useEffect, Fragment, useContext } from 'react'\nimport { useQuery, useMutation } from '@apollo/react-hooks'\nimport { Link } from 'react-router-dom'\n\n//ant d\nimport { Tooltip, Button, Modal, Breadcrumb } from 'antd'\n\n//graphql query\nimport { GET_BRANDS } from '../../Graqhql/Brands/BrandQuery'\nimport { DELETE_BRAND } from '../../Graqhql/Brands/BrandsMutations'\n\n//context\nimport { EditModalCTX } from '../../Contexts/EditModalContext'\nimport { CreateModalCTX } from '../../Contexts/CreateModalContext'\n\n//functional components\nimport LayoutWrap from '../../HOC/LayoutWrap'\nimport { SearchField } from '../../Components/Reusable_UI/Forms/SearchField'\nimport PageTitle from '../../Components/Reusable_UI/Headers_Titles/PageTitles'\nimport BrandsListTable from '../../Components/BrandsList/BrandsListTable'\nimport CreateBrand from '../Brands/CreateBrands'\nimport EditBrand from '../Brands/EditBrands'\nimport SuccessAlert from '../../Components/Reusable_UI/Alerts/SuccessAlerts'\nimport ErrorAlert from '../../Components/Reusable_UI/Alerts/ErrorAlerts'\nimport ErrorBoundary from '../../Utilities/ErrorBoundary'\n\n//ant component destructring\nconst { confirm } = Modal\n\n//inline styles\nconst titleDiv = {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center'\n}\n\nconst searchAddDiv = {\n display: 'flex',\n justifyContent: 'space-between',\n flexBasis: '21%'\n}\n\n//const title of login page\nconst PAGE_TITLE = 'Brands'\n\n//Breadcrumb nav\nconst BrandBreadcrumb = () => {\n return (\n \n \n Create experiment\n \n Brands\n \n )\n}\n\n//React FC JSX\nconst BrandsList: React.FC = props => {\n //get brands data from graphql\n const { data, loading, error } = useQuery(GET_BRANDS)\n\n //local state\n const [brandData, setBrandData] = useState([])\n const [editBrandId, setEditBrandId] = useState('')\n const [deleteId, setDeleteId] = useState()\n const [deleteError, setDeleteError] = useState()\n\n //context\n const { viewEditFormModal, editSuccess } = useContext(EditModalCTX)\n const { createSuccess, handleVisible, viewCreateFormModal } = useContext(\n CreateModalCTX\n )\n\n //update the local state, this will be used in search function.\n useEffect(() => {\n if (data) {\n setBrandData(data.brands)\n }\n }, [data])\n\n //SEARCH FILTER - search brand name from the list\n const handleSearch = (value: string) => {\n if (!value) {\n setBrandData(data.brands)\n } else {\n const filteredItem = data.brands.filter((brand: any) =>\n brand.name.includes(value)\n )\n setBrandData(filteredItem)\n }\n }\n\n //delete brand mutation\n const [deleteBrand, { loading: deleteLoading }] = useMutation(DELETE_BRAND, {\n onCompleted() {\n setDeleteId(null)\n },\n onError(error) {\n setDeleteError(error)\n },\n refetchQueries: [{ query: GET_BRANDS }]\n })\n\n //call delete brand mutations\n const handleBrandDelete = (brandId: string, brandName: string) => {\n setDeleteId(brandId)\n\n confirm({\n title: 'Delete brand',\n content: `Are you sure you want to delete ${brandName}?`,\n okText: 'Yes',\n okType: 'danger',\n cancelText: 'No',\n onOk() {\n deleteBrand({ variables: { id: brandId } })\n }\n })\n }\n\n // close delete error popup\n const onCloseDeleteError = () => {\n setDeleteError(null)\n setDeleteId(null)\n }\n\n return (\n \n {/* breadcrum navigation */}\n \n\n {/* title and search bar div */}\n
\n \n\n
\n \n {/* create brand button */}\n \n \n \n\n {/* create brand */}\n {viewCreateFormModal && }\n
\n
\n\n {createSuccess || editSuccess ? (\n \n ) : null}\n\n {/* error getting brand details */}\n {error ? (\n \n ) : (\n \n {/* delete brand error */}\n {deleteError && (\n \n )}\n\n {/* table content */}\n \n \n \n\n {/* edit brand pop up */}\n {viewEditFormModal && }\n \n )}\n
\n )\n}\n\nexport default BrandsList\n","//Query - Experiments\n\nimport gql from 'graphql-tag'\n\n//get the list of all experiments\nexport const GET_EXPERIMENTS = gql`\n query getExperiments($after: String, $searchParam: String) {\n\texperiments(first: ${Math.ceil(\n (window.innerHeight - 200) / 54\n )}, after: $after, name_Icontains: $searchParam){\n\t\tpageInfo {\n\t\t\tstartCursor\n\t\t\tendCursor\n\t\t\thasNextPage\n\t\t\thasPreviousPage\n\t\t}\n\t\tedges {\n\t\t\tcursor\n\t\t\tnode {\n\t\t\t\tid\n\t\t\t\tname\n timeStamp\n numberFolders\n numberPermutations\n\t\t\t}\n\t\t}\n\t}\n}\n`\n\n//get the choices and options for create/edit experiment forms\nexport const GET_EXPERIMENT_OPTIONS = gql`\n query {\n # channels\n channels {\n name\n mediums\n }\n\n # features\n features {\n id\n name\n archived\n discreteValues {\n id\n value\n }\n }\n\n # brands\n brands {\n id\n name\n }\n\n # users - manager\n dtxcloudUsers {\n id\n username\n }\n }\n`\n\n//edit experiment\n//get the choices and options for create/edit experiment forms\nexport const GET_EDIT_EXPERIMENT = gql`\n query($id: UUID) {\n # experiment\n experiment(id: $id) {\n id\n name\n manager {\n id\n }\n isCac\n owner {\n username\n }\n experimentBrandSet {\n id\n brand {\n id\n }\n }\n experimentIdentifier\n channels\n mediums\n startDate\n endDate\n spendToDate\n impressionsToDate\n experimentDiscreteSet {\n id\n discreteValue {\n id\n value\n feature {\n id\n name\n }\n }\n }\n }\n # channels\n channels {\n name\n mediums\n }\n\n # features\n features {\n id\n name\n archived\n discreteValues {\n id\n value\n }\n }\n # brands\n brands {\n id\n name\n }\n\n # users - manager\n dtxcloudUsers {\n id\n username\n }\n }\n`\n\n//view experiment\nexport const VIEW_EXPERIMENT = gql`\n query($id: UUID) {\n experiment(id: $id) {\n id\n name\n manager {\n id\n }\n isCac\n brands {\n id\n name\n }\n experimentIdentifier\n channels\n mediums\n startDate\n endDate\n spendToDate\n impressionsToDate\n discreteValues {\n id\n value\n feature {\n id\n name\n }\n }\n }\n }\n`\n\nexport const GET_EXPERIMENT_ANALYTICS = gql`\n query experiment($id: UUID) {\n analytics(id: $id) {\n id\n scanCount\n costPerScan\n permutationName\n }\n }\n`\n\n// export const SEARCH_EXPERIMENTS = gql`\n// query searchExperiments($searchParam: String) {\n// experiments(name_Icontains: $searchParam){\n// \t\tedges {\n// \t\t\tnode {\n// \t\t\t\tid\n// \t\t\t\tname\n// timeStamp\n// numberFolders\n// numberPermutations\n// \t\t\t}\n// \t\t}\n// \t}\n// }\n// `;\n","// mutations - Experiments\n\nimport gql from 'graphql-tag'\n\n//create experiment\nexport const CREATE_EXPERIMENT = gql`\n mutation($input: ExperimentInputType, $discreteValues: [UUID!]) {\n createExperiment(input: $input, discreteValues: $discreteValues) {\n experiment {\n id\n }\n }\n }\n`\n\n//update experiment\nexport const UPDATE_EXPERIMENT = gql`\n mutation(\n $id: UUID!\n $input: ExperimentInputType\n $addBrands: [UUID]\n $deleteBrands: [UUID]\n $addDiscreteValues: [UUID]\n $deleteDiscreteValues: [UUID]\n ) {\n updateExperiment(\n id: $id\n input: $input\n addBrands: $addBrands\n deleteBrands: $deleteBrands\n addDiscreteValues: $addDiscreteValues\n deleteDiscreteValues: $deleteDiscreteValues\n ) {\n ok\n }\n }\n`\n\n// mutation to delete experiment\nexport const DELETE_EXPERIMENT = gql`\n mutation($id: UUID!) {\n deleteExperiment(id: $id) {\n ok\n }\n }\n`\n","//This component wraps toggle elements and returns disabled or editable input element.\n\nimport { useEffect } from 'react'\n\n//typescipt\ninterface ToggleProps {\n editable: boolean\n editableEl: any\n staticEl: any\n elRef?: any\n autoFocus?: boolean\n}\n\n//React FC\nconst ToggleWrapper = ({\n editable,\n editableEl,\n staticEl,\n elRef,\n autoFocus = false\n}: ToggleProps): JSX.Element => {\n //give focus to editable element\n useEffect(() => {\n if (editable && autoFocus && elRef) {\n elRef.current.focus()\n }\n }, [editable, autoFocus, elRef])\n\n //return editable or disabled element\n if (editable) return editableEl\n return staticEl\n}\n\nexport default ToggleWrapper\n","//This component is used to toggle between editable and disabled input field\n\nimport React, { useRef, useState } from 'react'\n//styled components\nimport { Form, Input } from 'antd'\n//utility\nimport ToggleWrapper from './ToggleWrapper'\n\n//ant component destructuring\nconst { Item } = Form\n\n//typescript\ninterface ToggleInputProps {\n label: string\n value: string\n formattedValue?: string\n onElBlur?: () => void\n setFieldValue: (v: string) => any\n prefix?: string\n\n //disableInput is used in view permutation, once the final number is set to true\n //further editing must not be allowed\n disableInput?: boolean\n}\n\n//JSX\nconst ToggleEditInput = ({\n label,\n value,\n formattedValue,\n onElBlur,\n setFieldValue,\n prefix,\n disableInput = false\n}: ToggleInputProps): JSX.Element => {\n //ref\n const ref = useRef()\n //local state\n const [isEdit, setIsEdit] = useState(false)\n\n return (\n \n {\n !disableInput && setIsEdit(true)\n }}\n >\n \n
\n }\n // editable input element\n editableEl={\n setFieldValue(e.target.value)}\n onBlur={() => {\n setIsEdit(false)\n if (onElBlur) onElBlur()\n }}\n ref={(node: any) => (ref.current = node)}\n />\n }\n />\n \n )\n}\n\nexport default ToggleEditInput\n","import React, { useRef, useState } from 'react'\nimport { Form, Input, Select } from 'antd'\nimport ToggleWrapper from './ToggleWrapper'\n\nconst { Item } = Form\nconst { Option } = Select\n\ninterface SelectProps {\n name: string\n displayValue: string\n selectValue: string\n fieldValue: (v: string) => any\n options: any[]\n optionValue: (v: any) => string\n optionName: (v: any) => string\n setValue: (value: string) => void\n mode?: string\n\n //disable select is used in view permutation, once the final number is set to true\n //further editing must not be allowed\n disableSelect?: boolean\n}\n\nconst ToggleSelect = ({\n name,\n displayValue,\n selectValue,\n fieldValue,\n options,\n optionValue,\n optionName,\n setValue,\n mode,\n disableSelect = false\n}: SelectProps): JSX.Element => {\n //ref - to set focus for the editable element\n const ref = useRef()\n\n //local state\n const [isEdit, setIsEdit] = useState(false)\n\n return (\n \n {\n !disableSelect && setIsEdit(true)\n }}\n >\n \n \n }\n editableEl={\n setValue(fieldValue(value))}\n onBlur={() => setIsEdit(false)}\n ref={(node: any) => (ref.current = node)}\n >\n {options &&\n options.map((o: any) => (\n \n ))}\n \n }\n />\n \n )\n}\n\nexport default ToggleSelect\n","//This component is used to create a toggled List or Select dropdown.\n\nimport React, { useRef, useState } from 'react'\n//ant destructuring\nimport { Form, Select, List } from 'antd'\n//utility\nimport ToggleWrapper from './ToggleWrapper'\n\n//ant design component destructuring\nconst { Item } = Form\nconst { Option } = Select\n\n//typescript\ninterface ListSelectProps {\n name: string\n displayValue: any[]\n selectValue?: any[]\n fieldValue?: (v: any) => any\n options: any[]\n optionValue: (v: any) => string\n optionName: (v: any) => string\n setFieldValue: (value: any) => void\n onElBlur?: () => void\n onElChange?: () => void\n help?: string | boolean\n validateStatus?: '' | 'error' | 'success'\n optionFilterProp?: string\n formField?: any\n disableSelect?: boolean\n\n //disable list is used in view permutation, once the final number is set to true\n //further editing must not be allowed\n disableList?: boolean\n}\n\n//JSX\nconst ToggleListSelect = ({\n name,\n displayValue,\n selectValue,\n fieldValue,\n options,\n optionValue,\n optionName,\n setFieldValue,\n onElBlur,\n onElChange,\n help,\n validateStatus,\n optionFilterProp,\n formField,\n disableSelect = false,\n disableList = false\n}: ListSelectProps): JSX.Element => {\n //ref\n const ref = useRef()\n //local state\n const [isEdit, setIsEdit] = useState(false)\n\n return (\n \n {\n !disableList && setIsEdit(true)\n }}\n className={disableList ? 'd-pointer' : 'c-pointer'}\n >\n (\n {item.name || item} \n )}\n style={{ background: 'white' }}\n />\n \n }\n //editable input element\n editableEl={\n {\n setFieldValue(fieldValue ? fieldValue(value) : value)\n if (onElChange) onElChange()\n }}\n onBlur={() => {\n setIsEdit(false)\n if (onElBlur) onElBlur()\n }}\n ref={(node: any) => (ref.current = node)}\n optionFilterProp={optionFilterProp}\n disabled={disableSelect}\n >\n {options &&\n options.map((o: any) => (\n \n {optionName(o)}\n \n ))}\n \n }\n />\n \n )\n}\n\nexport default ToggleListSelect\n","//This component will toggle between tree select and description preview\nimport React, { useRef, useState } from 'react'\n//styled component\nimport { Form, TreeSelect, Collapse, Descriptions } from 'antd'\n//utilities\nimport ToggleWrapper from './ToggleWrapper'\n\n//ant design component destructuring\nconst { Item } = Form\nconst { Panel } = Collapse\nconst DescItem = Descriptions.Item\n\n//typescript\ninterface ListSelectProps {\n name: string\n selectValue?: any[]\n setFieldValue: (value: any) => void\n onToggle?: () => void\n onElChange?: () => void\n help?: string | boolean\n validateStatus?: '' | 'error' | 'success'\n optionFilterProp?: string\n formField?: any\n treeData: any\n filterProp: string\n showCheckedStrategy?: any\n label?: string\n disableEdit?: boolean\n selectedItems: any[]\n}\n\n//JSX\nconst ToggleTreeSelect = ({\n name,\n selectValue,\n setFieldValue,\n onToggle,\n onElChange,\n help,\n validateStatus,\n filterProp,\n formField,\n treeData,\n showCheckedStrategy,\n label,\n disableEdit = false,\n selectedItems\n}: ListSelectProps): JSX.Element => {\n //ref\n const ref = useRef()\n //local state\n const [isEdit, setIsEdit] = useState(false)\n\n return (\n \n {\n !disableEdit && setIsEdit(true)\n }}\n className={disableEdit ? 'd-pointer' : 'c-pointer'}\n >\n \n \n {!selectedItems || selectedItems.length === 0 ? (\n
\n

{label} not selected.

\n
\n ) : (\n \n {selectedItems.map((previewItem: any) => (\n \n {previewItem.discreteValues &&\n previewItem.discreteValues.map((item: any) => (\n

\n {item.value}\n

\n ))}\n \n ))}\n \n )}\n \n
\n \n }\n editableEl={\n {\n setFieldValue(value)\n if (onElChange) onElChange()\n }}\n onDropdownVisibleChange={(open: boolean) => {\n if (!open) {\n setIsEdit(false)\n if (onToggle) onToggle()\n }\n }}\n ref={(node: any) => (ref.current = node)}\n treeNodeFilterProp={filterProp}\n />\n }\n />\n \n )\n}\n\nexport default ToggleTreeSelect\n","//This is the utility function for creating a features -> Discrete value tree structure for TreeSelect styled component\n\n//typeScripts\nimport { AllFeaturesItem, Feature } from '../TypeScript_Types/Features'\n\n//tree data for TreeSelect\nexport const GetFeaturesTree = (\n inputData: Array\n): any => {\n const treeData = inputData.map((feature, i: number) => ({\n // Parent\n value: feature.id,\n title: feature.name,\n key: `0-${i}`,\n children: feature.discreteValues.map((discrete, index: number) => {\n const key = `0-${i}-${index}`\n return {\n // child\n title: discrete.value,\n value: discrete.id,\n key: key\n }\n })\n }))\n return treeData\n}\n","import { AllBrandItem } from '../TypeScript_Types/Brands'\n\n//format numbers with commas\nexport const numberWithCommas = (x: number): string => {\n return x\n ?.toString()\n .split(',')\n .join('')\n .replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',')\n}\n\n//remove commas from a number/string\nexport const removeCommas = (x: any): string => {\n return x\n ?.toString()\n .split(',')\n .join('')\n}\n\nexport interface FormatPermutationName {\n values: {\n medium: string\n brands: string[]\n variables: string[]\n channel: string\n }\n brandsList: AllBrandItem[]\n permutationData: {\n experiment: any\n }\n date?: string\n}\n\nexport const formatPermutationName = ({\n values,\n brandsList,\n permutationData\n}: FormatPermutationName): string => {\n const medium = values.medium ? values.medium : ''\n const brands = values.brands\n .map((brandId: string) => {\n const brand = brandsList.find(\n (brand: { id: string }) => brand?.id === brandId\n )\n return brand?.name\n })\n .join('-')\n const experimentDiscreteSet =\n permutationData?.experiment?.experimentDiscreteSet\n const features = values.variables\n .map((variableId: string) => {\n const feature = experimentDiscreteSet?.find(\n (experimentDiscreteValue: {\n id: string\n discreteValue: { id: string }\n }) =>\n experimentDiscreteValue?.discreteValue?.id === variableId || // create and edit have different data structure\n experimentDiscreteValue?.id === variableId\n )\n return feature?.discreteValue?.value?.toLowerCase()\n })\n .join('-')\n // const identifier = permutationData?.experiment?.experimentIdentifier || ''\n const channel = values.channel?.toLowerCase()\n return [\n brands,\n channel,\n medium.toLowerCase().replace(/,/g, '-'),\n // identifier,\n features\n ]\n .filter(Boolean)\n .join('_')\n}\n","//These functions will accept dates in UTC format and render the local date in YYYY-MM-DD and time in HH:MM format.\n\n//this is to add a '0' padding to single digits months\nfunction pad(value: number) {\n if (value < 10) {\n return '0' + value\n } else {\n return value\n }\n}\n\n//send formatted date\nexport const getDateValue = (timestamp: string) => {\n let newDate = new Date(timestamp)\n return (\n pad(newDate.getMonth() + 1) +\n '-' +\n pad(newDate.getDate()) +\n '-' +\n newDate.getFullYear()\n )\n}\n\n//send formatted time\nexport const getTimeValue = (timestamp: string) => {\n let newDate = new Date(timestamp)\n return pad(newDate.getHours()) + ':' + pad(newDate.getMinutes())\n}\n","import { ExperimentFormValues } from '../TypeScript_Types/ExperimentTypes'\nimport { Format } from '../Constants/dateTime'\nimport { getDateValue, getTimeValue } from './SplitDateTime'\nimport moment from 'moment'\nimport {\n AllFeaturesItem,\n FeaturePreview,\n DiscreteValues\n} from '../TypeScript_Types/Features'\n\nexport const submitEditExperiment = (\n values: ExperimentFormValues,\n initialBrands: Array,\n initialFeatures: Array,\n updateExperiment: (variables: any) => void,\n experimentId: string\n): void => {\n //convert dates to \"YYYY-MM-DD\" format and time to \"HH:MM\"\n let startDate\n let startTime\n let endDate\n let endTime\n let startDateTimeUTC = null\n let endDateTimeUTC = null\n\n //If start date is not null\n if (values.startDate) {\n startDate = moment(values.startDate).format(Format.convertUTCDateFormat)\n startTime = values.startTime\n ? moment(values.startTime).format(Format.timeFormat)\n : '00:00'\n //convert start date and time to UTC\n startDateTimeUTC = new Date(startDate + 'T' + startTime).toISOString()\n }\n\n //If end date is not null\n if (values.endDate) {\n endDate = moment(values.endDate).format(Format.convertUTCDateFormat)\n endTime = values.endTime\n ? moment(values.endTime).format(Format.timeFormat)\n : '00:00'\n //convert end date and time to UTC\n endDateTimeUTC = new Date(endDate + 'T' + endTime).toISOString()\n }\n\n //create add and delete brands list\n const deleteBrands =\n initialBrands.length > 0\n ? initialBrands\n .filter(\n (item: { brand: { id: string } }) =>\n !values.brands.includes(item.brand.id)\n )\n .map((brand: { id: string }) => brand.id)\n : []\n\n const addBrands =\n initialBrands.length > 0\n ? values.brands.filter((brand: string) =>\n initialBrands.some(\n (item: { brand: { id: string } }) => item.brand.id !== brand\n )\n )\n : values.brands\n\n //create add and delete features list\n // send experimentDiscreteSet > id for delete and discreteValue > id for add.\n const deleteDiscreteValues =\n initialFeatures.length > 0\n ? initialFeatures\n .filter(\n (feature: { discreteValue: { id: string } }) =>\n !values.discreteValues.includes(feature.discreteValue.id)\n )\n .map((item: { id: string }) => item.id)\n : []\n\n const addDiscreteValues =\n initialFeatures.length > 0\n ? values.discreteValues.filter(\n (value: string) =>\n !initialFeatures.some(\n (initFeature: { discreteValue: { id: string } }) =>\n initFeature.discreteValue.id === value\n )\n )\n : values.discreteValues\n //create input\n const input = {\n name: values.name,\n experiment_identifier: values.experiment_identifier, // eslint-disable-line\n channels: values.channels,\n mediums: values.mediums,\n startDate: startDateTimeUTC,\n endDate: endDateTimeUTC,\n manager: values.manager,\n isCac: values.isCac\n }\n // console.log({\n // id: experimentId,\n // input: input,\n // addBrands,\n // deleteBrands,\n // addDiscreteValues,\n // deleteDiscreteValues\n // })\n //call update mutation\n updateExperiment({\n variables: {\n id: experimentId,\n input: input,\n addBrands,\n deleteBrands,\n addDiscreteValues,\n deleteDiscreteValues\n }\n })\n}\n\n//Used to prepare data for the experiment form\nexport const createExperimentFormData = (expData: any): any => {\n const { experiment } = expData\n\n //get existing brands\n const brands = experiment.experimentBrandSet.map(\n (item: { brand: { id: string } }) => item.brand.id\n )\n \n //get existing discreteValues\n const discreteValues = experiment.experimentDiscreteSet.map(\n (item: { discreteValue: { id: string } }) => item.discreteValue.id\n )\n //get existing features\n // let features = experiment.discreteValues.map((item: {feature: {id: string}}) => item.feature.id);\n //split and format date and time\n const startDate = experiment.startDate\n ? moment(getDateValue(experiment.startDate), Format.dateFormat)\n : null\n const startTime = experiment.startDate\n ? moment(getTimeValue(experiment.startDate), Format.timeFormat)\n : null\n const endDate = experiment.endDate\n ? moment(getDateValue(experiment.endDate), Format.dateFormat)\n : null\n const endTime = experiment.endDate\n ? moment(getTimeValue(experiment.endDate), Format.timeFormat)\n : null\n //channels & mediums to upper case - to have it in sync with it's enums case\n const channels = experiment.channels.map((item: string) => item.toUpperCase())\n const mediums = experiment.mediums.map((item: string) => item.toUpperCase())\n\n const data = { ...experiment }\n // console.log(data)\n data.brands = brands\n data.discreteValues = discreteValues\n data.startDate = startDate\n data.startTime = startTime\n data.endDate = endDate\n data.endTime = endTime\n data.experiment_identifier = experiment.experimentIdentifier // eslint-disable-line\n data.channels = channels\n data.mediums = mediums\n data.manager = data.manager?.id\n return {\n experimentData: data,\n initialBrands: experiment.experimentBrandSet,\n initialFeatures: experiment.experimentDiscreteSet\n }\n}\n\nexport const accumulateFeatures = (experiment: any): any => {\n const customFeatureData = experiment.discreteValues.reduce(function(\n acc: any,\n obj: any\n ) {\n //find if the feature already exists in the accumulator\n const objIndex = acc.findIndex(\n (object: any) => object.featureId === obj.feature.id\n )\n if (objIndex === -1) {\n //create custom object\n const customFeature = {\n featureId: obj.feature.id,\n featureName: obj.feature.name,\n discreteValues: [obj.value]\n }\n acc.push(customFeature)\n } else {\n //replace featureNames in existing object\n acc[objIndex].discreteValues.push(obj.value)\n }\n return acc\n },\n [])\n return customFeatureData\n}\n\nexport const featuresAccumulator = (\n features: any,\n discreteValues: any\n): any => {\n //create a new array consisting the feature with just the selected discrete values.\n const customFeatureData = features.reduce(function(\n acc: Array,\n obj: AllFeaturesItem\n ) {\n if (\n obj.discreteValues.some(featureName =>\n discreteValues.includes(featureName.id)\n )\n ) {\n // filter the discreteValues data from feature(obj) that consist the featureName id\n const filterDiscreteValues: Array = obj.discreteValues.filter(\n featureItem => discreteValues.includes(featureItem.id)\n )\n\n //find if the feature already exists in the accumulator\n const objIndex = acc.findIndex(accItem => accItem.featureId === obj.id)\n if (objIndex === -1) {\n //create custom object\n const filteredFeature = {\n featureId: obj.id,\n featureName: obj.name,\n discreteValues: [...filterDiscreteValues]\n }\n acc.push(filteredFeature)\n } else {\n //replace featureNames in existing object\n acc[objIndex].discreteValues = filterDiscreteValues\n }\n }\n return acc\n },\n [])\n return customFeatureData\n}\n\nexport const accumulateFeatures2 = (expData: any, values: any): any => {\n return featuresAccumulator(expData.features, values.discreteValues)\n}\n\nexport const accumulateFeatures3 = (features: any[]): any => {\n return features.reduce((acc: any[], obj: any) => {\n const objIndex = acc.findIndex(\n (item: any) =>\n item.featureId === obj.discreteValue?.feature?.id || obj.feature?.id\n )\n\n if (objIndex >= 0) {\n acc[objIndex].discreteValues = [\n ...acc[objIndex].discreteValues,\n { id: obj.id, value: obj.discreteValue?.value || obj.value }\n ]\n } else {\n acc.push({\n featureId: obj.discreteValue?.feature?.id || obj.feature?.id,\n featureName: obj.discreteValue?.feature?.name || obj.feature?.name,\n discreteValues: [\n {\n id: obj.discreteValue?.id || obj.id,\n value: obj.discreteValue?.value || obj.value\n }\n ]\n })\n }\n return acc\n }, [])\n}\n","//This is the form for create experiment\n//The form \"Field\" component is from the resuable UI components - refer /Reusable_UI\n\nimport React, { useState, useEffect } from 'react'\nimport moment from 'moment'\n\n//form handler\nimport { Field } from 'formik'\n\n//styled components\nimport {\n Row,\n Col,\n Button,\n Form as AntForm,\n Popconfirm,\n Input,\n Tooltip,\n Switch\n} from 'antd'\n\n//functional components\nimport {\n AntDatePicker,\n AntTimePicker,\n AntTextarea\n} from '../Reusable_UI/Forms/FormFields'\nimport {\n ToggleListSelect,\n ToggleTreeSelect,\n ToggleSelect\n} from '../Reusable_UI/Forms/Toggle'\n\n//utilities\nimport { validateRequiredArray } from '../../Utilities/Validate'\nimport { GetFeaturesTree } from '../../Utilities/FeaturesTree'\nimport { numberWithCommas } from '../../Utilities/Format'\nimport { accumulateFeatures2 } from '../../Utilities/Experiment'\n\n//constants\nimport { Format } from '../../Constants/dateTime'\n\n//typescript\nimport { ExperimentProps } from '../../TypeScript_Types/ExperimentTypes'\nimport { FeatureTree, FeaturePreview } from '../../TypeScript_Types/Features'\n\n//ant d destructuring\nconst FormItem = AntForm.Item\n\nconst outputPara = {\n margin: '4px 0',\n border: '1px solid #d9d9d9',\n borderRadius: '4px',\n padding: '4px 11px',\n background: '#FFFFFF',\n lineHeight: '22px',\n height: '32px'\n}\n\n//JSX - React FC\nconst CreateEditExperimentForm = ({\n submitCount,\n values,\n buttonName,\n submitLoading,\n submitForm,\n expData,\n setFieldValue,\n nested = false,\n clickToEdit = false,\n totalImpressions,\n totalCost,\n owner = '',\n isChanged = false,\n isEdit = false,\n // initial data is set to true when it has been successfully fetched from API\n // and is ready for render\n initalDataReady,\n setInitialDataReady\n}: ExperimentProps): JSX.Element => {\n //local states\n const [featureTreeData, setFeatureTreeData]: [\n Array,\n any\n ] = useState([])\n const [selectedFeaturesPreview, setSelectedFeaturePreview]: [\n Array,\n any\n ] = useState([])\n const [channels, setChannels]: [Array, any] = useState([])\n const [mediums, setMediums]: [Array, any] = useState([])\n const [channelsUpdated, setChannelsUpdated] = useState(false)\n const [featureUpdated, setfeatureUpdate] = useState(false)\n const [brandUpdated, setBrandUpdate] = useState(false)\n const [brandNames, setBrandNames]: [Array, any] = useState([])\n const [editSection, setEditSection] = useState('')\n const [showSubmit, setShowSubmit] = useState(false)\n\n // create feature data\n useEffect(() => {\n if (expData && initalDataReady) {\n //features dropdown options\n const filteredFeatures = expData.features.filter(\n feature => !feature.archived\n )\n const featuresTree = GetFeaturesTree(filteredFeatures)\n setFeatureTreeData(featuresTree)\n\n //get channels & medium choice\n const channels = expData.channels.map(item => item.name)\n setChannels(channels)\n\n //set initialData to false\n if (initalDataReady) {\n setInitialDataReady(false)\n }\n }\n }, [expData, initalDataReady, setInitialDataReady])\n\n //BRANDS - filter selected brand details,\n useEffect(() => {\n if (\n expData &&\n ((values.brands.length > 0 && initalDataReady) || brandUpdated)\n ) {\n // data will in sorted order by id.\n const brandName = expData.brands\n .filter(item => values.brands.includes(item.id))\n .map(item => item.name)\n\n //reset brand operation flags\n setBrandNames(brandName)\n setBrandUpdate(false)\n\n if (initalDataReady) {\n setInitialDataReady(false)\n }\n }\n }, [values, expData, brandUpdated, initalDataReady, setInitialDataReady])\n\n //filter features\n useEffect(() => {\n //FEATURES - create an oject of selected discreteValues with features.\n //only if the values is not undefined and feature has been updated this block will run.\n if (\n expData &&\n ((values.discreteValues.length > 0 && initalDataReady) || featureUpdated)\n ) {\n const customFeatureData = accumulateFeatures2(expData, values)\n setSelectedFeaturePreview(customFeatureData)\n setfeatureUpdate(false)\n\n if (initalDataReady) {\n setInitialDataReady(false)\n }\n }\n }, [values, expData, featureUpdated, setInitialDataReady, initalDataReady])\n\n //update experiment name\n useEffect(() => {\n if (expData) {\n const experimentName = [\n values.startDate && moment(values.startDate).format('YYYY-MM'),\n values.brands.length > 3\n ? 'Multiple brands'\n : brandNames.toString().replace(/,/g, '-'),\n values.mediums\n .toString()\n .toLowerCase()\n .replace(/,/g, '-'),\n values.experiment_identifier\n ]\n .filter(Boolean)\n .join('_')\n setFieldValue('name', experimentName)\n }\n }, [values, expData, brandNames, setFieldValue])\n\n //update mediums - filters unique mediums from the channels\n //note - mediums and channels are being stored in all caps due to backend enums constraint\n useEffect(() => {\n if (\n expData &&\n // ((values.channels.length > 0 && !channelsUpdated) || channelsUpdated)\n ((values.channels.length > 0 && initalDataReady) || channelsUpdated)\n ) {\n const mediumObj = expData.channels.filter(channel =>\n values.channels.includes(channel.name.toUpperCase())\n )\n //grab mediums array and flatten\n const filteredMedium = mediumObj.map(objItem => objItem.mediums).flat()\n\n // array.from is a workaround due to typescript missing feature only supports iterables on Array.\n const uniqMedium = Array.from(new Set(filteredMedium))\n setMediums(uniqMedium)\n\n //check for medium changes and update only if channel is updated\n if (channelsUpdated) {\n const filteredValuesMedium = values.mediums.filter(item =>\n uniqMedium.includes(item)\n )\n //update \"mediums\" to remove the corresponding values of\n setFieldValue('mediums', filteredValuesMedium)\n }\n\n if (initalDataReady) {\n setInitialDataReady(false)\n }\n\n setChannelsUpdated(false)\n }\n }, [\n values,\n expData,\n setFieldValue,\n channelsUpdated,\n setInitialDataReady,\n initalDataReady\n ])\n\n //show submit button check\n useEffect(() => {\n setShowSubmit(() => (nested ? isChanged : true))\n }, [nested, isChanged])\n\n return (\n
\n {/* Experiment name */}\n {!nested && (\n \n \n \n )}\n\n {/* brands */}\n \n {({ field, form }: any) => (\n o.id}\n optionName={(o: any) => o.name}\n setFieldValue={(value: string) => {\n setFieldValue('brands', value)\n }}\n onElBlur={() => form.setFieldTouched(field.name, true)}\n onElChange={() => setBrandUpdate(true)}\n help={\n (values.brands.length === 0 && submitCount > 0) ||\n (form.touched.brands && values.brands.length === 0)\n ? 'Brands not selected.'\n : false\n }\n validateStatus={\n (values.brands.length === 0 && submitCount > 0) ||\n (form.touched.brands && values.brands.length === 0)\n ? 'error'\n : 'success'\n }\n optionFilterProp=\"title\"\n formField={field}\n />\n )}\n \n\n {/* Experiement identifier */}\n \n {({ field }: any) => (\n \n \n clickToEdit &&\n editSection !== 'expIdentifier' &&\n setEditSection('expIdentifier')\n }\n allowClear={clickToEdit ? editSection === 'expIdentifier' : true}\n onBlur={() =>\n clickToEdit &&\n editSection === 'expIdentifier' &&\n setEditSection('')\n }\n // suffix https://ant.design/components/input/#FAQ\n suffix={}\n />\n \n )}\n \n\n \n {/* Experiment manager */}\n \n \n {() => (\n user.id === values.manager\n )?.username || ''\n }\n selectValue={values.manager}\n fieldValue={(value: string) => value}\n options={expData?.dtxcloudUsers}\n optionValue={(o: { id: string }) => o.id}\n optionName={(o: { username: string }) => o.username}\n setValue={(value: any) => setFieldValue('manager', value)}\n />\n )}\n \n \n\n {/* owner */}\n {nested && (\n \n \n

{owner}

\n
\n \n )}\n\n \n {/* isCac */}\n \n setFieldValue('isCac', !values.isCac)}\n />\n \n \n
\n\n \n \n {/* start date */}\n \n !value ? 'Start date not selected' : undefined\n }\n />\n \n\n \n {/* start time */}\n \n \n\n \n {/* end date */}\n \n \n\n \n {/* end time */}\n \n \n \n {/* total impression and view only for View/Edit experiment */}\n {nested && (\n \n {/* total impression */}\n \n \n

\n {numberWithCommas(totalImpressions || 0)}\n

\n
\n \n\n {/* total cost */}\n \n \n

$ {totalCost}

\n
\n \n
\n )}\n\n \n \n {/* channel */}\n \n {({ field, form }: any) => (\n o.toUpperCase()}\n optionName={(o: string) => o}\n setFieldValue={(value: string) =>\n setFieldValue('channels', value)\n }\n onElBlur={() => form.setFieldTouched(field.name, true)}\n onElChange={() => setChannelsUpdated(true)}\n formField={field}\n />\n )}\n \n \n\n \n {/* medium */}\n \n {({ field, form }: any) => (\n o.toUpperCase()}\n optionName={(o: string) => o}\n setFieldValue={(value: string) =>\n setFieldValue('mediums', value)\n }\n onElBlur={() => form.setFieldTouched(field.name, true)}\n formField={field}\n help={\n (values.mediums.length === 0 && submitCount > 0) ||\n (form.touched.mediums && values.mediums.length === 0)\n ? 'Mediums not selected'\n : false\n }\n validateStatus={\n (values.mediums.length === 0 && submitCount > 0) ||\n (form.touched.mediums && values.mediums.length === 0)\n ? 'error'\n : 'success'\n }\n disableSelect={values && values.channels.length === 0}\n />\n )}\n \n \n \n\n {/* selected features panel */}\n \n \n validateRequiredArray(value, !!isEdit)}\n >\n {({ field, form }: any) => {\n return (\n \n setFieldValue('discreteValues', value)\n }\n onElChange={() => setfeatureUpdate(true)}\n help={\n (values.discreteValues.length === 0 && submitCount > 0) ||\n (form.touched.discreteValues &&\n values.discreteValues.length === 0)\n ? 'Feature names not selected'\n : false\n }\n validateStatus={\n (values.discreteValues.length === 0 && submitCount > 0) ||\n (form.touched.discreteValues &&\n values.discreteValues.length === 0)\n ? 'error'\n : 'success'\n }\n />\n )\n }}\n \n \n \n\n {/* submit button */}\n {showSubmit && (\n \n \n \n \n \n \n \n )}\n
\n )\n}\n\nexport default CreateEditExperimentForm\n","//container create experiment.\nimport React, { Fragment, useState, useEffect } from 'react'\nimport { Link } from 'react-router-dom'\nimport { Formik } from 'formik'\nimport moment from 'moment'\n\nimport { useQuery, useMutation } from '@apollo/react-hooks'\n\n//styled components\nimport { Alert, Breadcrumb } from 'antd'\n\n//constants\nimport { Format } from '../../../Constants/dateTime'\n\n//typescript types\nimport { ExperimentFormValues } from '../../../TypeScript_Types/ExperimentTypes'\n\n//graphql\nimport { GET_EXPERIMENT_OPTIONS } from '../../../Graqhql/Experiment/QueryExperiment'\nimport { CREATE_EXPERIMENT } from '../../../Graqhql/Experiment/MutationExperiment'\n\n//utilities\nimport ErrorBoundary from '../../../Utilities/ErrorBoundary'\n\n//functional components\nimport LayoutWrap from '../../../HOC/LayoutWrap'\nimport PageTitle from '../../../Components/Reusable_UI/Headers_Titles/PageTitles'\nimport CreateForm from '../../../Components/Experiment/Create_Edit_ExperimentForm'\nimport ErrorAlert from '../../../Components/Reusable_UI/Alerts/ErrorAlerts'\nimport { LoadingSpinner } from '../../../Components/Reusable_UI/Loaders_Spinners/LoadingSpinner'\n\n//const title of create experiment page\nconst PAGE_TITLE = 'Create Experiment'\n\n//const form fields initial state\nconst initialFieldValues: ExperimentFormValues = {\n name: '',\n brands: [],\n experiment_identifier: '', // eslint-disable-line\n startDate: null,\n startTime: null,\n endDate: null,\n endTime: null,\n channels: [],\n mediums: [],\n discreteValues: [],\n manager: '',\n isCac: false\n}\n\n//Breadcrumb nav\nconst CreateExperimentBreadcrumb = (): JSX.Element => {\n return (\n \n \n Features\n \n \n Brands\n \n \n Experiments\n \n Create experiment\n \n )\n}\n\n/// Create experiment\nconst CreateExperiement: React.FC = (props: {\n history: any\n location: any\n}) => {\n //local states\n const [expError, setExpError] = useState()\n const [createError, setCreateError] = useState()\n //this flag will indicate initial data load\n const [initalDataReady, setInitialDataReady] = useState(false)\n\n // get experiments options data from graphql\n const { data: expData, loading: expLoading } = useQuery(\n GET_EXPERIMENT_OPTIONS,\n {\n onError(error) {\n setExpError(error)\n }\n }\n )\n\n //const update initial data ready on fetching expData\n useEffect(() => {\n if (expData) {\n setInitialDataReady(true)\n }\n }, [expData])\n\n //mutation to create experiment\n const [createExperiment, { loading: createLoading }] = useMutation(\n CREATE_EXPERIMENT,\n {\n onCompleted({ createExperiment }) {\n props.history.push(`/${createExperiment.experiment.id}/view_experiment`)\n },\n onError(error) {\n setCreateError(error)\n }\n }\n )\n\n //submit create experiment request\n const handleSubmit = (values: ExperimentFormValues): void => {\n //convert dates to \"YYYY-MM-DD\" format and time to \"HH:MM\"\n let startDate\n let startTime\n let endDate\n let endTime\n let startDateTimeUTC = null\n let endDateTimeUTC = null\n\n //If start date is not null\n if (values.startDate) {\n startDate = moment(values.startDate).format(Format.convertUTCDateFormat)\n startTime = values.startTime\n ? moment(values.startTime).format(Format.timeFormat)\n : '00:00'\n //convert start date and time to UTC\n startDateTimeUTC = new Date(startDate + 'T' + startTime).toISOString()\n }\n\n //If end date is not null\n if (values.endDate) {\n endDate = moment(values.endDate).format(Format.convertUTCDateFormat)\n endTime = values.endTime\n ? moment(values.endTime).format(Format.timeFormat)\n : '00:00'\n //convert end date and time to UTC\n endDateTimeUTC = new Date(endDate + 'T' + endTime).toISOString()\n }\n\n {\n const input = {\n name: values.name,\n experiment_identifier: values.experiment_identifier, // eslint-disable-line\n channels: values.channels,\n brands: values.brands,\n mediums: values.mediums,\n startDate: startDateTimeUTC,\n endDate: endDateTimeUTC,\n manager: values.manager,\n isCac: values.isCac\n }\n const discreteValues = values.discreteValues\n //call create mutation\n createExperiment({\n variables: { input: input, discreteValues: discreteValues }\n })\n }\n }\n\n return (\n \n {/* bread crumb navigation */}\n \n\n {/* title of the page */}\n \n\n {/* reminder alert to create features & brands*/}\n \n \n \n\n {/* create experiment error */}\n {createError && (\n setCreateError(undefined)}\n />\n )}\n\n {/* loading experiment form data */}\n {expError ? (\n \n ) : (\n \n {// if the form options are load show spinner else render form.\n expLoading ? (\n \n ) : (\n \n {({ submitCount, values, submitForm, setFieldValue }) => (\n \n \n \n )}\n \n )}\n \n )}\n \n )\n}\n\nexport default CreateExperiement\n","import { TableColumns } from \"../../TypeScript_Types/TableColumns\";\n\n//this is the names of the columns in experiement list table\n\nexport const columnsNames: Readonly = [\n {\n title: 'Experiment Name',\n key: 'name'\n },\n {\n title: 'Date Create',\n key: 'timeStamp'\n },\n {\n title: '#Folder',\n key: 'numberFolders'\n },\n {\n title: '#Permutations',\n key: 'numberPermutations'\n },\n {\n title: 'Actions',\n key: 'actions'\n }\n]\n","//This coponent will display the table content of the experiment list\n\nimport React from 'react'\nimport { Link } from 'react-router-dom'\nimport InfiniteScroll from 'react-infinite-scroll-component'\n\n//styled components\nimport { Menu, Dropdown, Icon, Spin } from 'antd'\n\n//stylesheet\nimport '../Reusable_UI/Styles.less'\n\n//constants\nimport { columnsNames } from '../../Constants/Experiment/ExperimentListColumns'\n\n//typeScript\nimport { ExperimentTableProps } from '../../TypeScript_Types/ExperimentTypes'\n\n//functional component\nimport NoData from '../Reusable_UI/NoData/NoData'\n\n//ant Icon\nconst antIcon = \n\n//React FC\nconst ExperimenTable = ({\n experimentsData,\n loading,\n onLoadMore,\n hasNextPage,\n deleteId,\n handleDeleteExperiment,\n deleteLoading,\n history\n}: ExperimentTableProps) => {\n // pop up action menu\n const menu = (experimentId: string, name: string) => {\n return (\n \n \n Edit experiment\n \n handleDeleteExperiment(experimentId, name)}\n >\n Delete experiment\n \n \n )\n }\n\n return (\n
\n {/* this infinite scroll component will monitor scroll action and call loadMore function */}\n \n {' '}\n
\n }\n style={{ overflow: 'visible', overflowX: 'scroll' }}\n >\n \n \n \n {columnsNames.map((item: any) => (\n \n ))}\n \n \n\n {/* table list */}\n\n \n {experimentsData &&\n experimentsData.map((rowItems: any, rowIndex) => {\n return (\n \n history.push(`${rowItems.node.id}/view_experiment`)\n }\n >\n \n \n \n \n\n {/* actions - show loading spiiner if delete in progress else the menu */}\n {rowItems.node.id === deleteId && deleteLoading ? (\n \n ) : (\n // action menu\n \n )}\n \n )\n })}\n \n
{item.title}
{`${rowItems.node.name.substring(0, 60)}${\n rowItems.node.name.length > 60 ? '...' : ''\n }`}\n {new Date(rowItems.node.timeStamp).toLocaleString()}\n {rowItems.node.numberFolders}{rowItems.node.numberPermutations}\n \n e.stopPropagation()}>\n
\n {/* pop up more */}\n \n menu(rowItems.node.id, rowItems.node.name)\n }\n trigger={['click']}\n >\n \n More\n

\n \n
\n
\n\n {/* display no data icon */}\n {((experimentsData && experimentsData.length === 0) ||\n (!experimentsData && loading)) && }\n \n \n )\n}\n\nexport default ExperimenTable\n","//This is the parent container for showing the list of experiements in /experiments_list.\n//Async loading implementation\n\nimport React, { useState, Fragment, useEffect } from 'react'\nimport { Link } from 'react-router-dom'\nimport { useQuery, useMutation } from '@apollo/react-hooks'\n\n//styled component\nimport { Button, Tooltip, Modal } from 'antd'\n\n//graphql query\nimport { GET_EXPERIMENTS } from '../../Graqhql/Experiment/QueryExperiment'\nimport { DELETE_EXPERIMENT } from '../../Graqhql/Experiment/MutationExperiment'\n\n//functional components\nimport PageTitle from '../../Components/Reusable_UI/Headers_Titles/PageTitles'\nimport LayoutWrap from '../../HOC/LayoutWrap'\nimport ExperimenTable from '../../Components/ExperimentsList/ExperimentListTable'\nimport { SearchField } from '../../Components/Reusable_UI/Forms/SearchField'\nimport ErrorAlert from '../../Components/Reusable_UI/Alerts/ErrorAlerts'\n\n//ant design destructuring\nconst { confirm } = Modal\n\n//inline styles\nconst titleDiv = {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center'\n}\n\nconst searchAddDiv = {\n display: 'flex',\n justifyContent: 'space-between',\n flexBasis: '21%'\n}\n\n//const title of login page\nconst PAGE_TITLE = 'Experiment List'\n\n//JSX\nconst ExperiementList: React.FC = props => {\n //localStates\n const [fetchError, setFetchError] = useState(false)\n const [fetchErrorMsg, setFetchErrorMsg] = useState('')\n const [deleteId, setDeleteId] = useState()\n const [deleteError, setDeleteError] = useState()\n const [searchVal, setSearchVal] = useState('')\n\n const queryConfig = {\n onError(error: any) {\n setFetchError(true)\n setFetchErrorMsg(error.message)\n },\n variables: {}\n }\n\n if (searchVal) queryConfig.variables = { searchParam: searchVal }\n\n //get experiments data from graphql\n const { data, loading, fetchMore } = useQuery(GET_EXPERIMENTS, queryConfig)\n\n //local state\n const [experimentsData, setExperimentsData] = useState([])\n\n //update the local state, this will be used in search function.\n\n useEffect(() => {\n if (data) {\n setExperimentsData(data.experiments?.edges)\n }\n }, [data])\n\n const handleSearch = (value: string) => setSearchVal(value)\n\n //this will be used in updated and fetch more query functions, infinite scroll\n const experiment = data ? data.experiments : null\n\n //delete experiment mutation\n const [deleteExperiment, { loading: deleteLoading }] = useMutation(\n DELETE_EXPERIMENT,\n {\n onCompleted() {\n setDeleteId(null)\n },\n onError(error) {\n setDeleteError(error)\n },\n refetchQueries: [{ query: GET_EXPERIMENTS }]\n }\n )\n\n const handleDeleteExperiment = (id: string, name: string) => {\n setDeleteError(null)\n setDeleteId(id)\n\n {\n let decodedId = window.atob(id).split(':')[1]\n confirm({\n title: 'Delete experiment',\n content: `Are you sure you want to delete ${name.substring(\n 0,\n 60\n )}... ?`,\n okText: 'Yes',\n okType: 'danger',\n cancelText: 'No',\n onOk() {\n deleteExperiment({ variables: { id: decodedId } })\n }\n })\n }\n }\n\n // close delete error popup\n const onCloseDeleteError = () => {\n setDeleteError(null)\n setDeleteId(null)\n }\n\n return (\n \n {/* title and search bar div */}\n
\n \n\n
\n \n\n {/* create experiment button */}\n \n \n
\n
\n\n {/* if error display error message alert else render table */}\n {fetchError ? (\n \n ) : (\n \n {/* display error if delete action failed */}\n {deleteError && (\n \n )}\n\n {/* experiment table */}\n \n fetchMore({\n variables: {\n after: experiment && experiment.pageInfo.endCursor\n },\n\n updateQuery: (previousResult, { fetchMoreResult }: any) => {\n const newEdges = fetchMoreResult.experiments.edges\n const pageInfo = fetchMoreResult.experiments.pageInfo\n return newEdges.length\n ? {\n // Put the new experiments data at the end of the list and update `pageInfo`\n // so that we have a new `endCursor` and `hasNextPage` values\n experiments: {\n __typename: previousResult.experiments.__typename,\n edges: [\n ...previousResult.experiments.edges,\n ...newEdges\n ],\n pageInfo\n }\n }\n : previousResult\n }\n }).catch(error => {\n // fetch more error handling\n setFetchErrorMsg(error.message)\n setFetchError(true)\n })\n }\n />\n \n )}\n
\n )\n}\n\nexport default ExperiementList\n","//Container- Edit experiment\n\nimport React, { Fragment, useState, useEffect } from 'react'\nimport { Link } from 'react-router-dom'\nimport { Formik } from 'formik'\nimport {\n submitEditExperiment,\n createExperimentFormData\n} from '../../../Utilities/Experiment'\n\n//apollo hooks\nimport { useQuery, useMutation } from '@apollo/react-hooks'\n\n//ant d styled components\nimport { Breadcrumb } from 'antd'\n\n//graphql\nimport { GET_EDIT_EXPERIMENT } from '../../../Graqhql/Experiment/QueryExperiment'\nimport { UPDATE_EXPERIMENT } from '../../../Graqhql/Experiment/MutationExperiment'\n\n//typeScript\nimport { ExperimentFormValues } from '../../../TypeScript_Types/ExperimentTypes'\n\n//utilities\nimport ErrorBoundary from '../../../Utilities/ErrorBoundary'\n\n//functional components\nimport LayoutWrap from '../../../HOC/LayoutWrap'\nimport PageTitle from '../../../Components/Reusable_UI/Headers_Titles/PageTitles'\nimport EditExperimentForm from '../../../Components/Experiment/Create_Edit_ExperimentForm'\nimport ErrorAlert from '../../../Components/Reusable_UI/Alerts/ErrorAlerts'\nimport { LoadingSpinner } from '../../../Components/Reusable_UI/Loaders_Spinners/LoadingSpinner'\n\n//const title of edit experiment page\nconst PAGE_TITLE = 'Edit Experiment'\n\n//const form fields initial state\nconst initialFieldValues: ExperimentFormValues = {\n name: '',\n brands: [],\n experiment_identifier: '', // eslint-disable-line\n startDate: null,\n startTime: null,\n endDate: null,\n endTime: null,\n channels: [],\n mediums: [],\n discreteValues: [],\n manager: '',\n isCac: false\n}\n\n// TODO: create props interface\n\n/* eslint-disable react/prop-types */\n\n//React FC\nconst EditExperiement: React.FC = props => {\n //experiment form data state\n const [experimentData, setExperimentData] = useState(initialFieldValues)\n const [updateError, setUpdateError] = useState()\n const [initialBrands, setInitialBrands] = useState()\n const [initialFeatures, setInitialFeatures] = useState()\n const [expError, setExpError] = useState()\n //this flag will indicate initial data load\n const [initalDataReady, setInitialDataReady] = useState(false)\n\n //extract experiment id\n const experimentId = props.match.params.id\n const decodedExperimentId = window.atob(experimentId).split(':')[1]\n\n //get the experiment details\n const { data: expData, loading: expLoading } = useQuery(GET_EDIT_EXPERIMENT, {\n variables: { id: decodedExperimentId },\n onError(error) {\n setExpError(error)\n }\n })\n\n //create the initial form data\n useEffect(() => {\n if (expData) {\n const {\n experimentData,\n initialBrands,\n initialFeatures\n } = createExperimentFormData(expData)\n setExperimentData(experimentData)\n setInitialBrands(initialBrands)\n setInitialFeatures(initialFeatures)\n }\n }, [expData])\n\n // When the experiment data has updated successfully, change the inital data ready to true\n useEffect(() => {\n setInitialDataReady(true)\n }, [experimentData, expData])\n\n //submit mutation\n const [updateExperiment, { loading: updateLoading }] = useMutation(\n UPDATE_EXPERIMENT,\n {\n onCompleted() {\n props.history.push(`/${experimentId}/view_experiment`)\n },\n onError(error) {\n setUpdateError(error)\n }\n }\n )\n\n const handleSubmit = (values: ExperimentFormValues): void => {\n submitEditExperiment(\n values,\n initialBrands,\n initialFeatures,\n updateExperiment,\n decodedExperimentId\n )\n }\n\n //breadcrumb navigation menu\n const EditExperimentBreadcrumb = (\n \n \n View experiment\n \n Edit experiment\n \n )\n\n return (\n \n {/* breadcrumb navigation menu */}\n {EditExperimentBreadcrumb}\n\n {/* page title */}\n \n\n {/* error during update */}\n {updateError && (\n setUpdateError(undefined)}\n close={true}\n />\n )}\n\n {/* if error during loading experiment data */}\n {expError ? (\n \n ) : (\n \n {expLoading ? (\n \n ) : (\n \n {({ submitCount, values, submitForm, setFieldValue }) => (\n \n \n \n )}\n \n )}\n \n )}\n \n )\n}\n\nexport default EditExperiement\n","// This is the context to handle interaction & states between the container/component buttons and modal of Folder module.\n// Create modal is used by the table component and the 'Create' component to manage the modal state.\n\nimport React, { createContext, useState, useEffect } from 'react'\n\n//create context\nexport const CreateFolderModalCTX: any = createContext({})\n\nconst CreateFolderModalProvider: React.FC = props => {\n const [createFolderSuccess, setCreateFolderSuccess] = useState(false)\n const [createFolderError, setCreateFolderError] = useState(false)\n const [createFolderErrorMsg, setCreateFolderErrorMsg] = useState('')\n //show or hide state of modal\n const [createFolderFormModal, setViewFolderFormModal] = useState(false)\n\n // mount timer and unmount cleanup - set timer for 2secs and remove timer when the component is unmounted\n useEffect(() => {\n const timeout = setTimeout(() => {\n if (createFolderSuccess) {\n setCreateFolderSuccess(false)\n }\n }, 2000)\n\n return () => {\n // clear timeout\n return clearTimeout(timeout)\n }\n }, [createFolderSuccess])\n\n const handleVisible = () => {\n if (createFolderFormModal) {\n setCreateFolderError(false)\n setCreateFolderErrorMsg('')\n }\n setViewFolderFormModal(prevState => !prevState)\n }\n return (\n \n {props.children}\n \n )\n}\n\nexport default CreateFolderModalProvider\n","// This is the context to handle interaction & states between the container/component buttons and modal of Folder module.\n// EditFolder modal is used by the table component and the 'EditFolder' component to manage the modal state.\n\nimport React, { createContext, useState, useEffect } from 'react'\n\n//create context\nexport const EditFolderModalCTX: any = createContext({})\n\nconst EditFolderModalProvider: React.FC = props => {\n const [editFolderSuccess, setEditFolderSuccess] = useState(false)\n const [editFolderError, setEditFolderError] = useState(false)\n const [editFolderErrorMsg, setEditFolderErrorMsg] = useState('')\n //show or hide state of modal\n const [editFolderFormModal, setEditFolderFormModal] = useState(false)\n\n // mount timer and unmount cleanup - set timer for 2secs and remove timer when the component is unmounted\n useEffect(() => {\n const timeout = setTimeout(() => {\n if (editFolderSuccess) {\n setEditFolderSuccess(false)\n }\n }, 2000)\n\n return () => {\n // clear timeout\n return clearTimeout(timeout)\n }\n }, [editFolderSuccess])\n\n const handleVisible = () => {\n if (editFolderFormModal) {\n setEditFolderError(false)\n setEditFolderErrorMsg('')\n }\n setEditFolderFormModal(prevState => !prevState)\n }\n return (\n \n {props.children}\n \n )\n}\n\nexport default EditFolderModalProvider\n","//This is the context to handle the modal interaction & states between a container/component buttons and modal.\n//Create modal is used by table/list component and a \"create\" modal component.\n\n//note - context cannot be used in two or more differnt components from the same form/page\n\nimport React, { createContext, useState, useEffect } from 'react'\n\n//create context\nexport const DownloadModalContext: React.Context = createContext({})\n\ninterface Props {\n children: React.ReactNode\n}\n\nconst DownloadModalProvider: React.FC = (props: Props) => {\n const [downloadSuccess, setDownloadSuccess] = useState(false)\n const [downloadError, setDownloadError] = useState(false)\n const [downloadErrorMsg, setDownloadErrorMsg] = useState('')\n const [viewDownloadFormModal, setDownloadViewFormModal] = useState(false)\n\n // mount timer and unmount cleanup - set timer for 2secs and remove timer when the component is unmounted\n useEffect(() => {\n const timeout = setTimeout(() => {\n if (downloadSuccess) {\n setDownloadSuccess(false)\n }\n }, 2000)\n\n return (): void => {\n return clearTimeout(timeout)\n }\n }, [downloadSuccess])\n\n const handleVisible = (): void => {\n if (viewDownloadFormModal) {\n setDownloadError(false)\n setDownloadErrorMsg('')\n }\n setDownloadViewFormModal(prevState => !prevState)\n }\n return (\n \n {props.children}\n \n )\n}\n\nexport default DownloadModalProvider\n","import React, { useState, Fragment, useEffect } from 'react'\nimport { useMutation } from '@apollo/react-hooks'\nimport _ from 'lodash'\nimport { Formik } from 'formik'\n\n//styled components\nimport { Row, Col, Form as AntForm, Icon, Tooltip } from 'antd'\n\nimport {\n submitEditExperiment,\n createExperimentFormData\n} from '../../../Utilities/Experiment'\nimport { UPDATE_EXPERIMENT } from '../../../Graqhql/Experiment/MutationExperiment'\nimport { GET_EDIT_EXPERIMENT } from '../../../Graqhql/Experiment/QueryExperiment'\n//typescript\nimport {\n ExperimentFormValues,\n EditExperiment,\n DtxcloudUsers\n} from '../../../TypeScript_Types/ExperimentTypes'\nimport ErrorAlert from '../../Reusable_UI/Alerts/ErrorAlerts'\nimport { AllBrands } from '../../../TypeScript_Types/Brands'\nimport { AllChannels } from '../../../TypeScript_Types/Channels'\nimport { AllFeatures } from '../../../TypeScript_Types/Features'\n\n//utilities\nimport ErrorBoundary from '../../../Utilities/ErrorBoundary'\n\n//functional components\nimport ExperimentForm from '../Create_Edit_ExperimentForm'\n\n// ant design component destructuring\nconst FormItem = AntForm.Item\n\n//typescript\ninterface Props {\n selectOptions: AllBrands & AllChannels & AllFeatures & DtxcloudUsers\n experiment: EditExperiment\n expDecodedId: string\n}\n\n//form initial values\nconst initialFieldValues: ExperimentFormValues = {\n name: '',\n brands: [],\n experiment_identifier: '', // eslint-disable-line\n startDate: null,\n startTime: null,\n endDate: null,\n endTime: null,\n channels: [],\n mediums: [],\n discreteValues: [],\n manager: '',\n isCac: false\n}\n\n//inline styles - toggle icon to show and hide experiement details\nconst toogleIconDiv = {\n display: 'flex',\n alignItems: 'center',\n height: 115\n}\n\nconst toggleIcon = { fontSize: '22px' }\n\n//p tags\nconst outputPara = {\n margin: 0,\n border: '1px solid #d9d9d9',\n borderRadius: '4px',\n padding: '4px 11px',\n background: '#FFFFFF',\n lineHeight: '25px',\n minHeight: '35px'\n}\n\n//array listing divs\nconst ViewExperimentDetails = ({\n experiment,\n selectOptions,\n expDecodedId\n}: Props): JSX.Element => {\n //local state\n const [experimentData, setExperimentData] = useState(initialFieldValues)\n const [showForm, setShowForm] = useState(true)\n const [updateError, setUpdateError] = useState()\n const [initialBrands, setInitialBrands] = useState()\n const [initialFeatures, setInitialFeatures] = useState()\n const [expName, setExpName] = useState('')\n //this flag will indicate the experiment data is ready\n const [initalDataReady, setInitialDataReady] = useState(false)\n\n //create the initial form data\n useEffect(() => {\n if (experiment) {\n const {\n experimentData,\n initialBrands,\n initialFeatures\n } = createExperimentFormData({ experiment: { ...experiment } })\n\n setExperimentData(experimentData)\n setInitialBrands(initialBrands)\n setInitialFeatures(initialFeatures)\n setExpName(experimentData.name)\n }\n }, [experiment, initalDataReady])\n\n // When the experiment data has updated successfully, change the inital data ready to true\n useEffect(() => {\n setInitialDataReady(true)\n }, [experimentData, showForm])\n\n //This function will show/hide form details excluding form name\n const showHideFormToggle = (): void => {\n setShowForm(prevState => !prevState)\n }\n\n //Query to update the experiment\n const [updateExperiment, { loading: updateLoading }] = useMutation(\n UPDATE_EXPERIMENT,\n {\n onCompleted() {\n setUpdateError(null)\n },\n onError(error) {\n setUpdateError(error)\n },\n refetchQueries: [\n {\n query: GET_EDIT_EXPERIMENT,\n variables: { id: expDecodedId }\n }\n ]\n }\n )\n\n //on update submit\n const handleSubmit = (values: ExperimentFormValues): void => {\n submitEditExperiment(\n values,\n initialBrands,\n initialFeatures,\n updateExperiment,\n expDecodedId\n )\n }\n\n return (\n \n {/* display error if received while updating experiment */}\n {updateError && (\n setUpdateError(undefined)}\n />\n )}\n\n {/* experiment details */}\n \n {/* experiment name */}\n \n \n \n \n \n \n\n \n \n

{expName}

\n
\n \n
\n\n {/* toggle to expand or collapse form details */}\n {showForm && (\n \n {({ submitCount, values, submitForm, setFieldValue }) => {\n if (values.name !== expName) setExpName(values.name)\n const isChanged = !_.isEqual(values, experimentData)\n return (\n \n \n \n )\n }}\n \n )}\n
\n
\n )\n}\n\nexport default ViewExperimentDetails\n","//Query - folders\n\nimport gql from 'graphql-tag'\n\n//get folders by experiment ID\nexport const GET_FOLDERS = gql`\n query($experimentId: UUID) {\n folders(experimentId: $experimentId) {\n id\n name\n description\n permutationCount\n }\n }\n`\n\n//get folder by folder id\n\nexport const GET_FOLDER = gql`\n query($id: UUID) {\n folder(id: $id) {\n id\n name\n description\n }\n }\n`\n","// mutation - folder\n\nimport gql from 'graphql-tag'\n\n//create folder\nexport const CREATE_FOLDER = gql`\n mutation($experimentId: UUID, $input: FolderInputType) {\n createFolder(experimentId: $experimentId, input: $input) {\n ok\n }\n }\n`\n\n//edit folder\nexport const EDIT_FOLDER = gql`\n mutation($id: UUID!, $input: FolderInputType) {\n updateFolder(id: $id, input: $input) {\n ok\n }\n }\n`\n\n//delete folder\nexport const DELETE_FOLDER = gql`\n mutation($id: UUID!) {\n deleteFolder(id: $id) {\n ok\n }\n }\n`\n","//Create or edit folder form component\n\nimport React from 'react'\n\n//form handler\nimport { Form, Field } from 'formik'\n\n//functional components\nimport { AntInput, AntTextarea } from '../Reusable_UI/Forms/FormFields'\n//utilities\nimport { validateRequired } from '../../Utilities/Validate'\n\n//typeScript\ninterface Props {\n submitCount: number\n}\n\nconst CreateFolderForm = ({ submitCount }: Props) => {\n return (\n
\n {/* folder name */}\n \n\n {/* folder description */}\n \n \n )\n}\n\nexport default CreateFolderForm\n","//Container - create folder\n\nimport React, { useRef, useEffect, Fragment, useContext } from 'react'\nimport { Formik } from 'formik'\nimport { useMutation } from '@apollo/react-hooks'\n\n//context\nimport { CreateFolderModalCTX } from '../../Contexts/CreateFolderModalContext'\n\n//graphql\nimport { CREATE_FOLDER } from '../../Graqhql/Folders/FolderMutations'\nimport { GET_FOLDERS } from '../../Graqhql/Folders/FoldersQuery'\n\n//typescript\nimport { FoldersFormValues } from '../../TypeScript_Types/Folders'\n\n//utilities\nimport ErrorBoundary from '../../Utilities/ErrorBoundary'\n\n//functional component\nimport ModalWrap from '../../Components/Reusable_UI/Modal/ModalFormWrap'\nimport CreateFolderForm from '../../Components/Folders/Create_Edit_FoldersForm'\nimport ErrorAlert from '../../Components/Reusable_UI/Alerts/ErrorAlerts'\n\n//type props\ninterface Props {\n experimentId: string\n}\n\n//intial form values\nconst initialFieldValues: FoldersFormValues = {\n name: '',\n description: ''\n}\n\n//const modal buttons\nconst buttons = [\n {\n buttonName: 'Create',\n key: 'create'\n }\n]\n\nconst CreateFolder: React.FC = ({ experimentId }) => {\n //context\n const {\n createFolderFormModal,\n handleVisible,\n setCreateFolderSuccess,\n createFolderError,\n setCreateFolderError,\n createFolderErrorMsg,\n setCreateFolderErrorMsg\n } = useContext(CreateFolderModalCTX)\n\n //ref to call reset form\n const resetRef: any = useRef(null)\n\n //resetForm when there is changed in the view state of the modal,\n //do not move the reference click to handleVisible function, it will change the animation direction of the modal\n useEffect(() => {\n resetRef.current && resetRef.current.click()\n }, [createFolderFormModal])\n\n //create brand graphql mutation\n const [createBrand, { loading }] = useMutation(CREATE_FOLDER, {\n onCompleted() {\n //on success set the sucess state to true and close the modal\n setCreateFolderSuccess(true)\n handleVisible()\n },\n onError(error: any) {\n setCreateFolderError(true)\n setCreateFolderErrorMsg(error.message)\n },\n refetchQueries: [\n { query: GET_FOLDERS, variables: { experimentId: experimentId } }\n ]\n })\n\n //handle submit\n const handleSubmit = (values: FoldersFormValues) => {\n createBrand({ variables: { input: values, experimentId: experimentId } })\n }\n\n return (\n \n {/* form */}\n\n \n {({ submitCount, submitForm, handleReset }) => (\n \n {/* error alert */}\n {createFolderError && (\n {\n setCreateFolderError(false)\n setCreateFolderErrorMsg('')\n }}\n />\n )}\n \n \n \n\n {/* reset form div ref */}\n
\n \n )}\n \n \n )\n}\n\nexport default CreateFolder\n","import { TableColumns } from \"../../TypeScript_Types/TableColumns\";\n\n//this is the names of the columns in folders list table\n\nexport const columnsNames: Readonly = [\n {\n title: 'Folder Name',\n key: 'name'\n },\n {\n title: 'Description',\n key: 'description'\n },\n {\n title: '# Permutations',\n key: 'permutationCount'\n },\n {\n title: 'Actions',\n key: 'actions'\n }\n]\n","//This coponent will display the table content of the Folders\n\nimport React, { useContext } from 'react'\n\n//styled components\nimport { Menu, Dropdown, Icon } from 'antd'\n\n//stylesheet\nimport '../Reusable_UI/Styles.less'\n\n//constants\nimport { columnsNames } from '../../Constants/Folders/FoldersList'\n\n//context\nimport { EditFolderModalCTX } from '../../Contexts/EditFolderModalContext'\n\n//functional component\nimport NoData from '../Reusable_UI/NoData/NoData'\n\n//typescript\ninterface Props {\n folderListData: {\n folders: Array\n }\n listLoading: boolean\n setEditFolderId: React.Dispatch>\n deleteFolderId: string\n handleDeleteFolder: (id: string, name: string) => void\n deleteLoading: boolean\n}\n\n//JSX\nconst FoldersListTable = ({\n folderListData,\n setEditFolderId,\n listLoading,\n deleteFolderId,\n deleteLoading,\n handleDeleteFolder\n}: Props) => {\n //context\n const { handleVisible } = useContext(EditFolderModalCTX)\n\n // pop up action menu\n const menu = (rowItems: { id: string; name: string }) => {\n return (\n \n {\n setEditFolderId(rowItems.id)\n handleVisible()\n }}\n >\n Edit folder\n \n {\n handleDeleteFolder(rowItems.id, rowItems.name)\n }}\n >\n Delete folder\n \n \n )\n }\n\n return (\n
\n \n \n \n {columnsNames.map((item: any) => (\n \n ))}\n \n \n\n {/* table list */}\n\n \n {folderListData &&\n folderListData.folders.map((rowItems: any, rowIndex) => {\n return (\n \n \n \n \n \n \n )\n })}\n \n
{item.title}
{rowItems.name}{rowItems.description}{rowItems.permutationCount}\n {rowItems.id === deleteFolderId && deleteLoading ? (\n \n ) : (\n menu(rowItems)}\n trigger={['click']}\n >\n \n \n )}\n
\n\n {/* show loader or no data */}\n {(!folderListData && listLoading) ||\n (folderListData && folderListData.folders.length === 0) ? (\n \n ) : null}\n
\n )\n}\n\nexport default FoldersListTable\n","//Container - edit folder\nimport React, { Fragment, useContext, useRef, useEffect, useState } from 'react'\nimport { Formik } from 'formik'\nimport { useMutation, useQuery } from '@apollo/react-hooks'\n\n//graphql\nimport { EDIT_FOLDER } from '../../Graqhql/Folders/FolderMutations'\nimport { GET_FOLDER, GET_FOLDERS } from '../../Graqhql/Folders/FoldersQuery'\n\n//context\nimport { EditFolderModalCTX } from '../../Contexts/EditFolderModalContext'\n\n//typescript\nimport { FoldersFormValues } from '../../TypeScript_Types/Folders'\n\n//utilities\nimport ErrorBoundary from '../../Utilities/ErrorBoundary'\n\n//functional components\nimport EditFolderForm from '../../Components/Folders/Create_Edit_FoldersForm'\nimport ModalWrap from '../../Components/Reusable_UI/Modal/ModalFormWrap'\nimport ErrorAlert from '../../Components/Reusable_UI/Alerts/ErrorAlerts'\nimport { LoadingSpinner } from '../../Components/Reusable_UI/Loaders_Spinners/LoadingSpinner'\nimport SuccessAlert from '../../Components/Reusable_UI/Alerts/SuccessAlerts'\n\n//typescript\ninterface Props {\n editFolderId: string\n experimentId: string\n}\n\n//const modal buttons\nconst buttons = [\n {\n buttonName: 'Edit',\n key: 'edit'\n }\n]\n\n//JSX\nconst EditFolder: React.FC = ({ editFolderId, experimentId }) => {\n //localStates\n const [getFolderError, setGetFolderError] = useState()\n\n const { data: getFolder, loading: getFolderLoading } = useQuery(GET_FOLDER, {\n variables: { id: editFolderId },\n onError(error) {\n setGetFolderError(error)\n }\n })\n\n //context\n const {\n editFolderFormModal,\n handleVisible,\n editFolderSuccess,\n setEditFolderSuccess,\n editFolderError,\n setEditFolderError,\n editFolderErrorMsg,\n setEditFolderErrorMsg\n } = useContext(EditFolderModalCTX)\n\n //ref\n const resetRef: any = useRef(null)\n\n //useEffect - resetForm do not move calling ref to handleVisible function it will change the transform origin of the modal\n useEffect(() => {\n resetRef.current && resetRef.current.click()\n // reset get folder error\n setGetFolderError(null)\n }, [editFolderFormModal])\n\n //graphql mutation\n const [editFolder, { loading: editLoading }] = useMutation(EDIT_FOLDER, {\n onCompleted() {\n setEditFolderSuccess(true)\n handleVisible()\n },\n onError(error) {\n setEditFolderErrorMsg(error.message)\n setEditFolderError(true)\n },\n refetchQueries: [\n { query: GET_FOLDERS, variables: { experimentId: experimentId } }\n ]\n })\n\n //call mutation and submit form\n const handleSubmit = (values: FoldersFormValues) => {\n //mutation input arg\n let input = {\n name: values.name,\n description: values.description\n }\n //mutation id arg\n let id = editFolderId\n editFolder({ variables: { id, input } })\n }\n\n return (\n \n {/* success alert */}\n {editFolderSuccess ? (\n \n ) : null}\n\n {/* create experiment button */}\n \n {({ submitCount, submitForm, handleReset }) => (\n \n {/* error alert mutation request, NOTE - success is handled in the parent component */}\n {editFolderError && (\n {\n setEditFolderError(false)\n setEditFolderErrorMsg('')\n }}\n />\n )}\n\n {/* get folder details error */}\n {getFolderError ? (\n \n ) : (\n \n {/* display css loader while the folder details are getting downloaded, add edit data data */}\n {getFolderLoading ? (\n \n ) : (\n \n \n \n )}\n \n )}\n {/* reset form div red */}\n
\n \n )}\n \n \n )\n}\n\nexport default EditFolder\n","//This container will fetch the folders\n\n//NOTE- temporarily get all folders query is used, when fetch by experiment id is available, replace.\n\nimport React, { useState, useContext, Fragment } from 'react'\nimport { useQuery, useMutation } from '@apollo/react-hooks'\n\n//ant d\nimport { Tooltip, Button, Modal } from 'antd'\n\n//graphql query\nimport { GET_FOLDERS } from '../../Graqhql/Folders/FoldersQuery'\nimport { DELETE_FOLDER } from '../../Graqhql/Folders/FolderMutations'\n\n//context\nimport { CreateFolderModalCTX } from '../../Contexts/CreateFolderModalContext'\nimport { EditFolderModalCTX } from '../../Contexts/EditFolderModalContext'\n\n//utilities\nimport ErrorBoundary from '../../Utilities/ErrorBoundary'\n\n//functional components\nimport SuccessAlert from '../../Components/Reusable_UI/Alerts/SuccessAlerts'\nimport CreateFolder from '../Folders/CreateFolder'\nimport FoldersListTable from '../../Components/FoldersList/FoldersListTable'\nimport EditFolder from './EditFolder'\nimport ErrorAlert from '../../Components/Reusable_UI/Alerts/ErrorAlerts'\n\n//ant design destructuring\nconst { confirm } = Modal\n\n//types\ninterface Props {\n experimentId: string\n}\n\n//JSX\nconst FolderList: React.FC = ({ experimentId }) => {\n //context\n const {\n createFolderSuccess,\n handleVisible,\n createFolderFormModal\n } = useContext(CreateFolderModalCTX)\n const { editFolderFormModal, editFolderSuccess } = useContext(\n EditFolderModalCTX\n )\n\n //local states\n const [foldersListError, setFoldersListError] = useState()\n const [editFolderId, setEditFolderId] = useState()\n const [deleteFolderId, setDeleteFolderId] = useState()\n const [deleteFolderError, setDeleteFolderError] = useState()\n\n //get experiments data from graphql\n const { data: folderListData, loading: listLoading } = useQuery(GET_FOLDERS, {\n variables: { experimentId: experimentId },\n onError(error) {\n setFoldersListError(error)\n }\n })\n\n //delete folder mutation\n const [deleteFolder, { loading: deleteLoading }] = useMutation(\n DELETE_FOLDER,\n {\n onCompleted() {\n setDeleteFolderId(null)\n },\n onError(error) {\n setDeleteFolderError(error)\n },\n refetchQueries: [\n { query: GET_FOLDERS, variables: { experimentId: experimentId } }\n ]\n }\n )\n\n // delete dolder\n const handleDeleteFolder = (id: string, name: string) => {\n setDeleteFolderError(null)\n setDeleteFolderId(id)\n\n confirm({\n title: 'Delete folder',\n content: `Are you sure you want to delete ${name}?`,\n okText: 'Yes',\n okType: 'danger',\n cancelText: 'No',\n onOk() {\n deleteFolder({ variables: { id: id } })\n }\n })\n }\n\n //on close delete error alert\n const onCloseDeleteError = () => {\n setDeleteFolderError(null)\n setDeleteFolderId(null)\n }\n\n return (\n
\n {/* display folder action outcomes */}\n {createFolderSuccess || editFolderSuccess ? (\n \n ) : null}\n\n
\n \n \n \n
\n {/* create folder button, wrapped with context*/}\n {createFolderFormModal && }\n\n {/* display error received while fetching the table data */}\n {foldersListError ? (\n \n ) : (\n \n {/* delete folder error */}\n {deleteFolderError && (\n \n )}\n\n {/* created folders table listing */}\n \n \n \n\n {/* edit folder pop up */}\n {editFolderFormModal && (\n \n )}\n \n )}\n
\n )\n}\n\nexport default FolderList\n","//base instance for axios\n\n//apollo client can make REST calls bt client cannot be configured to separate URLs, hence axios.\n\nimport axios from 'axios'\n//utilities\nimport { EnvironmentURL } from './EnvironmentURL'\n\n//Note - Also check ApolloSetup.tsx if any changes\nlet endpoint = EnvironmentURL()\n\nconst instance: any = axios.create({\n //comment the below code for dev proxy\n baseURL: endpoint\n\n})\n\ninstance.CancelToken = axios.CancelToken\ninstance.isCancel = axios.isCancel\n\nexport default instance\n","//based on the environment development or production set the URL\n//used in ApolloSetup.tsx & RESTSetup.tsx\n\nexport const EnvironmentURL = (): string => {\n let baseUrl = 'http://localhost:8000'\n if (process.env.REACT_APP_ENV === 'production') {\n baseUrl = 'https://mc-api.dtxcloud.com'\n } else if (process.env.REACT_APP_ENV === 'staging') {\n baseUrl = 'https://stg-api.dtxcloud.com'\n }\n return baseUrl\n}\n\n//note - for graphql '/graphql' will be appeneded in the ApolloSetup.\n// - for REST '/v1' will be appeneded in the individual axios call.\n","// mutations - permutation\n\nimport gql from 'graphql-tag'\n\n//create permutation\nexport const CREATE_PERMUTATION = gql`\n mutation(\n $attributes: [UUID]\n $experimentId: UUID!\n $folder: UUID\n $input: PermutationInputType\n $variables: [UUID!]\n $brands: [UUID]\n ) {\n createPermutation(\n attributes: $attributes\n experimentId: $experimentId\n folder: $folder\n input: $input\n brands: $brands\n variables: $variables\n ) {\n ok\n }\n }\n`\n\n//edit permutation\nexport const EDIT_PERMUTATION = gql`\n mutation(\n $addAttribute: [UUID]\n $addBrands: [UUID]\n $addVariable: [UUID]\n $deleteAttribute: [UUID]\n $deleteBrands: [UUID]\n $deleteVariable: [UUID]\n $folder: UUID\n $id: UUID!\n $input: PermutationInputType\n ) {\n updatePermutation(\n id: $id\n folder: $folder\n input: $input\n addVariable: $addVariable\n deleteVariable: $deleteVariable\n addBrands: $addBrands\n deleteBrands: $deleteBrands\n addAttribute: $addAttribute\n deleteAttribute: $deleteAttribute\n ) {\n ok\n }\n }\n`\n\n//delete permutation\nexport const DELETE_PERMUTATION = gql`\n mutation($id: UUID!) {\n deletePermutation(id: $id) {\n ok\n }\n }\n`\n","// queries - permutation\n\n//Note - do not remove \"id\" from queries even if not used by any program modules. It is used by\n//apollo client to cache results\n\nimport gql from 'graphql-tag'\n\nexport const GET_PERMUTATION_EXPERIMENT = gql`\n query($permutationId: UUID) {\n permutation(id: $permutationId) {\n id\n experiment {\n id\n name\n }\n }\n }\n`\n\n//get the choices and options for create/edit permutation forms\nexport const GET_PERMUTATIONS_OPTIONS = gql`\n query($id: UUID) {\n # experiment\n experiment(id: $id) {\n id\n name\n experimentIdentifier\n channels\n mediums\n brands {\n id\n name\n }\n experimentBrandSet {\n id\n brand {\n id\n name\n }\n }\n experimentDiscreteSet {\n id\n discreteValue {\n id\n value\n feature {\n id\n name\n }\n }\n }\n }\n # folders by expt id\n folders(experimentId: $id) {\n id\n name\n }\n\n # all features\n features {\n id\n name\n archived\n discreteValues {\n id\n value\n }\n }\n }\n`\n\n//get permutation list\n\nexport const GET_PERMUTATIONS_LIST = gql`\n query($experimentId: UUID) {\n permutations(experimentId: $experimentId) {\n id\n name\n variables {\n id\n discreteValue {\n id\n value\n }\n }\n folder {\n id\n name\n }\n flowcodeCount\n timeStamp\n }\n }\n`\n\n//get permutation details for edit\nexport const GET_EDIT_PERMUTATION = gql`\n query($experimentId: UUID, $permutationID: UUID) {\n # choices from experiment\n experiment(id: $experimentId) {\n id\n name\n channels\n mediums\n experimentIdentifier\n brands {\n id\n name\n }\n experimentBrandSet {\n id\n brand {\n id\n name\n }\n }\n # variables - features selection dropdown\n experimentDiscreteSet {\n id\n discreteValue {\n id\n value\n feature {\n id\n name\n }\n }\n }\n }\n\n # folders\n folders(experimentId: $experimentId) {\n id\n name\n }\n\n # features for attributes\n features {\n id\n name\n archived\n discreteValues {\n id\n value\n }\n }\n\n # permutation\n permutation(id: $permutationID) {\n id\n name\n finalNumber\n brand {\n id\n brand {\n id\n name\n }\n }\n iscs\n \n # existing variables in the permutation\n variables {\n id\n discreteValue {\n id\n value\n feature {\n id\n name\n }\n }\n }\n\n # existing variables in the permutation for delete\n permutationVariableSet {\n id\n experimentDiscrete {\n id\n }\n }\n\n # existing attributes in the permutation\n attributes {\n id\n value\n feature {\n id\n name\n }\n }\n\n # existing in the permutation for delete\n permutationAttributeSet {\n id\n discreteValue {\n id\n }\n }\n channel\n medium\n estCost\n actualCost\n estImpressions\n actualImpressions\n folder {\n id\n }\n notes\n }\n }\n`\n\n//get permutation details for view\n//do not remove the id's, its required for caching\nexport const VIEW_PERMUTATION = gql`\n query($id: UUID) {\n # permutation\n permutation(id: $id) {\n id\n name\n finalNumber\n brand {\n id\n brand {\n id\n name\n }\n }\n iscs\n channel\n medium\n estCost\n actualCost\n estImpressions\n actualImpressions\n folder {\n id\n name\n }\n notes\n variables {\n id\n # archived\n discreteValue {\n id\n value\n feature {\n id\n name\n }\n }\n }\n attributes {\n id\n value\n # archived\n feature {\n id\n name\n }\n }\n experiment {\n id\n name\n }\n }\n }\n`\n","//This component is used for field where \"ID\" to be set as the value\n\n//This component will create formik based input fields using ant d.\n\nimport React from 'react'\nimport { FieldProps } from 'formik'\n\n//styled component\nimport { Form, Select } from 'antd'\n\n//Ant d component destructuring\nconst FormItem = Form.Item\nconst { Option } = Select\n\n//typescript for form fields\ninterface formFields {\n prefix: React.ReactNode\n label: string\n hasFeedback?: boolean\n selectOptions: Array\n submitCount: number\n optionValue: string\n optionName: string\n filterPropName?: string\n}\n\n//type class\ntype Class = { new (...args: any[]): any }\n\n//JSX\nconst CreateAntField = (AntComponent: Class) => ({\n field,\n form,\n hasFeedback,\n label,\n selectOptions,\n submitCount,\n optionName,\n optionValue,\n filterPropName,\n ...props\n}: FieldProps & formFields) => {\n const touched = form.touched[field.name]\n const submitted = submitCount > 0\n const hasError = form.errors[field.name]\n const submittedError = hasError && submitted\n const touchedError = hasError && touched\n\n const onChange = (value: any) => form.setFieldValue(field.name, value)\n const onBlur = () => form.setFieldTouched(field.name, true)\n\n return (\n
\n \n \n {selectOptions &&\n selectOptions.map((item: any, index) => (\n \n {item[optionName]}\n \n ))}\n \n \n
\n )\n}\n\n//components\nexport const AntSelectWithVal = CreateAntField(Select)\n","import { TableColumns } from \"../../TypeScript_Types/TableColumns\"\n\n// flowcode table\n\nexport const columnsNames: Readonly = [\n {\n title: '#',\n key: 'number'\n },\n {\n title: 'Unique',\n key: 'unique'\n },\n {\n title: 'Batch',\n key: 'batch'\n },\n {\n title: 'Short URL',\n key: 'shorturl'\n },\n {\n title: 'Landing page',\n key: 'redirectId'\n },\n {\n title: 'Features',\n key: 'features'\n },\n {\n title: 'Brand',\n key: 'brand'\n },\n {\n title: 'Scan',\n key: 'scan'\n },\n {\n title: 'Preview',\n key: 'preview'\n },\n {\n title: 'Download',\n key: 'download'\n },\n {\n title: 'Actions',\n key: 'actions'\n }\n]\n\nexport const DEFAULT_FLOWCODE_COLOR = '#000'\n","import { TableColumns } from \"../../TypeScript_Types/TableColumns\";\n\n//this is the names of the columns in permutations list table\n\nexport const columnsNames: Readonly = [\n {\n title: 'Name',\n key: 'name'\n },\n {\n title: 'Features',\n key: 'features'\n },\n {\n title: '#Flowcodes',\n key: 'flowcodes'\n },\n {\n title: 'Date created',\n key: 'date'\n },\n {\n title: 'Actions',\n key: 'actions'\n }\n]\n","//This component will generate the permutations details in a tabular form in view permutation\n//This coponent will display the table of the experiment list\n\nimport React, { useState, useContext } from 'react'\n\n//styled components\nimport { Dropdown, Icon, Menu } from 'antd'\n\n//constants\nimport { columnsNames } from '../../Constants/Permutations/PermutationsTableColumns'\n\n//functional component\nimport NoData from '../Reusable_UI/NoData/NoData'\n\n//typeScript\nimport { PermutationTableProps } from '../../TypeScript_Types/Permutations'\nimport { DownloadModalContext } from '../../Contexts/DownloadModalContext'\n\n//inline style\nconst moreStyle = {\n color: '#1890ff',\n cursor: 'pointer',\n paddingLeft: '5px'\n}\n\nconst dropdownOptionStyle = {\n color: '#1890ff',\n cursor: 'pointer',\n marginBottom: 0\n}\n\n//default numbers of feature names to be shown in the table\nconst initialShowCount = 3\n\nconst ViewPermutationsTable = ({\n permutationData,\n experimentId,\n listLoading,\n deletePermutationId,\n deleteLoading,\n handleDeletePermutation,\n history,\n handleClonePermutation,\n handleDownloadCSV\n}: PermutationTableProps): JSX.Element => {\n const { handleVisible } = useContext(DownloadModalContext)\n\n //local states\n const [showCount, setShowCount] = useState(initialShowCount)\n const [showMoreRowId, setShowMoreRowID] = useState()\n\n // pop up action menu\n const menu = (rowItems: { id: string; name: string }): JSX.Element => {\n return (\n \n {/* { setEditPermutationId(rowItems.id); handleVisible() }}>\n Edit permutation\n */}\n handleDeletePermutation(rowItems.id, rowItems.name)}\n >\n Delete permutation\n \n handleClonePermutation(rowItems.id)}>\n Clone Permutation\n \n {\n handleDownloadCSV(rowItems.id, rowItems.name)\n handleVisible()\n }}\n >\n Download CSV\n \n \n )\n }\n\n //show more features to increase the show count of the displayed feature\n //it will be in the increment of 3 or whatever the max difference upto 2.\n const showMoreFeatures = (rowID: string, featuresListCount: number): void => {\n let showCountTemp = initialShowCount\n\n //if the rowID doesnt match, set to initial.\n //This indicated that the show more is for a new row.\n if (rowID !== showMoreRowId) {\n setShowMoreRowID(rowID)\n } else {\n //else set it to the latest show count\n showCountTemp = showCount\n }\n\n if (showCountTemp < featuresListCount) {\n if (featuresListCount - showCountTemp > initialShowCount) {\n setShowCount(showCountTemp + initialShowCount)\n } else {\n setShowCount(showCountTemp + (featuresListCount - showCountTemp))\n }\n }\n }\n\n return (\n
\n \n \n \n {columnsNames.map((item: any) => (\n \n ))}\n \n \n\n {/* table list */}\n\n \n {permutationData &&\n permutationData.map((rowItems, rowIndex: number) => {\n return (\n \n history.push(\n `/${experimentId}/${rowItems.id}/view_permutation`\n )\n }\n >\n {/* create ellips for name longer than 60 characters */}\n \n\n \n\n \n\n \n {rowItems.id === deletePermutationId && deleteLoading ? (\n \n ) : (\n // menu\n \n )}\n \n )\n })}\n \n
{item.title}
\n {rowItems.name.length > 60\n ? `${rowItems.name.substring(0, 60)}...`\n : rowItems.name}\n \n {showMoreRowId === rowItems.id\n ? rowItems.variables\n .map(variable => variable.discreteValue.value)\n .flat()\n .slice(0, showCount)\n .join(', ')\n : rowItems.variables\n .map(variable => variable.discreteValue.value)\n .flat()\n .slice(0, initialShowCount)\n .join(', ')}\n {rowItems.variables.length <=\n initialShowCount ? null : rowItems.variables.length <=\n showCount && showMoreRowId === rowItems.id ? null : (\n \n showMoreFeatures(\n rowItems.id,\n rowItems.variables.length\n )\n }\n style={moreStyle}\n >\n more\n \n )}\n {rowItems.flowcodeCount}{new Date(rowItems.timeStamp).toLocaleString()}\n \n e.stopPropagation()}>\n
\n {/* dropdown more menu */}\n menu(rowItems)}\n trigger={['click']}\n >\n

More

\n \n
\n
\n\n {/* show loader or no data */}\n {(!permutationData && listLoading) ||\n (permutationData && permutationData.length < 1) ? (\n \n ) : null}\n
\n )\n}\n\nexport default ViewPermutationsTable\n","import { PermutationFormValues } from '../TypeScript_Types/Permutations'\nimport { numberWithCommas } from './Format'\nimport { AllFeaturesItem } from '../TypeScript_Types/Features'\nimport { ExperimentDiscreteSet } from '../TypeScript_Types/ExperimentTypes'\n\n// clone permutation data helper \nexport const formatPermutationData = (\n permutation: any\n): PermutationFormValues => {\n const formatNumber = (val: string): string =>\n numberWithCommas(parseFloat(val))\n\n return {\n name: permutation.name,\n estCost: permutation.estCost ? formatNumber(permutation.estCost) : 0,\n actualCost: permutation.actualCost\n ? formatNumber(permutation.actualCost)\n : 0,\n estImpressions: permutation.estImpressions\n ? formatNumber(permutation.estImpressions)\n : 0,\n actualImpressions: permutation.actualImpressions\n ? formatNumber(permutation.actualImpressions)\n : 0,\n iscs: permutation.iscs,\n notes: permutation.notes,\n channel: permutation.channel,\n medium: permutation.medium,\n brands: permutation.brand.map((brand: { id: string }) => brand?.id),\n folder: permutation.folder,\n variables: permutation.variables?.map(\n (variable: { discreteValue: {id: string} }) => variable.discreteValue.id\n ),\n attributes: permutation.attributes?.map(\n (attribute: { id: string }) => attribute.id\n )\n }\n}\n\nexport const reduceDiscreteSet = (features: any[]): any =>\n features.reduce(function(\n acc: Array,\n obj: ExperimentDiscreteSet\n ) {\n //find if the feature id is already present in the accumulator\n const objIndex = acc.findIndex(\n object => object.id === obj.discreteValue.feature.id\n )\n\n //create custom object\n if (objIndex === -1) {\n const filteredFeature: AllFeaturesItem = {\n id: obj.discreteValue.feature.id,\n name: obj.discreteValue.feature.name,\n discreteValues: [\n {\n id: obj.discreteValue.id,\n value: obj.discreteValue.value\n }\n ]\n }\n acc.push(filteredFeature)\n } else {\n const objDiscreteValues = {\n id: obj.discreteValue.id,\n value: obj.discreteValue.value\n }\n acc[objIndex].discreteValues.push(objDiscreteValues)\n }\n return acc\n },\n [])\n","//non cost numeric check - no decimal point\nexport const checkNumeric = (e: any) => {\n const { value } = e.target\n\n if (!value) {\n return null\n } else {\n const validChars = /\\$?\\d[\\d,]*(\\.\\d+)?$/\n let inputVal\n if (!validChars.test(value)) {\n inputVal = value.replace(/[^0-9]/g, '')\n return inputVal\n } else {\n inputVal = value.replace(/[,a-zA-Z]/g, '')\n return Number(inputVal)\n }\n }\n}\n\nexport const checkNumericVal = (value: string) => {\n if (!value) {\n return null\n } else {\n const validChars = /\\$?\\d[\\d,]*(\\.\\d+)?$/\n let inputVal\n if (!validChars.test(value)) {\n inputVal = value.replace(/[^0-9]/g, '')\n return inputVal\n } else {\n inputVal = value.replace(/[,a-zA-Z]/g, '')\n return Number(inputVal)\n }\n }\n}\n\n//cost numeric check - decimal point\nexport const checkDecimalNumeric = (value: string) => {\n //regex to test numbers with 2 decimals places\n const validCost = /^[0-9]+(\\.[0-9]{0,2})?$/\n\n if (!value) {\n return value\n } else {\n if (validCost.test(value)) {\n //format input to add commas\n let inputVal = value.replace(/\\d{1,3}(?=(\\d{3})+(?!\\d))/g, '$&,')\n return inputVal\n }\n return null\n }\n}\n","//this component will generate form layout for create and edit permutations\n\nimport React, { useEffect, useState } from 'react'\nimport moment from 'moment'\n//form handler\nimport { Form, Field } from 'formik'\n\n//styled components\nimport {\n Row,\n Col,\n Form as AntForm,\n Input,\n TreeSelect,\n Descriptions,\n Collapse,\n Select\n} from 'antd'\n\n//utilities\nimport {\n validateRequiredArray,\n validateRequired\n} from '../../Utilities/Validate'\n\n//typeScript\nimport {\n PermutationFormsProps,\n PermutationFormField\n} from '../../TypeScript_Types/Permutations'\nimport {\n AllFeaturesItem,\n FeatureTree,\n FeaturePreview,\n DiscreteValues\n} from '../../TypeScript_Types/Features'\nimport { ExperimentDiscreteSet } from '../../TypeScript_Types/ExperimentTypes'\n\n//functional components\nimport { AntInput } from '../Reusable_UI/Forms/FormFields'\nimport { AntSelectWithVal } from '../Reusable_UI/Forms/SelectWithVal'\nimport { checkDecimalNumeric } from '../../Utilities/CheckNumeric'\nimport { AllBrandItem } from '../../TypeScript_Types/Brands'\nimport { GetFeaturesTree } from '../../Utilities/FeaturesTree'\nimport { formatPermutationName } from '../../Utilities/Format'\nimport { reduceDiscreteSet } from '../../Utilities/Permutation'\n\n//ant design component destructuring\nconst FormItem = AntForm.Item\nconst { SHOW_CHILD } = TreeSelect\nconst DescriptionsItem = Descriptions.Item\nconst { Panel } = Collapse\nconst { Option } = Select\n\nconst CreateEditPermutation = ({\n submitCount,\n setFieldValue,\n permutationData,\n values,\n initialValues,\n initalDataReady,\n setInitialDataReady\n}: PermutationFormsProps): JSX.Element => {\n //local states\n const [featureTreeOptionalData, setFeatureTreeOptionalData]: [\n Array,\n any\n ] = useState([])\n const [featureTreeExpData, setFeatureTreeExpData]: [\n Array,\n any\n ] = useState([])\n const [optFeatureUpdated, setOptFeatureUpdate] = useState(false)\n const [expFeatureUpdated, setExpFeatureUpdate] = useState(false)\n const [selectedExpFeaturesPreview, setSelectedExpFeaturePreview]: [\n Array,\n any\n ] = useState([])\n const [selectedOptFeaturesPreview, setSelectedOptFeaturePreview]: [\n Array,\n any\n ] = useState([])\n const [brandsList, setBrandsList]: [Array, any] = useState([])\n const [showISCS, setShowISCS] = useState(false)\n\n //useEffects\n useEffect(() => {\n if (values.channel === 'TV') setShowISCS(true)\n else setShowISCS(false)\n }, [values])\n\n useEffect(() => {\n if (initialValues) {\n const clonePermutationValues: { [id: string]: any } = initialValues\n const fields = Object.keys(initialValues)\n fields.forEach((field: string) => {\n const permutationValue = clonePermutationValues[field]\n if (permutationValue)\n setFieldValue(field as PermutationFormField, permutationValue)\n })\n }\n }, [initialValues, setFieldValue])\n\n //update experiment name\n useEffect(() => {\n if (permutationData) {\n const permutationName = formatPermutationName({\n values,\n brandsList,\n permutationData,\n date: moment()\n .utc()\n .format('YYYY-MM')\n })\n\n setFieldValue('name', permutationName)\n }\n }, [values, permutationData, setFieldValue, brandsList])\n\n //create custom brandsList for selection from the experimentBrands\n useEffect(() => {\n if (permutationData && initalDataReady) {\n const customBrandsList = permutationData.experiment.experimentBrandSet.map(\n brands => {\n return {\n id: brands.id,\n name: brands.brand.name\n }\n }\n )\n setBrandsList(customBrandsList)\n\n if (initalDataReady) {\n setInitialDataReady(false)\n }\n }\n }, [permutationData, initalDataReady, setInitialDataReady])\n\n // create optional & experiment feature data\n useEffect(() => {\n if (permutationData && initalDataReady) {\n //optional features tree\n {\n const optionalFeaturesTree = GetFeaturesTree(\n permutationData.features.filter(feature => !feature.archived)\n )\n setFeatureTreeOptionalData(optionalFeaturesTree)\n }\n\n //create the tree hierarchial structure from EXPERIMENT FEATURE NAMES\n const customExpFeatureData = reduceDiscreteSet(\n permutationData.experiment.experimentDiscreteSet\n )\n\n {\n const expFeaturesTree = GetFeaturesTree(customExpFeatureData)\n setFeatureTreeExpData(expFeaturesTree)\n }\n\n if (initalDataReady) {\n setInitialDataReady(false)\n }\n }\n }, [permutationData, initalDataReady, setInitialDataReady])\n\n //create preview for selected experimentFeatures\n useEffect(() => {\n //FEATURES - create an oject of selected featureNames with features.\n // since only the IDs are stored when values are selected in the form this is required to create a preview of\n // selected featureNames with their corresponding features.\n\n //PREVIEW EXPERIMENT FEATURE NAMES - VARIABLES\n const selectedExptFeaturesPreview = (inputValue: Array): any => {\n const selectedFeatures = permutationData.experiment.experimentDiscreteSet.reduce(\n function(acc: Array, obj: ExperimentDiscreteSet) {\n if (inputValue.includes(obj.discreteValue.id)) {\n //find if the feature already exists in the accumulator\n const objIndex = acc.findIndex(\n object => object.featureId === obj.discreteValue.feature.id\n )\n if (objIndex === -1) {\n //create custom object\n const filteredFeature = {\n featureId: obj.discreteValue.feature.id,\n featureName: obj.discreteValue.feature.name,\n discreteValues: [\n {\n id: obj.discreteValue.id,\n value: obj.discreteValue.value\n }\n ]\n }\n acc.push(filteredFeature)\n } else {\n //replace featureNames in existing object\n acc[objIndex].discreteValues.push({\n id: obj.discreteValue.id,\n value: obj.discreteValue.value\n })\n }\n }\n return acc\n },\n []\n )\n\n return selectedFeatures\n }\n\n //PREVIEW OPTIONAL FEATURE NAMES - ATTRIBUTES\n const selectedFeaturesPreview = (inputValue: Array): any => {\n const selectedFeatures = permutationData.features.reduce(function(\n acc: Array,\n obj: AllFeaturesItem\n ) {\n if (obj.discreteValues.some(item => inputValue.includes(item.id))) {\n // filter the featureNames data from feature(obj) that consist the featureName id\n const filterDiscreteValues: Array = obj.discreteValues.filter(\n (featureItem: any) => inputValue.includes(featureItem.id)\n )\n //find if the feature already exists in the accumulator\n const objIndex = acc.findIndex(object => object.featureId === obj.id)\n if (objIndex === -1) {\n //create custom object\n const filteredFeature = {\n featureId: obj.id,\n featureName: obj.name,\n discreteValues: [...filterDiscreteValues]\n }\n acc.push(filteredFeature)\n } else {\n //replace featureNames in existing object\n acc[objIndex].discreteValues = filterDiscreteValues\n }\n }\n return acc\n },\n [])\n return selectedFeatures\n }\n\n //only if the values is not undefined and experiement feature has been updated this block will run.\n if ((values.variables.length > 0 && initalDataReady) || expFeatureUpdated) {\n //create a new array consisting the feature of the selected discrete values.\n const expFeatureData = selectedExptFeaturesPreview(values.variables)\n setSelectedExpFeaturePreview(expFeatureData)\n setExpFeatureUpdate(false)\n }\n\n //only if the values is not undefined and experiement feature has been updated this block will run.\n if (\n (values.attributes.length > 0 && initalDataReady) ||\n optFeatureUpdated\n ) {\n //create a new array consisting the feature of the selected discrete values.\n const optFeatureData = selectedFeaturesPreview(values.attributes)\n setSelectedOptFeaturePreview(optFeatureData)\n setOptFeatureUpdate(false)\n }\n\n if (initalDataReady) {\n setInitialDataReady(false)\n }\n }, [\n values,\n permutationData,\n expFeatureUpdated,\n optFeatureUpdated,\n setInitialDataReady,\n initalDataReady\n ])\n\n //handle cost changes - verify input and format output with commas\n const handleCost = (e: any, fieldName: any): void => {\n const checkCostVal = checkDecimalNumeric(e.target.value.replace(/[,]/g, ''))\n //format text for UI\n if (checkCostVal === null) {\n e.preventDefault()\n } else {\n setFieldValue(fieldName, checkCostVal)\n }\n }\n\n return (\n
\n {/* name */}\n \n\n {/* brands */}\n \n\n {/* channels and mediums from experiment */}\n \n \n {/* channel */}\n \n {({ field, form }: any) => (\n 0) ||\n (form.touched.channel && !values.channel)\n ? 'Channel not selected.'\n : false\n }\n validateStatus={\n (!values.channel && submitCount > 0) ||\n (form.touched.channel && !values.channel)\n ? 'error'\n : 'success'\n }\n >\n {\n setFieldValue('channel', value)\n }}\n onBlur={() => form.setFieldTouched(field.name, true)}\n >\n {permutationData.experiment.channels &&\n permutationData.experiment.channels.map(\n (channel, index: number) => (\n \n )\n )}\n \n \n )}\n \n \n\n \n {/* medium */}\n \n {({ field, form }: any) => (\n 0) ||\n (form.touched.medium && !values.medium)\n ? 'Medium not selected.'\n : false\n }\n validateStatus={\n (!values.medium && submitCount > 0) ||\n (form.touched.medium && !values.medium)\n ? 'error'\n : 'success'\n }\n >\n setFieldValue('medium', value)}\n onBlur={() => form.setFieldTouched(field.name, true)}\n >\n {permutationData.experiment.mediums &&\n permutationData.experiment.mediums.map(\n (medium, index: number) => (\n \n )\n )}\n \n \n )}\n \n \n \n\n \n \n {/* Folder */}\n \n \n\n \n {/* iscs */}\n \n \n \n\n \n \n {/* Estimated impressions */}\n \n {({ field, form }: any) => (\n \n handleCost(e, 'estImpressions')}\n onBlur={() => form.setFieldTouched('estImpressions', true)}\n />\n \n )}\n \n \n\n \n {/* Impression to date ~ actual impressions */}\n \n {({ field, form }: any) => (\n \n handleCost(e, 'actualImpressions')}\n onBlur={() => form.setFieldTouched('actualImpressions', true)}\n />\n \n )}\n \n \n \n\n \n \n {/* Estimated cost */}\n \n {({ field, form }: any) => (\n \n handleCost(e, 'estCost')}\n onBlur={() => form.setFieldTouched('estCost', true)}\n />\n \n )}\n \n \n\n \n {/* Spend to date ~ actual cost */}\n \n {({ field, form }: any) => (\n \n handleCost(e, 'actualCost')}\n onBlur={() => form.setFieldTouched('actualCost', true)}\n />\n \n )}\n \n \n \n\n {/* Experiment features */}\n \n {({ field, form }: any) => (\n 0) ||\n (form.touched.variables && form.errors.variables)\n ? 'Variables not selected'\n : false\n }\n validateStatus={\n (form.errors.variables && submitCount > 0) ||\n (form.touched.variables && form.errors.variables)\n ? 'error'\n : 'success'\n }\n >\n {\n setFieldValue('variables', value)\n setExpFeatureUpdate(true)\n }}\n onBlur={() => form.setFieldTouched(field.name, true)}\n treeNodeFilterProp=\"title\"\n />\n \n )}\n \n\n {/* selected experiment features panel */}\n \n \n \n {selectedExpFeaturesPreview.length > 0 ? (\n \n {selectedExpFeaturesPreview.map(previewItem => (\n \n {previewItem.discreteValues.map(item => (\n

\n {item.value}\n

\n ))}\n \n ))}\n \n ) : (\n
\n

Features not selected.

\n
\n )}\n
\n
\n
\n\n {/* optional features - attributes */}\n {/* validate={validateRequiredArray} disabled, field set to optional */}\n \n {({ field, form }: any) => (\n \n {\n setFieldValue('attributes', value)\n setOptFeatureUpdate(true)\n }}\n onBlur={() => form.setFieldTouched(field.name, true)}\n treeNodeFilterProp=\"title\"\n />\n \n )}\n \n\n {/* selected optional features panel */}\n \n \n \n {selectedOptFeaturesPreview.length > 0 ? (\n \n {selectedOptFeaturesPreview.map(previewItem => (\n \n {previewItem.discreteValues.map(item => (\n

\n {item.value}\n

\n ))}\n \n ))}\n \n ) : (\n
\n

Features not selected.

\n
\n )}\n
\n
\n
\n\n {/* nodes */}\n \n \n )\n}\n\nexport default CreateEditPermutation\n","//Container - create permutation\n\nimport React, { useState, Fragment, useEffect, useRef, useContext } from 'react'\nimport { Formik } from 'formik'\nimport { useQuery, useMutation, useLazyQuery } from '@apollo/react-hooks'\n\n//contexts\nimport { CreateModalCTX } from '../../Contexts/CreateModalContext'\n\n//typeScript\nimport { PermutationFormValues } from '../../TypeScript_Types/Permutations'\n\n//graphql\nimport {\n GET_PERMUTATIONS_OPTIONS,\n GET_PERMUTATIONS_LIST,\n GET_EDIT_PERMUTATION\n} from '../../Graqhql/Permutations/QueryPermutation'\nimport { CREATE_PERMUTATION } from '../../Graqhql/Permutations/MutationPermutation'\nimport { GET_FOLDERS } from '../../Graqhql/Folders/FoldersQuery'\n\n//utilities\nimport { removeCommas } from '../../Utilities/Format'\nimport { formatPermutationData } from '../../Utilities/Permutation'\nimport ErrorBoundary from '../../Utilities/ErrorBoundary'\n\n//functional component\nimport CreatePermutationForm from '../../Components/Permutations/Create_Edit_Permutation'\nimport ModalWrap from '../../Components/Reusable_UI/Modal/ModalFormWrap'\nimport { LoadingSpinner } from '../../Components/Reusable_UI/Loaders_Spinners/LoadingSpinner'\nimport ErrorAlert from '../../Components/Reusable_UI/Alerts/ErrorAlerts'\n\n//initial form fields\nconst initialFieldValues: PermutationFormValues = {\n name: '',\n brands: [],\n channel: '',\n medium: '',\n iscs: '',\n folder: null,\n estCost: null,\n actualCost: null,\n estImpressions: null,\n actualImpressions: null,\n variables: [],\n attributes: [],\n notes: ''\n}\n\n//type props\ninterface Props {\n experimentId: string\n clonePermutationId?: string\n setClonePermutationId: Function\n}\n\n//JSX\nconst CreatePermutation = ({\n experimentId,\n clonePermutationId,\n setClonePermutationId\n}: Props): JSX.Element => {\n //local state\n const [createAndClone, setCreateAndClone] = useState(false)\n const [\n clonePermutationDataLoading,\n setClonePermutationDataLoading\n ] = useState(false)\n const [\n createPermutationInitialValues,\n setCreatePermutationInitialValues\n ] = useState()\n //error while fetching permutations form options\n const [permutationOptionsError, setPermutationOptionsError] = useState()\n const [initalDataReady, setInitialDataReady] = useState(false)\n //Error while fetching permutation details for cloning\n const [permutationCloneError, setPermutationCloneError] = useState()\n\n //context\n const {\n viewCreateFormModal,\n handleVisible,\n setCreateSuccess,\n createError,\n setCreateError,\n createErrorMsg,\n setCreateErrorMsg\n } = useContext(CreateModalCTX)\n\n //ref to call reset form\n const resetRef: any = useRef(null)\n\n useEffect(() => {\n if (viewCreateFormModal) {\n resetRef.current && resetRef.current.click()\n }\n }, [viewCreateFormModal])\n\n //this is to set the toggle for create and clone\n const handleCreateAndClone = (): void => {\n setCreateAndClone(prevState => !prevState)\n }\n\n //this will be called when create button is clicked, if previous createAndClone is true\n //set it to false\n const handleCreate = (): void => {\n if (createAndClone) {\n handleCreateAndClone()\n }\n }\n\n //close modal will check if create and clone is true, if true then\n //it must be set to false so that the form gets reset.\n const closeModal = (): void => {\n if (createAndClone) {\n handleCreateAndClone()\n }\n if (createPermutationInitialValues)\n setCreatePermutationInitialValues(undefined)\n if (clonePermutationId) setClonePermutationId(null)\n handleVisible()\n }\n\n //const modal buttons\n const buttons = [\n {\n buttonName: 'Create',\n key: 'create',\n action: handleCreate\n },\n {\n buttonName: 'Create & clone',\n key: 'createClone',\n action: handleCreateAndClone\n }\n ]\n\n //get permutation options\n const { data: permutationDataOpt, loading: permutationLoading } = useQuery(\n GET_PERMUTATIONS_OPTIONS,\n {\n variables: { id: experimentId },\n onError(error) {\n setPermutationOptionsError(error)\n }\n }\n )\n\n //set initial data ready for render\n useEffect(() => {\n if (permutationDataOpt) {\n setInitialDataReady(true)\n }\n }, [permutationDataOpt])\n\n //create permutation mutation\n const [createPermutation, { loading: createLoading }] = useMutation(\n CREATE_PERMUTATION,\n {\n onCompleted() {\n //if create and clone is false, close the modal and set success to true.\n if (!createAndClone) {\n setCreateSuccess(true)\n handleVisible()\n }\n },\n onError(error) {\n setCreateError(true)\n setCreateErrorMsg(error.message)\n },\n refetchQueries: [\n {\n query: GET_PERMUTATIONS_LIST,\n variables: { experimentId: experimentId }\n },\n { query: GET_FOLDERS, variables: { experimentId: experimentId } }\n ]\n }\n )\n\n //handle submit\n const handleSubmit = (values: PermutationFormValues): void => {\n const inputVal = {\n name: values.name,\n estCost: values.estCost ? parseFloat(removeCommas(values.estCost)) : null,\n actualCost: values.actualCost\n ? parseFloat(removeCommas(values.actualCost))\n : null,\n estImpressions: values.estImpressions\n ? parseFloat(removeCommas(values.estImpressions))\n : null,\n actualImpressions: values.actualImpressions\n ? parseFloat(removeCommas(values.actualImpressions))\n : null,\n iscs: values.iscs,\n notes: values.notes,\n channel: values.channel,\n medium: values.medium\n }\n\n const newVariables = values.variables.map(\n (v: string) =>\n permutationDataOpt?.experiment.experimentDiscreteSet.find(\n (d: any) => d.discreteValue.id === v\n )?.id\n )\n\n createPermutation({\n variables: {\n experimentId: experimentId,\n input: inputVal,\n brands: values.brands,\n attributes: values.attributes,\n folder: values.folder,\n variables: newVariables\n }\n })\n }\n\n //CLONE PERMUTATION\n //useLazyQuery returns a function in its result tuple that you can call whenever you're ready to execute.\n //The below query is used to get the permutation data for cloning\n const [\n getClonePermutationData,\n { loading: clonePermutationDataFetchLoading }\n ] = useLazyQuery(GET_EDIT_PERMUTATION, {\n onError(error) {\n // TODO: create custom error function\n setClonePermutationDataLoading(false)\n setPermutationCloneError(error)\n },\n onCompleted(data) {\n const { permutation } = data\n //set the proper value for folder select\n permutation.folder = permutation.folder?.id\n const clonePermutationData = formatPermutationData(permutation)\n setCreatePermutationInitialValues(clonePermutationData)\n setClonePermutationDataLoading(false)\n }\n })\n\n // clone permutation data\n useEffect(() => {\n if (clonePermutationId) {\n setClonePermutationDataLoading(true)\n getClonePermutationData({\n variables: {\n experimentId: experimentId,\n permutationID: clonePermutationId\n }\n })\n }\n }, [clonePermutationId, getClonePermutationData, experimentId])\n\n return (\n \n \n {({ submitCount, submitForm, setFieldValue, values, handleReset }) => (\n \n {/* error fetching permutation options */}\n {permutationOptionsError || permutationCloneError ? (\n \n ) : (\n <>\n {permutationLoading ||\n permutationOptionsError ||\n clonePermutationDataLoading ||\n clonePermutationDataFetchLoading ? (\n \n ) : (\n \n {/* error creating permutation */}\n {createError && (\n {\n setCreateErrorMsg('')\n setCreateError(false)\n }}\n />\n )}\n \n \n \n \n )}\n \n )}\n\n {/* reset form div ref */}\n
\n \n )}\n \n \n )\n}\n\nexport default CreatePermutation\n","//This component is to take the input for the csv file name\nimport React from 'react'\n\n//form handler\nimport { Form, Field } from 'formik'\n\n//styled components\nimport { Row, Col } from 'antd'\n\n//utitlities\nimport { validateRequired } from '../../Utilities/Validate'\n\n//functional components\nimport { AntInput } from '../Reusable_UI/Forms/FormFields'\n\n//typeScript\ninterface Props {\n submitCount: number\n}\n\nconst CsvFileForm = ({ submitCount }: Props) => {\n return (\n
\n \n \n \n \n \n
\n )\n}\n\nexport default CsvFileForm\n","//This container will handle the download csv action for permutations\nimport React, { useContext, Fragment, useState, useEffect } from 'react'\nimport { Formik } from 'formik'\n\n//REST\nimport API from '../../Utilities/RESTSetup'\n\nimport { DownloadModalContext } from '../../Contexts/DownloadModalContext'\n\n//functional component\nimport ErrorAlert from '../../Components/Reusable_UI/Alerts/ErrorAlerts'\nimport ModalWrap from '../../Components/Reusable_UI/Modal/ModalFormWrap'\nimport CsvFileForm from '../../Components/Build/CsvFile'\n\n//types for form fields state\ninterface FormValues {\n fileName: string\n}\n\n//initial form fields\nconst initialFieldValues: FormValues = {\n fileName: ''\n}\n\ninterface Props {\n permutationId: string\n permutationName: string\n}\n\nconst DownloadCSV: React.FC = ({\n permutationId,\n permutationName\n}: Props): JSX.Element => {\n //context\n const {\n viewDownloadFormModal,\n handleVisible,\n setDownloadSuccess\n } = useContext(DownloadModalContext)\n\n //local states\n const [formFields, setFormFields] = useState()\n const [downloadingCsv, setDownloadingCsv] = useState(false)\n const [downloadCsvErrorMsg, setDownloadCsvErrorMsg] = useState()\n\n //update filename\n useEffect(() => {\n const fileNameUpdate = Object.create(initialFieldValues)\n fileNameUpdate.fileName = permutationName.substring(0, 40)\n setFormFields(fileNameUpdate)\n }, [permutationName])\n\n //download csv\n const handleSubmitCsv = (values: FormValues): void => {\n // initializations\n setDownloadCsvErrorMsg(null)\n setDownloadingCsv(true)\n\n //API config\n const config: any = {\n headers: {\n 'Content-Type': 'application/json'\n },\n responseType: 'blob'\n }\n\n //API call\n API.get(`/v1/csv/permutation/${permutationId}/`, config)\n .then((response: any) => {\n const link = document.createElement('a')\n link.href = window.URL.createObjectURL(new Blob([response.data]))\n link.setAttribute('download', `${values.fileName}.csv`)\n document.body.appendChild(link)\n link.click()\n\n //modal handling\n setDownloadSuccess(true)\n handleVisible()\n \n })\n .catch((error: any) => {\n if (error?.response?.status === 401) {\n setDownloadCsvErrorMsg(\n 'Your session has expired. Please log in again'\n )\n // TODO: add auto logout step\n } else if (error.response && error.response.data.detail) {\n setDownloadCsvErrorMsg(error.response.data.detail)\n } else {\n setDownloadCsvErrorMsg('Something went wrong')\n }\n setDownloadingCsv(false); \n })\n \n }\n\n const buttonsDownload = [\n {\n buttonName: 'Download CSV',\n key: 'download'\n }\n ]\n\n return (\n \n {({ submitCount, submitForm }) => (\n \n \n {/* download csv error */}\n {downloadCsvErrorMsg && (\n setDownloadCsvErrorMsg(undefined)} />\n )}\n\n \n \n \n )}\n \n )\n}\n\nexport default DownloadCSV\n","//Continer -Permutations list\n\nimport React, { Fragment, useState, useContext, useEffect } from 'react'\nimport { useQuery, useMutation } from '@apollo/react-hooks'\nimport { FileExcelFilled } from '@ant-design/icons'\nimport { BlockPicker, ColorResult } from 'react-color'\nimport API from '../../Utilities/RESTSetup'\n\n//ant d\nimport { Modal, Tooltip, Button, Menu, Dropdown, Tag, Row, Col } from 'antd'\n\n//graphql\nimport { DELETE_PERMUTATION } from '../../Graqhql/Permutations/MutationPermutation'\nimport { GET_PERMUTATIONS_LIST } from '../../Graqhql/Permutations/QueryPermutation'\n\n//context\nimport { CreateModalCTX } from '../../Contexts/CreateModalContext'\nimport { DownloadModalContext } from '../../Contexts/DownloadModalContext'\n\n//typeScript\nimport { Permutation } from '../../TypeScript_Types/Permutations'\nimport { Folder } from '../../TypeScript_Types/Folders'\n\n//utilities\nimport { DEFAULT_FLOWCODE_COLOR } from '../../Constants/Flowcodes/Flowcodes'\n\n//functional components\nimport ViewPermutationsTable from '../../Components/Permutations/ViewPermutationTable'\nimport SuccessAlert from '../../Components/Reusable_UI/Alerts/SuccessAlerts'\nimport { SearchField } from '../../Components/Reusable_UI/Forms/SearchField'\nimport ModalWrap from '../../Components/Reusable_UI/Modal/ModalFormWrap'\nimport CreatePermutation from './CreatePermutation'\nimport PageTitle from '../../Components/Reusable_UI/Headers_Titles/PageTitles'\nimport ErrorAlert from '../../Components/Reusable_UI/Alerts/ErrorAlerts'\nimport DownloadCSV from '../Build/DownloadCSV'\nimport ErrorBoundary from '../../Utilities/ErrorBoundary'\n\n//ant design destructuring\nconst { confirm } = Modal\n\n//types\ninterface Props {\n experimentId: string\n history: any\n}\n\n//JSX\nconst PermutationList = ({ experimentId, history }: Props): JSX.Element => {\n //context\n const { createSuccess, viewCreateFormModal, handleVisible } = useContext(\n CreateModalCTX\n )\n const { viewDownloadFormModal } = useContext(DownloadModalContext)\n\n //const { editSuccess, viewEditFormModal } = useContext(EditModalCTX)\n\n //local states\n const [permutationData, setPermutationData] = useState()\n const [deletePermutationId, setDeletePermutationId] = useState()\n const [clonePermutationId, setClonePermutationId] = useState('')\n const [deletePermutationError, setDeletePermutationError] = useState()\n const [selectedPermutationId, setSelectedPermutationId] = useState('')\n const [selectedPermutationName, setSelectedPermutationName] = useState<\n string\n >('')\n const [permutationListError, setPermutationListError] = useState()\n const [downloadFlowcodesError, setDownloadFlowcodesError] = useState()\n const [isDownloadFlowcodesLoading, setIsDownloadFlowcodesLoading] = useState(\n false\n )\n const [\n isDownloadPermutationsLoading,\n setIsDownloadPermutationsLoading\n ] = useState(false)\n //filter by folder\n const [filterMenuItems, setFilterMenuItems] = useState()\n const [filterMenuItemCount, setFilterMenuItemCount] = useState()\n const [filterFolderInfo, setFilterFolderInfo] = useState()\n const [searchField, setSearchField] = useState()\n const [\n isDownloadFlowcodesModalOpen,\n setIsDownloadFlowcodesModalOpen\n ] = useState(false)\n const [flowcodeColor, setFlowcodeColor] = useState(DEFAULT_FLOWCODE_COLOR)\n\n //get permutations data from graphql\n const { data: permutationsList, loading: listLoading } = useQuery(\n GET_PERMUTATIONS_LIST,\n {\n variables: { experimentId: experimentId },\n onError(error) {\n setPermutationListError(error)\n }\n }\n )\n\n const hasFlowcodes = permutationData?.some(\n (permutation: { flowcodeCount: number }) => permutation.flowcodeCount\n )\n const hasPermutations = !!permutationsList?.permutations?.length\n\n //update data\n useEffect(() => {\n if (permutationsList) {\n setPermutationData(permutationsList.permutations)\n\n //folder filter menu\n {\n //unique permutations by folderID\n const uniquePermutations: Array<{ id: string; name: string }> = []\n\n permutationsList.permutations.forEach((item: Permutation & Folder) => {\n if (item.folder) {\n const index = uniquePermutations.findIndex(\n pushedItem => pushedItem.id === item.folder.id\n )\n if (index <= -1) {\n uniquePermutations.push({\n id: item.folder.id,\n name: item.folder.name\n })\n }\n }\n })\n setFilterMenuItemCount(uniquePermutations.length)\n setFilterMenuItems(uniquePermutations)\n }\n }\n }, [permutationsList])\n\n //delete permutation mutation\n const [deletePermutation, { loading: deleteLoading }] = useMutation(\n DELETE_PERMUTATION,\n {\n onCompleted() {\n setDeletePermutationId(null)\n },\n onError(error) {\n setDeletePermutationError(error)\n },\n refetchQueries: [\n {\n query: GET_PERMUTATIONS_LIST,\n variables: { experimentId: experimentId }\n }\n ]\n }\n )\n\n const handleClonePermutation = (permutationId: string): void => {\n setClonePermutationId(permutationId)\n handleVisible()\n }\n\n const handleDownloadCSV = (\n permutationID: string,\n permutationName: string\n ): void => {\n setSelectedPermutationId(permutationID)\n setSelectedPermutationName(permutationName)\n }\n\n // delete permutation\n const handleDeletePermutation = (id: string, name: string): void => {\n setDeletePermutationError(null)\n setDeletePermutationId(id)\n\n confirm({\n title: 'Delete permutation',\n content: `Are you sure you want to delete ${name.substring(0, 60)}...?`,\n okText: 'Yes',\n okType: 'danger',\n cancelText: 'No',\n onOk() {\n deletePermutation({ variables: { id: id } })\n }\n })\n }\n\n //on close delete error alert\n const onCloseDeleteError = (): void => {\n setDeletePermutationError(null)\n setDeletePermutationId(null)\n }\n\n //search permutation\n const handleSearchPermutation = (value: string): void => {\n if (!value) {\n setSearchField(null)\n } else {\n setSearchField(value)\n }\n }\n\n //filter permutation by folder id\n const handleFolderFilter = (item: { id: string; name: string }): void => {\n setFilterFolderInfo(item)\n }\n\n const clearFolderFilter = (): void => {\n setFilterFolderInfo(null)\n }\n\n //Download flowcodes\n const handleDownloadFlowcodes = async (): Promise => {\n try {\n setIsDownloadFlowcodesLoading(true)\n const permutationIds: string[] = permutationData.map(\n ({ id }: { id: string }) => id\n )\n if (!permutationIds.length) {\n setDownloadFlowcodesError('Please select a permutation')\n }\n const url = '/v1/zip/permutations/all-flowcodes'\n const response = await API.get(url, {\n headers: {\n 'Content-Type': 'application/json'\n },\n responseType: 'blob',\n params: {\n ids: permutationIds.join(','),\n defaultColor: flowcodeColor?.replace(/#/gi, '')\n }\n })\n const objectURL = window.URL.createObjectURL(new Blob([response.data]))\n const link = document.createElement('a')\n let filename = response.request.getResponseHeader('Content-Disposition')\n filename =\n (filename && filename.split('filename=')[1]) || 'flowcode-archive.zip'\n link.setAttribute('download', filename)\n link.setAttribute('href', objectURL)\n document.body.appendChild(link)\n link.click()\n window.URL.revokeObjectURL(objectURL)\n } catch (e) {\n setDownloadFlowcodesError(\n 'Error downloading flowcodes. Please try again.'\n )\n } finally {\n setIsDownloadFlowcodesLoading(false)\n setFlowcodeColor(DEFAULT_FLOWCODE_COLOR)\n }\n }\n\n //Download permutation\n const handleDownloadPermutations = async (): Promise => {\n try {\n setIsDownloadPermutationsLoading(true)\n const permutationIds: string[] = permutationData.map(\n ({ id }: { id: string }) => id\n )\n if (!permutationIds.length) {\n return setDownloadFlowcodesError('Please select a permutation')\n }\n const path = '/v1/csv/permutations'\n const query = `ids=${permutationIds.join(',')}`\n const url = `${path}?${query}`\n const response = await API.get(url, {\n headers: {\n 'Content-Type': 'application/json'\n },\n responseType: 'blob'\n })\n const objectURL = window.URL.createObjectURL(new Blob([response.data]))\n const link = document.createElement('a')\n let filename = response.request.getResponseHeader('Content-Disposition')\n filename = (filename && filename.split('filename=')[1]).replace(/\"/gi, '')\n link.setAttribute('download', filename)\n link.setAttribute('href', objectURL)\n document.body.appendChild(link)\n link.click()\n window.URL.revokeObjectURL(objectURL)\n } catch (e) {\n setDownloadFlowcodesError(\n 'Error downloading permutations. Please try again.'\n )\n } finally {\n setIsDownloadPermutationsLoading(false)\n setFlowcodeColor(DEFAULT_FLOWCODE_COLOR)\n }\n }\n\n //filter list after updating search params\n useEffect(() => {\n if (permutationsList) {\n if (!searchField && !filterFolderInfo) {\n setPermutationData(permutationsList.permutations)\n } else {\n if (searchField && filterFolderInfo) {\n const filteredUniq = permutationsList.permutations.filter(\n (permutation: any) => {\n const name = permutation.name.toLowerCase()\n const searchFieldResult = name.indexOf(searchField) > -1\n const folderFilterResult = permutation.folder\n ? permutation.folder.id === filterFolderInfo.id\n : false\n return searchFieldResult && folderFilterResult\n }\n )\n\n setPermutationData(filteredUniq)\n } else {\n if (searchField) {\n const filteredSearch = permutationsList.permutations.filter(\n (permutation: any) => {\n const name = permutation.name.toLowerCase()\n return name.indexOf(searchField) > -1\n }\n )\n setPermutationData(filteredSearch)\n }\n\n if (filterFolderInfo) {\n const filteredFolder = permutationsList.permutations.filter(\n (permutation: any) => {\n // permutation.folder can be null for certain permutations\n if (permutation.folder) {\n return permutation.folder.id === filterFolderInfo.id\n }\n return false\n }\n )\n if (filteredFolder) {\n setPermutationData(filteredFolder)\n }\n }\n }\n }\n }\n }, [searchField, filterFolderInfo, permutationsList])\n\n //render filter by folders in menu\n const filterMenu = (\n \n {/* clear filter option only when filter is active */}\n {filterFolderInfo && (\n Clear filter\n )}\n\n {filterMenuItems &&\n filterMenuItems.map(\n (item: { id: string; name: string }, index: number) => (\n handleFolderFilter(item)}>\n {' '}\n {item.name}{' '}\n \n )\n )}\n \n )\n\n return (\n
\n {/* create or edit action outcomes */}\n {createSuccess ? (\n \n ) : null}\n\n {/* permutations */}\n {/*
*/}\n \n \n \n \n\n {/*
*/}\n \n {/* filter by folder only if the permutation has filters options */}\n {filterMenuItemCount > 0 && (\n \n \n \n \n \n \n\n {/* download flowcodes */}\n \n \n setIsDownloadFlowcodesModalOpen(true)}\n loading={isDownloadFlowcodesLoading}\n disabled={!hasFlowcodes}\n />\n \n \n {/* create permutation button */}\n \n \n \n \n \n \n \n {/*
*/}\n\n {/* filtered tags */}\n
\n {filterFolderInfo && (\n \n {`Filter: ${filterFolderInfo.name}`}\n \n )}\n
\n\n {/* create permutation form */}\n {viewCreateFormModal && (\n \n )}\n\n {/* TODO: Extract to FlowcodeOptionsModal options modal (flowcode studio v0.0.1) */}\n {isDownloadFlowcodesModalOpen && (\n {\n setIsDownloadFlowcodesModalOpen(false)\n setFlowcodeColor(DEFAULT_FLOWCODE_COLOR)\n }}\n submitForm={async () => {\n await handleDownloadFlowcodes()\n setIsDownloadFlowcodesModalOpen(false)\n }}\n >\n Color:\n
\n \n setFlowcodeColor(color.hex)\n }\n />\n
\n \n )}\n\n {/* if there is an error downloading flowcodes */}\n {!!downloadFlowcodesError && (\n setDownloadFlowcodesError('')}\n close={true}\n />\n )}\n\n {/* display error received while fetching the permutation table data */}\n {permutationListError ? (\n \n ) : (\n \n {/* delete permutation error alert*/}\n {deletePermutationError && (\n \n )}\n\n {/* Download csv */}\n {viewDownloadFormModal && (\n \n \n \n )}\n\n {/* created permutations table listing */}\n \n \n )}\n
\n )\n}\n\nexport default PermutationList\n","//This component will render analytical chart in view experiment\n\nimport React from 'react'\nimport { Bar } from 'react-chartjs-2'\nimport { GET_EXPERIMENT_ANALYTICS } from '../../Graqhql/Experiment/QueryExperiment'\nimport { useQuery } from '@apollo/react-hooks'\nimport { ExperimentAnalytic } from '../../TypeScript_Types/ExperimentTypes'\nimport NoData from '../Reusable_UI/NoData/NoData'\nimport { Divider } from 'antd'\nimport ErrorAlert from '../Reusable_UI/Alerts/ErrorAlerts'\n\ninterface Props {\n experimentId: any\n}\n\nconst SCANS_COLOR = '#356AC4'\nconst CPS_COLOR = '#EA4435'\n\nconst ExperimentAnalytics: React.FC = ({\n experimentId\n}: Props): JSX.Element | null => {\n const [error, setError] = React.useState()\n\n const { data, loading } = useQuery(GET_EXPERIMENT_ANALYTICS, {\n variables: { id: experimentId },\n onError(error) {\n setError(error.message)\n }\n })\n\n if (loading) {\n return
\n \n
\n }\n\n if (error)\n return (\n \n )\n\n if (!data?.analytics.length) return null\n\n const names: string[] = []\n const costPerScan: number[] = []\n const scans: number[] = []\n\n data.analytics.forEach(\n ({ costPerScan: cps, scanCount, permutationName }: ExperimentAnalytic) => {\n scans.push(scanCount)\n names.push(permutationName)\n costPerScan.push(cps)\n }\n )\n\n const chartData = {\n datasets: [\n {\n label: 'Cost Per Scan',\n type: 'line',\n data: costPerScan,\n fill: false,\n borderColor: CPS_COLOR,\n backgroundColor: CPS_COLOR,\n pointBorderColor: CPS_COLOR,\n pointBackgroundColor: CPS_COLOR,\n pointHoverBackgroundColor: CPS_COLOR,\n pointHoverBorderColor: CPS_COLOR,\n yAxisID: 'y-axis-2'\n },\n {\n label: 'Scans',\n type: 'bar',\n data: scans,\n fill: false,\n backgroundColor: SCANS_COLOR,\n borderColor: SCANS_COLOR,\n hoverBackgroundColor: SCANS_COLOR,\n hoverBorderColor: SCANS_COLOR,\n yAxisID: 'y-axis-1'\n }\n ]\n }\n\n const options = {\n responsive: true,\n tooltips: {\n mode: 'label'\n },\n elements: {\n line: {\n fill: false\n }\n },\n scales: {\n datasets: [{\n maxBarThickness: 50,\n }],\n xAxes: [\n {\n // maxBarThickness: 50, this attribute is no longer part of xAxes\n labels: names,\n display: true,\n gridLines: {\n display: true\n },\n ticks: {\n callback: (value: string) =>\n `${value.substr(0, 10)}${value?.length > 10 ? '...' : ''}`\n // beginAtZero: true\n }\n }\n ],\n yAxes: [\n {\n type: 'linear',\n display: true,\n position: 'left',\n id: 'y-axis-1',\n gridLines: {\n display: true\n },\n ticks: {\n // min: 0,\n stepSize: 5,\n beginAtZero: true\n }\n },\n {\n type: 'linear',\n display: true,\n position: 'right',\n id: 'y-axis-2',\n gridLines: {\n display: false\n },\n ticks: {\n beginAtZero: true,\n callback: (value: number) => `$${value.toFixed(2)}`\n }\n }\n ]\n }\n }\n\n return (\n <>\n \n
\n \n
\n \n \n )\n}\n\nexport default ExperimentAnalytics\n","//container - View Experiment Form\n//Includes experiment details, folders & permutations\n\nimport React, { useState, Fragment } from 'react'\nimport { Link, RouteComponentProps } from 'react-router-dom'\n\n//ant d styled components\nimport { Switch, Typography, Divider, Tooltip, Breadcrumb } from 'antd'\n\nimport { useQuery } from '@apollo/react-hooks'\n\n//graphql\nimport { GET_EDIT_EXPERIMENT } from '../../../Graqhql/Experiment/QueryExperiment'\n\n//contexts\nimport CreateFolderModalProvider from '../../../Contexts/CreateFolderModalContext'\nimport EditFolderModalProvider from '../../../Contexts/EditFolderModalContext'\nimport CreateModalProvider from '../../../Contexts/CreateModalContext'\nimport EditModalProvider from '../../../Contexts/EditModalContext'\nimport DownloadModalProvider from '../../../Contexts/DownloadModalContext'\n\n//utilities\nimport ErrorBoundary from '../../../Utilities/ErrorBoundary'\n\n//functional components\nimport LayoutWrap from '../../../HOC/LayoutWrap'\nimport PageTitle from '../../../Components/Reusable_UI/Headers_Titles/PageTitles'\nimport ViewAndEditExperiment from '../../../Components/Experiment/ViewExperimentForm/ViewAndEditExperiment'\nimport FolderList from '../../Folders/FoldersList'\nimport { LoadingSpinner } from '../../../Components/Reusable_UI/Loaders_Spinners/LoadingSpinner'\nimport ErrorAlert from '../../../Components/Reusable_UI/Alerts/ErrorAlerts'\nimport PermutationList from '../../Permutations/PermutationsList'\nimport ExperimentAnalytics from '../../../Components/Experiment/ExperimentAnalytics'\n\n//ant design componenent destructuring\nconst { Title } = Typography\n\n//inline styles\nconst folderDiv = {\n display: 'flex',\n alignItems: 'center',\n marginTop: 20\n}\n\n//const title of view experiment page\nconst PAGE_TITLE = 'View Experiment'\n\ntype Params = {\n id: string\n}\n\n//JSX\nconst ViewExperimentComponents = (\n props: RouteComponentProps\n): JSX.Element => {\n //local state\n const [folderView, setFolderView] = useState(false)\n const [expError, setExpError] = useState()\n\n //experiment id\n const experimentId = props.match.params.id\n const decodedExperimentId = window.atob(experimentId).split(':')[1]\n\n //get the experiment details\n const { data: expData, loading: expLoading } = useQuery(GET_EDIT_EXPERIMENT, {\n variables: { id: decodedExperimentId },\n onError(error) {\n setExpError(error)\n }\n })\n\n //breadcrumb navigation menu\n const ViewExperimentBreadcrumb = (\n \n \n Experiments\n \n View experiment\n \n )\n\n return (\n \n {/* breadcrumb navigation menu */}\n {ViewExperimentBreadcrumb}\n\n \n\n {/* error getting experiment details */}\n {expError ? (\n \n ) : (\n \n {/* if loading or no data show the spinner else render other components */}\n {/* this is necessary because setError will take time for async to complete, meanwhile the\n details component rendering starts if no expData */}\n\n {expLoading || !expData ? (\n \n ) : (\n \n {/* 1. experiment details */}\n \n \n \n\n {/* 2. Charts */}\n \n \n \n\n {/* 3. Groups */}\n
\n \n setFolderView(checked)}\n checked={folderView}\n />\n \n \n Folders\n \n
\n\n {/* if folder swtich true display the folder list*/}\n \n \n \n {folderView && (\n \n )}\n \n \n \n\n \n\n {/* 4. Permutation */}\n \n \n \n \n \n \n \n \n \n
\n )}\n
\n )}\n
\n )\n}\n\nexport default ViewExperimentComponents\n","//Query - Feature\n\nimport gql from 'graphql-tag'\n\n//get feature by ID\nexport const GET_FEATURE = gql`\n query($id: UUID) {\n feature(id: $id) {\n id\n name\n category\n type\n channel\n discreteValues {\n id\n value\n }\n }\n channels {\n name\n }\n }\n`\n\n//get all features\nexport const GET_FEATURES = gql`\n query($id: String) {\n features(category: $id) {\n id\n name\n category\n channel\n type\n archived\n discreteValues {\n id\n value\n }\n }\n }\n`\n\n//get channels choices for features form\n\nexport const GET_CHANNEL_CHOICES = gql`\n query {\n channels {\n name\n }\n }\n`\n","//Mutation - Features\n\nimport gql from 'graphql-tag'\n\n//create feature\nexport const CREATE_FEATURE = gql`\n mutation($input: FeatureInputType!, $discreteValues: [DiscreteInputType]) {\n createFeature(input: $input, discreteValues: $discreteValues) {\n ok\n }\n }\n`\n\n//update feature\nexport const UPDATE_FEATURE = gql`\n mutation(\n $id: UUID!\n $deleteValues: [UUID]\n $addValues: [DiscreteInputType]\n $input: FeatureInputType\n $updateValues: [DiscreteInputType]\n ) {\n updateFeature(\n id: $id\n deleteValues: $deleteValues\n addValues: $addValues\n updateValues: $updateValues\n input: $input\n ) {\n ok\n }\n }\n`\n\n//delete feature - archive or unarchive\n//NOTE - this is not deleteFeature mutation\nexport const DELETE_FEATURE = gql`\n mutation($id: UUID!, $input: FeatureInputType) {\n updateFeature(id: $id, input: $input) {\n ok\n }\n }\n`\n","//const value type - check the corresponding value of the 'Values type' selection from UI dropdown\n\n//typescript\n\n//constants\nexport const ValueType: any = {\n Freetext: 'string',\n Boolean: 'boolean',\n Numerical: 'number'\n}\n\nexport const TypeValue: any = {\n string: 'Freetext',\n boolean: 'Boolean',\n number: 'Numerical'\n}\n\n//options for dropdown\nexport const typeChoices: Readonly = ['Freetext', 'Numerical', 'Boolean']\n","//typescript table columns\nimport { TableColumns } from \"../../TypeScript_Types/TableColumns\"\n\n//this is the names of the columns in features list table\n\nexport const columnsNames: Readonly = [\n {\n title: 'Name',\n key: 'name'\n },\n {\n title: 'Category',\n key: 'category'\n },\n {\n title: 'Channels',\n key: 'channels'\n },\n {\n title: 'Values',\n key: 'discreteValue'\n },\n {\n title: 'Data type',\n key: 'dataType'\n },\n {\n title: 'Actions',\n key: 'actions'\n }\n]\n\nexport const featureCategories: Readonly = [\n 'Flowcode',\n 'targeting',\n 'education_type',\n 'time',\n 'user_flow',\n 'creative_attention',\n 'creative_interest',\n 'creative_desire',\n 'creative_scan_action',\n 'creative_conversion_action',\n 'other'\n]\n","//This is a common form for create feature\n//The form \"Field\" component is from the resuable UI components - refer /Reusable_UI\n\nimport React, { Fragment, useEffect, useState } from 'react'\n\n//form handler\nimport { Form, Field } from 'formik'\n\n//styled components\nimport { Row, Col, Form as AntForm, Input, Tag, Button } from 'antd'\n\n//constant\nimport { typeChoices } from '../../Constants/Features/FeatureValueType'\nimport { featureCategories } from '../../Constants/Features/FeaturesList'\n\n// utilities\nimport {\n validateRequired,\n validateRequiredArray\n} from '../../Utilities/Validate'\nimport { checkNumericVal } from '../../Utilities/CheckNumeric'\n\n//typeScript\nimport { FeatureFormsProps } from '../../TypeScript_Types/Features'\n\n//functional components\nimport { AntInput, AntSelect } from '../Reusable_UI/Forms/FormFields'\n\n//array destructuring\nconst FormItem = AntForm.Item\n\n//JSX - react FC\nconst CreateFeatureForm = ({\n submitCount,\n values,\n setFieldValue,\n channelChoices\n}: FeatureFormsProps) => {\n\n //local state\n const [isBooleanType, setIsBooleanType] = useState(false)\n\n\n //update boolean type\n useEffect(() => {\n if(values.type === 'Boolean'){\n setIsBooleanType(true);\n } else{\n setIsBooleanType(false);\n }\n }, [values])\n\n //save the inputs on hitting enter\n const handleValuesEnter = () => {\n //featureNames - object with discreteValue\n if (values.featureName) { \n const value = [{ value: values.featureName }, ...values.discreteValues]\n setFieldValue('discreteValues', value)\n //clear input\n setFieldValue('featureName', '')\n }\n }\n\n //remove the feature name\n const handleClose = (removeFeature: any) => {\n const value = values.discreteValues.filter(\n (featureName: any) => featureName.value !== removeFeature.value\n )\n setFieldValue('discreteValues', value)\n }\n\n return (\n
\n \n \n {/* Name */}\n \n \n\n \n {/* category */}\n \n \n \n\n \n \n {/* Channel */}\n \n \n \n\n \n \n {/* values */}\n \n \n \n\n {/* values for the selected type */}\n {values.type && (\n \n {!isBooleanType && (\n \n \n \n \n validateRequiredArray(values.discreteValues)\n }\n >\n {({ field, form }: any) => (\n 0) ||\n (form.touched.featureName &&\n values.discreteValues.length === 0)\n ? 'Values not entered for the value type'\n : false\n }\n validateStatus={\n (values.discreteValues.length === 0 &&\n submitCount > 0) ||\n (form.touched.featureName &&\n values.discreteValues.length === 0)\n ? 'error'\n : 'success'\n }\n >\n {\n values.type === 'Numerical'\n ? form.setFieldValue(\n 'featureName',\n checkNumericVal(value)\n )\n : form.setFieldValue('featureName', value)\n }}\n onPressEnter={handleValuesEnter}\n onBlur={() => form.setFieldTouched(field.name, true)}\n />\n \n )}\n \n \n \n \n {/* Add button to add the input to the featuresNames */}\n \n Add\n \n \n \n )}\n\n
\n {/* feature names / values listing */}\n {values.discreteValues.length > 0\n ? values.discreteValues.map((item: any, index: number) => (\n handleClose(item)}\n style={{ marginBottom: '10px', display: \"inline-block\" }}\n closable={!isBooleanType}\n >\n {item.value}\n \n ))\n : null}\n
\n
\n )}\n
\n )\n}\n\nexport default CreateFeatureForm\n","//container to create feature.\nimport React, { Fragment, useEffect, useContext, useRef, useState } from 'react'\nimport { Formik } from 'formik'\nimport { useMutation, useQuery } from '@apollo/react-hooks'\n\n//graphql\nimport { CREATE_FEATURE } from '../../Graqhql/Features/FeatureMutation'\nimport {\n GET_FEATURES,\n GET_CHANNEL_CHOICES\n} from '../../Graqhql/Features/FeatureQuery'\n\n//constants\nimport { ValueType } from '../../Constants/Features/FeatureValueType'\n\n//contexts\nimport { CreateModalCTX } from '../../Contexts/CreateModalContext'\n\n//typescript types\nimport { FeaturesFormValues } from '../../TypeScript_Types/Features'\n\n//utilities\nimport ErrorBoundary from '../../Utilities/ErrorBoundary'\n\n//functional components\nimport CreateFeatureForm from '../../Components/Feature/Create_FeatureForm'\nimport ModalWrap from '../../Components/Reusable_UI/Modal/ModalFormWrap'\nimport ErrorAlert from '../../Components/Reusable_UI/Alerts/ErrorAlerts'\nimport { LoadingSpinner } from '../../Components/Reusable_UI/Loaders_Spinners/LoadingSpinner'\n\n//const form fields initial state\nconst initialFieldValues: FeaturesFormValues = {\n name: '',\n category: '',\n type: '',\n featureName: '',\n discreteValues: [],\n channel: []\n}\n\n//const modal buttons\nconst buttons = [\n {\n buttonName: 'Create',\n key: 'create'\n }\n]\n\n//JSX\nconst CreateFeature: React.FC = () => {\n //local state\n const [fetchChannelsError, setFetchChannelsError] = useState()\n const [channelChoices, setChannelChoices] = useState([])\n\n //context\n const {\n viewCreateFormModal,\n handleVisible,\n setCreateSuccess,\n createError,\n setCreateError,\n createErrorMsg,\n setCreateErrorMsg\n } = useContext(CreateModalCTX)\n\n //ref to call reset form\n const resetRef: any = useRef(null)\n\n //useEffect - reset form if the modal state changes from true to false.\n //Do not move the reset ref call inside handleVisible, it will change the transform origin of the modal.\n useEffect(() => {\n //reset modal\n if (viewCreateFormModal) {\n resetRef.current && resetRef.current.click()\n }\n }, [viewCreateFormModal])\n\n //graphql mutation - call create feature mutation and then refresh the list\n const [createFeature, { loading }] = useMutation(CREATE_FEATURE, {\n onCompleted() {\n setCreateSuccess(true)\n // reset other states and close the modal\n handleVisible()\n },\n onError(error) {\n setCreateError(true)\n setCreateErrorMsg(error.message)\n },\n refetchQueries: [{ query: GET_FEATURES }]\n })\n\n //get channels\n const { data: channelChoicesData, loading: channelChoicesLoading } = useQuery(\n GET_CHANNEL_CHOICES,\n {\n onError(error) {\n setFetchChannelsError(error)\n }\n }\n )\n\n //get channels options\n useEffect(() => {\n if (channelChoicesData) {\n let channels = channelChoicesData.channels.map(\n (channel: any) => channel.name\n )\n setChannelChoices(channels)\n }\n }, [channelChoicesData])\n\n //submit form to create feature\n const handleSubmit = (values: FeaturesFormValues) => {\n const input = {\n name: values.name,\n category: values.category,\n channel: values.channel,\n type: ValueType[values.type]\n }\n\n const discreteValues = values.discreteValues\n createFeature({ variables: { input, discreteValues } })\n }\n\n return (\n \n \n {({ submitCount, values, submitForm, handleReset, setFieldValue }) => (\n \n {/* error alert, success alert is handled in parent container */}\n {createError && (\n {\n setCreateErrorMsg('')\n setCreateError(false)\n }}\n />\n )}\n\n {/* show spinner or data if dropdown options cannot be fetched */}\n {fetchChannelsError ? (\n \n ) : (\n <>\n {channelChoicesLoading ? (\n \n ) : (\n \n \n \n )}\n \n )}\n\n {/* reset form div ref */}\n
\n \n )}\n \n \n )\n}\n\nexport default CreateFeature\n","//This coponent will display the table content of the feature list\n\nimport React, { useContext } from 'react'\n\n//styled components\nimport { Menu, Dropdown, Icon } from 'antd'\n\n//stylesheet\nimport '../Reusable_UI/Styles.less'\n\n//constants\nimport { columnsNames } from '../../Constants/Features/FeaturesList'\nimport { TypeValue } from '../../Constants/Features/FeatureValueType'\n\n//context\nimport { EditModalCTX } from '../../Contexts/EditModalContext'\n\n//typeScript\nimport { FeaturesTableProps, FeatureListTable } from '../../TypeScript_Types/Features'\n\n//functional component\nimport NoData from '../Reusable_UI/NoData/NoData'\n\n//React FC JSX\nconst FeaturesListTable = ({\n featuresData,\n tableLoading,\n setEditFeatureId,\n handleArchive,\n archiveLoading,\n archivedId\n}: FeaturesTableProps) => {\n //context\n const { handleVisible } = useContext(EditModalCTX)\n\n // pop up action menu\n const menu = (feature: any) => {\n return (\n \n {\n setEditFeatureId(feature.id)\n handleVisible()\n }}\n >\n Edit\n \n \n handleArchive(feature.id, feature.name, feature.archived)\n }\n >\n {feature.archived ? 'Activate' : 'De-activate'}\n \n \n )\n }\n\n return (\n
\n \n \n \n {columnsNames.map((item: any) => (\n \n ))}\n \n \n\n {/* table list */}\n\n \n {featuresData &&\n featuresData.map((rowItems: FeatureListTable, rowIndex) => {\n return (\n \n \n \n \n \n \n \n \n )\n })}\n \n
{item.title}
{rowItems.name}{rowItems.category}{[rowItems.channel].join(', ')}\n {rowItems.discreteValues.map((item, index) =>\n index ? ', ' + item.value : item.value\n )}\n {TypeValue[rowItems.type]}\n {rowItems.id === archivedId && archiveLoading ? (\n \n ) : (\n menu(rowItems)}\n trigger={['click']}\n >\n \n \n )}\n
\n\n {/* no data */}\n {((featuresData && featuresData.length === 0) ||\n (!featuresData && tableLoading)) && }\n
\n )\n}\n\nexport default FeaturesListTable\n","//This is a common form for create feature\n//The form \"Field\" component is from the resuable UI components - refer /Reusable_UI\n\nimport React, { Fragment } from 'react'\n\n//form handler\nimport { Form, Field } from 'formik'\n\n//styled components\nimport { Row, Col, Form as AntForm, Input, Button, Tooltip } from 'antd'\n\n//constant\nimport { typeChoices } from '../../Constants/Features/FeatureValueType'\n\n//functional components\nimport { AntInput, AntSelect } from '../Reusable_UI/Forms/FormFields'\n\n// utilities\nimport {\n validateRequired,\n validateRequiredArray\n} from '../../Utilities/Validate'\nimport { checkNumericVal } from '../../Utilities/CheckNumeric'\n\nimport { featureCategories } from '../../Constants/Features/FeaturesList'\n\n//typeScript\nimport { FeatureFormsProps } from '../../TypeScript_Types/Features'\n\n//array destructuring\nconst FormItem = AntForm.Item\n\n//JSX - React FC\nconst EditFeatureForm = ({\n submitCount,\n values,\n setFieldValue,\n channelChoices\n}: FeatureFormsProps) => {\n //save the inputs on hitting enter\n const handleValuesEnter = () => {\n //featureNames - object with discreteValue\n if (values.featureName) {\n const value = [{ value: values.featureName }, ...values.discreteValues]\n setFieldValue('discreteValues', value)\n //clear input\n setFieldValue('featureName', '')\n }\n }\n\n //remove the feature name\n const handleDeleteValue = (removeFeature: { id: string; value: string }) => {\n const deleteValue = values.discreteValues.filter(\n (item: any) => item.id !== removeFeature.id\n )\n setFieldValue('discreteValues', deleteValue)\n }\n\n //handle value update - update feature name without deleting it\n const handleValueUpdate = (\n updateValue: string,\n item: { id: string; value: string }\n ) => {\n let tempFeatureNames: any = [...values.discreteValues]\n\n for (var index in tempFeatureNames) {\n if (tempFeatureNames[index].id === item.id) {\n if (values.type === 'Numerical') {\n tempFeatureNames[index].value = checkNumericVal(updateValue)\n } else {\n tempFeatureNames[index].value = updateValue\n }\n break\n }\n }\n setFieldValue('discreteValues', tempFeatureNames)\n }\n\n return (\n
\n \n \n {/* Name */}\n \n \n\n \n {/* category */}\n \n \n \n\n \n \n {/* Channel */}\n \n \n \n\n \n \n {/* values */}\n 0}\n submitCount={submitCount}\n validate={validateRequired}\n selectOptions={typeChoices}\n component={AntSelect}\n />\n \n \n\n {/* values for the selected type - note creating features without values will create impact across feature selection\n Tree Select forms */}\n {values.type && (\n \n \n \n \n validateRequiredArray(values.discreteValues)}\n >\n {({ field, form }: any) => (\n 0) ||\n (form.touched.featureName &&\n values.discreteValues.length === 0)\n ? 'Values not entered for the value type'\n : false\n }\n validateStatus={\n (values.discreteValues.length === 0 &&\n submitCount > 0) ||\n (form.touched.featureName &&\n values.discreteValues.length === 0)\n ? 'error'\n : 'success'\n }\n >\n {\n values.type === 'Numerical'\n ? form.setFieldValue(\n 'featureName',\n checkNumericVal(value)\n )\n : form.setFieldValue('featureName', value)\n }}\n onPressEnter={handleValuesEnter}\n onBlur={() => form.setFieldTouched(field.name, true)}\n />\n \n )}\n \n \n \n \n {/* Add button to add the input to the featuresNames */}\n \n Add\n \n \n \n\n
\n {/* feature names listing */}\n {values.discreteValues.length > 0\n ? values.discreteValues.map((item: any, index: number) => (\n \n \n \n \n \n handleValueUpdate(value, item)\n }\n />\n \n \n \n {/* Remove button to add the remove to the value */}\n \n handleDeleteValue(item)}\n icon=\"minus\"\n />\n \n \n \n \n ))\n : null}\n
\n
\n )}\n
\n )\n}\n\nexport default EditFeatureForm\n","//container to edit feature.\nimport React, { Fragment, useEffect, useRef, useContext, useState } from 'react'\nimport { Formik } from 'formik'\nimport { useMutation, useQuery } from '@apollo/react-hooks'\n\n//graphql\nimport { UPDATE_FEATURE } from '../../Graqhql/Features/FeatureMutation'\nimport { GET_FEATURES, GET_FEATURE } from '../../Graqhql/Features/FeatureQuery'\n\n//constants\nimport { ValueType, TypeValue } from '../../Constants/Features/FeatureValueType'\n\n//context\nimport { EditModalCTX } from '../../Contexts/EditModalContext'\n\n//typeScript types\nimport { FeaturesFormValues } from '../../TypeScript_Types/Features'\n\n//utilities\nimport ErrorBoundary from '../../Utilities/ErrorBoundary'\n\n//functional components\nimport EditFeatureForm from '../../Components/Feature/Edit_FeatureForm'\nimport ModalWrap from '../../Components/Reusable_UI/Modal/ModalFormWrap'\nimport ErrorAlert from '../../Components/Reusable_UI/Alerts/ErrorAlerts'\nimport { LoadingSpinner } from '../../Components/Reusable_UI/Loaders_Spinners/LoadingSpinner'\n\n//types props\ninterface Props {\n editFeatureId: string\n}\n\n//initial fields\nlet initialFieldValues: FeaturesFormValues = {\n name: '',\n category: '',\n type: '',\n featureName: '',\n discreteValues: [],\n channel: []\n}\n\n//const modal buttons\nconst buttons = [\n {\n buttonName: 'Edit',\n key: 'editFeature'\n }\n]\n\n//JSX - React FC\nconst EditFeature: React.FC = ({ editFeatureId }) => {\n //local states\n const [featureError, setFeatureError] = useState()\n const [featureInfo, setfeatureInfo] = useState(initialFieldValues)\n const [channelChoices, setChannelChoices] = useState([])\n const [initialDiscreteValues, setinitialDiscreteValues] = useState()\n\n //context\n const {\n handleVisible,\n setEditSuccess,\n setEditErrorMsg,\n editError,\n setEditError,\n editErrorMsg,\n viewEditFormModal\n } = useContext(EditModalCTX)\n\n //get feature details\n const { data: featureData, loading: featureLoading } = useQuery(GET_FEATURE, {\n variables: { id: editFeatureId },\n onError(error) {\n setFeatureError(error)\n }\n })\n\n //update intial state\n useEffect(() => {\n if (featureData) {\n const { feature } = featureData\n let tempInitialVal = Object.create(initialFieldValues)\n\n tempInitialVal.name = feature.name\n tempInitialVal.category = feature.category\n tempInitialVal.channel = feature.channel\n // get the id and discreteValue remove items like \"__typename\"\n tempInitialVal.discreteValues = feature.discreteValues.map(\n (item: { id: string; value: string }) => {\n return { id: item['id'], value: item['value'] }\n }\n )\n\n tempInitialVal.type = TypeValue[feature.type]\n\n setfeatureInfo(tempInitialVal)\n\n let channels = featureData.channels.map((channel: any) => channel.name)\n setChannelChoices(channels)\n\n //store the intial state of feature names, this will be used to find addValues during handleSubmit\n setinitialDiscreteValues(feature.discreteValues)\n }\n }, [featureData])\n\n //ref to call reset form\n const resetRef: any = useRef(null)\n\n //useEffect - reset form if the modal state changes from true to false.\n //Do not move the reset ref call inside handleVisible, it will change the transform origin of the modal.\n useEffect(() => {\n //reset modal form\n if (viewEditFormModal) {\n resetRef.current && resetRef.current.click()\n }\n }, [viewEditFormModal])\n\n //graphql mutation - call create feature mutation and then refresh the list\n const [editFeature, { loading }] = useMutation(UPDATE_FEATURE, {\n onCompleted() {\n setEditSuccess(true)\n // reset other states and close the modal\n handleVisible()\n },\n onError(error) {\n setEditError(true)\n setEditErrorMsg(error.message)\n },\n refetchQueries: [{ query: GET_FEATURES }]\n })\n //submit form\n const handleSubmit = (values: FeaturesFormValues) => {\n const input = {\n name: values.name,\n category: values.category,\n channel: values.channel,\n type: ValueType[values.type]\n }\n\n let addValues = values.discreteValues.filter(\n (feature: any) =>\n !initialDiscreteValues.some(\n (initialFeature: { id: string; value: string }) =>\n initialFeature.id === feature.id\n )\n )\n\n const updateValues = values.discreteValues.filter((feature: any) =>\n initialDiscreteValues.some(\n (initialFeature: { id: string; value: string }) =>\n initialFeature.id === feature.id\n )\n )\n\n const deleteValues = initialDiscreteValues\n .filter(\n (initialFeature: { id: string; value: string }) =>\n !values.discreteValues.some(\n (feature: any) => initialFeature.id === feature.id\n )\n )\n .map((deleteItem: { id: string; value: string }) => deleteItem.id)\n\n editFeature({\n variables: {\n id: editFeatureId,\n input,\n addValues,\n deleteValues,\n updateValues\n }\n })\n }\n\n return (\n \n \n {({ submitCount, values, submitForm, handleReset, setFieldValue }) => (\n \n {/* error alert - update mutation. NOTE - success is handled in the parent component */}\n {editError && (\n {\n setEditError(false)\n setEditErrorMsg('')\n }}\n />\n )}\n\n {/* edit alert - get feature details */}\n {featureError ? (\n \n ) : (\n \n {/* show spinner or data */}\n {featureLoading ? (\n \n ) : (\n \n \n \n )}\n \n )}\n\n {/* reset form div ref */}\n
\n \n )}\n \n \n )\n}\n\nexport default EditFeature\n","//This is the parent container for showing the list of features in /features_list.\n\nimport React, { useState, useEffect, useContext, Fragment } from 'react'\nimport { useQuery, useMutation } from '@apollo/react-hooks'\nimport { Link } from 'react-router-dom'\n\n//styled components\nimport { Collapse, Tooltip, Button, Modal, Breadcrumb } from 'antd'\n\n//graphql query\nimport { GET_FEATURES } from '../../Graqhql/Features/FeatureQuery'\nimport { DELETE_FEATURE } from '../../Graqhql/Features/FeatureMutation'\n\n//context\nimport { CreateModalCTX } from '../../Contexts/CreateModalContext'\nimport { EditModalCTX } from '../../Contexts/EditModalContext'\n\n//utilities\nimport ErrorBoundary from '../../Utilities/ErrorBoundary'\n\n//functional components\nimport CreateFeature from '../Feature/CreateFeature'\nimport PageTitle from '../../Components/Reusable_UI/Headers_Titles/PageTitles'\nimport LayoutWrap from '../../HOC/LayoutWrap'\nimport { SearchField } from '../../Components/Reusable_UI/Forms/SearchField'\nimport FeaturesListTable from '../../Components/FeaturesList/FeaturesListTable'\nimport EditFeature from '../Feature/EditFeature'\nimport SuccessAlert from '../../Components/Reusable_UI/Alerts/SuccessAlerts'\nimport ErrorAlert from '../../Components/Reusable_UI/Alerts/ErrorAlerts'\n\n//ant component destructuring\nconst { Panel } = Collapse\nconst { confirm } = Modal\n\n//inline styles\nconst titleDiv = {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center'\n}\n\nconst searchAddDiv = {\n display: 'flex',\n justifyContent: 'space-between',\n flexBasis: '21%'\n}\n\n//const title of login page\nconst PAGE_TITLE = 'Features'\n\n//Breadcrumb nav\nconst FeatureBreadcrumb = () => {\n return (\n \n \n Create experiment\n \n Features\n \n )\n}\n\n//JSX\nconst FeaturesList: React.FC = props => {\n //local state\n const [featuresData, setFeatures] = useState([])\n const [featuresDataError, setFeaturesDataError] = useState()\n const [activeData, setActiveData] = useState([])\n const [inactiveData, setInactiveData] = useState([])\n const [activeKey, setActiveKey] = useState(['1'])\n const [editFeatureId, setEditFeatureId] = useState('')\n const [archivedId, setArchivedId] = useState()\n const [archiveError, setArchiveError] = useState()\n\n //contexts\n const { createSuccess, handleVisible, viewCreateFormModal } = useContext(\n CreateModalCTX\n )\n const { editSuccess, viewEditFormModal } = useContext(EditModalCTX)\n\n //get features data from graphql\n const { data, loading } = useQuery(GET_FEATURES, {\n onError(error) {\n setFeaturesDataError(error)\n }\n })\n\n //update data\n useEffect(() => {\n if (data) {\n setFeatures(data.features)\n }\n }, [data])\n\n //sort features based on active or inactive state whenever features Data changes\n useEffect(() => {\n if (featuresData) {\n let active: any = []\n let inactive: any = []\n\n featuresData.forEach((item: any) => {\n if (item.archived) {\n inactive.push(item)\n } else {\n active.push(item)\n }\n })\n\n setActiveData(active)\n setInactiveData(inactive)\n }\n }, [featuresData])\n\n //delete brand mutation\n const [updateArchive, { loading: archiveLoading }] = useMutation(\n DELETE_FEATURE,\n {\n onCompleted() {\n setArchivedId(null)\n },\n onError() {\n setArchiveError(true)\n },\n refetchQueries: [{ query: GET_FEATURES }]\n }\n )\n\n //call's delete mutation to deactivate\n const handleArchive = (id: string, name: string, archived: boolean) => {\n //set the selected feature id for archive\n setArchivedId(id)\n\n //confirm modal\n confirm({\n title: archived ? 'Activate feature' : 'Deactivate feature',\n content: `Are you sure you want to ${\n archived ? 'activate' : 'de-activate'\n } ${name.substring(0, 40)}...?`,\n okText: 'Yes',\n okType: 'danger',\n cancelText: 'No',\n onOk() {\n updateArchive({\n variables: {\n id: id,\n input: { archived: archived ? false : true }\n }\n })\n }\n })\n }\n\n // close archive error popup\n const onCloseArchiverror = () => {\n setArchiveError(null)\n setArchivedId(null)\n }\n\n //search feature filter\n const handleSearch = (value: string) => {\n if (!value) {\n setFeatures(featuresData)\n } else {\n const filteredItem = data.features.filter((feature: any) => {\n let name = feature.name.toLowerCase()\n return name.indexOf(value) > -1\n })\n setFeatures(filteredItem)\n }\n }\n\n return (\n \n {/* breadcrumb navigations */}\n \n\n {/* title and search bar div */}\n
\n \n
\n \n {/* create feature button */}\n \n \n \n {/* create feature form */}\n {viewCreateFormModal && }\n
\n
\n\n {/* if error while fetching features, display the error alert else render table */}\n\n {featuresDataError ? (\n \n ) : (\n \n {/* create or edit feature success alert */}\n {createSuccess || editSuccess ? (\n \n ) : null}\n\n {/* archive feature error alert */}\n {archiveError && (\n \n )}\n\n {/* table content in collapsible panel*/}\n setActiveKey(key)}\n >\n {/* active panel */}\n \n \n \n \n \n\n {/* inactive panel */}\n \n \n \n \n \n \n\n {viewEditFormModal && }\n \n )}\n
\n )\n}\n\nexport default FeaturesList\n","//Context - Build.\n// This is the context for handling the build of a batch individually.\n\nimport React, { createContext, useState, useEffect } from 'react'\n\n//create context\nexport const BuildModalCTX: any = createContext({})\n\nconst BuildModalProvider: React.FC = props => {\n //local state\n const [buildSuccess, setBuildSuccess] = useState(false)\n const [buildError, setBuildError] = useState(false)\n const [buildErrorMsg, setBuildErrorMsg] = useState('')\n //show or hide state of modal\n const [buildFormModal, setViewFolderFormModal] = useState(false)\n\n // mount timer and unmount cleanup - set timer for 2secs and remove timer when the component is unmounted\n useEffect(() => {\n const timeout = setTimeout(() => {\n if (buildSuccess) {\n setBuildSuccess(false)\n }\n }, 2000)\n\n return () => {\n // clear timeout\n return clearTimeout(timeout)\n }\n }, [buildSuccess])\n\n const handleVisible = () => {\n if (buildFormModal) {\n setBuildError(false)\n setBuildErrorMsg('')\n }\n setViewFolderFormModal(prevState => !prevState)\n }\n return (\n \n {props.children}\n \n )\n}\n\nexport default BuildModalProvider\n","//View permutation form - This component will display the details of an experiment.\n//The form \"Field\" component is from the resuable UI components - refer /Reusable_UI\n\nimport React, { useState, Fragment, useEffect } from 'react'\n\n//styled components\nimport {\n Row,\n Col,\n Input,\n Icon,\n Tooltip,\n Switch,\n Form as AntForm,\n Button,\n Popconfirm,\n Alert\n} from 'antd'\nimport { Formik } from 'formik'\nimport * as _ from 'lodash'\n\n//functional components\nimport {\n ToggleSelect,\n ToggleListSelect,\n ToggleEditInput,\n ToggleTreeSelect\n} from '../Reusable_UI/Forms/Toggle'\n\n//utilities\nimport { numberWithCommas, formatPermutationName } from '../../Utilities/Format'\nimport { GetFeaturesTree } from '../../Utilities/FeaturesTree'\nimport { accumulateFeatures3 } from '../../Utilities/Experiment'\n\n// ant d\nconst FormItem = AntForm.Item\nconst { TextArea } = Input\n\n//typescript\ninterface Props {\n permutationDetails: any\n updatePermutation: (perm: any) => void\n expFeatures: any[]\n}\n\n//inline styles\nconst toggleIconDiv = {\n display: 'flex',\n alignItems: 'center',\n height: 115\n}\n\nconst toggleIcon = { fontSize: '22px' }\n\nconst ViewPermutationDetails = ({\n permutationDetails,\n updatePermutation,\n expFeatures\n}: Props): JSX.Element => {\n // local state\n const [showForm, setShowForm] = useState(true)\n const [variablesTreeData, setVariablesTreeData] = useState()\n const [attributesTreeData, setAttributesTreeData] = useState()\n\n //extract experiment from permtuation details\n const { experiment } = permutationDetails\n\n //generate the features tree structure for selection choices\n useEffect(() => {\n setVariablesTreeData(GetFeaturesTree(expFeatures))\n }, [expFeatures])\n\n //filter features to not allow the listing of archived features\n useEffect(() => {\n const filteredFeatures = permutationDetails.features.filter(\n ({ archived }: { archived: boolean }) => !archived\n )\n setAttributesTreeData(GetFeaturesTree(filteredFeatures))\n }, [permutationDetails.features])\n\n // show of hide permutation details\n const showHideFormToggle = (): void => {\n setShowForm(prevState => !prevState)\n }\n\n //create a dropdown for feature variables & attributes\n const getFeaturesList = (features: any[]): any[] =>\n accumulateFeatures3(features)\n\n //save the selected features variables\n const getFeaturesVariables = (features: any[]): any[] => {\n const objects: any[] = []\n experiment.experimentDiscreteSet.forEach((discreteFeature: any) => {\n if (features.includes(discreteFeature.discreteValue.id)) {\n objects.push(discreteFeature)\n }\n })\n return objects\n }\n\n //save selected attributes\n const getFeaturesAttributes = (features: string[]): any[] => {\n const objects: any[] = []\n permutationDetails.features.forEach((featureObject: any) => {\n featureObject.discreteValues.forEach((discreteFeature: any) => {\n if (features.includes(discreteFeature.id)) {\n objects.push({\n ...discreteFeature,\n feature: { id: featureObject.id, name: featureObject.name }\n })\n }\n })\n })\n return objects\n }\n\n //save brand objects\n const getBrandObjects = (input: any): any[] =>\n experiment.experimentBrandSet.filter((b: any) => input.includes(b.brand.id))\n\n //submit edits\n const submitChanges = (values: any): void => {\n const permutationName = formatPermutationName({\n values: {\n ...values,\n variables: values.variables.map(({ id }: { id: string }) => id),\n brands: values.brand.map(\n ({ brand: { id } }: { brand: { id: string } }) => id\n )\n },\n brandsList: experiment.brands,\n permutationData: permutationDetails\n })\n\n updatePermutation({\n name: permutationName,\n estCost: values.estCost,\n actualCost: values.actualCost,\n estImpressions: values.estImpressions,\n actualImpressions: values.actualImpressions,\n iscs: values.iscs,\n notes: values.notes,\n channel: values.channel,\n medium: values.medium,\n folder: values.folder,\n variables: values.variables,\n brands: values.brand,\n attributes: values.attributes,\n finalNumber: values.finalNumber\n })\n }\n\n //check the hasFolder\n const hasFolder = Boolean(\n permutationDetails.folders && permutationDetails?.folders?.length\n )\n\n return (\n \n \n {({ values, initialValues, setFieldValue }) => {\n const showSave = !_.isEqual(values, initialValues)\n\n const permutationName = formatPermutationName({\n values: {\n ...values,\n variables: values.variables.map(({ id }: { id: string }) => id),\n brands: values.brand.map(\n ({ brand: { id } }: { brand: { id: string } }) => id\n )\n },\n brandsList: experiment.brands,\n permutationData: permutationDetails\n })\n\n //show or hide ISCS field\n const showISCS = values.channel === 'TV'\n\n return (\n \n {/* Alert */}\n {values.finalNumber && (\n
\n \n
\n )}\n\n {/* experiment details */}\n \n \n \n\n {/* Group / Folder */}\n {hasFolder && (\n f.id === values.folder?.id\n )?.name\n }\n selectValue={values.folder?.id}\n fieldValue={(value: string) =>\n permutationDetails.folders.find((f: any) => f.id === value)\n }\n options={permutationDetails.folders}\n optionValue={(o: any) => o.id}\n optionName={(o: any) => o.name}\n setValue={(value: any) => setFieldValue('folder', value)}\n disableSelect={values.finalNumber}\n />\n )}\n\n {/* permutation section */}\n \n \n \n \n \n \n\n {/* permutaiton name */}\n \n \n \n \n \n\n {/* permutation ID */}\n \n \n \n \n \n \n\n {showForm && (\n \n {/* brands */}\n \n values.brand.some((br: any) => br.brand.id === b.id)\n )}\n selectValue={values.brand.map((b: any) => b.brand.id)}\n fieldValue={(v: string) => v}\n options={experiment.brands}\n optionValue={(o: any) => o.id}\n optionName={(o: any) => o.name}\n setFieldValue={(value: string) => {\n setFieldValue('brand', getBrandObjects(value))\n }}\n // if the final number is true, disable the list\n disableList={values.finalNumber}\n />\n\n \n \n {/* Channel */}\n value}\n options={experiment.channels}\n optionValue={(o: string) => o}\n optionName={(o: string) => o}\n setValue={(value: any) => {\n //if the channel is already set to TV, reset ISCS field on updating channel\n if (showISCS) {\n setFieldValue('iscs', '')\n }\n //update channel\n setFieldValue('channel', value.toUpperCase())\n }}\n // if the final number is true, disable the list\n disableSelect={values.finalNumber}\n />\n \n\n \n {/* Medium*/}\n value}\n options={experiment.mediums}\n optionValue={(o: string) => o}\n optionName={(o: string) => o}\n setValue={(value: any) =>\n setFieldValue('medium', value.toUpperCase())\n }\n disableSelect={values.finalNumber}\n />\n \n\n {showISCS && (\n \n {/* iscs code */}\n \n setFieldValue('iscs', v)\n }\n disableInput={values.finalNumber}\n />\n \n )}\n \n\n \n \n {/* Estimated impressions*/}\n \n setFieldValue('estImpressions', v)\n }\n disableInput={values.finalNumber}\n />\n \n\n \n {/* Actual impressions */}\n \n setFieldValue('actualImpressions', v)\n }\n disableInput={values.finalNumber}\n />\n \n\n \n {/* Estimated spend */}\n \n setFieldValue('estCost', v)\n }\n disableInput={values.finalNumber}\n />\n \n\n \n {/* Spend to Date */}\n \n setFieldValue('actualCost', v)\n }\n disableInput={values.finalNumber}\n />\n \n\n \n {/* Final numbers - if confirmed update permutation*/}\n \n \n {\n //the visual toggle change will not happen, submission must take place immediately\n values.finalNumber = true\n submitChanges(values)\n }}\n disabled={values.finalNumber}\n >\n \n \n \n \n \n \n\n {/* features - variables*/}\n v.discreteValue.id\n )}\n treeData={variablesTreeData}\n filterProp=\"title\"\n setFieldValue={(value: any) => {\n setFieldValue('variables', getFeaturesVariables(value))\n }}\n disableEdit={values.finalNumber}\n />\n\n {/* attributes */}\n a.id)}\n treeData={attributesTreeData}\n filterProp=\"title\"\n setFieldValue={(value: any) => {\n setFieldValue('attributes', getFeaturesAttributes(value))\n }}\n disableEdit={values.finalNumber}\n />\n\n {/* Notes */}\n setFieldValue('notes', v)}\n disableInput={values.finalNumber}\n />\n\n {showSave && (\n \n \n submitChanges(values)}\n >\n \n \n \n \n )}\n \n )}\n
\n )\n }}\n \n
\n )\n}\n\nexport default ViewPermutationDetails\n","//Query - flowcodes\n\nimport gql from 'graphql-tag'\n\n//get all flowcodes form options\nexport const GET_FLOWCODES_OPTIONS = gql`\n query($id: UUID, $category: String) {\n # permutations\n permutation(id: $id) {\n id\n # brands drop down\n permutationBrandSet {\n id\n brands {\n id\n name\n }\n }\n }\n\n #flowcode features\n features(category: $category) {\n id\n name\n archived\n discreteValues {\n id\n value\n }\n }\n }\n`\n\n//get all flowcodes list\nexport const GET_FLOWCODES_LIST = gql`\n query($id: UUID) {\n permutationBatches(id: $id) {\n id\n domain\n type\n isBuilt\n isScan\n batchFlowcodes {\n id\n redirectValue\n shorturl\n active\n batch {\n id\n attributes {\n id\n value\n feature {\n id\n name\n }\n }\n }\n flowcodeBrandSet {\n id\n permutationBrand {\n id\n brands {\n id\n name\n }\n }\n }\n }\n }\n permutation(id: $id) {\n id\n name\n }\n }\n`\n\n//get batch / flowcode by ID\n\nexport const GET_FLOWCODES_EDIT = gql`\n query($id: ID, $permutationId: UUID, $category: String) {\n # selection choices from permutation\n # permutations\n permutation(id: $permutationId) {\n id\n # brands dropdown\n permutationBrandSet {\n id\n brands {\n id\n name\n }\n }\n }\n # created batch details\n batch(id: $id) {\n id\n domain\n type\n attributes {\n id\n value\n }\n # delete attributes id\n batchDiscreteSet {\n id\n discreteValue {\n id\n }\n }\n # brand\n batchFlowcodes {\n id\n flowcodeBrandSet {\n id\n permutationBrand {\n id\n }\n }\n redirectValue\n shorturl\n }\n isScan\n }\n # features dropdown\n features(category: $category) {\n id\n name\n archived\n discreteValues {\n id\n value\n }\n }\n }\n`\n","//Mutation - Flowcodes\n\nimport gql from 'graphql-tag'\n\n//create batch (flowcodes)\nexport const CREATE_BATCH = gql`\n mutation(\n $permutationId: UUID\n $input: BatchInputType\n $attributes: [UUID]\n $permutationBrand: [UUID]\n ) {\n createBatch(\n permutationId: $permutationId\n input: $input\n attributes: $attributes\n permutationBrand: $permutationBrand\n ) {\n ok\n batch {\n id\n }\n }\n }\n`\n\n//delete batch\nexport const DELETE_BATCH = gql`\n mutation($id: ID!) {\n deleteBatch(id: $id) {\n ok\n }\n }\n`\n\n//update flowcodes\nexport const UPDATE_FLOWCODES = gql`\n mutation(\n $addBrand: [UUID]\n $deleteBrand: [UUID]\n $id: UUID!\n $input: FlowcodeInputType\n ) {\n updateFlowcode(\n id: $id\n input: $input\n deleteBrand: $deleteBrand\n addBrand: $addBrand\n ) {\n ok\n }\n }\n`\n\n//update batch\nexport const UPDATE_BATCH = gql`\n mutation(\n $addAttributes: [UUID]\n $deleteAttributes: [UUID]\n $id: ID!\n $input: BatchInputType\n ) {\n updateBatch(\n id: $id\n input: $input\n addAttributes: $addAttributes\n deleteAttributes: $deleteAttributes\n ) {\n ok\n }\n }\n`\n\n//build a batch\nexport const BUILD_BATCH = gql`\n mutation($id: ID!, $quantity: Int!) {\n buildBatch(id: $id, quantity: $quantity) {\n ok\n }\n }\n`\n\n//build all batch\nexport const BUILD_ALL = gql`\n mutation($permutationId: UUID!, $quantity: Int!) {\n buildBatches(permutationId: $permutationId, quantity: $quantity) {\n ok\n }\n }\n`\n","//This component will generate the flowcode details in a tabular form in view permutation\n//This coponent will display the table of the permutation list\n\nimport React, { useContext, Fragment } from 'react'\n\n//styled components\nimport { Dropdown, Menu, Icon, Divider } from 'antd'\n\n//contexts\nimport { EditModalCTX } from '../../Contexts/EditModalContext'\nimport { BuildModalCTX } from '../../Contexts/BuildModalContext'\n\n//constants\nimport { columnsNames } from '../../Constants/Flowcodes/Flowcodes'\n\n//stylesheet\nimport '../Reusable_UI/Styles.less'\n\n//functional component\nimport NoData from '../Reusable_UI/NoData/NoData'\n\n//typescript\nimport { FlowcodesTableProps } from '../../TypeScript_Types/Flowcodes'\n\n//inline styles\nconst menuStyle = {\n color: '#1890ff',\n cursor: 'pointer',\n margin: '0'\n}\n\n// TODO: update typings\nconst renderFlowcodeFeatures = (attributes: any): JSX.Element[] => {\n const featuresHash = attributes.reduce((prev: any, curr: any) => {\n const featureName = curr?.feature?.name\n if (prev[featureName]) prev[featureName] += `, ${curr.value}`\n else prev[featureName] = `${curr.value}`\n return prev\n }, {})\n const keys = Object.keys(featuresHash)\n const features = keys.map(key => (\n
\n {key}:\n {` `}\n {featuresHash[key]}\n
\n ))\n return features\n}\n\n//table header titles with center align text\nconst TableHeaderTitleCenter = ['Download', 'Preview', 'Actions']\n\nconst ViewFlowcodesTable = ({\n flowcodeData,\n listLoading,\n setPreviewQRId,\n deleteBatchId,\n handleDeleteBatch,\n setEditBatchId,\n setBuildBatchId,\n deleteLoading,\n downloadQRId,\n downloadQRLoading,\n handleDownloadQR\n}: FlowcodesTableProps) => {\n //context\n const { handleVisible } = useContext(EditModalCTX)\n const { handleVisible: buildHandleVisible } = useContext(BuildModalCTX)\n\n // pop up action menu\n const menu = (rowItemsId: string, batchFlowcodesId: string) => {\n return (\n \n {\n setEditBatchId({ id: rowItemsId, flowcodeId: batchFlowcodesId })\n handleVisible()\n }}\n >\n Edit flowcode\n \n handleDeleteBatch(rowItemsId)}>\n Delete flowcode\n \n \n )\n }\n\n return (\n
\n \n \n \n {columnsNames.map(item => (\n \n {item.title}\n \n ))}\n \n \n\n {/* table list */}\n\n \n {flowcodeData &&\n flowcodeData.permutationBatches.map(\n (rowItems, rowIndex: number) => {\n return (\n \n \n {/* Type - convert the string to lowercase except the first char */}\n \n \n\n {/* flowcodes */}\n {rowItems.batchFlowcodes.length > 0 ? (\n rowItems.batchFlowcodes.map(flowcode => (\n \n \n \n \n \n \n \n ))\n ) : (\n \n \n \n \n \n \n )}\n\n {/* preview icon */}\n {rowItems.type === 'MANY' ? (\n \n ) : (\n \n {rowItems.isBuilt ? (\n setPreviewQRId(rowItems.id)}\n >\n \n \n ) : (\n \n )}\n \n )}\n\n {/* download icon */}\n {rowItems.id === downloadQRId && downloadQRLoading ? (\n \n ) : (\n \n {rowItems.isBuilt ? (\n handleDownloadQR(rowItems.id)}\n className=\"tableIconDiv\"\n >\n \n \n ) : (\n \n )}\n \n )}\n\n {/* actions */}\n {rowItems.id === deleteBatchId && deleteLoading ? (\n \n ) : (\n // action menu\n \n )}\n \n )\n }\n )}\n \n
{rowIndex + 1}\n {rowItems.type.charAt(0) +\n rowItems.type.substring(1).toLowerCase()}\n {rowItems.id}{flowcode.shorturl ? flowcode.shorturl : ''}\n {flowcode.redirectValue\n ? flowcode.redirectValue\n : ''}\n \n {renderFlowcodeFeatures(\n flowcode?.batch?.attributes\n )}\n \n {flowcode.flowcodeBrandSet &&\n flowcode.flowcodeBrandSet\n .map(item => item.permutationBrand.brands.name)\n .join(', ')}\n {rowItems.isScan ? 'True' : 'False'}-\n \n \n {' '}\n {' '}\n -\n \n \n \n {/* In the actions column for ‘one’ flow codes - build shouldn’t be an option */}\n {rowItems.type !== 'ONE' && (\n {\n setBuildBatchId(rowItems.id)\n buildHandleVisible()\n }}\n >\n Build\n \n )}\n\n {rowItems.type !== 'ONE' && (\n \n )}\n\n \n menu(rowItems.id, rowItems.batchFlowcodes[0].id)\n }\n trigger={['click']}\n >\n More\n \n \n
\n {(flowcodeData && flowcodeData.permutationBatches.length < 1) ||\n !flowcodeData ||\n listLoading ? (\n \n ) : null}\n
\n )\n}\n\nexport default ViewFlowcodesTable\n","// TODO: move to flowcode utils?\n\nconst urlPatternStart = /(http|sms:|mailto:)/\nconst urlPatternSplit = /,(http|sms:|mailto:)/\n\nexport const splitURLs = (value: string): string[] => {\n const urls = []\n let ind = value.search(urlPatternSplit)\n let url = ''\n while (ind !== -1) {\n url = value.substr(0, ind).trim()\n if (url.search(urlPatternStart) === 0) {\n urls.push(url)\n }\n value = value.substr(ind + 1)\n ind = value.search(urlPatternSplit)\n }\n url = value.trim()\n if (url.search(urlPatternStart) === 0) {\n urls.push(value)\n }\n return urls\n}\n\nexport const constructRedirectValue = ({\n redirectValue1,\n redirectValue2,\n redirectValue3,\n redirectValue4,\n redirectValue5,\n redirectValue6\n}: {\n redirectValue1?: string\n redirectValue2?: string\n redirectValue3?: string\n redirectValue4?: string\n redirectValue5?: string\n redirectValue6?: string\n}): string =>\n [\n redirectValue1,\n redirectValue2,\n redirectValue3,\n redirectValue4,\n redirectValue5,\n redirectValue6\n ]\n .filter(Boolean)\n .join(',')\n","//create or edit flowcode types\n\ntype FlowcodesTypes = 'One' | 'Many'\n\n//The actual enum is in all caps, transform it to uppercase before sending the mutation request\nexport const FlowcodesType: Readonly = ['One', 'Many']\n","//this component will generate form layout for create and edit flowcodes\n\nimport React, { useEffect, useState } from 'react'\nimport {\n getLandingPageType,\n landingPageValidator,\n LandingPageOptions\n} from '@dtx-company/flowcode-utils'\n\n//form handler\nimport { Form, Field } from 'formik'\nimport {\n Row,\n Col,\n Form as AntForm,\n TreeSelect,\n Descriptions,\n Collapse,\n Tooltip,\n Switch\n} from 'antd'\n\n//constants\nimport { FlowcodesType } from '../../Constants/Flowcodes/FlowcodesType'\n\n//typeScript\nimport {\n FeaturePreview,\n AllFeaturesItem\n} from '../../TypeScript_Types/Features'\nimport { FlowcodesFormProps } from '../../TypeScript_Types/Flowcodes'\n\n//utils\nimport { GetFeaturesTree } from '../../Utilities/FeaturesTree'\n\n//functional components\nimport { AntInput, AntSelect } from '../Reusable_UI/Forms/FormFields'\nimport { AntSelectWithVal } from '../Reusable_UI/Forms/SelectWithVal'\nimport { validateRequired } from '../../Utilities/Validate'\n\n//ant design destructuring\nconst FormItem = AntForm.Item\nconst { SHOW_CHILD } = TreeSelect\nconst DescriptionsItem = Descriptions.Item\nconst { Panel } = Collapse\n\ninterface AddRemoveButton {\n displayPlusButton: boolean\n displayMinusButton: boolean\n handleAddBtnClick?: () => void\n handleMinusBtnClick?: () => void\n}\n\nconst AddRemoveButton = ({\n displayPlusButton,\n displayMinusButton,\n handleAddBtnClick = () => null,\n handleMinusBtnClick = () => null\n}: AddRemoveButton): JSX.Element => (\n \n
\n {displayPlusButton && (\n \n +\n \n )}\n {displayMinusButton && (\n \n -\n \n )}\n
\n \n)\n\nconst CreateEditFlowcode = ({\n submitCount,\n flowcodesData,\n values,\n setFieldValue,\n flowcodeType,\n featuresData,\n initialDataReady,\n setInitialDataReady\n}: FlowcodesFormProps): JSX.Element => {\n //local states\n const [brandsList, setBrandsList] = useState()\n const [featureTreeData, setFeatureTreeData] = useState()\n const [selectedFeaturesPreview, setSelectedFeaturePreview] = useState([])\n const [featureUpdated, setFeatureUpdated] = useState(false)\n // TOOD: refactor, add prefix key, make this infinite\n const [visibleLandingPages, setVisibleLandingPages] = useState<{\n [key: number]: boolean\n }>({\n 1: true,\n 2: !!values.redirectValue2,\n 3: !!values.redirectValue3,\n 4: !!values.redirectValue4,\n 5: !!values.redirectValue5,\n 6: !!values.redirectValue6\n })\n\n React.useEffect(() => {\n if (initialDataReady) {\n setVisibleLandingPages({\n 1: true,\n 2: !!values.redirectValue2,\n 3: !!values.redirectValue3,\n 4: !!values.redirectValue4,\n 5: !!values.redirectValue5,\n 6: !!values.redirectValue6\n })\n }\n }, [\n initialDataReady,\n values.redirectValue2,\n values.redirectValue3,\n values.redirectValue4,\n values.redirectValue5,\n values.redirectValue6\n ])\n\n const toggleVisibleLandingPage = (page: number): void => {\n setVisibleLandingPages(prev => {\n const isOpen = !prev[page]\n const redirectValue: any = `redirectValue${page}`\n if (!isOpen) setFieldValue(redirectValue, '', false)\n return {\n ...prev,\n [page]: isOpen\n }\n })\n }\n\n const validateRedirectValue = (value: string): string => {\n const id: LandingPageOptions = getLandingPageType(value)\n const isValid = landingPageValidator({\n id,\n url: value,\n data: value, // handle sms and mailto links\n options: {\n requireProtocol: true\n }\n })\n return !isValid ? 'Please enter a valid URL. Protocol is required.' : ''\n }\n\n const isLandingPageTwoVisible = visibleLandingPages[2]\n const isLandingPageThreeVisible = visibleLandingPages[3]\n const isLandingPageFourVisible = visibleLandingPages[4]\n const isLandingPageFiveVisible = visibleLandingPages[5]\n const isLandingPageSixVisible = visibleLandingPages[6]\n\n //create custom brandsList for selection from the permutations brands\n\n useEffect(() => {\n if (flowcodesData) {\n const customBrandsList = flowcodesData.permutation.permutationBrandSet.map(\n (item: { id: string; brands: { name: string } }) => {\n return {\n id: item.id,\n name: item.brands.name\n }\n }\n )\n setBrandsList(customBrandsList)\n }\n }, [flowcodesData])\n\n // create attributes features data tree\n useEffect(() => {\n if (featuresData && flowcodesData) {\n //create custom object for creating feature tree hierarchial structure from permutations attributes\n const treeData = GetFeaturesTree(featuresData)\n setFeatureTreeData(treeData)\n }\n }, [featuresData, flowcodesData])\n\n //create preview for selected features\n useEffect(() => {\n if (!flowcodesData) return\n //FEATURES - create an oject of selected featureNames with features.\n //PREVIEW FEATURE NAMES - ATTRIBUTES\n const selectedFeaturesPreview = (inputValue: Array) => {\n const selectedFeatures = flowcodesData?.features?.reduce(function(\n acc: Array,\n obj: AllFeaturesItem\n ) {\n //find if the feature already exists in the accumulator\n if (obj.discreteValues.some(item => inputValue.includes(item.id))) {\n // check if the feature already exist\n const objIndex = acc.findIndex(object => object.featureId === obj.id)\n //create a filtered discrete\n const filteredDiscrete = obj.discreteValues.filter(discrete =>\n inputValue.includes(discrete.id)\n )\n if (objIndex === -1) {\n //create custom object\n const customFeature = {\n featureId: obj.id,\n featureName: obj.name,\n discreteValues: [...filteredDiscrete]\n }\n acc.push(customFeature)\n } else {\n //replace attributes value in existing object\n acc[objIndex].discreteValues = [...filteredDiscrete]\n }\n }\n return acc\n },\n [])\n return selectedFeatures\n }\n\n //only if the values is not undefined and experiement feature has been updated this block will run.\n if ((values.attributes.length > 0 && initialDataReady) || featureUpdated) {\n //create a new array consisting the feature of the selected discrete values.\n const optFeatureData = selectedFeaturesPreview(values.attributes)\n setSelectedFeaturePreview(optFeatureData)\n setFeatureUpdated(false)\n\n if (initialDataReady) {\n setInitialDataReady(false)\n }\n }\n }, [\n values,\n flowcodesData,\n featureUpdated,\n featuresData,\n featureTreeData,\n initialDataReady,\n setInitialDataReady\n ])\n\n return (\n
\n \n \n {/* flowcode type */}\n {/* note - In any one permutation there should only be flowcodes with either ‘one’ or ‘many’.\n Once the user creates a flow code with either, they should not be allowed to create another with the other type*/}\n\n \n \n \n \n \n setFieldValue('isScan', checked)}\n checked={values.isScan}\n />\n \n \n \n \n Landing Pages:\n
\n \n \n \n \n toggleVisibleLandingPage(2)}\n />\n \n {isLandingPageTwoVisible && (\n \n \n \n \n toggleVisibleLandingPage(3)}\n handleMinusBtnClick={() => toggleVisibleLandingPage(2)}\n />\n \n )}\n {isLandingPageThreeVisible && (\n \n \n \n \n toggleVisibleLandingPage(4)}\n handleMinusBtnClick={() => toggleVisibleLandingPage(3)}\n />\n \n )}\n {isLandingPageFourVisible && (\n \n \n \n \n toggleVisibleLandingPage(5)}\n handleMinusBtnClick={() => toggleVisibleLandingPage(4)}\n />\n \n )}\n {isLandingPageFiveVisible && (\n \n \n \n \n toggleVisibleLandingPage(6)}\n handleMinusBtnClick={() => toggleVisibleLandingPage(5)}\n />\n \n )}\n {isLandingPageSixVisible && (\n \n \n \n \n toggleVisibleLandingPage(5)}\n handleMinusBtnClick={() => toggleVisibleLandingPage(6)}\n />\n \n )}\n
\n\n {/* brands */}\n \n\n {/* Flowcode features - permutation attributes*/}\n \n {({ field, form }: any) => (\n \n {\n setFieldValue('attributes', value)\n setFeatureUpdated(true)\n }}\n onBlur={() => form.setFieldTouched(field.name, true)}\n />\n \n )}\n \n\n {/* flowcodes preview */}\n \n \n \n {selectedFeaturesPreview.length > 0 ? (\n \n {selectedFeaturesPreview.map((previewItem: any) => (\n \n {previewItem.discreteValues.map((item: any) => (\n

\n {item.value}\n

\n ))}\n \n ))}\n \n ) : (\n
\n

Features not selected.

\n
\n )}\n
\n
\n
\n \n )\n}\n\nexport default CreateEditFlowcode\n","//This component will create formik based input fields using ant d.\n\nimport React from 'react'\nimport { FieldProps } from 'formik'\n\n//styled component\nimport { Form, Input } from 'antd'\n\n//utilities\nimport { checkNumeric } from '../../../Utilities/CheckNumeric'\n\n//Ant d component destructuring\nconst FormItem = Form.Item\n\n//typescript for form fields\ninterface formFields {\n prefix: React.ReactNode\n label: string\n hasFeedback?: boolean\n type: string\n submitCount: number\n}\n\n//type class\ntype Class = { new (...args: any[]): any }\n\n//JSX\nexport const InputNumber = (AntComponent: Class) => ({\n field,\n form,\n hasFeedback,\n label,\n type,\n submitCount,\n ...props\n}: FieldProps & formFields) => {\n const touched = form.touched[field.name]\n const submitted = submitCount > 0\n const hasError = form.errors[field.name]\n const submittedError = hasError && submitted\n const touchedError = hasError && touched\n\n const onChange = (value: any) =>\n form.setFieldValue(field.name, checkNumeric(value))\n const onBlur = () => form.setFieldTouched(field.name, true)\n return (\n
\n \n \n \n
\n )\n}\n\nexport const AntInputNumber = InputNumber(Input)\n","//this component will generate form layout to accept the quantity for build\n\nimport React from 'react'\n\n//form handler\nimport { Form, Field } from 'formik'\n\n//styled components\nimport { Row, Col } from 'antd'\n\n//functional components\nimport { AntInputNumber } from '../Reusable_UI/Forms/InputNumber'\n\n//utitlities\nimport { validateRequired } from '../../Utilities/Validate'\n\n//typeScript\ninterface Props {\n submitCount: number\n}\n\n\nconst BuildQuantityForm = ({ submitCount }: Props) => {\n return (\n
\n \n \n \n \n \n
\n )\n}\n\nexport default BuildQuantityForm\n","//SaveBuildBatch - invoked after successful create flowcode on type MANY\nimport React, { useContext, Fragment } from 'react'\nimport { Formik } from 'formik'\nimport { useMutation } from '@apollo/react-hooks'\n\n//context\nimport { CreateModalCTX } from '../../Contexts/CreateModalContext'\n\n//graphql\nimport { BUILD_BATCH } from '../../Graqhql/Flowcodes/FlowcodesMutation'\n\n//utilities\nimport ErrorBoundary from '../../Utilities/ErrorBoundary'\n\n//functional component\nimport ErrorAlert from '../../Components/Reusable_UI/Alerts/ErrorAlerts'\nimport BuildQuantityForm from '../../Components/Build/BuildQuantity'\nimport ModalWrap from '../../Components/Reusable_UI/Modal/ModalFormWrap'\n\n\n//initial form fields\nconst initialFieldValues: FormValues = {\n quantity: 0\n}\n\n//types for form fields state\ninterface FormValues {\n quantity: number\n}\n\ninterface Props {\n batchId: string\n saveAndBuild: boolean\n setCreateComplete: React.Dispatch>\n handleSaveBuild: () => void\n}\n\nconst SaveBuildBatch: React.FC = ({\n batchId,\n saveAndBuild,\n handleSaveBuild,\n setCreateComplete\n}) => {\n //context\n const {\n handleVisible,\n setCreateSuccess,\n setCreateError,\n setCreateErrorMsg,\n createError,\n createErrorMsg\n } = useContext(CreateModalCTX)\n\n //build batch mutation\n const [buildBatch, { loading: buildBatchLoading }] = useMutation(\n BUILD_BATCH,\n {\n onCompleted() {\n //reset save & build state\n handleSaveBuild()\n //reset create form complete state\n setCreateComplete(false)\n setCreateSuccess(true)\n handleVisible()\n },\n onError(error) {\n setCreateError(true)\n setCreateErrorMsg(error.message)\n }\n }\n )\n\n //handle submit\n const handleSubmit = (values: FormValues) => {\n buildBatch({ variables: { id: batchId, quantity: values.quantity } })\n }\n\n //const modal buttons\n const buttons = [\n {\n buttonName: 'Build',\n key: 'build'\n }\n ]\n\n return (\n \n {({ submitCount, submitForm }) => (\n \n \n {/* error creating build */}\n {createError && (\n {\n setCreateError(false)\n setCreateErrorMsg('')\n }}\n />\n )}\n \n \n \n \n \n )}\n \n )\n}\n\nexport default SaveBuildBatch\n","//Create flowcodes Form container\n\nimport React, { useContext, useState, Fragment, useRef, useEffect } from 'react'\nimport { Formik } from 'formik'\nimport { useQuery, useMutation } from '@apollo/react-hooks'\n\n//context\nimport { CreateModalCTX } from '../../Contexts/CreateModalContext'\n\n//graphql\nimport {\n GET_FLOWCODES_OPTIONS,\n GET_FLOWCODES_LIST\n} from '../../Graqhql/Flowcodes/FlowcodesQuery'\nimport { CREATE_BATCH } from '../../Graqhql/Flowcodes/FlowcodesMutation'\n\n//utilities\nimport { constructRedirectValue } from '../../Utilities/Flowcode'\nimport ErrorBoundary from '../../Utilities/ErrorBoundary'\n\n//typescript\nimport { FlowcodesFormValues } from '../../TypeScript_Types/Flowcodes'\n\n//functional component\nimport CreateFlowcode from '../../Components/Flowcodes/Create_Edit_Flowcode'\nimport ModalWrap from '../../Components/Reusable_UI/Modal/ModalFormWrap'\nimport { LoadingSpinner } from '../../Components/Reusable_UI/Loaders_Spinners/LoadingSpinner'\nimport ErrorAlert from '../../Components/Reusable_UI/Alerts/ErrorAlerts'\nimport BuildBatch from './SaveBuildBatch'\n\n//initial form fields\nconst initialFieldValues: FlowcodesFormValues = {\n type: '',\n brand: [],\n redirectValue: '', // remove\n attributes: [],\n isScan: true,\n redirectValue1: '',\n redirectValue2: '',\n redirectValue3: '',\n redirectValue4: '',\n redirectValue5: '',\n redirectValue6: ''\n}\n\ninterface Props {\n permutationId: string\n flowcodeType: string\n}\n\n//React FC - JSX\nconst CreateFlowcodes = ({\n permutationId,\n flowcodeType\n}: Props): JSX.Element => {\n //local state\n const [saveAndBuild, setSaveAndBuild] = useState(false)\n const [createComplete, setCreateComplete] = useState(false)\n const [batchId, setBatchId] = useState()\n const [flowcodesFetchError, setFlowcodesFetchError] = useState()\n const [initialDataReady, setInitialDataReady] = useState(false)\n\n //context\n const {\n viewCreateFormModal,\n handleVisible,\n setCreateSuccess,\n setCreateError,\n setCreateErrorMsg,\n createError,\n createErrorMsg\n } = useContext(CreateModalCTX)\n\n //ref to call reset form\n const resetRef: any = useRef(null)\n\n //get flowcodes options\n const { data: flowcodesData, loading: flowcodesLoading } = useQuery(\n GET_FLOWCODES_OPTIONS,\n {\n variables: { id: permutationId, category: 'flowcode' },\n onError(error) {\n setFlowcodesFetchError(error)\n }\n }\n )\n\n //set true if initial data is ready, not using onCompleted doesn't work in few refresh scenarios\n useEffect(() => {\n if (flowcodesData) {\n setInitialDataReady(true)\n }\n }, [flowcodesData])\n\n //reset form on modal/form close action\n useEffect(() => {\n if (viewCreateFormModal) {\n resetRef.current && resetRef.current.click()\n }\n }, [viewCreateFormModal])\n\n //create flowcodes mutation\n const [createBatch, { loading: createLoading }] = useMutation(CREATE_BATCH, {\n onCompleted(data) {\n //if create and clone is false, close the modal and set success to true.\n if (!saveAndBuild) {\n setCreateSuccess(true)\n handleVisible()\n } else {\n setCreateComplete(true)\n setBatchId(data.createBatch.batch.id)\n }\n },\n onError(error) {\n setCreateError(true)\n setCreateErrorMsg(error.message)\n },\n refetchQueries: [\n { query: GET_FLOWCODES_LIST, variables: { id: permutationId } }\n ]\n })\n\n //this function will be called when save and build button is clicked\n const handleSaveBuild = (): void => {\n setSaveAndBuild(prevState => !prevState)\n }\n\n //handle submit\n const handleSubmit = (values: FlowcodesFormValues): void => {\n // let input = { ...values}\n const input = {\n type: values.type.toUpperCase(),\n redirectValue: constructRedirectValue(values),\n isScan: values.isScan\n // domain: \" \"\n }\n const permutationBrand = values.brand\n const attributes = values.attributes\n createBatch({\n variables: {\n permutationId: permutationId,\n input,\n attributes,\n permutationBrand\n }\n })\n }\n\n //For flow codes that are ‘one’ there should only be the option to save.\n\n const nonOneButtons = [\n {\n buttonName: 'Save',\n key: 'save'\n },\n {\n buttonName: 'Save & build',\n key: 'saveBuild',\n action: handleSaveBuild\n }\n ]\n\n const oneTypeButtons = [\n {\n buttonName: 'Save',\n key: 'save'\n }\n ]\n\n return (\n \n {saveAndBuild && createComplete ? (\n \n ) : (\n \n {({\n submitCount,\n submitForm,\n values,\n setFieldValue,\n handleReset\n }) => (\n \n {/* Display error if occurred during fetching form options */}\n {flowcodesFetchError ? (\n \n ) : (\n <>\n {flowcodesLoading ? (\n \n ) : (\n \n {/* error creating flowcode */}\n {createError && (\n {\n setCreateError(false)\n setCreateErrorMsg('')\n }}\n />\n )}\n \n \n !feature.archived\n )\n }\n setFieldValue={setFieldValue}\n initialDataReady={initialDataReady}\n setInitialDataReady={setInitialDataReady}\n />\n \n \n )}\n \n )}\n\n {/* reset form div ref */}\n
\n \n )}\n \n )}\n \n )\n}\n\nexport default CreateFlowcodes\n","//Edit flowcodes Form container\n\nimport React, { useContext, useState, useEffect, useRef, Fragment } from 'react'\nimport { Formik } from 'formik'\nimport { useQuery, useMutation } from '@apollo/react-hooks'\n\n//context\nimport { EditModalCTX } from '../../Contexts/EditModalContext'\n\n//graphql\nimport {\n GET_FLOWCODES_EDIT,\n GET_FLOWCODES_LIST\n} from '../../Graqhql/Flowcodes/FlowcodesQuery'\nimport {\n UPDATE_BATCH,\n UPDATE_FLOWCODES\n} from '../../Graqhql/Flowcodes/FlowcodesMutation'\n\n//typescript\nimport { FlowcodesFormValues } from '../../TypeScript_Types/Flowcodes'\n\n//utilities\nimport ErrorBoundary from '../../Utilities/ErrorBoundary'\nimport { splitURLs, constructRedirectValue } from '../../Utilities/Flowcode'\n\n//functional component\nimport EditFlowcode from '../../Components/Flowcodes/Create_Edit_Flowcode'\nimport ModalWrap from '../../Components/Reusable_UI/Modal/ModalFormWrap'\nimport { LoadingSpinner } from '../../Components/Reusable_UI/Loaders_Spinners/LoadingSpinner'\nimport ErrorAlert from '../../Components/Reusable_UI/Alerts/ErrorAlerts'\n\n//initial form fields\nconst initialFieldValues: FlowcodesFormValues = {\n type: '',\n brand: [],\n redirectValue: '',\n attributes: [],\n isScan: true,\n redirectValue1: '',\n redirectValue2: '',\n redirectValue3: '',\n redirectValue4: '',\n redirectValue5: '',\n redirectValue6: ''\n}\n\n//types for form fields state\ninterface FormValues {\n type: string\n brand: Array\n redirectValue: string\n attributes: Array\n isScan: boolean\n redirectValue1?: string\n redirectValue2?: string\n redirectValue3?: string\n redirectValue4?: string\n redirectValue5?: string\n redirectValue6?: string\n}\n\ninterface Props {\n permutationId: string\n updateId: {\n id: string\n flowcodeId: string\n }\n flowcodeType: string\n}\n\nconst EditFlowcodes = ({\n permutationId,\n updateId,\n flowcodeType\n}: Props): JSX.Element => {\n //local state\n const [flowcodesFields, setFlowcodesFields] = useState(initialFieldValues)\n const [flowcodesFetchError, setFlowcodesFetchError] = useState()\n const [initialAttributes, setInitialAttributes] = useState()\n const [initialBrands, setInitialBrands] = useState()\n //for delete\n const [initialBrandsSet, setInitialBrandsSet] = useState()\n const [initialAttributesSet, setInitialAttributesSet] = useState()\n const [initialDataReady, setInitialDataReady] = useState(false)\n\n //ref to call reset form\n const resetRef: any = useRef(null)\n\n //context\n const {\n viewEditFormModal,\n handleVisible,\n setEditSuccess,\n editError,\n setEditError,\n editErrorMsg,\n setEditErrorMsg\n } = useContext(EditModalCTX)\n\n //get flowcodes options\n const { data: flowcodesData, loading: flowcodesLoading } = useQuery(\n GET_FLOWCODES_EDIT,\n {\n variables: {\n id: updateId.id,\n permutationId: permutationId,\n category: 'flowcode'\n },\n onError(error) {\n setFlowcodesFetchError(error)\n }\n }\n )\n\n //create the initial form data from the fetched data\n //Note - currently the program is build to support only one flowcode.\n useEffect(() => {\n if (flowcodesData) {\n const { batch } = flowcodesData\n const redirectValues = splitURLs(\n batch.batchFlowcodes[0].redirectValue\n ).reduce((prev, curr, i) => {\n prev[`redirectValue${i + 1}`] = curr\n return prev\n }, {} as any)\n // set the initial form data\n const initialData = {\n ...initialFieldValues,\n type: batch.type.charAt(0) + batch.type.substring(1).toLowerCase(),\n brand: batch.batchFlowcodes[0].flowcodeBrandSet.map(\n (item: any) => item.permutationBrand.id\n ),\n redirectValue: batch.batchFlowcodes[0].redirectValue, // remove this\n attributes: batch.attributes.map((item: { id: string }) => item.id),\n isScan: batch.isScan,\n ...redirectValues\n }\n //form fields\n setFlowcodesFields(initialData)\n //intial brands & attributes - add\n setInitialAttributes(batch.batchDiscreteSet)\n setInitialBrands(batch.batchFlowcodes[0].flowcodeBrandSet)\n //initial brands & attributes - delete\n setInitialAttributesSet(batch.batchDiscreteSet)\n setInitialBrandsSet(batch.batchFlowcodes[0].flowcodeBrandSet)\n setInitialDataReady(true)\n }\n }, [flowcodesData])\n\n //reset form on modal/form close action\n useEffect(() => {\n if (viewEditFormModal) {\n resetRef.current && resetRef.current.click()\n }\n }, [viewEditFormModal])\n\n //edit flowcodes mutation\n //update batch\n const [updateBatch, { loading: updateBatchLoading }] = useMutation(\n UPDATE_BATCH,\n {\n onError(error) {\n setEditError(true)\n setEditErrorMsg(error.message)\n }\n // refetchQueries: [{ query: GET_FLOWCODES_LIST, variables:{id: permutationId} }]\n }\n )\n\n //update flowcodes\n const [updateFlowcodes, { loading: updateFlowcodeLoading }] = useMutation(\n UPDATE_FLOWCODES,\n {\n onCompleted() {\n //if create and clone is false, close the modal and set success to true.\n if (!editError) {\n setEditSuccess(true)\n handleVisible()\n }\n },\n onError(error) {\n setEditError(true)\n setEditErrorMsg(error.message)\n },\n refetchQueries: [\n { query: GET_FLOWCODES_LIST, variables: { id: permutationId } }\n ]\n }\n )\n\n //handle submit\n //Note - uncomment attributes and brand when fixed in backend\n const handleSubmit = (values: FormValues): void => {\n //update batch\n const inputBatch = {\n type: values.type.toUpperCase(),\n isScan: values.isScan\n }\n\n //attributes\n const deleteAttributes =\n initialAttributesSet.length > 0\n ? initialAttributesSet\n .filter(\n (attribute: { id: string; discreteValue: { id: string } }) =>\n !values.attributes.includes(attribute.discreteValue.id)\n )\n .map((filterAttribute: { id: string }) => filterAttribute.id)\n : []\n\n const addAttributes =\n initialAttributes.length > 0\n ? values.attributes.filter((attribute: string) =>\n initialAttributes.some((id: string) => id !== attribute)\n )\n : values.attributes\n //flowcode\n const inputFlowcode = { redirectValue: constructRedirectValue(values) }\n\n //brands\n const deleteBrand =\n initialBrandsSet.length > 0\n ? initialBrandsSet\n .filter(\n (flowcodeBrandSet: {\n id: string\n permutationBrand: { id: string }\n }) => !values.brand.includes(flowcodeBrandSet.permutationBrand.id)\n )\n .map((filterBrand: { id: string }) => filterBrand.id)\n : []\n\n const addBrand =\n initialBrands.length > 0\n ? values.brand.filter((brand: string) =>\n initialBrands.some((id: string) => id !== brand)\n )\n : values.brand\n\n updateBatch({\n variables: {\n id: updateId.id,\n input: inputBatch,\n deleteAttributes,\n addAttributes\n }\n })\n updateFlowcodes({\n variables: {\n id: updateId.flowcodeId,\n input: inputFlowcode,\n addBrand,\n deleteBrand\n }\n })\n }\n\n //const modal buttons\n const buttons = [\n {\n buttonName: 'Edit',\n key: 'edit'\n }\n ]\n\n const batchId = flowcodesData?.batch?.id\n const title = `Edit Flowcode - ${batchId || ''}`\n\n return (\n \n {({ submitCount, submitForm, values, setFieldValue, handleReset }) => (\n \n {/* Display error if occurred during fetching form options */}\n {flowcodesFetchError ? (\n \n ) : (\n <>\n {/* flowcodes error and loading */}\n {flowcodesLoading ? (\n \n ) : (\n \n {/* error updating flowcodes */}\n {editError && (\n {\n setEditError(false)\n setEditErrorMsg('')\n }}\n />\n )}\n \n !archived\n )\n }\n values={values}\n flowcodeType={flowcodeType}\n setFieldValue={setFieldValue}\n initialDataReady={initialDataReady}\n setInitialDataReady={setInitialDataReady}\n />\n \n \n )}\n \n )}\n {/* reset form div ref */}\n
\n \n )}\n \n )\n}\n\nexport default EditFlowcodes\n","//This container will handle the build batch action for the individual batches from flowcodes list\n//SaveBuildBatch - invoked after successful create\n//OR on BUILD ALL\nimport React, { useContext, Fragment, useState, useEffect } from 'react'\nimport { Formik } from 'formik'\nimport { useMutation } from '@apollo/react-hooks'\n\n//REST\nimport API from '../../Utilities/RESTSetup'\n\n//context\nimport { BuildModalCTX } from '../../Contexts/BuildModalContext'\n\n//graphql\nimport {\n BUILD_BATCH,\n BUILD_ALL\n} from '../../Graqhql/Flowcodes/FlowcodesMutation'\n\n//functional component\nimport ErrorAlert from '../../Components/Reusable_UI/Alerts/ErrorAlerts'\nimport ModalWrap from '../../Components/Reusable_UI/Modal/ModalFormWrap'\nimport CsvFileForm from '../../Components/Build/CsvFile'\nimport BuildQuantityForm from '../../Components/Build/BuildQuantity'\nimport { GET_FLOWCODES_LIST } from '../../Graqhql/Flowcodes/FlowcodesQuery'\n\n//initial form fields\nconst initialFieldValues: FormValues = {\n quantity: '',\n fileName: ''\n}\n\n//types for form fields state\ninterface FormValues {\n quantity: any //this is to set quantity to empty in the intial state\n fileName: string\n}\n\ninterface Props {\n batchId: string\n buildAll: boolean\n permutationId: string\n permutationName: string\n}\n\nconst BuildBatch: React.FC = ({\n batchId,\n buildAll,\n permutationId,\n permutationName\n}: Props): JSX.Element => {\n //context\n const {\n buildFormModal,\n handleVisible,\n setBuildSuccess,\n buildError,\n setBuildError,\n buildErrorMsg,\n setBuildErrorMsg\n } = useContext(BuildModalCTX)\n\n //local states\n const [formFields, setFormFields] = useState()\n const [downloadCsv, setDownloadCsv] = useState(false)\n const [downloadingCsv, setDownloadingCsv] = useState(false)\n const [downloadCsvErrorMsg, setDownloadCsvErrorMsg] = useState()\n\n //update filename\n useEffect(() => {\n const fileNameUpdate = Object.create(initialFieldValues)\n fileNameUpdate.fileName = permutationName.substring(0, 40)\n setFormFields(fileNameUpdate)\n }, [permutationName])\n\n //build individual mutation\n const [buildBatch, { loading: buildBatchLoading }] = useMutation(\n BUILD_BATCH,\n {\n onCompleted() {\n setDownloadCsv(true)\n },\n onError(error) {\n setBuildError(true)\n setBuildErrorMsg(error.message)\n }\n }\n )\n\n // buill all by permutation ID\n const [buildAllBatch, { loading: buildAllBatchLoading }] = useMutation(\n BUILD_ALL,\n {\n onCompleted() {\n setDownloadCsv(true)\n },\n onError(error) {\n setBuildError(true)\n setBuildErrorMsg(error.message)\n },\n refetchQueries: [\n { query: GET_FLOWCODES_LIST, variables: { id: permutationId } }\n ]\n }\n )\n\n //handle submit - if the build was initiated from build all button then call build all mutation\n const handleSubmitBuild = (values: FormValues): void => {\n if (buildAll) {\n buildAllBatch({\n variables: { permutationId: permutationId, quantity: values.quantity }\n })\n } else {\n buildBatch({ variables: { id: batchId, quantity: values.quantity } })\n }\n }\n\n //download csv\n const handleSubmitCsv = (values: FormValues): void => {\n // initializations\n setDownloadCsvErrorMsg(null)\n setDownloadingCsv(true)\n\n //API config\n const config: any = {\n headers: {\n 'Content-Type': 'application/json'\n },\n responseType: 'blob'\n }\n\n //API call\n API.get(`/api/csv/permutation/${permutationId}/`, config)\n .then((response: any) => {\n const link = document.createElement('a')\n link.href = window.URL.createObjectURL(new Blob([response.data]))\n link.setAttribute('download', `${values.fileName}.csv`)\n document.body.appendChild(link)\n link.click()\n\n //modal handling\n setBuildSuccess(true)\n handleVisible()\n })\n .catch((error: any) => {\n if (error.response && error.response.status === 401) {\n setDownloadCsvErrorMsg(\n 'Your session has expired. Please log in again'\n )\n // add auto logout step\n } else if (error.response && error.response.data.detail) {\n setDownloadCsvErrorMsg(error.response.data.detail)\n } else {\n setDownloadCsvErrorMsg('Something went wrong')\n }\n })\n }\n\n //const modal buttons\n const buttonsBuild = [\n {\n buttonName: 'Build',\n key: 'build'\n }\n ]\n\n const buttonsDownload = [\n {\n buttonName: 'Download CSV',\n key: 'download'\n }\n ]\n\n\n return (\n \n {({ submitCount, submitForm }) => (\n \n \n {/* error building batch, close -> closable */}\n { buildError && \n {setBuildError(false); setBuildErrorMsg('')}}\n\n />\n }\n\n {/* download csv error */}\n {downloadCsvErrorMsg && (\n setDownloadCsvErrorMsg(undefined)}/>\n )}\n\n {downloadCsv ? \n : }\n \n \n )}\n \n )\n }\nexport default BuildBatch\n","//This container is used to display the batch (Flowcodes) QR.\n\nimport React, { useEffect, useState, Fragment } from 'react'\n\n//styled components\nimport { BlockPicker, ColorResult } from 'react-color'\nimport { Modal, Typography } from 'antd'\n\n//REST\nimport API from '../../Utilities/RESTSetup'\n\n//constants\nimport { DEFAULT_FLOWCODE_COLOR } from '../../Constants/Flowcodes/Flowcodes'\n\n//utilities\nimport ErrorBoundary from '../../Utilities/ErrorBoundary'\n\n//functional components\nimport { LoadingSpinner } from '../../Components/Reusable_UI/Loaders_Spinners/LoadingSpinner'\nimport ErrorAlert from '../../Components/Reusable_UI/Alerts/ErrorAlerts'\n\n\n//ant component destructuring\nconst { Text } = Typography\n\n//types\ninterface Props {\n previewBatchId: string\n setPreviewQRId: React.Dispatch\n}\n\n//JSX\nconst PreviewQR = ({ previewBatchId, setPreviewQRId }: Props): JSX.Element => {\n //local states\n const [imageLink, setImageLink] = useState()\n const [imageFileName, setImageFileName] = useState()\n const [downloadErrorMsg, setDownloadQRErrorMsg] = useState()\n const [downloadQRLoading, setDownloadQRLoading] = useState(false)\n const [flowcodeColor, setFlowcodeColor] = useState(DEFAULT_FLOWCODE_COLOR)\n\n //get preview image urls\n useEffect(() => {\n setDownloadQRLoading(true)\n let unmounted = false\n const source = API.CancelToken.source()\n\n //API config\n const config: any = {\n headers: {\n 'Content-Type': 'application/json'\n },\n responseType: 'blob',\n params: {\n defaultColor: flowcodeColor?.replace(/#/gi, '')\n }\n }\n\n //API call\n API.get(`/v1/flowcode/${previewBatchId}/`, config)\n .then((response: any) => {\n if (!unmounted) {\n const url = window.URL.createObjectURL(response.data)\n let filename = response.request.getResponseHeader(\n 'Content-Disposition'\n )\n filename = filename.split('\"')[1]\n\n setImageFileName(filename)\n setImageLink(url)\n setDownloadQRLoading(false)\n }\n })\n .catch((error: any) => {\n if (!unmounted) {\n if (error.response && error.response.status === 401) {\n setDownloadQRErrorMsg(\n 'Your session has expired. Please log in again'\n )\n // add auto logout step\n } else if (error.response && error.response.data.detail) {\n setDownloadQRErrorMsg(error.response.data.detail)\n } else {\n setDownloadQRErrorMsg('Something went wrong')\n }\n setDownloadQRLoading(false)\n }\n })\n return function() {\n unmounted = true\n source.cancel('Cancelling in cleanup')\n }\n }, [previewBatchId, flowcodeColor])\n\n const handleClose = (): void => {\n setPreviewQRId(null)\n }\n\n return (\n \n {downloadErrorMsg ? (\n {\n setDownloadQRErrorMsg(undefined)\n handleClose()\n }}\n />\n ) : (\n \n {downloadQRLoading ? (\n \n ) : (\n \n {`File - ${imageFileName}`}\n \"QR\"\n Color:\n
\n \n setFlowcodeColor(color.hex)\n }\n />\n
\n
\n )}\n \n )}\n
\n )\n}\n\nexport default PreviewQR\n","//Flowcodes list container\n//Includes create flowcodes button, flowcode table components\n\nimport React, { useState, Fragment, useContext } from 'react'\nimport { BlockPicker, ColorResult } from 'react-color'\n\n//REST\nimport API from '../../Utilities/RESTSetup'\n\n//ant d\nimport { Tooltip, Button, Modal } from 'antd'\n\n//graphql\nimport { useQuery, useMutation } from '@apollo/react-hooks'\nimport { GET_FLOWCODES_LIST } from '../../Graqhql/Flowcodes/FlowcodesQuery'\nimport { DELETE_BATCH } from '../../Graqhql/Flowcodes/FlowcodesMutation'\n\n//context\nimport { CreateModalCTX } from '../../Contexts/CreateModalContext'\nimport { EditModalCTX } from '../../Contexts/EditModalContext'\nimport { BuildModalCTX } from '../../Contexts/BuildModalContext'\n\n//functional component\nimport { SearchField } from '../../Components/Reusable_UI/Forms/SearchField'\nimport FlowcodeTable from '../../Components/Flowcodes/FlowcodesTable'\nimport CreateFlowcodes from './CreateFlowcodes'\nimport SuccessAlert from '../../Components/Reusable_UI/Alerts/SuccessAlerts'\nimport PageTitle from '../../Components/Reusable_UI/Headers_Titles/PageTitles'\nimport ModalWrap from '../../Components/Reusable_UI/Modal/ModalFormWrap'\nimport EditFlowcodes from './EditFlowcodes'\nimport BuildBatch from '../Build/BuildBatch'\nimport PreviewQR from './PreviewQR'\nimport { useEffect } from 'react'\nimport { DEFAULT_FLOWCODE_COLOR } from '../../Constants/Flowcodes/Flowcodes'\nimport ErrorAlert from '../../Components/Reusable_UI/Alerts/ErrorAlerts'\nimport ErrorBoundary from '../../Utilities/ErrorBoundary'\n\n//ant design component destructuring\nconst { confirm } = Modal\n\n//inline styles\nconst flowcodes = {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n marginTop: 20\n}\n\nconst searchAddDiv = {\n display: 'flex',\n justifyContent: 'space-between',\n flexBasis: '25%'\n}\n\ninterface Props {\n permutationId: string\n}\n\nconst FlowcodesList = ({ permutationId }: Props): JSX.Element => {\n //local states\n const [flowcodesList, setFlowcodesList] = useState()\n const [batchesPresent, setBatchesPresent] = useState()\n const [flowcodeType, setFlowcodeType] = useState()\n\n const [deleteBatchId, setDeleteBatchId] = useState()\n const [deleteBatchError, setDeleteBatchError] = useState()\n const [editBatchId, setEditBatchId] = useState()\n const [buildBatchId, setBuildBatchId] = useState()\n const [buildAll, setBuildAll] = useState(false)\n const [downloadQRErrorMsg, setDownloadQRErrorMsg] = useState()\n const [downloadQRLoading, setDownloadQRLoading] = useState(false)\n const [downloadQRId, setDownloadQRId] = useState()\n const [previewQRId, setPreviewQRId] = useState()\n const [flowcodesListError, setFlowcodesListError] = useState()\n const [\n isDownloadFlowcodeModalOpen,\n setIsDownloadFlowcodeModalOpen\n ] = useState(false)\n const [flowcodeColor, setFlowcodeColor] = useState(DEFAULT_FLOWCODE_COLOR)\n\n //context\n const { createSuccess, viewCreateFormModal, handleVisible } = useContext(\n CreateModalCTX\n )\n const { editSuccess, viewEditFormModal } = useContext(EditModalCTX)\n const {\n buildSuccess,\n buildFormModal,\n handleVisible: buildHandleVisible\n } = useContext(BuildModalCTX)\n\n //get flowcodes data from graphql\n const { data: flowcodesListData, loading: flowcodeslistLoading } = useQuery(\n GET_FLOWCODES_LIST,\n {\n variables: { id: permutationId },\n onError(error) {\n setFlowcodesListError(error)\n }\n }\n )\n\n //update initial data\n useEffect(() => {\n setFlowcodesList(flowcodesListData)\n\n //To determine the 'ONE' or \"MANY\" type of a batch, this will be used to set the type in create/edit\n //flowcodes.\n //In any one permutation there should only be flowcodes with either ‘one’ or ‘many’.\n //Once the user creates a flow code with either, they should not be allowed to create another with the other type.\n const batchesPresentTemp =\n flowcodesListData && flowcodesListData.permutationBatches.length > 0\n const flowcodeTypeTemp = batchesPresentTemp\n ? flowcodesListData.permutationBatches[0].type\n : ''\n setBatchesPresent(batchesPresentTemp)\n setFlowcodeType(flowcodeTypeTemp)\n }, [flowcodesListData])\n\n //delete batch mutation\n const [deleteBatch, { loading: deleteLoading }] = useMutation(DELETE_BATCH, {\n onCompleted() {\n setDeleteBatchId(null)\n },\n onError(error) {\n setDeleteBatchError(error)\n },\n refetchQueries: [\n { query: GET_FLOWCODES_LIST, variables: { id: permutationId } }\n ]\n })\n\n // delete batch\n const handleDeleteBatch = (id: string): void => {\n setDeleteBatchError(null)\n setDeleteBatchId(id)\n\n confirm({\n title: 'Delete batch',\n content: `Are you sure you want to delete batch: ${id}?`,\n okText: 'Yes',\n okType: 'danger',\n cancelText: 'No',\n onOk() {\n deleteBatch({ variables: { id: id } })\n }\n })\n }\n\n //download QR images\n const handleDownloadQR = (downloadBatchId: string, color?: string): void => {\n // initializations\n setDownloadQRErrorMsg(null)\n setDownloadQRId(downloadBatchId)\n setDownloadQRLoading(true)\n\n //API config\n const config: any = {\n headers: {\n 'Content-Type': 'application/json'\n },\n responseType: 'blob',\n params: {\n defaultColor: color?.replace(/#/gi, '')\n }\n }\n\n API.get(`/v1/flowcode/${downloadBatchId}`, config)\n .then((response: any) => {\n const url = window.URL.createObjectURL(new Blob([response.data]))\n const link = document.createElement('a')\n link.href = url\n let filename = response.request.getResponseHeader('Content-Disposition')\n filename = filename.split('\"')[1]\n link.setAttribute('download', `${filename}`)\n document.body.appendChild(link)\n link.click()\n //initialize\n setDownloadQRId(null)\n setDownloadQRLoading(false)\n })\n .catch((error: any) => {\n if (error.response && error.response.status === 401) {\n setDownloadQRErrorMsg('Your session has expired. Please log in again')\n // add auto logout step\n } else if (error.response && error.response.data.detail) {\n setDownloadQRErrorMsg(error.response.data.detail)\n } else {\n setDownloadQRErrorMsg('Something went wrong')\n }\n\n //initialize\n setDownloadQRId(null)\n setDownloadQRLoading(false)\n })\n }\n\n //on close delete error alert\n const onCloseDeleteError = (): void => {\n setDeleteBatchError(null)\n setDeleteBatchId(null)\n setDownloadQRErrorMsg(null)\n }\n\n //search filter - by redirectValue\n const handleSearch = (value: string): void => {\n if (!value) {\n setFlowcodesList(flowcodesListData)\n } else {\n const filteredItem = flowcodesListData.permutationBatches.filter(\n (batch: any) =>\n batch.batchFlowcodes.some(\n (flowcode: any) => flowcode.redirectValue.indexOf(value) > -1\n )\n )\n const filteredBatch = {\n permutationBatches: [...filteredItem]\n }\n setFlowcodesList(filteredBatch)\n }\n }\n\n return (\n
\n
\n \n\n {/* create or edit action outcomes */}\n {createSuccess || editSuccess ? (\n \n ) : null}\n\n {/* this is only for build performed from table build menu option & not'save & build' */}\n {buildSuccess && (\n \n )}\n\n {/* search bar and create button */}\n
\n \n\n {/* create flowcode button */}\n \n \n \n\n {/* build all batches by permutation ID button, disabled*/}\n \n {\n setBuildAll(true)\n buildHandleVisible()\n }}\n disabled={!batchesPresent}\n />\n \n
\n
\n\n {/* create flowcode modal */}\n {viewCreateFormModal && (\n \n )}\n\n {/* TODO: Extract to FlowcodeOptionsModal options modal (flowcode studio v0.0.1) */}\n {isDownloadFlowcodeModalOpen && (\n {\n setIsDownloadFlowcodeModalOpen(false)\n setDownloadQRId(null)\n setFlowcodeColor(DEFAULT_FLOWCODE_COLOR)\n }}\n submitForm={async () => {\n setIsDownloadFlowcodeModalOpen(false)\n handleDownloadQR(downloadQRId, flowcodeColor)\n setFlowcodeColor(DEFAULT_FLOWCODE_COLOR)\n }}\n >\n Color:\n
\n \n setFlowcodeColor(color.hex)\n }\n />\n
\n \n )}\n\n {/* flowcodes by permutation ID list */}\n {flowcodesListError ? (\n \n ) : (\n \n {/* delete batch error alert */}\n {deleteBatchError && (\n \n )}\n\n {/* download QR error */}\n {downloadQRErrorMsg && (\n \n )}\n\n {/* edit flowcode modal */}\n {viewEditFormModal && (\n \n )}\n\n {/* build batch */}\n {buildFormModal && (\n \n )}\n\n {/* preview batch QR */}\n {!!previewQRId && (\n \n )}\n\n {/* flowcodes table */}\n \n {\n setIsDownloadFlowcodeModalOpen(true)\n setDownloadQRId(downloadbatchId)\n }}\n setBuildBatchId={setBuildBatchId}\n downloadQRId={downloadQRId}\n downloadQRLoading={downloadQRLoading}\n deleteLoading={deleteLoading}\n setPreviewQRId={setPreviewQRId}\n />\n \n \n )}\n
\n )\n}\n\nexport default FlowcodesList\n","//View Permutaiton Form container\n//Includes permutation details & flowcodes components.\n\nimport React, { Fragment, useState, useEffect } from 'react'\nimport { Link } from 'react-router-dom'\n\n//ant d\nimport { Divider, Breadcrumb } from 'antd'\n\n//graphql\nimport { useQuery, useMutation } from '@apollo/react-hooks'\nimport { GET_EDIT_PERMUTATION } from '../../Graqhql/Permutations/QueryPermutation'\nimport { EDIT_PERMUTATION } from '../../Graqhql/Permutations/MutationPermutation'\n\n//contexts\nimport CreateModalProvider from '../../Contexts/CreateModalContext'\nimport EditModalProvider from '../../Contexts/EditModalContext'\nimport BuildModalProvider from '../../Contexts/BuildModalContext'\n\n//utilities\nimport { reduceDiscreteSet } from '../../Utilities/Permutation'\nimport { removeCommas } from '../../Utilities/Format'\nimport ErrorBoundary from '../../Utilities/ErrorBoundary'\n\n//functional components\nimport LayoutWrap from '../../HOC/LayoutWrap'\nimport PageTitle from '../../Components/Reusable_UI/Headers_Titles/PageTitles'\nimport ViewPermutationDetails from '../../Components/Permutations/ViewPermutationDetails'\nimport Flocodes from '../Flowcodes/FlowcodesList'\nimport ErrorAlert from '../../Components/Reusable_UI/Alerts/ErrorAlerts'\nimport { LoadingSpinner } from '../../Components/Reusable_UI/Loaders_Spinners/LoadingSpinner'\n\n//const title view permutation\nconst PAGE_TITLE = 'View Permutation'\n\ninterface Props {\n history: any\n location: any\n match: any\n staticContext: any\n}\n\n//JSX\nconst ViewPermutation: React.FC = ({\n history,\n location,\n match,\n staticContext\n}: Props) => {\n //local state\n const [error, setFetchError] = useState()\n const [editError, setEditError] = useState()\n // const [experimentId, setExperimentId] = useState('')\n const [expFeatures, setExpFeatures] = useState()\n\n //permutation id retrieved from url\n const permutationId = match.params.id\n const experimentId = match.params.exp\n\n //get the permutation/experiment details\n const { data: permutationData, loading: loading2 } = useQuery(\n GET_EDIT_PERMUTATION,\n {\n variables: {\n experimentId: experimentId,\n permutationID: permutationId\n },\n onError(error) {\n setFetchError(error)\n }\n }\n )\n\n //edit permutation mutation\n const [editPermutation, { loading: editLoading }] = useMutation(\n EDIT_PERMUTATION,\n {\n onCompleted() {\n // setEditSuccess(true)\n },\n onError(error) {\n setEditError(error)\n },\n refetchQueries: [\n {\n query: GET_EDIT_PERMUTATION,\n variables: {\n experimentId: experimentId,\n permutationID: permutationId\n }\n }\n ]\n }\n )\n\n useEffect(() => {\n if (permutationData?.experiment.experimentDiscreteSet)\n setExpFeatures(\n reduceDiscreteSet(permutationData.experiment.experimentDiscreteSet)\n )\n }, [permutationData])\n\n //format the data for update mutation\n const updatePermutation = ({\n name,\n estCost,\n actualCost,\n estImpressions,\n actualImpressions,\n iscs,\n notes,\n channel,\n medium,\n folder,\n variables,\n brands,\n attributes,\n finalNumber\n }: any): void => {\n const initialVariables = permutationData.permutation.permutationVariableSet\n const initialBrands = permutationData.permutation.brand\n const initialAttributes =\n permutationData.permutation.permutationAttributeSet\n\n const addVariable = variables\n .filter(\n (v: any) =>\n !initialVariables\n .map((va: any) => va.experimentDiscrete.id)\n .includes(v.id)\n )\n .map((variable: any) => variable.id)\n\n const deleteVariable = initialVariables\n .filter(\n (v: any) =>\n !variables.map((va: any) => va.id).includes(v.experimentDiscrete.id)\n )\n .map((variable: any) => variable.id)\n\n const addAttribute = attributes\n .filter(\n (a: any) =>\n !initialAttributes\n .map((att: any) => att.discreteValue.id)\n .includes(a.id)\n )\n .map((attribute: any) => attribute.id)\n const deleteAttribute = initialAttributes\n .filter(\n (a: any) =>\n !attributes.map((att: any) => att.id).includes(a.discreteValue.id)\n )\n .map((attribute: any) => attribute.id)\n\n const addBrands = brands\n .filter((b: any) => !initialBrands.map((br: any) => br.id).includes(b.id))\n .map((brand: any) => brand.id)\n const deleteBrands = initialBrands\n .filter((b: any) => !brands.map((br: any) => br.id).includes(b.id))\n .map((brand: any) => brand.id)\n\n const body = {\n variables: {\n id: permutationId,\n input: {\n name,\n estCost: estCost === '' ? null : estCost,\n actualCost: actualCost === '' ? null : actualCost,\n estImpressions:\n estImpressions === '' ? null : +removeCommas(estImpressions), //remove commas and convert to Int\n actualImpressions:\n actualImpressions === '' ? null : +removeCommas(actualImpressions), //remove commas and convert to Int\n iscs,\n notes,\n channel,\n medium,\n finalNumber\n },\n folder: folder?.id || null,\n addVariable,\n deleteVariable,\n addBrands,\n deleteBrands,\n addAttribute,\n deleteAttribute\n }\n }\n editPermutation(body)\n }\n\n const isLoading = loading2\n const dataComplete = permutationData && expFeatures\n\n return (\n \n {/* breadcrumb navigation menu */}\n {dataComplete && (\n \n \n Experiments\n \n \n \n View experiment\n \n \n View permutation\n \n )}\n\n {/* page title */}\n \n\n {/* fetch permutation details error */}\n {error ? (\n \n ) : (\n \n {/* fetching permutation details loading state */}\n {isLoading || !dataComplete ? (\n \n ) : (\n \n {/* display error if occurred while updating the permutation */}\n {editError && (\n setEditError(undefined)}\n />\n )}\n\n {/* 1. permutation details */}\n {editLoading ? (\n
\n \n
\n ) : (\n \n \n \n )}\n\n \n\n {/* flowcodes */}\n \n \n \n \n \n \n \n \n \n
\n )}\n
\n )}\n
\n )\n}\n\nexport default ViewPermutation\n","//mutation - login\n\nimport gql from 'graphql-tag'\n\nexport const LOGIN_USER = gql`\n mutation($username: String!, $password: String!) {\n tokenAuth(username: $username, password: $password) {\n token\n }\n }\n`\n","//Login Form - This component will render the login form.\n//The form \"Field\" component is from the resuable UI components - refer /Reusable_UI\n\nimport React from 'react'\nimport { Link } from 'react-router-dom'\n\n//form handler\nimport { Form, Field } from 'formik'\n\n//styled components\nimport { Icon, Button, Form as AntForm } from 'antd'\n\n//functional components\nimport { AntInputPassword, AntInput } from '../Reusable_UI/Forms/FormFields'\n\n//utilities\nimport { validateLength, validateRequired } from '../../Utilities/Validate'\n\n//styles\nimport '../Reusable_UI/Styles.less'\n\n//Antd components\nconst FormItem = AntForm.Item\n\n//types for props from parent container Login.tsx\ninterface Props {\n loading: boolean\n submitCount: number\n values: any\n}\n\nconst LoginForm = ({ loading, submitCount }: Props) => {\n return (\n
\n }\n component={AntInput}\n />\n\n }\n component={AntInputPassword}\n />\n \n \n {/* Forgot password */}\n \n {' '}\n SIGN IN\n \n New User? Sign Up!\n \n \n )\n}\n\nexport default LoginForm\n","//Container - login\n\nimport React, { Fragment, useState } from 'react'\nimport { Formik } from 'formik'\nimport { useMutation, useApolloClient } from '@apollo/react-hooks'\n\n//styled components\nimport { Row, Col } from 'antd'\n\n//graphql\nimport { LOGIN_USER } from '../../Graqhql/Login'\n\n//utilities\nimport ErrorBoundary from '../../Utilities/ErrorBoundary';\n\n//functional components\nimport LayoutWrap from '../../HOC/LayoutWrap'\nimport LoginForm from '../../Components/Login/LoginForm'\nimport ErrorAlert from '../../Components/Reusable_UI/Alerts/ErrorAlerts'\nimport PageTitle from '../../Components/Reusable_UI/Headers_Titles/PageTitles'\n\n//const title of login page\nconst PAGE_TITLE = 'Sign In'\n\n//const form fields initial state\nconst initialFieldValues = { username: '', password: '' }\n\n//types for form fields state\ninterface FormValues {\n username: string\n password: string\n}\n\nconst Login: React.FC = props => {\n //local state\n const [loginError, setLoginError] = useState()\n\n const client = useApolloClient()\n\n //use mutation hook - extract mutate function, token and save it to the local storage when the request is completed.\n //NOTE - the storage will be changed to improve security\n\n const [tokenAuth, { loading }] = useMutation(LOGIN_USER, {\n onCompleted({ tokenAuth }) {\n localStorage.setItem('token', tokenAuth.token)\n client.writeData({\n data: { isAuthenticated: !!tokenAuth.token, __typename: 'Auth' }\n })\n },\n onError(error) {\n setLoginError(error)\n }\n })\n\n //handle submit function\n const handleSubmit = (values: FormValues) => {\n tokenAuth({\n variables: { username: values.username, password: values.password }\n })\n }\n\n return (\n \n \n \n {/* title of the page */}\n \n\n {/* on error during mutation display error message */}\n {loginError && (\n \n )}\n\n \n {({ submitCount, values }) => (\n \n {/* login form */}\n \n \n \n \n )}\n \n \n \n \n )\n}\n\nexport default Login\n","//mutation - register\n\nimport gql from 'graphql-tag'\n\nexport const REGISTER_USER = gql`\n mutation($username: String!, $email: String!, $password: String!) {\n createUser(username: $username, email: $email, password: $password) {\n token\n }\n }\n`\n","//Authentication\nexport enum Auth {\n //local storage authentication token identifier\n AUTH_TOKEN = 'token',\n\n //error keyword for logging out user in afterware\n LOGOUT_TOKEN = 'Signature has expired',\n INVALID_TOKEN = 'Error decoding signature'\n}\n","//Register Form - This component will render the register form -> /register.\n//The form \"Field\" component is from the resuable UI components - refer /Reusable_UI\n\nimport React from 'react'\nimport { Link } from 'react-router-dom'\n\n//styled components\nimport { Form, Field } from 'formik'\n\n//styled icons\nimport { Icon, Button, Form as AntForm } from 'antd'\n\n//functional components\nimport { AntInputPassword, AntInput } from '../Reusable_UI/Forms/FormFields'\n\n//utilities\nimport {\n validateLength,\n validateRequired,\n validateEmail\n} from '../../Utilities/Validate'\n\n//styles\nimport '../Reusable_UI/Styles.less'\n\n//Antd components\nconst FormItem = AntForm.Item\n\n//types for props from parent container Login.tsx\ninterface Props {\n loading: boolean\n submitCount: number\n values: any\n}\n\nconst RegisterForm = ({ loading, submitCount, values }: Props) => {\n return (\n
\n }\n component={AntInput}\n />\n\n }\n component={AntInput}\n />\n\n }\n component={AntInputPassword}\n />\n\n \n \n SIGN UP\n \n Already a User? Sign In!\n \n \n )\n}\n\nexport default RegisterForm\n","//Container - register form page\n\nimport React, { Fragment, useState } from 'react'\nimport { Formik } from 'formik'\nimport { useMutation, useApolloClient } from '@apollo/react-hooks'\n\n//styled components\nimport { Row, Col } from 'antd'\n\n//graphql\nimport { REGISTER_USER } from '../../Graqhql/Register'\n\n//utilities\nimport ErrorBoundary from '../../Utilities/ErrorBoundary'\n\n//functional components\nimport LayoutWrap from '../../HOC/LayoutWrap'\nimport RegisterForm from '../../Components/Register/RegisteForm'\nimport PageTitle from '../../Components/Reusable_UI/Headers_Titles/PageTitles'\nimport ErrorAlert from '../../Components/Reusable_UI/Alerts/ErrorAlerts'\n\n//const title of login page\nconst PAGE_TITLE = 'Sign Up'\n\n//const form fields initial state\nconst initialFieldValues = {\n username: '',\n email: '',\n password: ''\n}\n\n//types for form fields state\ninterface FormValues {\n username: string\n password: string\n email: string\n}\n\nconst Register: React.FC = props => {\n const client = useApolloClient()\n\n //local state\n const [registerError, setRegisterError] = useState()\n\n //use mutation hook - extract mutate function, token and save it to the local storage when the request is completed.\n const [createUser, { loading }] = useMutation(REGISTER_USER, {\n onCompleted({ createUser }) {\n localStorage.setItem('token', createUser.token)\n client.writeData({\n data: { isAuthenticated: !!createUser.token, __typename: 'Auth' }\n })\n },\n onError(error) {\n setRegisterError(error)\n }\n })\n\n //handle submit function\n const handleSubmit = (values: FormValues) => {\n createUser({\n variables: {\n username: values.username,\n email: values.email,\n password: values.password\n }\n })\n }\n\n return (\n \n \n \n \n {({ submitCount, values }) => (\n \n {/* title of the page */}\n \n\n {/* on error during mutation display error message */}\n {registerError && (\n \n )}\n\n {/* register form */}\n \n \n \n \n )}\n \n \n \n \n )\n}\n\nexport default Register\n","//This component contains the route/url information of all pages in the app.\n\nimport React from 'react'\nimport { Route, Switch, withRouter, Redirect } from 'react-router-dom'\nimport { useQuery } from '@apollo/react-hooks'\n\n//utils\nimport { IS_AUTHENTICATED } from '../Graqhql/Authenticated'\n\n//Components - NOTE - lazy loading (async) was removed to avoid the fallback loader\n\n//brands\nimport BrandList from '../Containers/BrandsList/Brands'\n//experiments\nimport CreateExperiment from '../Containers/Experiment/CreateExperiment/CreateExperiment'\nimport ExperimentsList from '../Containers/ExperimentsList/ExperimenstList'\nimport EditExperiment from '../Containers/Experiment/EditExperiment/EditExperiment'\nimport ViewExperiment from '../Containers/Experiment/ViewExperiment/ViewExperiment'\n//features\nimport FeaturesList from '../Containers/FeaturesList/Features'\n//permutations\nimport ViewPermutation from '../Containers/Permutations/ViewPermutation'\n//user\nimport Login from '../Containers/Login/Login'\nimport Register from '../Containers/Register/Register'\n\n//JSX\nconst AppRoutes: React.FC = () => {\n // get authenticated state to switch the authenticated or unauthenticated pages\n const { data } = useQuery(IS_AUTHENTICATED)\n const authenticated = data ? data.isAuthenticated : false\n\n return (\n \n {/* routes in reverse alphabetical order */}\n\n {/* view permutation */}\n \n authenticated ? (\n \n ) : (\n \n )\n }\n />\n\n {/* view experiment */}\n \n authenticated ? (\n \n ) : (\n \n )\n }\n />\n\n {/* register - create user*/}\n \n authenticated ? (\n \n ) : (\n \n )\n }\n />\n\n {/* features - features list*/}\n\n \n authenticated ? (\n \n ) : (\n \n )\n }\n />\n\n {/* experiment list */}\n \n authenticated ? (\n \n ) : (\n \n )\n }\n />\n\n {/* edit experiment */}\n \n authenticated ? (\n \n ) : (\n \n )\n }\n />\n\n {/* brand list*/}\n \n authenticated ? (\n \n ) : (\n \n )\n }\n />\n\n {/* create experiment */}\n \n authenticated ? (\n \n ) : (\n \n )\n }\n />\n\n {/* login */}\n \n authenticated ? (\n \n ) : (\n \n )\n }\n />\n \n )\n}\n\nexport default withRouter(AppRoutes)\n","import React from 'react'\n\n//App routes\nimport AppRoutes from './Routes/AppRoutes'\nimport ErrorBoundary from './Utilities/ErrorBoundary'\n\nconst App: React.FC = () => {\n return (\n \n \n \n )\n}\n\nexport default App\n","//utilities\nimport { client } from '../Utilities/ApolloSetup'\n\n//logout user on \"signature expired\" response.\nexport const Logout = () => {\n localStorage.removeItem('token')\n client.resetStore()\n}\n","//This is the setup for instantiating required constructor fields and connecting the endpoint\n//client will be imported in index.js and hooked to Apollo Provider\n\nimport {\n ApolloClient,\n ApolloLink,\n InMemoryCache,\n HttpLink,\n from\n} from 'apollo-boost'\nimport { onError } from 'apollo-link-error'\n\n//constant\nimport { Auth } from '../Constants/auth'\n\n//utilities\nimport { EnvironmentURL } from './EnvironmentURL'\nimport { Logout } from './Logout'\n\n//Apollo cache\nconst cache = new InMemoryCache()\n\n//get auth token written in local storage.\nconst getAuthToken = () => {\n const token = localStorage.getItem(Auth.AUTH_TOKEN)\n return token ? `JWT ${token}` : ''\n}\n\n// the endpoint link\n// Note - also check for the baseURL in RESTSetup.tsx if any changes\nconst endpoint = EnvironmentURL()\n\nconst httpLink = new HttpLink({\n //uri setup for staging or production env, comment the below code for dev proxy\n uri: `${endpoint}/graphql`\n //setup for dev proxy\n // uri: \"/graphql\"\n})\n\n//global default options - change here to override\nconst defaultOptions: any = {\n watchQuery: {\n fetchPolicy: 'cache-and-network'\n },\n query: {\n fetchPolicy: 'network-only'\n }\n}\n\n//array of unauthorized messages\nconst unAuthorizedMessages = [\n Auth.LOGOUT_TOKEN.valueOf(),\n Auth.INVALID_TOKEN.valueOf()\n]\n\n//afterware\nconst unAuthorizedInterceptor = onError(({ graphQLErrors }) => {\n //note - backend is not sending unauth error in graphQLErrors & not networkError.\n //if the graphQLErrors message is changed in the backend, it will have to be updated in the 'Auth' enum.\n if (\n graphQLErrors &&\n unAuthorizedMessages.includes(graphQLErrors[0].message)\n ) {\n //logout user\n Logout()\n }\n})\n\n//middleware header config\nconst requestMiddleware = new ApolloLink((operation, forward) => {\n // Use the setContext method to set the HTTP headers.\n operation.setContext({\n headers: {\n authorization: getAuthToken()\n }\n })\n return forward(operation)\n})\n\n// apollo client set up to connect to the Apollo Provider - refer index.js\nexport const client = new ApolloClient({\n // do not change the position of 'httpLink' in the concat Link array\n link: from([requestMiddleware, unAuthorizedInterceptor, httpLink]),\n cache,\n defaultOptions,\n resolvers: {}\n})\n\n//writing auth flag to cache during app load\ncache.writeData({\n data: {\n isAuthenticated: !!getAuthToken(),\n __typename: 'Auth'\n }\n})\n\n","import React from 'react'\nimport ReactDOM from 'react-dom'\nimport { BrowserRouter } from 'react-router-dom'\n//apollo\nimport { ApolloProvider } from '@apollo/react-hooks'\n\n//service worker\nimport * as serviceWorker from './serviceWorker'\n\n//contexts\nimport EditModalProvider from './Contexts/EditModalContext'\nimport CreateModalProvider from './Contexts/CreateModalContext'\nimport SideNavCtxProvider from './Contexts/SideNavToggle'\n\n//styling\nimport './index.css'\n\n//functional components\nimport App from './App'\n\n//utilities\nimport { client } from './Utilities/ApolloSetup'\n\nReactDOM.render(\n // Apollo client provider\n \n {/* React router */}\n \n {/* contexts providers */}\n \n \n \n \n \n \n \n \n ,\n document.getElementById('root')\n)\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister()\n"],"sourceRoot":""}