tocco-admin 0.5.36 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/changelog.md +43 -0
  2. package/dist/{chunk-252.a7a4e7dcb9a020fd9129.js → chunk-215.fff39767c95996b4de4d.js} +2 -2
  3. package/dist/chunk-215.fff39767c95996b4de4d.js.map +1 -0
  4. package/dist/chunk-404.9bc2425dfbf4ee21635e.js +2 -0
  5. package/dist/chunk-404.9bc2425dfbf4ee21635e.js.map +1 -0
  6. package/dist/chunk-817.46476531b6e7efc9219a.js +2 -0
  7. package/dist/chunk-817.46476531b6e7efc9219a.js.map +1 -0
  8. package/dist/chunk-82.856d20bcbc6eedcbd32f.js +2 -0
  9. package/dist/chunk-82.856d20bcbc6eedcbd32f.js.map +1 -0
  10. package/dist/chunk-872.a9273eaa81fc55df7a8b.js +2 -0
  11. package/dist/chunk-872.a9273eaa81fc55df7a8b.js.map +1 -0
  12. package/dist/chunk-actions.36f03e5e0bdd9b2974c7.js +2 -0
  13. package/dist/chunk-actions.36f03e5e0bdd9b2974c7.js.map +1 -0
  14. package/dist/chunk-code-editor.f6597326374cd04ca8c0.js +7 -0
  15. package/dist/chunk-code-editor.f6597326374cd04ca8c0.js.map +1 -0
  16. package/dist/chunk-docs-actions.04e0b787c292d57ebc24.js +2 -0
  17. package/dist/chunk-docs-actions.04e0b787c292d57ebc24.js.map +1 -0
  18. package/dist/chunk-vendor-icons.5d77807afe310d44ae38.js +1 -0
  19. package/dist/{chunk-vendor-quill.bcff7a1213d0e7ba09f1.js → chunk-vendor-quill.1789cce485c0fe1c2550.js} +1 -1
  20. package/dist/index.js +8 -8
  21. package/dist/index.js.map +1 -1
  22. package/package.json +1 -1
  23. package/dist/chunk-230.21fdce71dc0b88f90fb7.js +0 -2
  24. package/dist/chunk-230.21fdce71dc0b88f90fb7.js.map +0 -1
  25. package/dist/chunk-252.a7a4e7dcb9a020fd9129.js.map +0 -1
  26. package/dist/chunk-693.054c38747be49a688ab4.js +0 -2
  27. package/dist/chunk-693.054c38747be49a688ab4.js.map +0 -1
  28. package/dist/chunk-796.1fe921c33448dcec0a97.js +0 -2
  29. package/dist/chunk-796.1fe921c33448dcec0a97.js.map +0 -1
  30. package/dist/chunk-82.3247bc18e2ce1c9526c4.js +0 -2
  31. package/dist/chunk-82.3247bc18e2ce1c9526c4.js.map +0 -1
  32. package/dist/chunk-872.ee6a53c618c0363f03e5.js +0 -2
  33. package/dist/chunk-872.ee6a53c618c0363f03e5.js.map +0 -1
  34. package/dist/chunk-actions.adbdd7321401dd50d5f3.js +0 -2
  35. package/dist/chunk-actions.adbdd7321401dd50d5f3.js.map +0 -1
  36. package/dist/chunk-code-editor.3a23df0e5978cc2dc915.js +0 -7
  37. package/dist/chunk-code-editor.3a23df0e5978cc2dc915.js.map +0 -1
  38. package/dist/chunk-docs-actions.40480956435a5f959445.js +0 -2
  39. package/dist/chunk-docs-actions.40480956435a5f959445.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["webpack:///./packages/admin/src/routes/docs/components/DocsBrowserApp/DocsBrowserApp.js","webpack:///./packages/admin/src/routes/docs/components/DocsBrowserApp/DocsBrowserAppContainer.js","webpack:///./packages/admin/src/routes/docs/route.js","webpack:///./packages/docs-browser/src/components/Action/actions/CreateDomain.js","webpack:///./packages/docs-browser/src/components/Action/actions/CreateFolder.js","webpack:///./packages/docs-browser/src/components/Action/actions/Delete.js","webpack:///./packages/docs-browser/src/components/Action/actions/Edit.js","webpack:///./packages/docs-browser/src/components/Action/actions/Move.js","webpack:///./packages/docs-browser/src/components/Action/actions/MoveContainer.js","webpack:///./packages/docs-browser/src/modules/path/actions.js","webpack:///./packages/docs-browser/src/modules/path/sagas.js","webpack:///./packages/docs-browser/src/modules/path/reducer.js","webpack:///./packages/docs-browser/src/modules/path/index.js","webpack:///./packages/docs-browser/src/modules/create/sagas.js","webpack:///./packages/docs-browser/src/modules/create/actions.js","webpack:///./packages/docs-browser/src/modules/create/reducer.js","webpack:///./packages/docs-browser/src/modules/create/index.js","webpack:///./packages/docs-browser/src/modules/list/actions.js","webpack:///./packages/docs-browser/src/modules/list/reducer.js","webpack:///./packages/docs-browser/src/modules/list/index.js","webpack:///./packages/docs-browser/src/modules/list/sagas.js","webpack:///./packages/docs-browser/src/modules/move/sagas.js","webpack:///./packages/docs-browser/src/modules/move/reducer.js","webpack:///./packages/docs-browser/src/modules/move/index.js","webpack:///./packages/docs-browser/src/modules/reducers.js","webpack:///./packages/docs-browser/src/components/Action/LazyAction.js","webpack:///./packages/docs-browser/src/components/FileInput/FileInput.js","webpack:///./packages/docs-browser/src/components/FileInput/FileInputContainer.js","webpack:///./packages/docs-browser/src/components/DocsView/StyledComponents.js","webpack:///./packages/docs-browser/src/utils/isRootLocation.js","webpack:///./packages/docs-browser/src/components/DocsView/DocsView.js","webpack:///./packages/docs-browser/src/components/DocsView/DocsViewContainer.js","webpack:///./packages/docs-browser/src/components/DocumentView/StyledComponents.js","webpack:///./packages/docs-browser/src/components/DocumentView/DocumentView.js","webpack:///./packages/docs-browser/src/components/DocumentView/DocumentViewContainer.js","webpack:///./packages/docs-browser/src/containers/BreadcrumbsContainer.js","webpack:///./packages/docs-browser/src/components/DocsBrowser/StyledComponents.js","webpack:///./packages/docs-browser/src/components/DocsBrowser/DocsBrowser.js","webpack:///./packages/docs-browser/src/components/DocsBrowser/DocsBrowserContainer.js","webpack:///./packages/docs-browser/src/input.js","webpack:///./packages/docs-browser/src/main.js","webpack:///./packages/docs-browser/src/modules/move/actions.js","webpack:///./packages/docs-browser/src/utils/getDetailFormName.js","webpack:///./packages/docs-browser/src/utils/getNode.js","webpack:///./packages/entity-detail/src/modules/entityDetail/actions.js","webpack:///./packages/entity-detail/src/modules/entityDetail/reducer.js","webpack:///./packages/entity-detail/src/modules/entityDetail/index.js","webpack:///./packages/entity-detail/src/util/api/entities.js","webpack:///./packages/entity-detail/src/util/modes.js","webpack:///./packages/entity-detail/src/components/ErrorItems/ErrorItems.js","webpack:///./packages/entity-detail/src/util/detailFooter/types.js","webpack:///./packages/entity-detail/src/util/detailFooter/helpers.js","webpack:///./packages/entity-detail/src/modules/entityDetail/sagas.js","webpack:///./packages/entity-detail/src/modules/reducers.js","webpack:///./packages/entity-detail/src/components/SubGrid/SubGrid.js","webpack:///./packages/entity-detail/src/components/SubGrid/index.js","webpack:///./packages/entity-detail/src/containers/SubGridContainer.js","webpack:///./packages/entity-detail/src/util/detailView/fromFieldFactories/subGrid.js","webpack:///./packages/entity-detail/src/components/ErrorItems/index.js","webpack:///./packages/entity-detail/src/components/DetailForm/StyledComponents.js","webpack:///./packages/entity-detail/src/components/DetailForm/SaveButton.js","webpack:///./packages/entity-detail/src/components/DetailForm/MarkButton.js","webpack:///./packages/entity-detail/src/components/DetailFooter/StyledComponents.js","webpack:///./packages/entity-detail/src/components/DetailFooter/FooterItem.js","webpack:///./packages/entity-detail/src/components/DetailFooter/TextValue.js","webpack:///./packages/entity-detail/src/components/DetailFooter/DetailFooterReduced.js","webpack:///./packages/entity-detail/src/components/DetailFooter/TimestampValue.js","webpack:///./packages/entity-detail/src/components/DetailFooter/DetailFooterFull.js","webpack:///./packages/entity-detail/src/components/DetailFooter/DetailFooter.js","webpack:///./packages/entity-detail/src/containers/DetailFooterContainer.js","webpack:///./packages/entity-detail/src/components/DetailForm/DetailForm.js","webpack:///./packages/entity-detail/src/containers/DetailFormContainer.js","webpack:///./packages/entity-detail/src/components/DetailView/DetailView.js","webpack:///./packages/entity-detail/src/containers/DetailViewContainer.js","webpack:///./packages/entity-detail/src/input.js","webpack:///./packages/entity-detail/src/customActions.js","webpack:///./packages/entity-detail/src/shortcuts.js","webpack:///./packages/entity-detail/src/main.js","webpack:///./packages/tocco-ui/src/BurgerButton/framerMotionFeatures.js","webpack:///./packages/tocco-ui/src/Icon/FontAwesomeAdapter.js","webpack:///./packages/tocco-ui/src/Icon/ToccoIcons.js","webpack:///./packages/tocco-ui/src/Icon/Icon.js","webpack:///./packages/tocco-ui/src/LoadingSpinner/LoadingSpinner.js","webpack:///./node_modules/history/DOMUtils.js","webpack:///./node_modules/history/LocationUtils.js","webpack:///./node_modules/history/PathUtils.js","webpack:///./node_modules/history/createHashHistory.js","webpack:///./node_modules/history/createMemoryHistory.js","webpack:///./node_modules/history/createTransitionManager.js"],"names":["ListLink","entityName","entityKeys","children","rootNodes","map","key","StyledLink","to","JSON","stringify","target","props","queryParams","queryString","history","location","search","navigationStrategy","DetailLink","parse","searchFormCollapsed","onSearchFormCollapsedChange","collapsed","saveUserPreferences","mapActionCreators","container","connect","state","_get","preferences","userPreferences","injectIntl","DocsBrowserApp","context","onSuccess","intl","emitAction","parent","getNode","pathname","defaultValues","id","model","value","formName","getDetailFormName","mode","onEntityCreated","remoteEvents","type","payload","entities","message","formatMessage","action","toaster","title","customDeleteEndpoint","selection","onCancel","ids","split","entityKey","push","entityId","onEntityUpdated","onEntityDeleted","StyledButtonsWrapper","styled","StyledButton","initialize","moveElements","MoveContainer","isWaiting","docs","move","domainTypes","input","businessUnit","onError","initialNode","initialParent","useState","setParent","useEffect","getCustomLocation","Error","LoadMask","required","memoryHistory","initialLocation","getInitialLocation","listLimit","selectionStyle","searchFormType","disableViewPersistor","getListFormName","onListParentChange","embedded","noLeftPadding","sortable","Button","onClick","look","ink","disabled","_isEqual","setBreadcrumbs","breadcrumbs","getSearchBreadcrumbs","loadBreadcrumbs","getRootNodesParam","mainSagas","textResourceSelector","messages","docsPathSelector","path","rootNodesSelector","select","display","node","searchMode","call","url","rootnodes","options","rest","result","body","put","actions","Array","isArray","length","join","all","takeLatest","ACTION_HANDLERS","reducerUtil","initialState","sagas","fork","moduleSagas","handler","handleFilesSelected","createDocuments","dialogSelector","create","dialog","files","isDirectory","uuid","blockingInfoId","notification","response","items","filter","item","status","bean","msgId","consoleLogger","formData","FormData","file","append","f","resource","method","takeEvery","directory","instanceCount","changeListParent","changeSelection","changeSearchFormCollapsed","externalEvents","setDone","inputSelector","acceptedStatusCodes","targetEntityKey","selectedEntityKeys","selected","errorCode","validation","errors","combineReducers","list","pathSagas","createSagas","listSagas","moveSagas","lazy","appId","LazyAction","ActionComponent","actionEmitter","Suspense","fallback","ref","onChange","fileInput","useRef","prevInstanceCount","current","click","style","e","multiple","webkitdirectory","FileInput","StyledContentWrapper","StyledIconWrapper","scale","ROOT_PATH_REGEX","test","LazyListApp","React","match","onSearchChange","openFileDialog","limit","domainDetailFormName","folderDetailFormName","showActions","openResource","useReducer","x","entityListNumber","forceEntityListUpdate","entityListKey","setSelection","useMemo","params","charAt","toUpperCase","slice","getParent","keys","getFormName","mounted","searchModeRef","onSelectChange","tql","getTql","handleUploadDocument","definition","config","handleUploadDirectory","store","undefined","isRootLocation","viewPersistor","onRowClick","searchStore","getDefaultLocation","searchFormPosition","onStoreCreate","cellRenderers","rowData","column","cellRenderer","icon","c","dmsEntityModel","actionAppComponent","Action","contextParams","detailFormNames","Domain","Folder","customActions","DocsView","StyledDocumentViewWrapper","theme","LazyDetailApp","lastList","reverse","find","breadcrumb","lastListUrl","documentDetailFormName","DocumentView","pathPrefix","breadcrumbsInfo","Breadcrumbs","StyledWrapper","StyledContent","StyledScrollbar","StyledBreadcrumbs","withTheme","setSearchMode","docsViewNumber","forceDocsViewUpdate","useLocation","resetSearchMode","handleSearchChange","query","hasUserChanges","backgroundColor","themeUtil","breadcrumbsItem","exact","render","DocsBrowser","getDispatchActions","actionSettings","reduce","acc","actionSetting","name","argsFactory","EXTERNAL_EVENTS","createHistory","createMemoryHistory","createHashHistory","getUserConfirmation","confirmCallback","getState","okText","cancelText","dispatch","GlobalStyles","initApp","events","publicPath","appFactory","reducers","errorLogging","handleNotifications","cache","singleRootNode","startUrl","toLowerCase","content","textResourceModules","app","event","getEvents","prevProps","changedProps","_pickBy","this","_isEmpty","forEach","component","INITIALIZE","MOVE_ELEMENTS","SET_WAITING","CLOSE","setWaiting","close","DOC_PATH_REGEX","PARENT_PATH_REGEX","docMatches","exec","getResourceNode","parentMatches","getParentNode","SET_LAST_SAVE","setFormDefinition","formDefinition","loadDetailView","modelPaths","setEntity","entity","submitForm","setLastSave","lastSave","Date","now","setEntityModel","entityModel","unloadDetailView","navigateToCreate","relationName","setFieldDefinitions","fieldDefinitions","navigateToAction","setMarked","marked","touched","updateEntity","createEntity","paths","_paths","acceptedErrorCodes","resp","SubmissionError","form","information","headers","get","pop","ErrorItem","decode","StyledErrorItemWrapper","Typography","formErrors","output","elements","hasFieldErrors","hasValidatorErrors","hasRelatedEntityErrors","validatorErrors","relatedEntityErrorsCompact","outdatedError","selectUnit","updateTimestamp","timeStampValue","unit","titleId","sameEntity","values","ago","user","updateUser","idx","el","NONE","REDUCED","FULL","getFooterType","useNiceFields","modes","types","getFooterPaths","keyField","autoComplete","loadDetailFormDefinition","loadEntity","loadEntityModel","updateFormSubmit","createFormSubmit","touchAllFields","handleSubmitError","getCurrentEntityState","submitValidate","getEntityForSubmit","getFormErrors","locationFieldFocus","focusErrorField","handleInvalidForm","fireTouched","showNotification","loadDisplayExpressions","loadRelationDisplays","enhanceEntityWithDisplayExpressions","enhanceEntityWithDisplays","loadData","loadMarked","updateMarked","reloadAfterAction","remoteEvent","asyncValidationStop","formInitialValueSelector","formId","initial","entityDetailSelector","entityDetail","FORM_ID","debounce","formActionTypes","actionExtensions","fieldName","autoCompleteEndpoint","triggerField","getFormValues","formValues","Object","currentFieldValue","formActions","meta","field","fieldDefinition","fd","formPaths","footerPaths","formDefaultValues","inputDefaultValues","defaultValuesFields","api","flattenEntity","createdEntityId","error","validationErrors","duration","initialFormValues","initialValues","dirtyFields","dirtyFieldNames","getFormSyncErrors","getFormAsyncErrors","getFormSubmitErrors","focusField","element","document","getElementById","focus","errorField","locationField","locationMapping","postcode","firstErrorField","isValidSelector","actionTouched","stateTouched","titleResourceName","messageResourceName","__key","__model","relationFields","request","displayExpressions","componentType","displayExpressionsL","dE","dataType","displays","relationField","newValue","v2","reset","markable","keepDirty","keepValues","navigateToCreateRelative","navigateToActionRelative","isCurrentEntity","entityDetailReducer","entityDetailSagas","StyledListApp","SubGrid","formBase","detailFormName","formField","reverseRelation","targetEntity","showSearchForm","showLink","gridName","onNavigateToCreate","reverseRelationName","defaultProps","SubGridContainer","StyledForm","StyledSaveButton","hasErrors","StyledActionSpan","colors","secondary","submitting","Popover","placement","data-cy","label","pending","mouseOver","setMouseOver","stopPropagation","onMouseEnter","onMouseLeave","StyledFooterWrapper","colorizeText","StyledFooterItemWrapper","StyledFooterItemLabel","StyledSpan","declareNoneWrappingText","StyledFooterItemValue","StyledTimestampValueWrapper","StyledTimestampRelativeValue","labelId","ValueComp","valueComponent","diffValue","FormattedValue","create_timestamp","create_user","update_timestamp","update_user","version","DetailFooter","DetailFooterContainer","reduxForm","destroyOnUnmount","dirty","valid","anyTouched","formEl","useLayoutEffect","firstInput","querySelector","customRenderedActions","save","actionDefinition","mark","onSubmit","preventDefault","onKeyDown","tagName","fieldMappingType","readOnly","componentMapping","logError","_error","formInitialValues","getFormInitialValues","DetailForm","DetailView","validateSingleton","loadingText","msg","DetailFormContainer","validate","getSyncValidation","asyncValidate","handledAsyncValidate","asyncBlurFields","fD","new","fullscreen","ctrl","alt","code","DetailViewContainer","formApp","SimpleFormApp","listApp","EntityListApp","appComponent","viewName","detailApp","EntityDetailApp","chooseDocument","keyDown","shortcuts","dispatchActions","library","faChevronDoubleLeft","faChevronDoubleRight","faChevronRight","faChevronLeft","faChevronUp","faChevronDown","faGlobe","faPlus","faFolder","faFolders","faStar","faStarSolid","faTimes","faArrowRight","faArrowLeft","faFile","faFileAlt","faFileCode","faFileCsv","faFileExcel","faFileExport","faFileImport","faFilePdf","faFileSpreadsheet","faIdBadge","faCheck","faExclamation","faCircle","faCheckCircle","faGoogle","faFacebook","faFacebookF","faDropbox","faMicrosoft","faJira","faApple","faBars","faExternalLink","faPhone","faMapMarked","faSearch","faCog","faInfo","faHorizontalRule","faSync","faSquareFull","faCompress","faBook","faSortUp","faSortDown","faQuestionCircle","faEllipsisV","faMinus","faTimesCircle","faInfoCircle","faExclamationCircle","faTrash","faList","faSquare","faBell","faArrowToBottom","faArrowToTop","faSquareSolid","faBox","faBoxOpen","faNewspaper","faComment","faSave","faPen","faPaperclip","faAddressCard","faMailBulk","faSitemap","faBarcodeAlt","faAbacus","faCalendarCheck","faPhoneLaptop","faTasks","faChalkboardTeacher","faUsers","faChevronDoubleDown","faChevronDoubleUp","includes","replace","color","fixedWidth","fill","d","icons","logo","height","aria-hidden","role","xmlns","viewBox","office","enableBackground","ToccoIcons","propTypes","PropTypes","iconLibsFactories","fa","iconMap","toc","Icon","mapping","iconFactory","lib","size","fontSize","spin","faCircleNotch","exports","__esModule","canUseDOM","window","createElement","addEventListener","listener","attachEvent","removeEventListener","detachEvent","getConfirmation","callback","confirm","supportsHistory","ua","navigator","userAgent","indexOf","supportsPopStateOnHashChange","supportsGoWithoutReloadUsingHash","isExtraneousPopstateEvent","locationsAreEqual","createLocation","_extends","assign","i","arguments","source","prototype","hasOwnProperty","_resolvePathname2","_interopRequireDefault","_valueEqual2","_PathUtils","obj","default","currentLocation","parsePath","hash","decodeURI","URIError","a","b","addLeadingSlash","stripLeadingSlash","substr","hasBasename","prefix","RegExp","stripBasename","stripTrailingSlash","hashIndex","searchIndex","createPath","_warning2","_invariant2","_LocationUtils","_createTransitionManager2","_DOMUtils","HashPathCoders","hashbang","encodePath","decodePath","noslash","slash","getHashPath","href","substring","pushHashPath","replaceHashPath","globalHistory","canGoWithoutReload","_props$getUserConfirm","_props$hashType","hashType","basename","_HashPathCoders$hashT","getDOMLocation","transitionManager","setState","nextState","notifyListeners","forceNextPop","ignorePath","handleHashChange","encodedPath","prevLocation","handlePop","confirmTransitionTo","ok","revertPop","fromLocation","toLocation","toIndex","allPaths","lastIndexOf","fromIndex","delta","go","createHref","prevIndex","nextPaths","n","goBack","goForward","listenerCount","checkDOMListeners","isBlocked","block","prompt","unblock","setPrompt","listen","unlisten","appendListener","_typeof","Symbol","iterator","constructor","clamp","lowerBound","upperBound","Math","min","max","_props$initialEntries","initialEntries","_props$initialIndex","initialIndex","_props$keyLength","keyLength","entries","createKey","random","toString","index","entry","nextIndex","nextEntries","splice","canGo","_warning","listeners","nextPrompt","fn","isActive","apply","_len","args","_key"],"mappings":"mRAQaA,EAAW,SAAC,GAAuC,IAAtCC,EAAsC,EAAtCA,WAAYC,EAA0B,EAA1BA,WAAYC,EAAc,EAAdA,SAC1CC,EAAYF,EAAWG,KAAI,SAAAC,GAAG,MAAK,CAACL,aAAYK,UACtD,OAAO,kBAACC,EAAA,EAAD,CAAYC,GAAE,0BAAqBC,KAAKC,UAAUN,IAAcO,OAAO,UAAUR,IAgC1F,QAvBuB,SAAAS,GACrB,IAAMC,EAAcC,QAAkBF,EAAMG,QAAQC,SAASC,QAE7D,OAAO,kBAAC,UAAD,OACDL,EADC,CAELM,mBAAoB,CAClBlB,WACAmB,kBAEEN,EAAYT,WAAa,CAACA,UAAWK,KAAKW,MAAMP,EAAYT,YAN3D,CAOLiB,oBAAqBT,EAAMS,oBAC3BC,4BAA6B,YAAiB,IAAfC,EAAe,EAAfA,UAC7BX,EAAMY,oBAAoB,CAAC,iCAAkCD,S,ICxB7DE,EAAoB,CACxBD,oB,SAAAA,IAOF,MCbA,GACEE,WDYaC,cAJS,SAACC,EAAOhB,GAAR,MAAmB,CACzCS,oBAAqBQ,IAAKD,EAAME,YAAYC,gBAAiB,iCAAkC,SAGzDN,EAAxC,EAA2DO,QAAWC,M,4HEkDtE,SAAeD,SAzDM,SAAC,GAA2C,IAA1CE,EAA0C,EAA1CA,QAASC,EAAiC,EAAjCA,UAAWC,EAAsB,EAAtBA,KAAMC,EAAgB,EAAhBA,WAyBzCC,GAASC,OAAQL,EAAQnB,QAAQC,SAASwB,UAC1CC,EAAgBH,EAClB,CACE,CAACI,GAAI,MAAF,OAAQJ,EAAOK,OAASC,MAAON,EAAOhC,MAE3C,GAEEuC,GAAWC,OAAkBZ,EAAS,UAE5C,OAAO,kBAAC,IAAD,CACLjC,WA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DAEvCA,EAASkC,EAEF,WACDlC,IAAWkC,IAAYlC,EAAS,QA2DtCrB,oBAvDwB,SAA6BtzB,EAAUuC,EAAQqQ,EAAqB6b,GAI5F,GAAc,MAAVkG,EAAgB,CAClB,IAAI3tB,EAA2B,mBAAX2tB,EAAwBA,EAAO30B,EAAUuC,GAAUoyB,EAEjD,iBAAX3tB,EAC0B,mBAAxB4L,EACTA,EAAoB5L,EAAQynB,KAE5B,EAAI2C,EAAUnB,UAAS,EAAO,mFAE9BxB,GAAS,IAIXA,GAAoB,IAAXznB,QAGXynB,GAAS,IAoCXuG,eA9BmB,SAAwB8B,GAC3C,IAAIC,GAAW,EAEX3I,EAAW,WACT2I,GAAUD,EAAGE,WAAMtoB,EAAW8gB,YAKpC,OAFAoH,EAAU5zB,KAAKorB,GAER,WACL2I,GAAW,EACXH,EAAYA,EAAU/tB,QAAO,SAAUC,GACrC,OAAOA,IAASslB,OAmBpB2E,gBAdoB,WACpB,IAAK,IAAIkE,EAAOzH,UAAUloB,OAAQ4vB,EAAO9vB,MAAM6vB,GAAOE,EAAO,EAAGA,EAAOF,EAAME,IAC3ED,EAAKC,GAAQ3H,UAAU2H,GAGzBP,EAAUpiB,SAAQ,SAAU4Z,GAC1B,OAAOA,EAAS4I,WAAMtoB,EAAWwoB","file":"chunk-docs-actions.40480956435a5f959445.js","sourcesContent":["import React from 'react'\nimport PropTypes from 'prop-types'\nimport DocsBrowser from 'tocco-docs-browser/src/main'\nimport {AdminLink as StyledLink} from 'tocco-ui'\nimport queryString from 'query-string'\n\nimport {DetailLink} from '../../../entities/utils/navigationStrategy'\n\nexport const ListLink = ({entityName, entityKeys, children}) => {\n const rootNodes = entityKeys.map(key => ({entityName, key}))\n return <StyledLink to={`/docs?rootNodes=${JSON.stringify(rootNodes)}`} target=\"_blank\">{children}</StyledLink>\n}\n\nListLink.propTypes = {\n entityName: PropTypes.string.isRequired,\n children: PropTypes.any.isRequired,\n entityKeys: PropTypes.arrayOf(PropTypes.string)\n}\n\nconst DocsBrowserApp = props => {\n const queryParams = queryString.parse(props.history.location.search)\n\n return <DocsBrowser\n {...props}\n navigationStrategy={{\n ListLink,\n DetailLink\n }}\n {...queryParams.rootNodes && {rootNodes: JSON.parse(queryParams.rootNodes)}}\n searchFormCollapsed={props.searchFormCollapsed}\n onSearchFormCollapsedChange={({collapsed}) => {\n props.saveUserPreferences({'admin.list.searchFormCollapsed': collapsed})\n }}\n />\n}\n\nDocsBrowserApp.propTypes = {\n history: PropTypes.object.isRequired,\n searchFormCollapsed: PropTypes.bool,\n saveUserPreferences: PropTypes.func\n}\n\nexport default DocsBrowserApp\n","import {connect} from 'react-redux'\nimport {injectIntl} from 'react-intl'\nimport _get from 'lodash/get'\n\nimport DocsBrowserApp from './DocsBrowserApp'\nimport {saveUserPreferences} from '../../../../modules/preferences/actions'\n\nconst mapActionCreators = {\n saveUserPreferences\n}\n\nconst mapStateToProps = (state, props) => ({\n searchFormCollapsed: _get(state.preferences.userPreferences, 'admin.list.searchFormCollapsed', null)\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(DocsBrowserApp))\n","import DocsBrowserApp from './components/DocsBrowserApp'\n\nexport default {\n container: DocsBrowserApp\n}\n","import React from 'react'\nimport PropTypes from 'prop-types'\nimport EntityDetailApp from 'tocco-entity-detail/src/main'\nimport {injectIntl} from 'react-intl'\n\nimport getNode from '../../../utils/getNode'\nimport getDetailFormName from '../../../utils/getDetailFormName'\n\nconst CreateDomain = ({context, onSuccess, intl, emitAction}) => {\n const emitActionBarrier = action => {\n if (action.payload && action.payload.toaster\n && action.payload.toaster.title !== 'client.entity-detail.createSuccessfulTitle') {\n emitAction(action)\n }\n }\n\n const handleEntityCreated = ({id}) => {\n const remoteEvents = [{\n type: 'entity-create-event',\n payload: {\n entities: [{\n entityName: 'Docs_list_item',\n key: `Domain/${id}`\n }]\n }\n }]\n\n onSuccess({\n message: intl.formatMessage({id: 'client.docs-browser.createDomainSuccessful'}),\n remoteEvents\n })\n }\n\n const parent = getNode(context.history.location.pathname)\n const defaultValues = parent\n ? [\n {id: `rel${parent.model}`, value: parent.key}\n ]\n : []\n\n const formName = getDetailFormName(context, 'Domain')\n\n return <EntityDetailApp\n entityName=\"Domain\"\n formName={formName}\n mode=\"create\"\n defaultValues={defaultValues}\n onEntityCreated={handleEntityCreated}\n emitAction={emitActionBarrier}\n />\n}\n\nCreateDomain.propTypes = {\n context: PropTypes.shape({\n history: PropTypes.shape({\n location: PropTypes.shape({\n pathname: PropTypes.string.isRequired\n }).isRequired\n }).isRequired\n }).isRequired,\n onSuccess: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n emitAction: PropTypes.func.isRequired\n}\n\nexport default injectIntl(CreateDomain)\n","import React from 'react'\nimport PropTypes from 'prop-types'\nimport EntityDetailApp from 'tocco-entity-detail/src/main'\nimport {injectIntl} from 'react-intl'\n\nimport getNode from '../../../utils/getNode'\nimport getDetailFormName from '../../../utils/getDetailFormName'\n\nconst CreateFolder = ({context, onSuccess, intl, emitAction}) => {\n const emitActionBarrier = action => {\n if (action.payload && action.payload.toaster\n && action.payload.toaster.title !== 'client.entity-detail.createSuccessfulTitle') {\n emitAction(action)\n }\n }\n\n const handleEntityCreated = ({id}) => {\n const remoteEvents = [{\n type: 'entity-create-event',\n payload: {\n entities: [{\n entityName: 'Docs_list_item',\n key: `Folder/${id}`\n }]\n }\n }]\n\n onSuccess({\n message: intl.formatMessage({id: 'client.docs-browser.createFolderSuccessful'}),\n remoteEvents\n })\n }\n\n const parent = getNode(context.history.location.pathname)\n const defaultValues = parent\n ? [\n {id: `rel${parent.model}`, value: parent.key}\n ]\n : []\n\n const formName = getDetailFormName(context, 'Folder')\n\n return <EntityDetailApp\n entityName=\"Folder\"\n formName={formName}\n mode=\"create\"\n defaultValues={defaultValues}\n onEntityCreated={handleEntityCreated}\n emitAction={emitActionBarrier}\n />\n}\n\nCreateFolder.propTypes = {\n context: PropTypes.shape({\n history: PropTypes.shape({\n location: PropTypes.shape({\n pathname: PropTypes.string.isRequired\n }).isRequired\n }).isRequired\n }).isRequired,\n onSuccess: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n emitAction: PropTypes.func.isRequired\n}\n\nexport default injectIntl(CreateFolder)\n","import React from 'react'\nimport DeleteApp from 'tocco-delete/src/main'\n\nexport default props => <DeleteApp {...props} customDeleteEndpoint={'documents/delete'}/>\n","import React from 'react'\nimport PropTypes from 'prop-types'\nimport {injectIntl} from 'react-intl'\nimport EntityDetailApp from 'tocco-entity-detail/src/main'\nimport {selection} from 'tocco-util'\n\nimport getDetailFormName from '../../../utils/getDetailFormName'\n\nconst EditAction = ({selection, onSuccess, onCancel, intl, context, emitAction}) => {\n const emitActionBarrier = action => {\n if (action.payload && action.payload.title !== 'client.entity-detail.saveSuccessfulTitle') {\n emitAction(action)\n }\n }\n\n const [entityName, entityKey] = selection.ids[0].split('/')\n\n if (entityName === 'Resource') {\n context.history.push(`/docs/doc/${entityKey}/detail`)\n onCancel()\n }\n\n const handleEntityUpdated = () => {\n const remoteEvents = [{\n type: 'entity-update-event',\n payload: {\n entities: [{\n entityName: 'Docs_list_item',\n key: selection.ids[0]\n }]\n }\n }]\n\n onSuccess({\n message: null,\n remoteEvents\n })\n }\n\n const handleEntityDeleted = () => {\n const remoteEvents = [{\n type: 'entity-delete-event',\n payload: {\n entities: [{\n entityName: 'Docs_list_item',\n key: selection.ids[0]\n }]\n }\n }]\n\n onSuccess({\n message: null,\n remoteEvents\n })\n }\n\n const formName = getDetailFormName(context, entityName)\n\n return <EntityDetailApp\n entityName={entityName}\n formName={formName}\n entityId={entityKey}\n mode=\"update\"\n onEntityUpdated={handleEntityUpdated}\n onEntityDeleted={handleEntityDeleted}\n emitAction={emitActionBarrier}\n />\n}\n\nEditAction.propTypes = {\n selection: selection.propType,\n context: PropTypes.shape({\n history: PropTypes.shape({\n push: PropTypes.func.isRequired\n }).isRequired\n }).isRequired,\n onSuccess: PropTypes.func.isRequired,\n onCancel: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n emitAction: PropTypes.func.isRequired\n}\n\nexport default injectIntl(EditAction)\n","import React, {useEffect, useState} from 'react'\nimport PropTypes from 'prop-types'\nimport {FormattedMessage} from 'react-intl'\nimport {selection} from 'tocco-util'\nimport {Button, LoadMask, StyledButton} from 'tocco-ui'\nimport styled from 'styled-components'\nimport _isEqual from 'lodash/isEqual'\n\nimport DocsBrowser from '../../../main'\nimport getNode from '../../../utils/getNode'\n\nconst StyledButtonsWrapper = styled.div`\n display: flex;\n justify-content: flex-end;\n\n ${StyledButton} {\n margin-right: 0;\n }\n`\n\nexport const MoveAction = ({\n selection,\n onSuccess,\n onError,\n context,\n initialize,\n moveElements,\n isWaiting,\n domainTypes,\n rootNodes,\n businessUnit,\n emitAction\n}) => {\n const initialNode = getNode(context.history.location.pathname)\n const initialParent = {model: 'Docs_list_item', key: `${initialNode.model}/${initialNode.key}`}\n const [parent, setParent] = useState(initialParent)\n\n useEffect(() => {\n initialize(selection, onSuccess, onError)\n }, [])\n\n const getCustomLocation = (model, key) => {\n switch (model) {\n case 'Domain':\n return `/docs/domain/${key}/list`\n case 'Folder':\n return `/docs/folder/${key}/list`\n case 'Resource':\n return\n default:\n throw new Error(`Unexpected model: ${model}`)\n }\n }\n\n const getInitialLocation = () => {\n if (parent === null) {\n return null\n }\n const [model, key] = parent.key.split('/')\n return getCustomLocation(model, key)\n }\n\n return <LoadMask required={[!isWaiting]}>\n <DocsBrowser\n memoryHistory={true}\n initialLocation={getInitialLocation()}\n listLimit={10}\n selectionStyle=\"none\"\n searchFormType=\"none\"\n disableViewPersistor={true}\n getListFormName={parent => parent === null ? 'Move_root_docs_list_item' : 'Move_docs_list_item'}\n onListParentChange={parent => setParent(parent)}\n getCustomLocation={getCustomLocation}\n navigationStrategy={{}}\n embedded={true}\n emitAction={emitAction}\n noLeftPadding={true}\n domainTypes={domainTypes}\n rootNodes={rootNodes}\n businessUnit={businessUnit}\n sortable={false}\n />\n <StyledButtonsWrapper>\n <Button\n onClick={() => moveElements(parent.key, selection.ids)}\n look=\"raised\"\n ink=\"primary\"\n disabled={parent === null || _isEqual(parent, initialParent)}\n >\n <FormattedMessage id=\"client.actions.dms-move.button\"/>\n </Button>\n </StyledButtonsWrapper>\n </LoadMask>\n}\n\nMoveAction.propTypes = {\n selection: selection.propType,\n onSuccess: PropTypes.func.isRequired,\n onError: PropTypes.func.isRequired,\n context: PropTypes.shape({\n history: PropTypes.shape({\n location: PropTypes.shape({\n pathname: PropTypes.string.isRequired\n }).isRequired\n }).isRequired\n }).isRequired,\n initialize: PropTypes.func.isRequired,\n moveElements: PropTypes.func.isRequired,\n isWaiting: PropTypes.bool.isRequired,\n domainTypes: PropTypes.arrayOf(PropTypes.string),\n rootNodes: PropTypes.arrayOf(PropTypes.shape({\n entityName: PropTypes.string,\n key: PropTypes.string\n })),\n businessUnit: PropTypes.string,\n emitAction: PropTypes.func.isRequired\n}\n","import React from 'react'\nimport {connect} from 'react-redux'\nimport {injectIntl} from 'react-intl'\n\nimport {initialize, moveElements} from '../../../modules/move/actions'\nimport {MoveAction} from './Move'\n\nconst mapActionCreators = {\n initialize,\n moveElements\n}\n\nconst mapStateToProps = state => ({\n isWaiting: state.docs.move.isWaiting,\n domainTypes: state.input.domainTypes,\n rootNodes: state.input.rootNodes,\n businessUnit: state.input.businessUnit\n})\n\nconst MoveContainer = connect(mapStateToProps, mapActionCreators)(MoveAction)\n\nexport default injectIntl(props => <MoveContainer {...props}/>)\n","export const LOAD_BREADCRUMBS = 'docs/path/LOAD_BREADCRUMBS'\nexport const SET_BREADCRUMBS = 'docs/path/SET_BREADCRUMBS'\nexport const SET_SEARCH_MODE = 'docs/path/SET_SEARCH_MODE'\n\nexport const loadBreadcrumbs = location => ({\n type: LOAD_BREADCRUMBS,\n payload: {\n location\n }\n})\n\nexport const setBreadcrumbs = breadcrumbs => ({\n type: SET_BREADCRUMBS,\n payload: {\n breadcrumbs\n }\n})\n\nexport const setSearchMode = searchMode => ({\n type: SET_SEARCH_MODE,\n payload: {\n searchMode\n }\n})\n","import {rest} from 'tocco-app-extensions'\nimport {takeLatest, all, call, put, select} from 'redux-saga/effects'\n\nimport getNode from '../../utils/getNode'\nimport * as actions from './actions'\n\nexport const textResourceSelector = (state, key) => state.intl.messages[key] || key\nexport const docsPathSelector = state => state.docs.path\nexport const rootNodesSelector = state => state.input.rootNodes\n\nexport function* getSearchBreadcrumbs() {\n return [{\n display: yield select(textResourceSelector, 'client.docs-browser.breadcrumbs.start'),\n path: '',\n type: 'list'\n }, {\n display: yield select(textResourceSelector, 'client.docs-browser.breadcrumbs.searchResults'),\n path: '',\n type: 'list'\n }]\n}\n\nexport function* loadBreadcrumbs({payload: {location}}) {\n const node = getNode(location)\n const pathState = yield select(docsPathSelector)\n\n let breadcrumbs\n\n if (pathState.searchMode && !node) {\n breadcrumbs = yield call(getSearchBreadcrumbs)\n } else {\n const url = node ? `documents/${node.model}/${node.key}/breadcrumbs` : 'documents/breadcrumbs'\n const options = {\n queryParams: {\n rootnodes: yield call(getRootNodesParam)\n }\n }\n const result = yield call(rest.requestSaga, url, options)\n breadcrumbs = result.body.breadcrumbs\n }\n\n yield put(actions.setBreadcrumbs(breadcrumbs))\n}\n\nfunction* getRootNodesParam() {\n const rootNodes = yield select(rootNodesSelector)\n return Array.isArray(rootNodes) && rootNodes.length > 0\n ? rootNodes.map(node => `${node.entityName}/${node.key}`).join(',')\n : null\n}\n\nexport default function* mainSagas() {\n yield all([\n takeLatest(actions.LOAD_BREADCRUMBS, loadBreadcrumbs)\n ])\n}\n","import {reducer as reducerUtil} from 'tocco-util'\n\nimport * as actions from './actions'\n\nconst ACTION_HANDLERS = {\n [actions.SET_BREADCRUMBS]: reducerUtil.singleTransferReducer('breadcrumbs'),\n [actions.SET_SEARCH_MODE]: reducerUtil.singleTransferReducer('searchMode')\n}\n\nconst initialState = {\n breadcrumbs: [],\n searchMode: false\n}\n\nexport default function reducer(state = initialState, action) {\n const handler = ACTION_HANDLERS[action.type]\n return handler ? handler(state, action) : state\n}\n","import {fork, all} from 'redux-saga/effects'\n\nimport moduleSagas from './sagas'\nimport reducer from './reducer'\n\nexport function* sagas() {\n yield all([\n fork(moduleSagas)\n ])\n}\n\nexport default reducer\n","import {all, takeEvery, call, put, select} from 'redux-saga/effects'\nimport {rest, notification} from 'tocco-app-extensions'\nimport {consoleLogger} from 'tocco-util'\nimport {v4 as uuid} from 'uuid'\n\nimport getNode from '../../utils/getNode'\nimport * as actions from './actions'\n\nexport const dialogSelector = state => state.docs.create.dialog\nexport const textResourceSelector = (state, key) => state.intl.messages[key]\n\nconst CREATED_STATUS = 201\n\nexport function* handleFilesSelected({payload: {files, isDirectory}}) {\n const blockingInfoId = yield call(uuid)\n yield put(notification.blockingInfo(\n blockingInfoId,\n isDirectory\n ? 'client.docs-browser.uploadInProgressDirectory'\n : files.length > 1\n ? 'client.docs-browser.uploadInProgressMultiple'\n : 'client.docs-browser.uploadInProgress',\n null\n ))\n\n const {location, onSuccess, onError} = yield select(dialogSelector)\n\n try {\n const response = yield call(createDocuments, location, files)\n\n const remoteEvents = [{\n type: 'entity-create-event',\n payload: {\n entities: response.body.items\n .filter(item => item.status === CREATED_STATUS)\n .map(item => ({\n entityName: item.bean.model,\n key: item.bean.key\n }))\n }\n }]\n\n yield put(notification.removeBlockingInfo(blockingInfoId))\n\n const msgId = isDirectory ? 'client.docs-browser.uploadSuccessfulDirectory' : 'client.docs-browser.uploadSuccessful'\n onSuccess({\n message: yield select(textResourceSelector, msgId),\n remoteEvents\n })\n } catch (e) {\n consoleLogger.logError('Failed to upload files', e)\n yield put(notification.removeBlockingInfo(blockingInfoId))\n onError({\n message: yield select(textResourceSelector, 'client.docs-browser.uploadFailed')\n })\n }\n}\n\nexport function* createDocuments(location, files) {\n const node = getNode(location)\n\n if (!node) {\n return\n }\n\n const formData = new FormData()\n for (const file of files) {\n formData.append('files', file)\n }\n\n const resource = `documents/${node.model}/${node.key}`\n const options = {\n method: 'POST',\n body: formData\n }\n\n return yield call(rest.requestSaga, resource, options)\n}\n\nexport default function* mainSagas() {\n yield all([\n takeEvery(actions.FILES_SELECTED, handleFilesSelected)\n ])\n}\n","export const OPEN_DIALOG = 'docs/create/OPEN_DIALOG'\nexport const FILES_SELECTED = 'docs/create/FILES_SELECTED'\n\nexport const openDialog = (location, directory, onSuccess, onError) => ({\n type: OPEN_DIALOG,\n payload: {\n location,\n directory,\n onSuccess,\n onError\n }\n})\n\nexport const filesSelected = (files, isDirectory) => ({\n type: FILES_SELECTED,\n payload: {\n files,\n isDirectory\n }\n})\n","import * as actions from './actions'\n\nconst openDialog = (state, {payload: {location, directory, onSuccess, onError}}) => ({\n ...state,\n dialog: {\n instanceCount: state.dialog.instanceCount + 1,\n directory,\n location,\n onSuccess,\n onError\n }\n})\n\nconst ACTION_HANDLERS = {\n [actions.OPEN_DIALOG]: openDialog\n}\n\nconst initialState = {\n dialog: {\n instanceCount: 0,\n directory: false,\n location: null,\n onSuccess: null,\n onError: null\n }\n}\n\nexport default function reducer(state = initialState, action) {\n const handler = ACTION_HANDLERS[action.type]\n return handler ? handler(state, action) : state\n}\n","import {fork, all} from 'redux-saga/effects'\n\nimport moduleSagas from './sagas'\nimport reducer from './reducer'\n\nexport function* sagas() {\n yield all([\n fork(moduleSagas)\n ])\n}\n\nexport default reducer\n","export const CHANGE_LIST_PARENT = 'docs/list/CHANGE_LIST_PARENT'\nexport const CHANGE_SELECTION = 'docs/list/CHANGE_SELECTION'\nexport const CHANGE_SEARCH_FORM_COLLAPSED = 'docs/list/CHANGE_SEARCH_FORM_COLLAPSED'\nexport const SET_SEARCH_FORM_COLLAPSED = 'docs/list/SET_SEARCH_FORM_COLLAPSED'\n\nexport const changeListParent = parent => ({\n type: CHANGE_LIST_PARENT,\n payload: {\n parent\n }\n})\n\nexport const changeSelection = selection => ({\n type: CHANGE_SELECTION,\n payload: {\n selection\n }\n})\n\nexport const changeSearchFormCollapsed = collapsed => ({\n type: CHANGE_SEARCH_FORM_COLLAPSED,\n payload: {\n collapsed\n }\n})\n\nexport const setSearchFormCollapsed = searchFormCollapsed => ({\n type: SET_SEARCH_FORM_COLLAPSED,\n payload: {\n searchFormCollapsed\n }\n})\n","import {reducer as reducerUtil} from 'tocco-util'\n\nimport * as actions from './actions'\n\nconst ACTION_HANDLERS = {\n [actions.SET_SEARCH_FORM_COLLAPSED]: reducerUtil.singleTransferReducer('searchFormCollapsed')\n}\n\nconst initialState = {\n searchFormCollapsed: null\n}\n\nexport default function reducer(state = initialState, action) {\n const handler = ACTION_HANDLERS[action.type]\n return handler ? handler(state, action) : state\n}\n","import sagas from './sagas'\nimport reducer from './reducer'\n\nexport {sagas}\n\nexport default reducer\n","import {all, put, takeLatest} from 'redux-saga/effects'\nimport {externalEvents} from 'tocco-app-extensions'\n\nimport * as actions from './actions'\n\nexport function* changeListParent({payload}) {\n yield put(externalEvents.fireExternalEvent('onListParentChange', payload.parent))\n}\n\nexport function* changeSelection({payload}) {\n yield put(externalEvents.fireExternalEvent('onSelectChange', payload.selection))\n}\n\nexport function* changeSearchFormCollapsed({payload}) {\n yield put(externalEvents.fireExternalEvent('onSearchFormCollapsedChange', payload.collapsed))\n}\n\nexport default function* mainSagas() {\n yield all([\n takeLatest(actions.CHANGE_LIST_PARENT, changeListParent),\n takeLatest(actions.CHANGE_SELECTION, changeSelection),\n takeLatest(actions.CHANGE_SEARCH_FORM_COLLAPSED, changeSearchFormCollapsed)\n ])\n}\n","import {takeLatest, all, call, put, select} from 'redux-saga/effects'\nimport {notification, rest} from 'tocco-app-extensions'\nimport {validation} from 'tocco-util'\n\nimport * as actions from './actions'\n\nexport const inputSelector = state => state.docs.move.input\nexport const textResourceSelector = (state, key) => state.intl.messages[key]\n\nexport function* moveElements({payload}) {\n const resource = 'documents/move'\n const options = {\n method: 'POST',\n acceptedStatusCodes: [400],\n body: {\n targetEntityKey: payload.target,\n selectedEntityKeys: payload.selected\n }\n }\n\n yield put(actions.setWaiting(true))\n const response = yield call(rest.requestSaga, resource, options)\n\n if (response.status === 204) {\n yield call(setDone)\n } else {\n yield put(actions.setWaiting(false))\n let message = 'client.actions.dms-move.failed.message'\n if (response.body.errorCode === 'VALIDATION_FAILED') {\n message = validation.getErrorCompact(response.body.errors)\n }\n yield put(notification.toaster({type: 'error', title: 'client.actions.dms-move.failed.title', body: message}))\n }\n}\n\nexport function* setDone() {\n const {selection, onSuccess} = yield select(inputSelector)\n\n const remoteEvents = [{\n type: 'entity-update-event',\n payload: {\n entities: selection.ids.map(id => ({\n entityName: 'Docs_list_item',\n key: id\n }))\n }\n }]\n\n onSuccess({\n message: yield select(textResourceSelector, 'client.docs-browser.moveSuccessful'),\n remoteEvents\n })\n\n yield put(actions.close())\n}\n\nexport default function* mainSagas() {\n yield all([\n takeLatest(actions.MOVE_ELEMENTS, moveElements)\n ])\n}\n","import {reducer as reducerUtil} from 'tocco-util'\n\nimport * as actions from './actions'\n\nconst initialize = (state, {payload: {selection, onSuccess, onError}}) => ({\n ...state,\n input: {\n selection,\n onSuccess,\n onError\n }\n})\n\nconst close = () => ({\n ...initialState\n})\n\nconst ACTION_HANDLERS = {\n [actions.INITIALIZE]: initialize,\n [actions.SET_WAITING]: reducerUtil.singleTransferReducer('isWaiting'),\n [actions.CLOSE]: close\n}\n\nconst initialState = {\n isWaiting: false,\n input: {\n selection: null,\n onSuccess: null,\n onError: null\n }\n}\n\nexport default function reducer(state = initialState, action) {\n const handler = ACTION_HANDLERS[action.type]\n return handler ? handler(state, action) : state\n}\n","import {fork, all} from 'redux-saga/effects'\n\nimport moduleSagas from './sagas'\nimport reducer from './reducer'\n\nexport function* sagas() {\n yield all([\n fork(moduleSagas)\n ])\n}\n\nexport default reducer\n","import {combineReducers} from 'redux'\n\nimport path, {sagas as pathSagas} from './path'\nimport create, {sagas as createSagas} from './create'\nimport list, {sagas as listSagas} from './list'\nimport move, {sagas as moveSagas} from './move'\n\nexport default {\n docs: combineReducers({path, create, list, move})\n}\n\nexport const sagas = [pathSagas, createSagas, listSagas, moveSagas]\n","import React, {lazy, Suspense} from 'react'\nimport {connect} from 'react-redux'\nimport PropTypes from 'prop-types'\nimport {actionEmitter} from 'tocco-app-extensions'\nimport {LoadMask} from 'tocco-ui'\nimport {consoleLogger} from 'tocco-util'\n\nconst actions = {\n 'dms-create-folder': lazy(() => import(/* webpackChunkName: \"docs-actions\" */'./actions/CreateFolder')),\n 'dms-create-domain': lazy(() => import(/* webpackChunkName: \"docs-actions\" */'./actions/CreateDomain')),\n 'dms-edit': lazy(() => import(/* webpackChunkName: \"docs-actions\" */'./actions/Edit')),\n 'dms-move': lazy(() => import(/* webpackChunkName: \"docs-actions\" */'./actions/MoveContainer')),\n 'delete': lazy(() => import(/* webpackChunkName: \"docs-actions\" */'./actions/Delete'))\n}\n\nconst renderLoader = () => <LoadMask/>\n\nconst LazyAction = props => {\n const {appId} = props\n const LazyAction = actions[appId]\n\n if (!LazyAction) {\n consoleLogger.logError(`no action found with id: ${appId}`)\n return null\n }\n\n const ActionComponent = connect(null, {\n emitAction: action => actionEmitter.dispatchEmittedAction(action)\n })(LazyAction)\n\n return <Suspense fallback={renderLoader()}>\n <ActionComponent\n {...props}\n />\n </Suspense>\n}\n\nLazyAction.propTypes = {\n appId: PropTypes.string.isRequired\n}\n\nexport default LazyAction\n","import React, {useRef, useEffect} from 'react'\nimport PropTypes from 'prop-types'\n\nconst usePrevious = value => {\n const ref = useRef()\n useEffect(() => {\n ref.current = value\n })\n return ref.current\n}\n\nconst FileInput = ({instanceCount, directory, onChange}) => {\n const fileInput = useRef()\n\n const prevInstanceCount = usePrevious(instanceCount)\n\n useEffect(() => {\n if (fileInput.current && instanceCount > prevInstanceCount) {\n fileInput.current.click()\n }\n })\n\n const handleChange = e => {\n const files = e.target.files\n if (files && files.length > 0 && onChange) {\n onChange(files, directory)\n }\n e.target.value = null\n }\n \n return <input\n type=\"file\"\n ref={fileInput}\n style={{display: 'none'}}\n onChange={handleChange}\n multiple {...(directory ? {webkitdirectory: 'true', directory: 'true'} : {})}\n />\n}\n\nFileInput.propTypes = {\n instanceCount: PropTypes.number.isRequired,\n directory: PropTypes.bool,\n onChange: PropTypes.func\n}\n\nexport default FileInput\n","import {connect} from 'react-redux'\n\nimport FileInput from './FileInput'\nimport {filesSelected} from '../../modules/create/actions'\n\nconst mapActionCreators = {\n onChange: filesSelected\n}\n\nconst mapStateToProps = state => ({\n instanceCount: state.docs.create.dialog.instanceCount,\n directory: state.docs.create.dialog.directory\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(FileInput)\n","import styled from 'styled-components'\nimport {scale} from 'tocco-ui'\n\nexport const StyledContentWrapper = styled.div`\n display: flex;\n align-items: center;\n`\n\nexport const StyledIconWrapper = styled.span`\n font-size: ${scale.font(1)};\n display: inline-block;\n margin-right: ${scale.space(-2)};\n`\n","const ROOT_PATH_REGEX = /^\\/docs\\/?$/\n\nconst isRootLocation = pathname => ROOT_PATH_REGEX.test(pathname)\n\nexport default isRootLocation\n","import React, {Suspense, useEffect, useMemo, useReducer, useRef, useState} from 'react'\nimport PropTypes from 'prop-types'\nimport {viewPersistor} from 'tocco-util'\nimport {Icon, LoadMask} from 'tocco-ui'\nimport {searchFormTypePropTypes} from 'tocco-entity-list/src/util/searchFormTypes'\nimport {selectionStylePropType} from 'tocco-entity-list/src/util/selectionStyles'\n\nimport Action from '../Action'\nimport FileInput from '../FileInput'\nimport {StyledContentWrapper, StyledIconWrapper} from './StyledComponents'\nimport isRootLocation from '../../utils/isRootLocation'\n\nexport const getParent = match => {\n if (match.params && match.params.model) {\n const model = match.params.model.charAt(0).toUpperCase() + match.params.model.slice(1)\n const key = match.params.key\n const fullKey = `${model}/${key}`\n return {\n model: 'Docs_list_item',\n key: fullKey // e.g. \"Domain/118\"\n }\n }\n return null\n}\n\nexport const getTql = domainTypes =>\n Array.isArray(domainTypes)\n && domainTypes.length > 0\n ? `exists(relDomain_type where IN(unique_id, ${domainTypes.map(type => `\"${type}\"`).join(',')}))`\n : null\n\nexport const getFormName = (parent, keys) => parent\n ? 'Docs_list_item'\n : keys\n ? 'Root_docs_list_item_specific'\n : 'Root_docs_list_item'\n\nexport const getDefaultLocation = (model, key) => {\n switch (model) {\n case 'Domain':\n return `/docs/domain/${key}/list`\n case 'Folder':\n return `/docs/folder/${key}/list`\n case 'Resource':\n return `/docs/doc/${key}/detail`\n default:\n throw new Error(`Unexpected model: ${model}`)\n }\n}\n\nconst LazyListApp = React.lazy(() => import('./LazyListApp'))\n\nconst DocsView = props => {\n const {\n history,\n match,\n domainTypes,\n rootNodes,\n navigationStrategy,\n changeListParent,\n onSearchChange,\n emitAction,\n openFileDialog,\n limit,\n searchFormType,\n selectionStyle,\n getCustomLocation,\n disableViewPersistor,\n getListFormName,\n domainDetailFormName,\n folderDetailFormName,\n showActions,\n sortable,\n searchMode,\n openResource,\n searchFormCollapsed,\n changeSelection,\n changeSearchFormCollapsed\n } = props\n // eslint-disable-next-line no-unused-vars\n const [entityListNumber, forceEntityListUpdate] = useReducer(x => x + 1, 0)\n\n const entityListKey = `entity-list-${entityListNumber}`\n\n const [selection, setSelection] = useState([])\n const parent = useMemo(() => getParent(match), [match.params])\n\n const keys = !parent && rootNodes ? rootNodes.map(node => `${node.entityName}/${node.key}`) : null\n const formName = useMemo(() => getListFormName\n ? getListFormName(parent, keys)\n : getFormName(parent, keys)\n , [match.params, getListFormName])\n\n const mounted = useRef(false)\n const searchModeRef = useRef(searchMode)\n\n searchModeRef.current = searchMode\n\n useEffect(() => {\n mounted.current = true\n return () => (mounted.current = false)\n })\n\n useEffect(() => {\n changeListParent(parent)\n setSelection([])\n }, [parent])\n\n const onSelectChange = selection => {\n setSelection(selection)\n changeSelection(selection)\n }\n\n const handleRowClick = ({id}) => {\n onSelectChange([id])\n\n if (searchModeRef.current && isRootLocation(history.location.pathname)) {\n if (!viewPersistor.viewInfoSelector('search').store) {\n // persist search store to allow a \"go back to search\"\n const searchStore = viewPersistor.viewInfoSelector(entityListKey).store\n viewPersistor.persistViewInfo('search', {store: searchStore})\n }\n forceEntityListUpdate()\n }\n\n const [model, key] = id.split('/')\n const location = getCustomLocation ? getCustomLocation(model, key) : getDefaultLocation(model, key)\n\n if (location) {\n if (openResource && model === 'Resource') {\n openResource(location)\n } else {\n history.push(location)\n }\n }\n }\n\n const tql = !parent && !keys ? getTql(domainTypes) : null\n\n const handleUploadDocument = function* (definition, selection, parent, params, config, onSuccess, onError) {\n const directory = false\n openFileDialog(history.location.pathname, directory, onSuccess, onError)\n }\n\n const handleUploadDirectory = function* (definition, selection, parent, params, config, onSuccess, onError) {\n const directory = true\n openFileDialog(history.location.pathname, directory, onSuccess, onError)\n }\n\n const handleSearch = e => {\n if (mounted.current) {\n onSearchChange(e)\n }\n }\n\n const store = disableViewPersistor\n ? undefined\n : isRootLocation(history.location.pathname)\n ? viewPersistor.viewInfoSelector('search').store\n : null\n\n return (\n <>\n <Suspense fallback={<LoadMask/>}>\n <LazyListApp\n key={entityListKey}\n id=\"documents\"\n entityName=\"Docs_list_item\"\n formName={formName}\n limit={limit || 25}\n onRowClick={handleRowClick}\n searchFormPosition=\"left\"\n searchFormType={searchFormType || 'admin'}\n parent={parent}\n onSearchChange={handleSearch}\n store={store}\n onStoreCreate={store => {\n if (!disableViewPersistor) {\n viewPersistor.persistViewInfo(entityListKey, {store})\n }\n }}\n cellRenderers={{\n 'dms-label-with-icon': (rowData, column, cellRenderer) => (\n <StyledContentWrapper>\n <StyledIconWrapper>\n <Icon icon={rowData.icon}/>\n </StyledIconWrapper>\n <span>{cellRenderer(column.children[0])}</span>\n </StyledContentWrapper>\n ),\n 'dms-actions': (rowData, column, cellRenderer) => {\n return (<StyledContentWrapper>\n {column.children\n .filter(c => !c.dmsEntityModel || c.dmsEntityModel === rowData.type)\n .map(c => cellRenderer(c))}\n </StyledContentWrapper>\n )\n }\n }}\n emitAction={emitAction}\n actionAppComponent={Action}\n contextParams={{\n history,\n detailFormNames: {\n Domain: domainDetailFormName,\n Folder: folderDetailFormName\n }\n }}\n customActions={{\n 'upload-document': handleUploadDocument,\n 'upload-directory': handleUploadDirectory\n }}\n navigationStrategy={navigationStrategy}\n tql={tql}\n keys={keys}\n selectionStyle={selectionStyle || 'multi_explicit'}\n onSelectChange={onSelectChange}\n selection={selection}\n showActions={showActions}\n sortable={sortable}\n searchFormCollapsed={searchFormCollapsed}\n onSearchFormCollapsedChange={changeSearchFormCollapsed}\n />\n </Suspense>\n <FileInput/>\n </>\n )\n}\n\nDocsView.propTypes = {\n match: PropTypes.object.isRequired,\n history: PropTypes.object.isRequired,\n navigationStrategy: PropTypes.object,\n domainTypes: PropTypes.arrayOf(PropTypes.string),\n rootNodes: PropTypes.arrayOf(PropTypes.shape({\n entityName: PropTypes.string,\n key: PropTypes.string\n })),\n changeListParent: PropTypes.func.isRequired,\n onSearchChange: PropTypes.func.isRequired,\n emitAction: PropTypes.func.isRequired,\n openFileDialog: PropTypes.func.isRequired,\n limit: PropTypes.number,\n searchFormType: searchFormTypePropTypes,\n selectionStyle: selectionStylePropType,\n getCustomLocation: PropTypes.func,\n disableViewPersistor: PropTypes.bool,\n getListFormName: PropTypes.func,\n domainDetailFormName: PropTypes.string,\n folderDetailFormName: PropTypes.string,\n showActions: PropTypes.bool,\n sortable: PropTypes.bool,\n searchMode: PropTypes.bool,\n openResource: PropTypes.func,\n searchFormCollapsed: PropTypes.bool,\n changeSelection: PropTypes.func.isRequired,\n changeSearchFormCollapsed: PropTypes.func.isRequired\n}\n\nexport default DocsView\n","import {connect} from 'react-redux'\nimport {injectIntl} from 'react-intl'\n\nimport DocsView from './DocsView'\nimport {changeListParent, changeSearchFormCollapsed, changeSelection} from '../../modules/list/actions'\n\nconst mapStateToProps = state => ({\n domainTypes: state.input.domainTypes,\n rootNodes: state.input.rootNodes,\n limit: state.input.listLimit,\n searchFormType: state.input.searchFormType,\n selectionStyle: state.input.selectionStyle,\n getCustomLocation: state.input.getCustomLocation,\n disableViewPersistor: state.input.disableViewPersistor,\n getListFormName: state.input.getListFormName,\n domainDetailFormName: state.input.domainDetailFormName,\n folderDetailFormName: state.input.folderDetailFormName,\n showActions: state.input.showActions,\n sortable: state.input.sortable,\n openResource: state.input.openResource,\n searchFormCollapsed: state.docs.list.searchFormCollapsed\n})\n\nconst mapActionCreators = {\n changeListParent,\n changeSelection,\n changeSearchFormCollapsed\n}\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(DocsView))\n","import styled from 'styled-components'\nimport {theme, scale} from 'tocco-ui'\n\nexport const StyledDocumentViewWrapper = styled.div`\n height: 100%;\n background-color: ${theme.color('paper')};\n padding-left: ${scale.space(0.5)};\n overflow-y: hidden;\n`\n","import React, {Suspense} from 'react'\nimport PropTypes from 'prop-types'\nimport {LoadMask} from 'tocco-ui'\n\nimport Action from '../Action/'\nimport {StyledDocumentViewWrapper} from './StyledComponents'\n\nconst LazyDetailApp = React.lazy(() => import('./LazyDetailApp'))\n\nconst DocumentView = ({match, history, breadcrumbs, formName, navigationStrategy, emitAction}) => {\n const handleEntityDeleted = () => {\n const lastList = breadcrumbs.slice().reverse()\n .find(breadcrumb => breadcrumb.type === 'list')\n const lastListUrl = `/docs/${lastList.path}`\n history.push(lastListUrl)\n }\n\n return (\n <StyledDocumentViewWrapper>\n <Suspense fallback={<LoadMask/>}>\n <LazyDetailApp\n entityName=\"Resource\"\n entityId={match.params.key}\n formName={formName || 'DmsResource'}\n mode=\"update\"\n actionAppComponent={Action}\n navigationStrategy={navigationStrategy}\n emitAction={emitAction}\n onEntityDeleted={handleEntityDeleted}\n />\n </Suspense>\n </StyledDocumentViewWrapper>\n )\n}\n\nDocumentView.propTypes = {\n match: PropTypes.shape({\n params: PropTypes.shape({\n key: PropTypes.string.isRequired\n }).isRequired\n }).isRequired,\n history: PropTypes.shape({\n push: PropTypes.func.isRequired\n }).isRequired,\n breadcrumbs: PropTypes.arrayOf(PropTypes.shape({\n path: PropTypes.string.isRequired,\n type: PropTypes.string.isRequired\n })).isRequired,\n formName: PropTypes.string,\n navigationStrategy: PropTypes.object,\n emitAction: PropTypes.func.isRequired\n}\n\nexport default DocumentView\n","import {connect} from 'react-redux'\nimport {injectIntl} from 'react-intl'\nimport {actionEmitter} from 'tocco-app-extensions'\n\nimport DocumentView from './DocumentView'\n\nconst mapStateToProps = state => ({\n breadcrumbs: state.docs.path.breadcrumbs,\n formName: state.input.documentDetailFormName\n})\n\nconst mapActionCreators = {\n emitAction: action => actionEmitter.dispatchEmittedAction(action)\n}\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(DocumentView))\n","import {connect} from 'react-redux'\nimport {injectIntl} from 'react-intl'\nimport {Breadcrumbs} from 'tocco-ui'\n\nconst mapActionCreators = {\n}\n\nconst mapStateToProps = state => ({\n pathPrefix: '/docs',\n breadcrumbsInfo: state.docs.path.breadcrumbs\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(Breadcrumbs))\n","import styled from 'styled-components'\nimport {StyledScrollbar} from 'tocco-ui'\n\nexport const StyledWrapper = styled.div`\n display: grid;\n grid-template-rows: auto 1fr;\n grid-template-areas:\n 'breadcrumbs'\n 'content';\n height: 100%;\n width: 100%;\n`\n\nexport const StyledContent = styled.div`\n grid-area: content;\n overflow-x: hidden;\n ${StyledScrollbar}\n`\n\nexport const StyledBreadcrumbs = styled.div`\n grid-area: breadcrumbs;\n ${({noLeftPadding}) => noLeftPadding && `\n > div {\n padding-left: 0;\n }\n `}\n`\n","import React, {useEffect, useReducer, useRef} from 'react'\nimport PropTypes from 'prop-types'\nimport {Route, Switch, useLocation} from 'react-router-dom'\nimport {withTheme} from 'styled-components'\nimport {theme as themeUtil} from 'tocco-ui'\nimport {viewPersistor} from 'tocco-util'\n\nimport DocsView from '../DocsView'\nimport DocumentView from '../DocumentView'\nimport Breadcrumbs from '../../containers/BreadcrumbsContainer'\nimport {StyledWrapper, StyledBreadcrumbs, StyledContent} from './StyledComponents'\nimport isRootLocation from '../../utils/isRootLocation'\n\nconst DocsBrowser = ({\n history,\n searchMode,\n navigationStrategy,\n setSearchMode,\n loadBreadcrumbs,\n emitAction,\n openFileDialog,\n theme,\n embedded,\n noLeftPadding\n}) => {\n // eslint-disable-next-line no-unused-vars\n const [docsViewNumber, forceDocsViewUpdate] = useReducer(x => x + 1, 0)\n\n const location = useLocation()\n\n const searchModeRef = useRef(searchMode)\n searchModeRef.current = searchMode\n\n useEffect(() => {\n loadBreadcrumbs(location.pathname)\n })\n\n const resetSearchMode = () => {\n if (searchModeRef.current) {\n viewPersistor.clearPersistedViews()\n setSearchMode(false)\n loadBreadcrumbs(location.pathname)\n forceDocsViewUpdate()\n }\n }\n\n const handleSearchChange = e => {\n const hasUserChanges = e.query && e.query.hasUserChanges\n if (hasUserChanges) {\n setSearchMode(true)\n history.push('/docs/')\n loadBreadcrumbs(location.pathname)\n } else if (isRootLocation(history.location.pathname)) {\n resetSearchMode()\n }\n }\n\n const handleBreadcrumbsClick = breadcrumbsItem => {\n if (breadcrumbsItem.path === '') {\n resetSearchMode()\n }\n }\n\n const key = `docs-view-${docsViewNumber}`\n\n return (\n <StyledWrapper>\n <StyledBreadcrumbs noLeftPadding={noLeftPadding}>\n <Breadcrumbs\n {...embedded ? {backgroundColor: themeUtil.color('paper')({theme})} : {}}\n onClick={handleBreadcrumbsClick}\n />\n </StyledBreadcrumbs>\n <StyledContent>\n <Switch>\n <Route\n exact\n path={'/docs/doc/:key/detail'}\n render={({match}) => (\n <DocumentView\n match={match}\n history={history}\n navigationStrategy={navigationStrategy}\n />\n )}\n />\n <Route\n exact\n path={['/docs/:model/:key/list', '/docs']}\n render={({match}) => (\n <DocsView\n key={key}\n history={history}\n match={match}\n navigationStrategy={navigationStrategy}\n onSearchChange={handleSearchChange}\n emitAction={emitAction}\n openFileDialog={openFileDialog}\n searchMode={searchMode}\n />)}\n />\n </Switch>\n </StyledContent>\n </StyledWrapper>\n )\n}\n\nDocsBrowser.propTypes = {\n loadBreadcrumbs: PropTypes.func.isRequired,\n setSearchMode: PropTypes.func.isRequired,\n emitAction: PropTypes.func.isRequired,\n openFileDialog: PropTypes.func.isRequired,\n history: PropTypes.object.isRequired,\n searchMode: PropTypes.bool.isRequired,\n navigationStrategy: PropTypes.object,\n embedded: PropTypes.bool,\n theme: PropTypes.object,\n noLeftPadding: PropTypes.bool\n}\n\nexport default withTheme(DocsBrowser)\n","import {connect} from 'react-redux'\nimport {injectIntl} from 'react-intl'\nimport {actionEmitter} from 'tocco-app-extensions'\n\nimport DocsBrowser from './DocsBrowser'\nimport {loadBreadcrumbs, setSearchMode} from '../../modules/path/actions'\nimport {openDialog} from '../../modules/create/actions'\n\nconst mapStateToProps = state => ({\n searchMode: state.docs.path.searchMode,\n navigationStrategy: state.input.navigationStrategy,\n embedded: state.input.embedded,\n noLeftPadding: state.input.noLeftPadding\n})\n\nconst mapActionCreators = {\n loadBreadcrumbs,\n setSearchMode,\n emitAction: action => actionEmitter.dispatchEmittedAction(action),\n openFileDialog: openDialog\n}\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(DocsBrowser))\n","import {setSearchFormCollapsed} from './modules/list/actions'\n\nconst isDefined = value => value !== undefined\n\nexport const getDispatchActions = input =>\n actionSettings.reduce((acc, actionSetting) => {\n if (isDefined(input[actionSetting.name])) {\n acc.push(actionSetting.action(...actionSetting.argsFactory(input)))\n }\n return acc\n }, [])\n\nconst actionSettings = [\n {\n name: 'searchFormCollapsed',\n action: setSearchFormCollapsed,\n argsFactory: input => [input.searchFormCollapsed]\n }\n]\n","import React from 'react'\nimport PropTypes from 'prop-types'\nimport {reducer as reducerUtil} from 'tocco-util'\nimport {actionEmitter, appFactory, cache, errorLogging, externalEvents, notification, rest} from 'tocco-app-extensions'\nimport {searchFormTypePropTypes} from 'tocco-entity-list/src/util/searchFormTypes'\nimport {selectionStylePropType} from 'tocco-entity-list/src/util/selectionStyles'\nimport createHashHistory from 'history/createHashHistory'\nimport createMemoryHistory from 'history/createMemoryHistory'\nimport {Redirect, Route, Router as ReactRouter} from 'react-router'\nimport {GlobalStyles} from 'tocco-ui'\nimport _pickBy from 'lodash/pickBy'\nimport _isEqual from 'lodash/isEqual'\nimport _isEmpty from 'lodash/isEmpty'\n\nimport reducers, {sagas} from './modules/reducers'\nimport DocsBrowser from './components/DocsBrowser'\nimport {getDispatchActions} from './input'\n\nconst packageName = 'docs-browser'\n\nconst EXTERNAL_EVENTS = [\n 'onListParentChange',\n 'openResource',\n 'onSelectChange',\n 'onSearchFormCollapsedChange'\n]\n\nconst textResourceSelector = (state, key) => state.intl.messages[key] || key\n\nconst createHistory = (store, memoryHistory) => {\n const historyFactory = memoryHistory ? createMemoryHistory : createHashHistory\n\n return historyFactory({\n getUserConfirmation: (message, confirmCallback) => {\n const state = store.getState()\n\n const okText = textResourceSelector(state, 'client.common.ok')\n const cancelText = textResourceSelector(state, 'client.common.cancel')\n\n const action = notification.confirm(\n '',\n message,\n okText,\n cancelText,\n () => confirmCallback(true),\n () => confirmCallback(false)\n )\n store.dispatch(action)\n }\n })\n}\nconst initApp = (id, input, events = {}, publicPath) => {\n const store = appFactory.createStore(reducers, sagas, input, packageName)\n\n externalEvents.addToStore(store, events)\n actionEmitter.addToStore(store)\n errorLogging.addToStore(store, true, ['console', 'remote', 'notification'])\n const handleNotifications = !events.emitAction\n notification.addToStore(store, handleNotifications)\n cache.addToStore(store)\n\n if (input.businessUnit) {\n rest.setBusinessUnit(input.businessUnit)\n }\n\n const history = input.history || createHistory(store, input.memoryHistory)\n\n if (input.initialLocation) {\n history.push(input.initialLocation)\n }\n\n const singleRootNode = Array.isArray(input.rootNodes) && input.rootNodes.length === 1\n && input.rootNodes[0].entityName !== 'Resource'\n ? input.rootNodes[0]\n : null\n\n const startUrl = singleRootNode\n ? `/docs/${singleRootNode.entityName.toLowerCase()}/${singleRootNode.key}/list`\n : '/docs'\n\n const content = (\n <ReactRouter history={history}>\n {handleNotifications && <notification.Notifications/>}\n <GlobalStyles/>\n <DocsBrowser history={history}/>\n <Route exact path=\"/\">\n <Redirect to={startUrl}/>\n </Route>\n {\n singleRootNode && (\n <Route exact path=\"/docs\">\n <Redirect to={startUrl}/>\n </Route>\n )\n }\n </ReactRouter>\n )\n\n return appFactory.createApp(\n packageName,\n content,\n store,\n {\n input,\n events,\n actions: getDispatchActions(input),\n publicPath,\n textResourceModules: ['component', 'common', 'actions', 'entity-list', 'entity-detail', packageName]\n }\n )\n}\n\n(() => {\n if (__PACKAGE_NAME__ === packageName) {\n appFactory.registerAppInRegistry(packageName, initApp)\n\n if (__DEV__) {\n const input = require('./dev/input.json')\n\n if (!__NO_MOCK__) {\n const fetchMock = require('fetch-mock').default\n fetchMock.config.overwriteRoutes = false\n const setupFetchMocks = require('./dev/fetchMocks').default\n setupFetchMocks(packageName, fetchMock)\n fetchMock.spy()\n }\n\n const app = initApp(packageName, input)\n\n if (module.hot) {\n module.hot.accept('./modules/reducers', () => {\n const reducers = require('./modules/reducers').default\n reducerUtil.hotReloadReducers(app.store, reducers)\n })\n }\n\n appFactory.renderApp(app.component)\n }\n }\n})()\n\nconst getEvents = props =>\n EXTERNAL_EVENTS.reduce((events, event) => {\n if (props[event]) {\n events[event] = props[event]\n }\n return events\n }, {})\n\nclass DocsBrowserApp extends React.Component {\n constructor(props) {\n super(props)\n\n this.app = initApp('docs-browser', props, getEvents(props))\n }\n\n componentDidUpdate(prevProps) {\n const changedProps = _pickBy(this.props, (value, key) => !_isEqual(value, prevProps[key]))\n if (!_isEmpty(changedProps)) {\n getDispatchActions(changedProps).forEach(action => {\n this.app.store.dispatch(action)\n })\n }\n }\n\n render() {\n return this.app.component\n }\n}\n\nDocsBrowserApp.propTypes = {\n history: PropTypes.object,\n navigationStrategy: PropTypes.object,\n domainTypes: PropTypes.arrayOf(PropTypes.string),\n rootNodes: PropTypes.arrayOf(PropTypes.shape({\n entityName: PropTypes.string,\n key: PropTypes.string\n })),\n initialLocation: PropTypes.string,\n listLimit: PropTypes.number,\n documentDetailFormName: PropTypes.string,\n searchFormType: searchFormTypePropTypes,\n selectionStyle: selectionStylePropType,\n getListFormName: PropTypes.func,\n memoryHistory: PropTypes.bool,\n disableViewPersistor: PropTypes.bool,\n getCustomLocation: PropTypes.func,\n businessUnit: PropTypes.string,\n searchFormCollapsed: PropTypes.bool,\n ...EXTERNAL_EVENTS.reduce((propTypes, event) => {\n propTypes[event] = PropTypes.func\n return propTypes\n }, {})\n}\n\nexport default DocsBrowserApp\n","export const INITIALIZE = 'docs/move/INITIALIZE'\nexport const INVALID_SELECTION = 'docs/move/INVALID_SELECTION'\nexport const MOVE_ELEMENTS = 'docs/move/MOVE_ELEMENTS'\nexport const SET_WAITING = 'docs/move/SET_WAITING'\nexport const SET_DONE = 'docs/move/SET_DONE'\nexport const CLOSE = 'docs/move/CLOSE'\n\nexport const initialize = (selection, onSuccess, onError) => ({\n type: INITIALIZE,\n payload: {\n selection,\n onSuccess,\n onError\n }\n})\n\nexport const invalidSelection = () => ({\n type: INVALID_SELECTION\n})\n\nexport const moveElements = (target, selected) => ({\n type: MOVE_ELEMENTS,\n payload: {\n target,\n selected\n }\n})\n\nexport const setWaiting = (isWaiting = true) => ({\n type: SET_WAITING,\n payload: {\n isWaiting\n }\n})\n\nexport const close = () => ({\n type: CLOSE\n})\n","const getDetailFormName = (context, entityName) =>\n context.detailFormNames && context.detailFormNames[entityName]\n ? context.detailFormNames[entityName]\n : `Dms${entityName}`\n\nexport default getDetailFormName\n","const DOC_PATH_REGEX = /^\\/docs\\/doc\\/(\\d+)\\/detail$/\nconst PARENT_PATH_REGEX = /^\\/docs\\/(domain|folder)\\/(\\d+)\\/list$/\n\nconst getResourceNode = pathname => {\n const docMatches = DOC_PATH_REGEX.exec(pathname)\n return docMatches && docMatches.length >= 2\n ? {\n model: 'Resource',\n key: docMatches[1]\n }\n : null\n}\n\nconst getParentNode = pathname => {\n const parentMatches = PARENT_PATH_REGEX.exec(pathname)\n if (parentMatches && parentMatches.length >= 3) {\n const model = parentMatches[1].charAt(0).toUpperCase() + parentMatches[1].slice(1)\n const key = parentMatches[2]\n return {\n model,\n key\n }\n }\n return null\n}\n\nconst getNode = pathname => getResourceNode(pathname) || getParentNode(pathname)\n\nexport default getNode\n","export const SET_FORM_DEFINITION = 'entityDetail/SET_FORM_DEFINITION'\nexport const LOAD_DETAIL_VIEW = 'entityDetail/LOAD_DETAIL_VIEW'\nexport const SET_ENTITY = 'entityDetail/SET_ENTITY'\nexport const SUBMIT_FORM = 'entityDetail/SUBMIT_FORM'\nexport const SET_LAST_SAVE = 'entityDetail/SET_LAST_SAVE'\nexport const SET_ENTITY_MODEL = 'entityDetail/SET_ENTITY_MODEL'\nexport const UNLOAD_DETAIL_VIEW = 'entityDetail/UNLOAD_DETAIL_VIEW'\nexport const FIRE_TOUCHED = 'entityDetail/FIRE_TOUCHED'\nexport const SET_TOUCHED = 'entityDetail/SET_TOUCHED'\nexport const SET_ENTITY_NAME = 'entityDetail/SET_ENTITY_NAME'\nexport const SET_ENTITY_ID = 'entityDetail/SET_ENTITY_ID'\nexport const SET_MODE = 'entityDetail/SET_MODE'\nexport const SET_FORM_NAME = 'entityDetail/SET_FORM_NAME'\nexport const UPLOAD_DOCUMENT = 'entityDetail/UPLOAD_DOCUMENT'\nexport const SET_APP_ID = 'entityDetail/SET_APP_ID'\nexport const TOUCH_ALL_FIELDS = 'entityDetail/TOCH_ALL_FIELDS'\nexport const SET_DEFAULT_VALUES = 'entityDetail/SET_DEFAULT_VALUES'\nexport const NAVIGATE_TO_CREATE = 'entityDetail/NAVIGATE_TO_CREATE'\nexport const SET_FIELD_DEFINITIONS = 'entityDetail/SET_FIELD_DEFINITIONS'\nexport const NAVIGATE_TO_ACTION = 'entityDetail/NAVIGATE_TO_ACTION'\nexport const UPDATE_MARKED = 'entityDetail/UPDATE_MARKED'\nexport const SET_MARKED = 'entityDetail/SET_MARKED'\n\nexport const setFormDefinition = formDefinition => ({\n type: SET_FORM_DEFINITION,\n payload: {\n formDefinition\n }\n})\n\nexport const loadDetailView = (modelPaths, entityId) => ({\n type: LOAD_DETAIL_VIEW,\n payload: {\n modelPaths,\n entityId\n }\n})\n\nexport const setEntity = entity => ({\n type: SET_ENTITY,\n payload: {\n entity\n }\n})\n\nexport const submitForm = () => ({\n type: SUBMIT_FORM\n})\n\nexport const setLastSave = (lastSave = Date.now()) => ({\n type: SET_LAST_SAVE,\n payload: {\n lastSave\n }\n})\n\nexport const setEntityModel = entityModel => ({\n type: SET_ENTITY_MODEL,\n payload: {\n entityModel\n }\n})\n\nexport const unloadDetailView = () => ({\n type: UNLOAD_DETAIL_VIEW\n})\n\nexport const fireTouched = touched => ({\n type: FIRE_TOUCHED,\n payload: {\n touched\n }\n})\n\nexport const setTouched = touched => ({\n type: SET_TOUCHED,\n payload: {\n touched\n }\n})\n\nexport const setEntityName = entityName => ({\n type: SET_ENTITY_NAME,\n payload: {\n entityName\n }\n})\n\nexport const setEntityId = entityId => ({\n type: SET_ENTITY_ID,\n payload: {\n entityId\n }\n})\n\nexport const setMode = mode => ({\n type: SET_MODE,\n payload: {\n mode\n }\n})\nexport const setFormName = formName => ({\n type: SET_FORM_NAME,\n payload: {\n formName\n }\n})\n\nexport const setAppId = appId => ({\n type: SET_APP_ID,\n payload: {\n appId\n }\n})\n\nexport const touchAllFields = () => ({\n type: TOUCH_ALL_FIELDS\n})\n\nexport const setDefaultValues = defaultValues => ({\n type: SET_DEFAULT_VALUES,\n payload: {\n defaultValues\n }\n})\n\nexport const navigateToCreate = relationName => ({\n type: NAVIGATE_TO_CREATE,\n payload: {\n relationName\n }\n})\n\nexport const setFieldDefinitions = fieldDefinitions => ({\n type: SET_FIELD_DEFINITIONS,\n payload: {\n fieldDefinitions\n }\n})\n\nexport const navigateToAction = (definition, selection) => ({\n type: NAVIGATE_TO_ACTION,\n payload: {\n definition,\n selection\n }\n})\n\nexport const updateMarked = (entityName, entityId, marked) => ({\n type: UPDATE_MARKED,\n payload: {\n entityName,\n entityId,\n marked\n }\n})\n\nexport const setMarked = marked => ({\n type: SET_MARKED,\n payload: {\n marked\n }\n})\n","import {reducer as reducerUtil} from 'tocco-util'\n\nimport * as actions from './actions'\n\nconst ACTION_HANDLERS = {\n [actions.SET_ENTITY_NAME]: reducerUtil.singleTransferReducer('entityName'),\n [actions.SET_FORM_NAME]: reducerUtil.singleTransferReducer('formName'),\n [actions.SET_ENTITY_ID]: reducerUtil.singleTransferReducer('entityId'),\n [actions.SET_MODE]: reducerUtil.singleTransferReducer('mode'),\n [actions.SET_FORM_DEFINITION]: reducerUtil.singleTransferReducer('formDefinition'),\n [actions.SET_ENTITY]: reducerUtil.singleTransferReducer('entity'),\n [actions.SET_LAST_SAVE]: reducerUtil.singleTransferReducer('lastSave'),\n [actions.SET_ENTITY_MODEL]: reducerUtil.singleTransferReducer('entityModel'),\n [actions.SET_TOUCHED]: reducerUtil.singleTransferReducer('touched'),\n [actions.SET_APP_ID]: reducerUtil.singleTransferReducer('appId'),\n [actions.SET_DEFAULT_VALUES]: reducerUtil.singleTransferReducer('defaultValues'),\n [actions.SET_FIELD_DEFINITIONS]: reducerUtil.singleTransferReducer('fieldDefinitions'),\n [actions.SET_MARKED]: reducerUtil.singleTransferReducer('marked')\n}\n\nconst initialState = {\n appId: '',\n entityName: '',\n entityId: '',\n formName: '',\n mode: '',\n formDefinition: {},\n entity: {},\n entityModel: {},\n touched: false,\n defaultValues: {},\n fieldDefinitions: [],\n marked: false\n}\n\nexport default function reducer(state = initialState, action) {\n const handler = ACTION_HANDLERS[action.type]\n return handler ? handler(state, action) : state\n}\n","import reducer from './reducer'\nimport sagas from './sagas'\n\nexport {sagas}\nexport default reducer\n","import {SubmissionError} from 'redux-form/es/SubmissionError'\nimport {form, rest} from 'tocco-app-extensions'\nimport {call} from 'redux-saga/effects'\n\nexport function* updateEntity(entity, paths = []) {\n const options = {\n method: 'PATCH',\n queryParams: {\n _paths: paths.join(',')\n },\n body: entity,\n acceptedErrorCodes: ['VALIDATION_FAILED'],\n acceptedStatusCodes: [404, 409]\n }\n const resource = `entities/2.0/${entity.model}/${entity.key}`\n const resp = yield call(rest.requestSaga, resource, options)\n\n if (resp.body.errorCode === 'VALIDATION_FAILED') {\n throw new SubmissionError(form.validationErrorToFormError(entity, resp.body.errors))\n }\n\n if (resp.status === 409 && resp.body.information) {\n throw new rest.InformationError(resp.body.information)\n }\n\n return resp.body\n}\n\nconst SUCCESSFUL_SAVED_STATUS = 201\n\nexport function* createEntity(entity, paths = []) {\n const options = {\n method: 'POST',\n queryParams: {\n _paths: paths.join(',')\n },\n body: entity,\n acceptedErrorCodes: ['VALIDATION_FAILED'],\n acceptedStatusCodes: [409]\n }\n const resource = `entities/2.0/${entity.model}`\n const resp = yield call(rest.requestSaga, resource, options)\n\n if (resp.status === SUCCESSFUL_SAVED_STATUS) {\n const location = resp.headers.get('Location')\n const id = location.split('/').pop()\n return id\n } else {\n if (resp.body && resp.body.errorCode === 'VALIDATION_FAILED') {\n throw new SubmissionError(form.validationErrorToFormError(entity, resp.body.errors))\n }\n\n if (resp.status === 409 && resp.body.information) {\n throw new rest.InformationError(resp.body.information)\n }\n\n throw new Error('unexpected error during save', resp)\n }\n}\n","export default {\n CREATE: 'create',\n UPDATE: 'update'\n}\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport {FormattedMessage, FormattedRelativeTime} from 'react-intl'\nimport {form} from 'tocco-app-extensions'\nimport Typography from 'tocco-ui/src/Typography'\nimport styled from 'styled-components'\nimport {scale} from 'tocco-ui'\nimport {selectUnit} from '@formatjs/intl-utils'\nimport {decode} from 'html-entities'\n\nexport const ErrorItem = ({message}) =>\n <div>\n {decode(message)}\n </div>\n\nErrorItem.propTypes = {\n message: PropTypes.string.isRequired\n}\n\nconst StyledErrorItemWrapper = styled.div`\n &:not(:last-child) {\n margin-bottom: ${scale.space(0.4)};\n }\n`\n\nconst ErrorItems = ({formErrors}) => {\n let output = null\n const elements = []\n\n const hasFieldErrors = form.formErrorsUtil.hasFieldErrors(formErrors)\n const hasValidatorErrors = form.formErrorsUtil.hasValidatorErrors(formErrors)\n const hasRelatedEntityErrors = form.formErrorsUtil.hasRelatedEntityErrors(formErrors)\n const validatorErrors = form.formErrorsUtil.getValidatorErrors(formErrors)\n const relatedEntityErrorsCompact = form.formErrorsUtil.getRelatedEntityErrorsCompact(formErrors)\n const hasOutdatedError = form.formErrorsUtil.hasOutdatedError(formErrors)\n\n if (hasOutdatedError) {\n const outdatedError = form.formErrorsUtil.getOutdatedError(formErrors)\n const {value: timeStampValue, unit} = selectUnit(new Date(outdatedError.updateTimestamp))\n\n const titleId = `client.entity-detail.${outdatedError.sameEntity ? 'outdated' : 'relatedOutdated'}ErrorTitle`\n\n elements.push(\n <StyledErrorItemWrapper key=\"outDatedError\">\n <Typography.H5>\n <FormattedMessage\n id={titleId}\n values={{\n model: outdatedError.model,\n key: outdatedError.key\n }}\n />\n </Typography.H5>\n <FormattedMessage\n id=\"client.entity-detail.outdatedErrorDescription\"\n values={{\n ago: <FormattedRelativeTime value={timeStampValue} unit={unit}/>,\n user: outdatedError.updateUser\n }}\n />\n </StyledErrorItemWrapper>\n )\n }\n\n if (hasFieldErrors) {\n elements.push(\n !hasValidatorErrors && !hasRelatedEntityErrors\n ? (\n <StyledErrorItemWrapper key=\"hasFieldErrors\">\n <FormattedMessage id=\"client.entity-detail.invalidFieldsError\"/>\n </StyledErrorItemWrapper>\n )\n : (\n <StyledErrorItemWrapper key=\"hasFieldErrors\">\n <Typography.H5>\n <FormattedMessage id=\"client.entity-detail.invalidFieldsError\"/>\n </Typography.H5>\n </StyledErrorItemWrapper>\n )\n )\n }\n\n if (hasValidatorErrors) {\n elements.push(\n <StyledErrorItemWrapper key=\"hasValidatorErrors\">\n <Typography.H5>\n <FormattedMessage id=\"client.entity-detail.validatorErrors\"/>\n </Typography.H5>\n {validatorErrors.map((message, idx) => <ErrorItem key={idx} message={message}/>\n )}\n </StyledErrorItemWrapper>\n )\n }\n\n if (hasRelatedEntityErrors) {\n elements.push(\n <StyledErrorItemWrapper key=\"hasRelatedEntityErrors\">\n <Typography.H5>\n <FormattedMessage id=\"client.entity-detail.invalidRelationErrors\"/>\n </Typography.H5>\n {relatedEntityErrorsCompact.map((message, idx) => <ErrorItem key={idx} message={message}/>\n )}\n </StyledErrorItemWrapper>\n )\n }\n\n if (elements.length > 0) {\n output = (\n <>\n {elements.map(el => el)}\n </>\n )\n }\n return output\n}\n\nErrorItems.propTypes = {\n formErrors: PropTypes.object\n}\n\nexport default ErrorItems\n","const types = {\n NONE: 'none',\n REDUCED: 'reduced',\n FULL: 'full'\n}\n\nexport default types\n","import modes from '../modes'\nimport types from './types'\n\nexport const getFooterType = (mode, entityModel) => {\n const {useNiceFields} = entityModel\n\n if (mode === modes.CREATE) {\n return types.NONE\n }\n\n return useNiceFields ? types.FULL : types.REDUCED\n}\n\nconst paths = ['create_timestamp', 'update_timestamp', 'create_user', 'update_user', 'version']\n\nexport const getFooterPaths = (mode, entityModel) => {\n const type = getFooterType(mode, entityModel)\n const keyField = entityModel.keyField\n switch (type) {\n case types.FULL:\n return [keyField, ...paths]\n case types.REDUCED:\n return [keyField]\n case types.NONE:\n default:\n return []\n }\n}\n","import React from 'react'\nimport {\n actions as formActions,\n getFormAsyncErrors,\n getFormSubmitErrors,\n getFormSyncErrors,\n getFormValues,\n isValid as isValidSelector\n} from 'redux-form'\nimport {SubmissionError} from 'redux-form/es/SubmissionError'\nimport * as formActionTypes from 'redux-form/es/actionTypes'\nimport {\n actions as actionExtensions,\n errorLogging,\n externalEvents,\n form,\n notification,\n remoteEvents,\n rest\n} from 'tocco-app-extensions'\nimport {api} from 'tocco-util'\nimport {all, call, debounce, fork, put, select, takeEvery, takeLatest} from 'redux-saga/effects'\nimport {selectUnit} from '@formatjs/intl-utils'\nimport {FormattedMessage, FormattedRelativeTime} from 'react-intl'\nimport _get from 'lodash/get'\n\nimport * as actions from './actions'\nimport {createEntity, updateEntity} from '../../util/api/entities'\nimport modes from '../../util/modes'\nimport {ErrorItem} from '../../components/ErrorItems/ErrorItems'\nimport {getFooterPaths} from '../../util/detailFooter/helpers'\n\nexport const formInitialValueSelector = (state, formId) => state.form[formId].initial\n\nexport const entityDetailSelector = state => state.entityDetail\n\nconst FORM_ID = 'detailForm'\n\nexport const inputSelector = state => state.input\n\nexport default function* sagas() {\n yield all([\n takeLatest(actions.LOAD_DETAIL_VIEW, loadDetailView),\n takeLatest(actions.UNLOAD_DETAIL_VIEW, unloadDetailView),\n takeLatest(actions.TOUCH_ALL_FIELDS, touchAllFields),\n takeEvery(actions.SUBMIT_FORM, submitForm),\n takeEvery(actions.FIRE_TOUCHED, fireTouched),\n takeEvery(actions.NAVIGATE_TO_CREATE, navigateToCreate),\n takeEvery(remoteEvents.REMOTE_EVENT, remoteEvent),\n takeLatest(actions.NAVIGATE_TO_ACTION, navigateToAction),\n debounce(500, formActionTypes.CHANGE, onChange),\n takeEvery(formActionTypes.STOP_ASYNC_VALIDATION, asyncValidationStop),\n takeLatest(actions.UPDATE_MARKED, updateMarked),\n takeLatest(actionExtensions.actions.ACTION_INVOKED, reloadAfterAction)\n ])\n}\n\nexport function* autoComplete(fieldName, autoCompleteEndpoint) {\n const options = {\n method: 'POST',\n body: {\n triggerField: fieldName,\n entity: yield call(getEntityForSubmit)\n },\n acceptedStatusCodes: [403]\n }\n\n const response = yield call(rest.requestSaga, autoCompleteEndpoint, options)\n const values = _get(response, 'body.values', [])\n const formValues = yield select(getFormValues(FORM_ID))\n\n yield all(Object.keys(values).map(fieldName => {\n const value = values[fieldName]\n const currentFieldValue = formValues[fieldName]\n if (value.mode === 'override' || (value.mode === 'if_empty' && form.isValueEmpty(currentFieldValue))) {\n return put(formActions.change(FORM_ID, fieldName, value.value))\n }\n return null\n }\n ))\n}\n\nexport function* onChange({meta}) {\n const {field} = meta\n const fieldDefinition = (yield (select(entityDetailSelector))).fieldDefinitions.find(fd => fd.id === field)\n if (fieldDefinition && fieldDefinition.autoCompleteEndpoint) {\n yield call(autoComplete, field, fieldDefinition.autoCompleteEndpoint)\n }\n}\n\nexport function* loadDetailFormDefinition(formName, mode) {\n const formDefinition = yield call(rest.fetchForm, formName, mode)\n yield put(actions.setFormDefinition(formDefinition))\n const fieldDefinitions = yield call(form.getFieldDefinitions, formDefinition)\n yield put(actions.setFieldDefinitions(fieldDefinitions))\n return {formDefinition, fieldDefinitions}\n}\n\nexport function* loadEntity(entityName, entityId, fieldDefinitions) {\n const formPaths = yield call(form.getUsedPaths, fieldDefinitions)\n const {mode, entityModel} = yield select(entityDetailSelector)\n const footerPaths = yield call(getFooterPaths, mode, entityModel)\n const paths = [...formPaths, ...footerPaths]\n const entity = yield call(rest.fetchEntity, entityName, entityId, {paths})\n yield put(actions.setEntity(entity))\n return entity\n}\n\nexport function* unloadDetailView() {\n yield put(actions.setEntity(null))\n yield put(formActions.destroy(FORM_ID))\n}\n\nexport function* loadEntityModel(entityName) {\n const entityModel = yield call(rest.fetchModel, entityName)\n yield put(actions.setEntityModel(entityModel))\n return entityModel\n}\n\nexport function* loadDetailView() {\n const {entityName, formName, mode, defaultValues} = yield select(entityDetailSelector)\n\n const model = yield call(loadEntityModel, entityName)\n const {fieldDefinitions} = yield call(loadDetailFormDefinition, formName, mode)\n\n if (mode === modes.CREATE) {\n yield put(actions.setEntity({paths: {}, model: entityName}))\n const formDefaultValues = yield call(form.getDefaultValues, fieldDefinitions)\n const inputDefaultValues = defaultValues ? yield call(form.transformInputValues, defaultValues, model) : {}\n const defaultValuesFields = {...formDefaultValues, ...inputDefaultValues}\n const flattenEntity = yield call(api.getFlattenEntity, {model: entityName})\n const formValues = yield call(form.entityToFormValues, {...flattenEntity, ...defaultValuesFields})\n yield put(formActions.initialize(FORM_ID, formValues))\n } else {\n yield call(loadData)\n }\n}\n\nexport function* updateFormSubmit(entity) {\n const updateResponse = yield call(updateEntity, entity)\n if (updateResponse.status === 404) {\n // record was most likely moved to another business unit\n yield put(externalEvents.fireExternalEvent('onEntityDeleted'))\n } else {\n yield call(loadData)\n\n yield put(externalEvents.fireExternalEvent('onEntityUpdated'))\n yield call(showNotification, 'success', 'saveSuccessfulTitle', 'saveSuccessfulMessage')\n yield put(actions.setLastSave())\n yield put(formActions.stopSubmit(FORM_ID))\n }\n}\n\nexport function* createFormSubmit(entity) {\n const createdEntityId = yield call(createEntity, entity)\n yield put(externalEvents.fireExternalEvent('onEntityCreated', {id: createdEntityId}))\n yield call(showNotification, 'success', 'createSuccessfulTitle', 'createSuccessfulMessage')\n}\n\nexport function* touchAllFields() {\n const {fieldDefinitions} = yield select(entityDetailSelector)\n yield put(formActions.touch(FORM_ID, ...(fieldDefinitions.map(f => form.transformFieldName(f.path || f.id)))))\n}\n\nexport function* handleSubmitError(error) {\n if (error instanceof SubmissionError) {\n yield put(formActions.stopSubmit(FORM_ID, error.errors))\n yield call(handleInvalidForm)\n\n const validationErrors = yield call(form.formErrorsUtil.getValidatorErrors, error.errors)\n const message = (validationErrors && validationErrors.length > 0\n ? validationErrors.join('<br>')\n : 'client.entity-detail.saveAbortedMessage')\n\n yield put(notification.toaster({\n type: 'warning',\n title: 'client.entity-detail.saveAbortedTitle',\n body: () => <ErrorItem message={message}/>,\n duration: 5000\n }))\n } else if (error instanceof rest.InformationError) {\n yield put(notification.toaster({\n type: 'info',\n title: 'client.entity-detail.saveAbortedTitle',\n body: error.message\n }))\n yield put(formActions.stopSubmit(FORM_ID))\n } else if (error instanceof rest.ClientQuestionCancelledException) {\n yield put(formActions.stopSubmit(FORM_ID))\n } else {\n yield put(errorLogging.logError(\n 'client.common.unexpectedError',\n 'client.entity-detail.saveError',\n error))\n yield put(formActions.stopSubmit(FORM_ID))\n }\n}\n\nexport function* getCurrentEntityState() {\n const formValues = yield select(getFormValues(FORM_ID))\n const initialFormValues = yield select(formInitialValueSelector, FORM_ID)\n const {mode} = yield select(entityDetailSelector)\n const initialValues = mode === modes.CREATE ? {} : initialFormValues\n const dirtyFields = yield call(form.getDirtyFields, initialValues, formValues, mode === modes.CREATE)\n\n return {\n formValues,\n initialValues,\n mode,\n dirtyFields\n }\n}\n\nexport function* submitValidate() {\n const {formValues, initialValues, mode} = yield call(getCurrentEntityState)\n yield call(form.submitValidation, formValues, initialValues, mode)\n}\n\nexport function* getEntityForSubmit() {\n const {formValues, dirtyFields} = yield call(getCurrentEntityState)\n const flattenEntity = yield call(form.formValuesToFlattenEntity, formValues)\n const dirtyFieldNames = dirtyFields.map(fieldName => form.transformFieldNameBack(fieldName))\n return yield call(api.toEntity, flattenEntity, dirtyFieldNames)\n}\n\nexport function* getPaths() {\n const {fieldDefinitions} = yield select(entityDetailSelector)\n return yield call(form.getUsedPaths, fieldDefinitions)\n}\n\nexport function* getFormErrors() {\n return {\n ...(yield select(getFormSyncErrors(FORM_ID))),\n ...(yield select(getFormAsyncErrors(FORM_ID))),\n ...(yield select(getFormSubmitErrors(FORM_ID)))\n }\n}\n\nexport function focusField(fieldName) {\n const element = document.getElementById(form.getFieldId(FORM_ID, fieldName))\n if (element) {\n element.focus()\n return true\n }\n\n return false\n}\n\nexport function* locationFieldFocus(errorField) {\n const {fieldDefinitions} = yield select(entityDetailSelector)\n const locationField = fieldDefinitions\n .find(f => f.locationMapping && f.locationMapping.postcode === errorField)\n yield call(focusField, locationField.id)\n}\n\nexport function* focusErrorField() {\n const formErrors = yield call(getFormErrors)\n const firstErrorField = yield call(form.formErrorsUtil.getFirstErrorField, formErrors)\n if (firstErrorField) {\n const focusSet = yield call(focusField, firstErrorField)\n\n if (!focusSet) {\n yield call(locationFieldFocus, firstErrorField)\n }\n }\n}\n\nexport function* handleInvalidForm() {\n yield call(touchAllFields)\n yield call(focusErrorField)\n}\n\nexport function* submitForm() {\n try {\n const isValid = yield select(isValidSelector(FORM_ID))\n if (!isValid) {\n yield call(handleInvalidForm)\n } else {\n yield put(formActions.startSubmit(FORM_ID))\n const {mode} = yield select(entityDetailSelector)\n yield call(submitValidate)\n const entity = yield call(getEntityForSubmit)\n if (mode === modes.UPDATE) {\n yield call(updateFormSubmit, entity)\n } else if (mode === modes.CREATE) {\n yield call(createFormSubmit, entity)\n }\n }\n } catch (error) {\n yield call(handleSubmitError, error)\n }\n}\n\nexport function* fireTouched({payload}) {\n const {touched: actionTouched} = payload\n const {touched: stateTouched} = yield select(entityDetailSelector)\n\n if (actionTouched !== stateTouched) {\n yield put(externalEvents.fireExternalEvent('onTouchedChange', {\n touched: actionTouched\n }))\n yield put(actions.setTouched(actionTouched))\n }\n}\n\nexport function* showNotification(type, titleResourceName, messageResourceName) {\n yield put(notification.toaster({\n type,\n title: `client.entity-detail.${titleResourceName}`,\n body: `client.entity-detail.${messageResourceName}`\n }\n ))\n}\n\nexport function* loadDisplayExpressions(formName, mode, paths, entities) {\n if (paths && paths.length > 0) {\n const keys = entities.map(e => e.__key)\n const entityName = entities[0].__model\n const result = yield call(rest.fetchDisplayExpressions, formName, mode, keys, paths, entityName)\n return result\n }\n}\n\nexport function* loadRelationDisplays(relationFields, entities) {\n if (relationFields && relationFields.length > 0) {\n const request = yield call(api.getPathDisplayRequest, entities, relationFields, {})\n return yield call(rest.fetchDisplays, request)\n }\n}\n\nexport function* enhanceEntityWithDisplayExpressions(entity) {\n const {fieldDefinitions, formName, mode} = yield select(entityDetailSelector)\n const displayExpressions = fieldDefinitions.filter(f => f.componentType === 'display').map(f => f.id)\n const displayExpressionsL = yield call(loadDisplayExpressions, formName, mode, displayExpressions, [entity])\n if (displayExpressionsL) {\n Object.keys(displayExpressionsL[entity.__key]).forEach(dE => {\n entity[dE] = displayExpressionsL[entity.__key][dE]\n })\n }\n}\n\nexport function* enhanceEntityWithDisplays(entity) {\n const {fieldDefinitions} = yield select(entityDetailSelector)\n const relationFields = fieldDefinitions.filter(f => api.relationFieldTypes.includes(f.dataType)).map(f => f.path)\n\n const displays = yield call(loadRelationDisplays, relationFields, [entity])\n\n relationFields.forEach(relationField => {\n const value = entity[relationField]\n if (value) {\n const newValue = Array.isArray(value)\n ? value.map(v2 => ({...v2, display: displays[v2.model][v2.key]}))\n : {...value, display: displays[value.model][value.key]}\n entity[relationField] = newValue\n }\n })\n}\n\nexport function* loadData(reset = true) {\n const {entityName, entityId, fieldDefinitions, entityModel} = yield select(entityDetailSelector)\n\n if (entityModel.markable === true) {\n yield fork(loadMarked, entityName, entityId)\n }\n\n const entity = yield call(loadEntity, entityName, entityId, fieldDefinitions)\n const flattenEntity = yield call(api.getFlattenEntity, entity)\n\n yield call(enhanceEntityWithDisplayExpressions, flattenEntity)\n yield call(enhanceEntityWithDisplays, flattenEntity)\n\n const formValues = yield call(form.entityToFormValues, flattenEntity)\n const options = reset ? {} : {keepDirty: true, keepValues: false}\n yield put(formActions.initialize(FORM_ID, formValues, options))\n}\n\nexport function* loadMarked(entityName, entityId) {\n const marked = yield call(rest.fetchMarked, entityName, entityId)\n yield put(actions.setMarked(marked))\n}\n\nexport function* updateMarked({payload: {entityName, entityId, marked}}) {\n yield put(actions.setMarked(marked))\n yield call(rest.setMarked, entityName, entityId, marked)\n}\n\nexport function* reloadAfterAction({payload}) {\n const {definition} = payload\n if (definition.id !== 'delete') {\n yield call(loadData, false)\n yield put(externalEvents.fireExternalEvent('onRefresh'))\n }\n}\n\nexport function* navigateToCreate({payload}) {\n const {navigationStrategy} = yield select(inputSelector)\n yield call(navigationStrategy.navigateToCreateRelative, payload.relationName)\n}\n\nexport function* navigateToAction({payload}) {\n const {definition, selection} = payload\n const {navigationStrategy} = yield select(inputSelector)\n yield call(navigationStrategy.navigateToActionRelative, definition, selection)\n}\n\nexport const isCurrentEntity = (event, entityName, entityId) =>\n !!event.payload.entities.find(entity => entity.entityName === entityName && entity.key === entityId)\n || (event.payload.parent && event.payload.parent.model === entityName && event.payload.parent.key === entityId)\n\nexport function* remoteEvent(action) {\n const event = action.payload.event\n const {entityName, entityId} = yield select(entityDetailSelector)\n\n if (isCurrentEntity(event, entityName, entityId)) {\n switch (event.type) {\n case 'entity-delete-event':\n yield put(externalEvents.fireExternalEvent('onEntityDeleted'))\n break\n case 'entity-update-event':\n yield call(loadData, false)\n break\n }\n }\n}\n\nexport function* asyncValidationStop({payload}) {\n if (payload) {\n const hasOutdatedError = form.formErrorsUtil.hasOutdatedError(payload)\n if (hasOutdatedError) {\n const outdatedError = form.formErrorsUtil.getOutdatedError(payload)\n const {value: timeStampValue, unit} = selectUnit(new Date(outdatedError.updateTimestamp))\n const titleId = `client.entity-detail.${outdatedError.sameEntity ? 'outdated' : 'relatedOutdated'}ErrorTitle`\n\n yield put(notification.toaster({\n type: 'warning',\n key: 'outdated-warning',\n title: <FormattedMessage\n id={titleId}\n values={{\n model: outdatedError.model,\n key: outdatedError.key\n }}\n />,\n body: <FormattedMessage\n id=\"client.entity-detail.outdatedErrorDescription\"\n values={{\n ago: <FormattedRelativeTime value={timeStampValue} unit={unit}/>,\n user: outdatedError.updateUser\n }}\n />\n }))\n }\n }\n}\n","import {reducer as form} from 'redux-form'\n\nimport entityDetailReducer, {sagas as entityDetailSagas} from './entityDetail'\n\nexport default {\n entityDetail: entityDetailReducer,\n form\n}\n\nexport const sagas = [\n entityDetailSagas\n]\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport EntityListApp from 'tocco-entity-list/src/main'\nimport styled from 'styled-components'\nimport {viewPersistor} from 'tocco-util'\n\nconst StyledListApp = styled.div`\n width: 100%;\n`\n\nconst SubGrid = props => {\n const formBase = `${props.detailFormName}_${props.formField.path}`\n const id = `${props.appId}-subgrid-${props.entityName}-${props.entityKey}-${props.formField.reverseRelation}`\n\n return (\n <StyledListApp>\n <EntityListApp\n id={id}\n entityName={props.formField.targetEntity}\n formName={formBase}\n limit={props.limit}\n searchFormType={props.showSearchForm ? 'basic' : 'none'}\n navigationStrategy={props.navigationStrategy}\n showLink={true}\n onRowClick={e => {\n if (props.onRowClick) {\n props.onRowClick({\n id: e.id,\n gridName: props.formField.path,\n relationName: props.formField.path\n })\n }\n }}\n onNavigateToCreate={() => {\n props.navigateToCreate(props.formField.path)\n }}\n parent={{\n key: props.entityKey,\n reverseRelationName: props.formField.reverseRelation,\n model: props.entityName,\n relationName: props.formField.path\n }}\n emitAction={props.emitAction}\n store={viewPersistor.viewInfoSelector(id).store}\n onStoreCreate={store => {\n viewPersistor.persistViewInfo(id, {store})\n }}\n />\n </StyledListApp>\n )\n}\n\nSubGrid.defaultProps = {\n limit: 5\n}\n\nSubGrid.propTypes = {\n entityKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n entityName: PropTypes.string.isRequired,\n detailFormName: PropTypes.string.isRequired,\n formField: PropTypes.shape({\n path: PropTypes.string,\n targetEntity: PropTypes.string,\n reverseRelation: PropTypes.string\n }).isRequired,\n onRowClick: PropTypes.func,\n navigateToCreate: PropTypes.func.isRequired,\n showSubGridsCreateButton: PropTypes.bool,\n appId: PropTypes.string,\n showSearchForm: PropTypes.bool,\n limit: PropTypes.number,\n emitAction: PropTypes.func.isRequired,\n navigationStrategy: PropTypes.objectOf(PropTypes.func)\n}\n\nexport default SubGrid\n","import SubGrid from './SubGrid'\n\nexport default SubGrid\n","import {connect} from 'react-redux'\nimport {externalEvents, actionEmitter} from 'tocco-app-extensions'\n\nimport SubGrid from '../components/SubGrid'\nimport {navigateToCreate} from './../modules/entityDetail/actions'\n\nconst mapStateToProps = (state, props) => ({\n appId: state.entityDetail.appId,\n entityKey: state.entityDetail.entity.key,\n entityName: state.entityDetail.entity.model,\n detailFormName: state.entityDetail.formDefinition.id,\n navigationStrategy: state.input.navigationStrategy\n})\n\nconst mapActionCreators = {\n onRowClick: e => externalEvents.fireExternalEvent('onSubGridRowClick', {\n id: e.id,\n gridName: e.gridName,\n relationName: e.relationName\n }),\n navigateToCreate,\n emitAction: action => actionEmitter.dispatchEmittedAction(action)\n}\n\nexport default connect(mapStateToProps, mapActionCreators)(SubGrid)\n","import React from 'react'\n\nimport SubGridContainer from '../../../containers/SubGridContainer'\n\nexport default (formField, key) => (\n <SubGridContainer\n key={key}\n formField={formField}\n showSearchForm={formField.showSearchForm}\n limit={formField.limit || undefined}\n />\n)\n","import ErrorItems from './ErrorItems'\n\nexport default ErrorItems\n","import styled from 'styled-components'\nimport {Button, scale, theme, StyledScrollbar} from 'tocco-ui'\n\nexport const StyledForm = styled.form`\n display: flex;\n flex-direction: column;\n padding-bottom: ${scale.space(-0.5)};\n height: 100%;\n overflow-y: auto;\n ${StyledScrollbar}\n`\n\nexport const StyledSaveButton = styled(Button)`\n ${({hasErrors}) => hasErrors && `\n background-color: ${theme.color('paper')};\n `}\n display: block;\n`\n\nexport const StyledActionWrapper = styled.div`\n ${StyledSaveButton} {\n width: 100%;\n max-width: fit-content;\n justify-content: center;\n box-sizing: border-box;\n\n > * {\n overflow: hidden;\n }\n }\n`\n\nexport const StyledActionSpan = styled.span`\n cursor: pointer;\n display: flex;\n height: 100%;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n\n &:hover {\n color: ${theme.color('secondaryLight')};\n }\n ${({marked, theme}) => marked && `color: ${theme.colors.secondary};`}\n`\n","import {Popover} from 'tocco-ui'\nimport React from 'react'\nimport PropTypes from 'prop-types'\n\nimport modes from '../../util/modes'\nimport ErrorItems from '../ErrorItems'\nimport {StyledSaveButton} from './StyledComponents'\n\nconst SaveButton = ({\n submitting,\n mode,\n intl,\n hasErrors,\n formErrors,\n icon\n}) => {\n const msg = id => (intl.formatMessage({id}))\n\n return (\n <Popover\n content={hasErrors ? <ErrorItems formErrors={formErrors}/> : null}\n placement=\"bottom\">\n <StyledSaveButton\n data-cy=\"detail-form_submit-button\"\n id=\"detail-save_button\"\n disabled={submitting}\n ink=\"primary\"\n label={msg(`client.entity-detail.${mode === modes.CREATE ? 'create' : 'save'}`)}\n look={hasErrors ? 'flat' : 'raised'}\n pending={submitting}\n type=\"submit\"\n hasErrors={hasErrors}\n icon={hasErrors ? 'exclamation' : icon}\n />\n </Popover>\n )\n}\n\nSaveButton.propTypes = {\n intl: PropTypes.object.isRequired,\n submitting: PropTypes.bool,\n mode: PropTypes.oneOf(Object.values(modes)),\n hasErrors: PropTypes.bool,\n formErrors: PropTypes.object,\n icon: PropTypes.string\n}\n\nexport default SaveButton\n","import {Icon, Typography} from 'tocco-ui'\nimport React, {useState, useEffect} from 'react'\nimport PropTypes from 'prop-types'\nimport {connect} from 'react-redux'\n\nimport {updateMarked} from '../../modules/entityDetail/actions'\nimport {StyledActionSpan} from './StyledComponents'\n\nconst MarkButton = ({entityName, entityId, marked, updateMarked}) => {\n const [mouseOver, setMouseOver] = useState(false)\n\n useEffect(() => {\n if (!marked) {\n setMouseOver(false) // reset mouse over to false to show empty star when user unmarks even if still hovering\n }\n }, [marked])\n\n const handleClick = e => {\n e.stopPropagation()\n updateMarked(entityName, entityId, !marked)\n }\n\n return <Typography.Span>\n <StyledActionSpan\n marked={marked}\n onClick={handleClick}\n onMouseEnter={() => setMouseOver(true)}\n onMouseLeave={() => setMouseOver(false)}>\n <Icon icon={marked || mouseOver ? 'star-full' : 'star'}/>\n </StyledActionSpan>\n </Typography.Span>\n}\n\nMarkButton.propTypes = {\n entityName: PropTypes.string.isRequired,\n entityId: PropTypes.string.isRequired,\n marked: PropTypes.bool.isRequired,\n updateMarked: PropTypes.func.isRequired\n}\n\nconst mapActionCreators = {\n updateMarked\n}\n\nconst mapStateToProps = state => ({\n entityName: state.entityDetail.entityName,\n entityId: state.entityDetail.entityId,\n marked: state.entityDetail.marked\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(MarkButton)\n","import styled from 'styled-components'\nimport {colorizeText, StyledSpan, theme, scale} from 'tocco-ui'\nimport {declareNoneWrappingText} from 'tocco-ui/src/utilStyles'\n\nexport const StyledFooterWrapper = styled.div`\n max-width: 650px;\n display: flex;\n justify-content: space-between;\n flex-wrap: wrap;\n gap: ${scale.font(0)};\n margin-right: ${scale.font(0)};\n\n && {\n * {\n color: ${colorizeText.shade2};\n font-size: ${scale.font(-0.8)};\n }\n }\n`\n\nexport const StyledFooterItemWrapper = styled.div`\n display: flex;\n`\nexport const StyledFooterItemLabel = styled(StyledSpan)`\n && {\n margin-right: ${scale.space(-1.37)};\n font-weight: ${theme.fontWeight('bold')};\n ${declareNoneWrappingText}\n }\n`\n\nexport const StyledFooterItemValue = styled.span`\n flex: 1;\n overflow: hidden;\n`\n\nexport const StyledTimestampValueWrapper = styled.span`\n display: flex;\n`\n\nexport const StyledTimestampRelativeValue = styled(StyledSpan)`\n && {\n margin-left: ${scale.space(-1.37)};\n }\n`\n","import React from 'react'\nimport PropTypes from 'prop-types'\nimport {FormattedMessage} from 'react-intl'\n\nimport {StyledFooterItemWrapper, StyledFooterItemLabel, StyledFooterItemValue} from './StyledComponents'\n\nconst FooterItem = ({labelId, valueComponent: ValueComp}) => (\n <StyledFooterItemWrapper>\n <StyledFooterItemLabel><FormattedMessage id={labelId}/>:</StyledFooterItemLabel>\n <StyledFooterItemValue><ValueComp/></StyledFooterItemValue>\n </StyledFooterItemWrapper>\n)\n\nFooterItem.propTypes = {\n labelId: PropTypes.string.isRequired,\n valueComponent: PropTypes.func.isRequired\n}\n\nexport default FooterItem\n","import React from 'react'\nimport PropTypes from 'prop-types'\nimport {Typography} from 'tocco-ui'\n\nconst TextValue = ({value}) => <Typography.Span>{value}</Typography.Span>\n\nTextValue.propTypes = {\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired\n}\n\nexport default TextValue\n","import React from 'react'\nimport PropTypes from 'prop-types'\n\nimport {StyledFooterWrapper} from './StyledComponents'\nimport FooterItem from './FooterItem'\nimport TextValue from './TextValue'\n\nconst DetailFooterReduced = ({\n entity,\n keyField\n}) => (\n <StyledFooterWrapper>\n <div>\n <FooterItem\n labelId=\"client.entity-detail.footer.key\"\n valueComponent={() => <TextValue value={entity.paths[keyField].value}/>}/>\n </div>\n </StyledFooterWrapper>\n)\n\nDetailFooterReduced.propTypes = {\n entity: PropTypes.object.isRequired,\n keyField: PropTypes.string.isRequired\n}\n\nexport default DetailFooterReduced\n","import React from 'react'\nimport PropTypes from 'prop-types'\nimport {FormattedValue} from 'tocco-ui'\nimport {FormattedRelativeTime} from 'react-intl'\nimport {selectUnit} from '@formatjs/intl-utils'\n\nimport {StyledTimestampRelativeValue, StyledTimestampValueWrapper} from './StyledComponents'\n\nconst TimestampValue = ({value}) => {\n const {value: diffValue, unit} = selectUnit(new Date(value))\n\n return <StyledTimestampValueWrapper>\n <FormattedValue value={value} type=\"datetime\"/>\n <StyledTimestampRelativeValue>\n (<FormattedRelativeTime value={diffValue} unit={unit}/>)\n </StyledTimestampRelativeValue>\n </StyledTimestampValueWrapper>\n}\n\nTimestampValue.propTypes = {\n value: PropTypes.string.isRequired\n}\n\nexport default TimestampValue\n","import React from 'react'\nimport PropTypes from 'prop-types'\n\nimport {StyledFooterWrapper} from './StyledComponents'\nimport FooterItem from './FooterItem'\nimport TimestampValue from './TimestampValue'\nimport TextValue from './TextValue'\n\nconst DetailFooterFull = ({\n entity,\n keyField\n}) => (\n <StyledFooterWrapper>\n <div>\n <FooterItem\n labelId=\"client.entity-detail.footer.created\"\n valueComponent={() => <TimestampValue value={entity.paths.create_timestamp.value}/>}/>\n <FooterItem\n labelId=\"client.entity-detail.footer.by\"\n valueComponent={() => <TextValue value={entity.paths.create_user.value}/>}/>\n </div>\n <div>\n <FooterItem\n labelId=\"client.entity-detail.footer.updated\"\n valueComponent={() => <TimestampValue value={entity.paths.update_timestamp.value}/>}/>\n <FooterItem\n labelId=\"client.entity-detail.footer.by\"\n valueComponent={() => <TextValue value={entity.paths.update_user.value}/>}/>\n </div>\n <div>\n <FooterItem\n labelId=\"client.entity-detail.footer.version\"\n valueComponent={() => <TextValue value={entity.paths.version.value}/>}/>\n <FooterItem\n labelId=\"client.entity-detail.footer.key\"\n valueComponent={() => <TextValue value={entity.paths[keyField].value}/>}/>\n </div>\n </StyledFooterWrapper>\n)\n\nDetailFooterFull.propTypes = {\n entity: PropTypes.object.isRequired,\n keyField: PropTypes.string.isRequired\n}\n\nexport default DetailFooterFull\n","import React from 'react'\nimport PropTypes from 'prop-types'\n\nimport {getFooterType} from '../../util/detailFooter/helpers'\nimport types from '../../util/detailFooter/types'\nimport DetailFooterReduced from './DetailFooterReduced'\nimport DetailFooterFull from './DetailFooterFull'\n\nconst DetailFooter = ({mode, entity, entityModel}) => {\n const type = getFooterType(mode, entityModel)\n\n switch (type) {\n case types.FULL:\n return <DetailFooterFull entity={entity} keyField={entityModel.keyField}/>\n case types.REDUCED:\n return <DetailFooterReduced entity={entity} keyField={entityModel.keyField}/>\n case types.NONE:\n default:\n return null\n }\n}\n\nDetailFooter.propTypes = {\n mode: PropTypes.string.isRequired,\n entity: PropTypes.object.isRequired,\n entityModel: PropTypes.object.isRequired\n}\n\nexport default DetailFooter\n","import {connect} from 'react-redux'\nimport {injectIntl} from 'react-intl'\n\nimport DetailFooter from '../components/DetailFooter/DetailFooter'\n\nconst mapStateToProps = state => ({\n mode: state.entityDetail.mode,\n entity: state.entityDetail.entity,\n entityModel: state.entityDetail.entityModel\n})\n\nexport default connect(mapStateToProps)(injectIntl(DetailFooter))\n","import PropTypes from 'prop-types'\nimport React, {useEffect, useLayoutEffect, useMemo, useRef} from 'react'\nimport {reduxForm} from 'redux-form'\nimport {form} from 'tocco-app-extensions'\n\nimport SubGrid from '../../util/detailView/fromFieldFactories/subGrid'\nimport SaveButton from './SaveButton'\nimport MarkButton from './MarkButton'\nimport {StyledForm} from './StyledComponents'\nimport DetailFooterContainer from '../../containers/DetailFooterContainer'\n\nconst DetailForm = props => {\n const {\n fireTouched,\n dirty,\n intl,\n submitting,\n mode,\n formErrors,\n valid,\n submitForm,\n entity,\n formDefinition,\n formValues,\n anyTouched,\n form: formName\n } = props\n\n const formEl = useRef(null)\n\n useEffect(() => {\n fireTouched(dirty && anyTouched)\n }, [dirty, anyTouched])\n\n useLayoutEffect(() => {\n const firstInput = formEl.current.querySelector('input:not([disabled]),textarea:not([disabled])')\n\n if (firstInput != null) {\n firstInput.focus()\n }\n }, [])\n\n const customRenderedActions = useMemo(() => (\n {\n save: actionDefinition =>\n <SaveButton\n intl={intl}\n submitting={submitting}\n mode={mode}\n hasErrors={!valid && anyTouched}\n formErrors={formErrors}\n {...actionDefinition}\n />,\n mark: actionDefinition => <MarkButton {...actionDefinition}/>\n }\n ), [submitting, mode, valid, anyTouched, formErrors])\n\n const handleSubmit = event => {\n event.preventDefault()\n submitForm()\n }\n\n const handleKeyPress = event => {\n if (event.key === 'Enter' && event.target.tagName !== 'TEXTAREA') {\n event.preventDefault() // disable save on enter key down\n }\n }\n\n return <StyledForm\n onSubmit={handleSubmit}\n onKeyDown={handleKeyPress}\n ref={formEl}\n >\n <form.FormBuilder\n entity={entity}\n formName={formName}\n formDefinition={formDefinition}\n formValues={formValues}\n fieldMappingType={formDefinition.readOnly ? 'readonly' : 'editable'}\n mode={mode}\n componentMapping={{[form.componentTypes.SUB_TABLE]: SubGrid}}\n customRenderedActions={customRenderedActions}\n />\n <DetailFooterContainer/>\n </StyledForm>\n}\n\nDetailForm.propTypes = {\n intl: PropTypes.object.isRequired,\n mode: PropTypes.oneOf(['update', 'create']),\n submitForm: PropTypes.func.isRequired,\n formDefinition: PropTypes.object.isRequired,\n entity: PropTypes.object.isRequired,\n form: PropTypes.string.isRequired,\n touch: PropTypes.func.isRequired,\n formValues: PropTypes.object,\n submitting: PropTypes.bool,\n formErrors: PropTypes.object,\n valid: PropTypes.bool,\n dirty: PropTypes.bool,\n lastSave: PropTypes.number,\n fireTouched: PropTypes.func.isRequired,\n anyTouched: PropTypes.bool\n}\n\nexport default reduxForm({\n form: 'detailForm',\n destroyOnUnmount: false\n})(DetailForm)\n","import {connect} from 'react-redux'\nimport {injectIntl} from 'react-intl'\nimport _get from 'lodash/get'\nimport {\n getFormValues,\n getFormInitialValues,\n getFormSyncErrors,\n getFormAsyncErrors,\n getFormSubmitErrors\n} from 'redux-form'\nimport {errorLogging} from 'tocco-app-extensions'\n\nimport DetailForm from '../components/DetailForm/DetailForm'\nimport {\n unloadDetailView,\n submitForm,\n fireTouched\n} from '../modules/entityDetail/actions'\n\nconst mapActionCreators = {\n unloadDetailView,\n submitForm,\n fireTouched,\n logError: errorLogging.logError\n}\n\nconst getFormGeneralErrors = formName =>\n state => (\n _get(state, `form.${formName}.error`, {})\n )\n\nconst mapStateToProps = state => ({\n formDefinition: state.entityDetail.formDefinition,\n entity: state.entityDetail.entity,\n formValues: getFormValues('detailForm')(state),\n formErrors: {\n ...getFormSyncErrors('detailForm')(state),\n ...getFormAsyncErrors('detailForm')(state),\n ...getFormSubmitErrors('detailForm')(state),\n _error: getFormGeneralErrors('detailForm')(state)\n },\n formInitialValues: getFormInitialValues('detailForm')(state),\n lastSave: state.entityDetail.lastSave\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(DetailForm))\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport _isEmpty from 'lodash/isEmpty'\nimport {form} from 'tocco-app-extensions'\nimport {LoadMask} from 'tocco-ui'\n\nimport modes from '../../util/modes'\nimport DetailFormContainer from '../../containers/DetailFormContainer'\n\nclass DetailView extends React.Component {\n componentWillUnmount() {\n this.props.unloadDetailView()\n }\n\n handledAsyncValidate = formValues =>\n form.asyncValidation(\n formValues,\n this.props.mode === modes.CREATE ? {} : this.props.formInitialValues,\n this.props.fieldDefinitions,\n this.props.mode\n )\n\n getSyncValidation = () => {\n if (!this.validateSingleton && !_isEmpty(this.props.fieldDefinitions)) {\n this.validateSingleton = form.syncValidation(this.props.fieldDefinitions)\n }\n return this.validateSingleton\n }\n\n msg = id => this.props.intl.formatMessage({id})\n\n render() {\n const props = this.props\n\n return (\n <LoadMask\n required={[props.formInitialValues]}\n loadingText={this.msg('client.entity-detail.loadingText')}\n >\n <DetailFormContainer\n mode={this.props.mode}\n validate={this.getSyncValidation()}\n asyncValidate={this.handledAsyncValidate}\n asyncBlurFields={this.props.fieldDefinitions.map(fD => fD.path)}\n />\n </LoadMask>\n )\n }\n}\n\nexport default DetailView\n\nDetailView.propTypes = {\n intl: PropTypes.object.isRequired,\n mode: PropTypes.oneOf(['update', 'create']),\n loadDetailView: PropTypes.func.isRequired,\n unloadDetailView: PropTypes.func.isRequired,\n logError: PropTypes.func.isRequired,\n entityModel: PropTypes.object.isRequired,\n fieldDefinitions: PropTypes.arrayOf(\n PropTypes.shape({\n path: PropTypes.string,\n id: PropTypes.string,\n validation: PropTypes.object\n })\n ).isRequired,\n entityName: PropTypes.string.isRequired,\n entityId: PropTypes.string,\n formInitialValues: PropTypes.shape({\n initial: PropTypes.objectOf(PropTypes.string)\n })\n}\n","import {connect} from 'react-redux'\nimport {injectIntl} from 'react-intl'\nimport {getFormInitialValues} from 'redux-form'\nimport {errorLogging} from 'tocco-app-extensions'\n\nimport {\n loadDetailView,\n unloadDetailView\n} from '../modules/entityDetail/actions'\nimport DetailView from '../components/DetailView/DetailView'\n\nconst mapActionCreators = {\n loadDetailView,\n unloadDetailView,\n logError: errorLogging.logError\n}\n\nconst mapStateToProps = (state, props) => {\n return {\n entityName: state.entityDetail.entityName,\n entityId: state.entityDetail.entityId,\n entityModel: state.entityDetail.entityModel,\n fieldDefinitions: state.entityDetail.fieldDefinitions,\n mode: state.entityDetail.mode,\n formInitialValues: getFormInitialValues('detailForm')(state)\n }\n}\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(DetailView))\n","import {\n loadDetailView,\n setEntityName,\n setEntityId,\n setFormName,\n setMode,\n setAppId,\n setDefaultValues\n} from './modules/entityDetail/actions'\n\nexport const getDispatchActions = input => ([\n setEntityName(input.entityName),\n setEntityId(input.entityId ? input.entityId : null),\n setMode(input.mode),\n setFormName(input.formName),\n setAppId(input.id),\n setDefaultValues(input.defaultValues),\n loadDetailView()\n])\n","import {put} from 'redux-saga/effects'\n\nimport {navigateToCreate, navigateToAction} from './modules/entityDetail/actions'\n\nexport default {\n new: function* () {\n yield put(navigateToCreate())\n },\n fullscreen: function* (definition, selection) {\n yield put(navigateToAction(definition, selection))\n }\n}\n","import {submitForm} from './modules/entityDetail/actions'\n\nexport default [\n {\n ctrl: true,\n alt: true,\n code: 'KeyS',\n actions: [submitForm()]\n }\n]\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport {navigationStrategy, reducer as reducerUtil} from 'tocco-util'\nimport {\n actionEmitter,\n actions,\n appFactory,\n errorLogging,\n externalEvents,\n formData,\n keyDown,\n notification\n} from 'tocco-app-extensions'\nimport SimpleFormApp from 'tocco-simple-form/src/main'\nimport EntityListApp from 'tocco-entity-list/src/main'\n\nimport reducers, {sagas} from './modules/reducers'\nimport DetailViewContainer from './containers/DetailViewContainer'\nimport {getDispatchActions} from './input'\nimport customActions from './customActions'\nimport shortcuts from './shortcuts'\n\nconst packageName = 'entity-detail'\n\nconst EXTERNAL_EVENTS = [\n 'onSubGridRowClick',\n 'onEntityCreated',\n 'onEntityUpdated',\n 'onEntityDeleted',\n 'onTouchedChange',\n 'onRefresh',\n 'emitAction'\n]\n\nconst initApp = (id, input, events = {}, publicPath) => {\n const content = <DetailViewContainer/>\n\n const store = appFactory.createStore(reducers, sagas, input, packageName)\n externalEvents.addToStore(store, events)\n actionEmitter.addToStore(store, events.emitAction)\n errorLogging.addToStore(store, false)\n notification.addToStore(store, false)\n actions.addToStore(store,\n {\n formApp: SimpleFormApp,\n listApp: EntityListApp,\n customActions,\n appComponent: input.actionAppComponent,\n navigationStrategy: input.navigationStrategy,\n context: {\n viewName: 'detail',\n formName: input.formName\n }\n }\n )\n formData.addToStore(store, {\n listApp: EntityListApp,\n detailApp: EntityDetailApp,\n navigationStrategy: input.navigationStrategy,\n chooseDocument: input.chooseDocument\n })\n keyDown.addToStore(store, shortcuts)\n\n const dispatchActions = getDispatchActions(input)\n\n const app = appFactory.createApp(\n packageName,\n content,\n store,\n {\n input,\n events,\n actions: dispatchActions,\n publicPath,\n textResourceModules: ['component', 'common', 'entity-list', 'entity-detail']\n }\n )\n\n if (module.hot) {\n module.hot.accept('./modules/reducers', () => {\n const reducers = require('./modules/reducers').default\n reducerUtil.hotReloadReducers(app.store, reducers)\n })\n }\n\n return app\n}\n\n(() => {\n if (__DEV__ && __PACKAGE_NAME__ === 'entity-detail') {\n const input = require('./dev/input.json')\n\n if (!__NO_MOCK__) {\n const fetchMock = require('fetch-mock').default\n fetchMock.config.overwriteRoutes = false\n\n const setupFetchMocks = require('./dev/fetchMocks').default\n setupFetchMocks(packageName, fetchMock)\n\n const listFetchMocks = require('tocco-entity-list/src/dev/fetchMocks').default\n listFetchMocks('entity-list', fetchMock)\n\n fetchMock.spy()\n }\n\n const app = initApp('id', input)\n appFactory.renderApp(app.component)\n } else {\n appFactory.registerAppInRegistry(packageName, initApp)\n }\n})()\n\nclass EntityDetailApp extends React.Component {\n constructor(props) {\n super(props)\n\n const events = EXTERNAL_EVENTS.reduce((events, event) => {\n if (props[event]) {\n events[event] = props[event]\n }\n return events\n }, {})\n\n this.app = initApp(props.id, props, events)\n }\n\n render() {\n return this.app.component\n }\n}\n\nEntityDetailApp.propTypes = {\n entityName: PropTypes.string.isRequired,\n formName: PropTypes.string.isRequired,\n mode: PropTypes.oneOf(['update', 'create']),\n ...EXTERNAL_EVENTS.reduce((propTypes, event) => {\n propTypes[event] = PropTypes.func\n return propTypes\n }, {}),\n navigationStrategy: navigationStrategy.propTypes,\n chooseDocument: PropTypes.func,\n actionAppComponent: PropTypes.func\n}\n\nexport default EntityDetailApp\n","import {domAnimation} from 'framer-motion'\nexport default domAnimation\n","import React from 'react'\nimport PropTypes from 'prop-types'\nimport _get from 'lodash/get'\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome'\nimport {library} from '@fortawesome/fontawesome-svg-core'\nimport {\n faSquare as faSquareSolid, faSquareFull, faStar as faStarSolid, faPaperclip\n} from '@fortawesome/pro-solid-svg-icons'\nimport {\n faTimes, faCircle, faHorizontalRule, faSync, faMinus, faTimesCircle, faInfoCircle,\n faCheckCircle, faExclamationCircle, faTrash, faList, faPhone, faSearch, faFolder,\n faExternalLink, faChevronDoubleRight, faChevronDoubleLeft, faChevronRight, faChevronLeft, faChevronUp, faChevronDown,\n faPlus, faGlobe, faFileExcel, faFilePdf, faFile, faSortDown, faSortUp, faArrowRight, faArrowLeft, faQuestionCircle,\n faCog, faFolders, faStar, faFileAlt, faFileCode, faFileCsv, faFileExport, faFileImport, faFileSpreadsheet, faIdBadge,\n faCheck, faMapMarked, faBars, faInfo, faCompress, faBook, faEllipsisV, faSquare, faExclamation, faBell,\n faArrowToBottom, faArrowToTop, faBox, faBoxOpen, faNewspaper, faComment, faSave, faPen, faAddressCard,\n faMailBulk, faSitemap, faBarcodeAlt, faAbacus, faCalendarCheck, faPhoneLaptop, faTasks, faChalkboardTeacher, faUsers,\n faChevronDoubleDown, faChevronDoubleUp\n} from '@fortawesome/pro-light-svg-icons'\nimport {\n faApple, faDropbox, faFacebook, faFacebookF, faGoogle, faJira, faMicrosoft\n} from '@fortawesome/free-brands-svg-icons'\n\n(() => {\n library.add(\n faChevronDoubleLeft, faChevronDoubleRight, faChevronRight,\n faChevronLeft, faChevronUp, faChevronDown, faGlobe, faPlus, faFolder, faFolders, faStar, faStarSolid,\n faTimes, faArrowRight, faArrowLeft, faFile, faFileAlt, faFileCode, faFileCsv, faFileExcel, faFileExport,\n faFileImport, faFilePdf, faFileSpreadsheet, faIdBadge, faCheck, faExclamation, faCircle,\n faCheckCircle, faGoogle, faFacebook, faFacebookF, faDropbox, faMicrosoft, faJira, faApple, faBars, faExternalLink,\n faPhone, faMapMarked, faSearch, faCog, faInfo, faHorizontalRule, faSync, faSquareFull,\n faCompress, faBook, faSortUp, faSortDown, faQuestionCircle, faEllipsisV, faMinus, faTimesCircle, faInfoCircle,\n faExclamationCircle, faTrash, faList, faSquare, faBell, faArrowToBottom, faArrowToTop, faSquareSolid, faBox,\n faBoxOpen, faNewspaper, faComment, faSave, faPen, faPaperclip, faAddressCard,\n faMailBulk, faSitemap, faBarcodeAlt, faAbacus, faCalendarCheck, faPhoneLaptop, faTasks,\n faChalkboardTeacher, faUsers, faChevronDoubleDown, faChevronDoubleUp)\n})()\n\n/**\n * The following icons are solely used to support custom display expressions and should not be removed: faSquareSolid\n */\n\nconst FontAwesomeAdapter = ({\n icon,\n style\n}) =>\n <FontAwesomeIcon\n icon={icon.includes(',') ? icon.replace(/\\s+/, '').split(',') : icon}\n style={style}\n {..._get(style, 'color') && {color: style.color}}\n fixedWidth\n />\n\nFontAwesomeAdapter.propTypes = {\n icon: PropTypes.string.isRequired,\n style: PropTypes.object\n}\n\nexport default FontAwesomeAdapter\n","import React from 'react'\nimport PropTypes from 'prop-types'\nimport _get from 'lodash/get'\n\nconst icons = {\n logo: style => (\n <svg height={_get(style, 'fontSize', 20)} {...style} aria-hidden=\"true\" role=\"img\"\n xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path\n fill=\"currentColor\"\n d={`M256 8C119.033 8 8 119.033 8 256s111.033 248 248 248 248-111.033 248-248S392.967 8 256 \n 8zm80 248c0 44.112-35.888 80-80 80s-80-35.888-80-80 35.888-80 80-80 80 35.888 80 80z`}\n />\n </svg>\n ),\n office: style => {\n return <svg height={_get(style, 'fontSize', 20)} {...style} aria-hidden=\"true\" role=\"img\"\n enableBackground=\"new 0 0 2075 2499.8\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 2075 2499.8\">\n <path\n fill=\"currentColor\"\n d={`m0 2016.6v-1519.8l1344.4-496.8 730.6 233.7v2045.9l-730.6 220.3-1344.4-483.3 1344.4 \n 161.8v-1769.2l-876.8 204.6v1198.3z`}\n />\n </svg>\n }\n}\n\nconst ToccoIcons = ({icon, style}) =>\n icons[icon](style)\n\nToccoIcons.propTypes = {\n icon: PropTypes.string.isRequired,\n style: PropTypes.object\n}\n\nexport default ToccoIcons\n","import React from 'react'\nimport PropTypes from 'prop-types'\n\nimport mapping from './mapping'\nimport FontAwesomeAdapter from './FontAwesomeAdapter'\nimport ToccoIcons from './ToccoIcons'\n\nconst iconLibsFactories = {\n fa: (iconMap, props) => <FontAwesomeAdapter {...props} icon={iconMap.id}/>,\n toc: (iconMap, props) => <ToccoIcons {...props} icon={iconMap.id}/>\n}\n\nexport const Icon = props => {\n const iconMap = mapping[props.icon]\n\n if (!iconMap) {\n return null\n }\n\n const iconFactory = iconLibsFactories[iconMap.lib]\n return iconFactory ? iconFactory(iconMap, props) : null\n}\n\nIcon.propTypes = {\n /**\n * id of icon. Full list can be found in mapping.json file or showcase deployment.\n */\n icon: PropTypes.string.isRequired,\n /**\n * CSS Styles object. Color property can be used to colorize the icon and fontSize for the size.\n */\n style: PropTypes.objectOf(PropTypes.string)\n}\n\nexport default Icon\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome'\nimport {faCircleNotch} from '@fortawesome/pro-solid-svg-icons'\n\n/**\n * Spinner that indicates a loading process\n */\nconst LoadingSpinner = ({size, style}) => (\n <FontAwesomeIcon\n {...style}\n style={{fontSize: size}}\n spin\n icon={faCircleNotch}\n />\n)\n\nLoadingSpinner.propTypes = {\n /**\n * Specify width and height.\n */\n size: PropTypes.string,\n /**\n * css properties object. color can be used to set the color of the spinner\n */\n style: PropTypes.object\n}\n\nexport default LoadingSpinner\n","'use strict';\n\nexports.__esModule = true;\nvar canUseDOM = exports.canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n\nvar addEventListener = exports.addEventListener = function addEventListener(node, event, listener) {\n return node.addEventListener ? node.addEventListener(event, listener, false) : node.attachEvent('on' + event, listener);\n};\n\nvar removeEventListener = exports.removeEventListener = function removeEventListener(node, event, listener) {\n return node.removeEventListener ? node.removeEventListener(event, listener, false) : node.detachEvent('on' + event, listener);\n};\n\nvar getConfirmation = exports.getConfirmation = function getConfirmation(message, callback) {\n return callback(window.confirm(message));\n}; // eslint-disable-line no-alert\n\n/**\n * Returns true if the HTML5 history API is supported. Taken from Modernizr.\n *\n * https://github.com/Modernizr/Modernizr/blob/master/LICENSE\n * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js\n * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586\n */\nvar supportsHistory = exports.supportsHistory = function supportsHistory() {\n var ua = window.navigator.userAgent;\n\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;\n\n return window.history && 'pushState' in window.history;\n};\n\n/**\n * Returns true if browser fires popstate on hash change.\n * IE10 and IE11 do not.\n */\nvar supportsPopStateOnHashChange = exports.supportsPopStateOnHashChange = function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n};\n\n/**\n * Returns false if using go(n) with hash history causes a full page reload.\n */\nvar supportsGoWithoutReloadUsingHash = exports.supportsGoWithoutReloadUsingHash = function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n};\n\n/**\n * Returns true if a given popstate event is an extraneous WebKit event.\n * Accounts for the fact that Chrome on iOS fires real popstate events\n * containing undefined state when pressing the back button.\n */\nvar isExtraneousPopstateEvent = exports.isExtraneousPopstateEvent = function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n};","'use strict';\n\nexports.__esModule = true;\nexports.locationsAreEqual = exports.createLocation = undefined;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _resolvePathname = require('resolve-pathname');\n\nvar _resolvePathname2 = _interopRequireDefault(_resolvePathname);\n\nvar _valueEqual = require('value-equal');\n\nvar _valueEqual2 = _interopRequireDefault(_valueEqual);\n\nvar _PathUtils = require('./PathUtils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar createLocation = exports.createLocation = function createLocation(path, state, key, currentLocation) {\n var location = void 0;\n if (typeof path === 'string') {\n // Two-arg form: push(path, state)\n location = (0, _PathUtils.parsePath)(path);\n location.state = state;\n } else {\n // One-arg form: push(location)\n location = _extends({}, path);\n\n if (location.pathname === undefined) location.pathname = '';\n\n if (location.search) {\n if (location.search.charAt(0) !== '?') location.search = '?' + location.search;\n } else {\n location.search = '';\n }\n\n if (location.hash) {\n if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;\n } else {\n location.hash = '';\n }\n\n if (state !== undefined && location.state === undefined) location.state = state;\n }\n\n try {\n location.pathname = decodeURI(location.pathname);\n } catch (e) {\n if (e instanceof URIError) {\n throw new URIError('Pathname \"' + location.pathname + '\" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');\n } else {\n throw e;\n }\n }\n\n if (key) location.key = key;\n\n if (currentLocation) {\n // Resolve incomplete/relative pathname relative to current location.\n if (!location.pathname) {\n location.pathname = currentLocation.pathname;\n } else if (location.pathname.charAt(0) !== '/') {\n location.pathname = (0, _resolvePathname2.default)(location.pathname, currentLocation.pathname);\n }\n } else {\n // When there is no prior location and pathname is empty, set it to /\n if (!location.pathname) {\n location.pathname = '/';\n }\n }\n\n return location;\n};\n\nvar locationsAreEqual = exports.locationsAreEqual = function locationsAreEqual(a, b) {\n return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && (0, _valueEqual2.default)(a.state, b.state);\n};","'use strict';\n\nexports.__esModule = true;\nvar addLeadingSlash = exports.addLeadingSlash = function addLeadingSlash(path) {\n return path.charAt(0) === '/' ? path : '/' + path;\n};\n\nvar stripLeadingSlash = exports.stripLeadingSlash = function stripLeadingSlash(path) {\n return path.charAt(0) === '/' ? path.substr(1) : path;\n};\n\nvar hasBasename = exports.hasBasename = function hasBasename(path, prefix) {\n return new RegExp('^' + prefix + '(\\\\/|\\\\?|#|$)', 'i').test(path);\n};\n\nvar stripBasename = exports.stripBasename = function stripBasename(path, prefix) {\n return hasBasename(path, prefix) ? path.substr(prefix.length) : path;\n};\n\nvar stripTrailingSlash = exports.stripTrailingSlash = function stripTrailingSlash(path) {\n return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;\n};\n\nvar parsePath = exports.parsePath = function parsePath(path) {\n var pathname = path || '/';\n var search = '';\n var hash = '';\n\n var hashIndex = pathname.indexOf('#');\n if (hashIndex !== -1) {\n hash = pathname.substr(hashIndex);\n pathname = pathname.substr(0, hashIndex);\n }\n\n var searchIndex = pathname.indexOf('?');\n if (searchIndex !== -1) {\n search = pathname.substr(searchIndex);\n pathname = pathname.substr(0, searchIndex);\n }\n\n return {\n pathname: pathname,\n search: search === '?' ? '' : search,\n hash: hash === '#' ? '' : hash\n };\n};\n\nvar createPath = exports.createPath = function createPath(location) {\n var pathname = location.pathname,\n search = location.search,\n hash = location.hash;\n\n\n var path = pathname || '/';\n\n if (search && search !== '?') path += search.charAt(0) === '?' ? search : '?' + search;\n\n if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : '#' + hash;\n\n return path;\n};","'use strict';\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _invariant = require('invariant');\n\nvar _invariant2 = _interopRequireDefault(_invariant);\n\nvar _LocationUtils = require('./LocationUtils');\n\nvar _PathUtils = require('./PathUtils');\n\nvar _createTransitionManager = require('./createTransitionManager');\n\nvar _createTransitionManager2 = _interopRequireDefault(_createTransitionManager);\n\nvar _DOMUtils = require('./DOMUtils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar HashChangeEvent = 'hashchange';\n\nvar HashPathCoders = {\n hashbang: {\n encodePath: function encodePath(path) {\n return path.charAt(0) === '!' ? path : '!/' + (0, _PathUtils.stripLeadingSlash)(path);\n },\n decodePath: function decodePath(path) {\n return path.charAt(0) === '!' ? path.substr(1) : path;\n }\n },\n noslash: {\n encodePath: _PathUtils.stripLeadingSlash,\n decodePath: _PathUtils.addLeadingSlash\n },\n slash: {\n encodePath: _PathUtils.addLeadingSlash,\n decodePath: _PathUtils.addLeadingSlash\n }\n};\n\nvar getHashPath = function getHashPath() {\n // We can't use window.location.hash here because it's not\n // consistent across browsers - Firefox will pre-decode it!\n var href = window.location.href;\n var hashIndex = href.indexOf('#');\n return hashIndex === -1 ? '' : href.substring(hashIndex + 1);\n};\n\nvar pushHashPath = function pushHashPath(path) {\n return window.location.hash = path;\n};\n\nvar replaceHashPath = function replaceHashPath(path) {\n var hashIndex = window.location.href.indexOf('#');\n\n window.location.replace(window.location.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + '#' + path);\n};\n\nvar createHashHistory = function createHashHistory() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n (0, _invariant2.default)(_DOMUtils.canUseDOM, 'Hash history needs a DOM');\n\n var globalHistory = window.history;\n var canGoWithoutReload = (0, _DOMUtils.supportsGoWithoutReloadUsingHash)();\n\n var _props$getUserConfirm = props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === undefined ? _DOMUtils.getConfirmation : _props$getUserConfirm,\n _props$hashType = props.hashType,\n hashType = _props$hashType === undefined ? 'slash' : _props$hashType;\n\n var basename = props.basename ? (0, _PathUtils.stripTrailingSlash)((0, _PathUtils.addLeadingSlash)(props.basename)) : '';\n\n var _HashPathCoders$hashT = HashPathCoders[hashType],\n encodePath = _HashPathCoders$hashT.encodePath,\n decodePath = _HashPathCoders$hashT.decodePath;\n\n\n var getDOMLocation = function getDOMLocation() {\n var path = decodePath(getHashPath());\n\n (0, _warning2.default)(!basename || (0, _PathUtils.hasBasename)(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".');\n\n if (basename) path = (0, _PathUtils.stripBasename)(path, basename);\n\n return (0, _LocationUtils.createLocation)(path);\n };\n\n var transitionManager = (0, _createTransitionManager2.default)();\n\n var setState = function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n\n transitionManager.notifyListeners(history.location, history.action);\n };\n\n var forceNextPop = false;\n var ignorePath = null;\n\n var handleHashChange = function handleHashChange() {\n var path = getHashPath();\n var encodedPath = encodePath(path);\n\n if (path !== encodedPath) {\n // Ensure we always have a properly-encoded hash.\n replaceHashPath(encodedPath);\n } else {\n var location = getDOMLocation();\n var prevLocation = history.location;\n\n if (!forceNextPop && (0, _LocationUtils.locationsAreEqual)(prevLocation, location)) return; // A hashchange doesn't always == location change.\n\n if (ignorePath === (0, _PathUtils.createPath)(location)) return; // Ignore this change; we already setState in push/replace.\n\n ignorePath = null;\n\n handlePop(location);\n }\n };\n\n var handlePop = function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({ action: action, location: location });\n } else {\n revertPop(location);\n }\n });\n }\n };\n\n var revertPop = function revertPop(fromLocation) {\n var toLocation = history.location;\n\n // TODO: We could probably make this more reliable by\n // keeping a list of paths we've seen in sessionStorage.\n // Instead, we just default to 0 for paths we don't know.\n\n var toIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(toLocation));\n\n if (toIndex === -1) toIndex = 0;\n\n var fromIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(fromLocation));\n\n if (fromIndex === -1) fromIndex = 0;\n\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n };\n\n // Ensure the hash is encoded properly before doing anything else.\n var path = getHashPath();\n var encodedPath = encodePath(path);\n\n if (path !== encodedPath) replaceHashPath(encodedPath);\n\n var initialLocation = getDOMLocation();\n var allPaths = [(0, _PathUtils.createPath)(initialLocation)];\n\n // Public interface\n\n var createHref = function createHref(location) {\n return '#' + encodePath(basename + (0, _PathUtils.createPath)(location));\n };\n\n var push = function push(path, state) {\n (0, _warning2.default)(state === undefined, 'Hash history cannot push state; it is ignored');\n\n var action = 'PUSH';\n var location = (0, _LocationUtils.createLocation)(path, undefined, undefined, history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var path = (0, _PathUtils.createPath)(location);\n var encodedPath = encodePath(basename + path);\n var hashChanged = getHashPath() !== encodedPath;\n\n if (hashChanged) {\n // We cannot tell if a hashchange was caused by a PUSH, so we'd\n // rather setState here and ignore the hashchange. The caveat here\n // is that other hash histories in the page will consider it a POP.\n ignorePath = path;\n pushHashPath(encodedPath);\n\n var prevIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(history.location));\n var nextPaths = allPaths.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n\n nextPaths.push(path);\n allPaths = nextPaths;\n\n setState({ action: action, location: location });\n } else {\n (0, _warning2.default)(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack');\n\n setState();\n }\n });\n };\n\n var replace = function replace(path, state) {\n (0, _warning2.default)(state === undefined, 'Hash history cannot replace state; it is ignored');\n\n var action = 'REPLACE';\n var location = (0, _LocationUtils.createLocation)(path, undefined, undefined, history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var path = (0, _PathUtils.createPath)(location);\n var encodedPath = encodePath(basename + path);\n var hashChanged = getHashPath() !== encodedPath;\n\n if (hashChanged) {\n // We cannot tell if a hashchange was caused by a REPLACE, so we'd\n // rather setState here and ignore the hashchange. The caveat here\n // is that other hash histories in the page will consider it a POP.\n ignorePath = path;\n replaceHashPath(encodedPath);\n }\n\n var prevIndex = allPaths.indexOf((0, _PathUtils.createPath)(history.location));\n\n if (prevIndex !== -1) allPaths[prevIndex] = path;\n\n setState({ action: action, location: location });\n });\n };\n\n var go = function go(n) {\n (0, _warning2.default)(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser');\n\n globalHistory.go(n);\n };\n\n var goBack = function goBack() {\n return go(-1);\n };\n\n var goForward = function goForward() {\n return go(1);\n };\n\n var listenerCount = 0;\n\n var checkDOMListeners = function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1) {\n (0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n (0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange);\n }\n };\n\n var isBlocked = false;\n\n var block = function block() {\n var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n };\n\n var listen = function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n };\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n\n return history;\n};\n\nexports.default = createHashHistory;","'use strict';\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _PathUtils = require('./PathUtils');\n\nvar _LocationUtils = require('./LocationUtils');\n\nvar _createTransitionManager = require('./createTransitionManager');\n\nvar _createTransitionManager2 = _interopRequireDefault(_createTransitionManager);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar clamp = function clamp(n, lowerBound, upperBound) {\n return Math.min(Math.max(n, lowerBound), upperBound);\n};\n\n/**\n * Creates a history object that stores locations in memory.\n */\nvar createMemoryHistory = function createMemoryHistory() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var getUserConfirmation = props.getUserConfirmation,\n _props$initialEntries = props.initialEntries,\n initialEntries = _props$initialEntries === undefined ? ['/'] : _props$initialEntries,\n _props$initialIndex = props.initialIndex,\n initialIndex = _props$initialIndex === undefined ? 0 : _props$initialIndex,\n _props$keyLength = props.keyLength,\n keyLength = _props$keyLength === undefined ? 6 : _props$keyLength;\n\n\n var transitionManager = (0, _createTransitionManager2.default)();\n\n var setState = function setState(nextState) {\n _extends(history, nextState);\n\n history.length = history.entries.length;\n\n transitionManager.notifyListeners(history.location, history.action);\n };\n\n var createKey = function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n };\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? (0, _LocationUtils.createLocation)(entry, undefined, createKey()) : (0, _LocationUtils.createLocation)(entry, undefined, entry.key || createKey());\n });\n\n // Public interface\n\n var createHref = _PathUtils.createPath;\n\n var push = function push(path, state) {\n (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n\n var action = 'PUSH';\n var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n\n var nextEntries = history.entries.slice(0);\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n };\n\n var replace = function replace(path, state) {\n (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n\n var action = 'REPLACE';\n var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n history.entries[history.index] = location;\n\n setState({ action: action, location: location });\n });\n };\n\n var go = function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n\n var action = 'POP';\n var location = history.entries[nextIndex];\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n };\n\n var goBack = function goBack() {\n return go(-1);\n };\n\n var goForward = function goForward() {\n return go(1);\n };\n\n var canGo = function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n };\n\n var block = function block() {\n var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n return transitionManager.setPrompt(prompt);\n };\n\n var listen = function listen(listener) {\n return transitionManager.appendListener(listener);\n };\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n\n return history;\n};\n\nexports.default = createMemoryHistory;","'use strict';\n\nexports.__esModule = true;\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar createTransitionManager = function createTransitionManager() {\n var prompt = null;\n\n var setPrompt = function setPrompt(nextPrompt) {\n (0, _warning2.default)(prompt == null, 'A history supports only one prompt at a time');\n\n prompt = nextPrompt;\n\n return function () {\n if (prompt === nextPrompt) prompt = null;\n };\n };\n\n var confirmTransitionTo = function confirmTransitionTo(location, action, getUserConfirmation, callback) {\n // TODO: If another transition starts while we're still confirming\n // the previous one, we may end up in a weird state. Figure out the\n // best way to handle this.\n if (prompt != null) {\n var result = typeof prompt === 'function' ? prompt(location, action) : prompt;\n\n if (typeof result === 'string') {\n if (typeof getUserConfirmation === 'function') {\n getUserConfirmation(result, callback);\n } else {\n (0, _warning2.default)(false, 'A history needs a getUserConfirmation function in order to use a prompt message');\n\n callback(true);\n }\n } else {\n // Return false from a transition hook to cancel the transition.\n callback(result !== false);\n }\n } else {\n callback(true);\n }\n };\n\n var listeners = [];\n\n var appendListener = function appendListener(fn) {\n var isActive = true;\n\n var listener = function listener() {\n if (isActive) fn.apply(undefined, arguments);\n };\n\n listeners.push(listener);\n\n return function () {\n isActive = false;\n listeners = listeners.filter(function (item) {\n return item !== listener;\n });\n };\n };\n\n var notifyListeners = function notifyListeners() {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n listeners.forEach(function (listener) {\n return listener.apply(undefined, args);\n });\n };\n\n return {\n setPrompt: setPrompt,\n confirmTransitionTo: confirmTransitionTo,\n appendListener: appendListener,\n notifyListeners: notifyListeners\n };\n};\n\nexports.default = createTransitionManager;"],"sourceRoot":""}