tocco-admin 1.0.41 → 1.0.44

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 (47) hide show
  1. package/changelog.md +10 -0
  2. package/dist/chunk-143.07fb6e3ab17c62d06e0e.js +2 -0
  3. package/dist/chunk-143.07fb6e3ab17c62d06e0e.js.map +1 -0
  4. package/dist/chunk-18.e1b24b703c97426d790a.js +2 -0
  5. package/dist/chunk-18.e1b24b703c97426d790a.js.map +1 -0
  6. package/dist/{chunk-383.4481cc99771c55a933c8.js → chunk-383.3bea29cae95f2d47b418.js} +2 -1
  7. package/dist/chunk-383.3bea29cae95f2d47b418.js.map +1 -0
  8. package/dist/chunk-399.355bc76f23887d9a37b3.js +2 -0
  9. package/dist/chunk-399.355bc76f23887d9a37b3.js.map +1 -0
  10. package/dist/chunk-44.bf59c78f5a5d21755958.js +2 -0
  11. package/dist/chunk-44.bf59c78f5a5d21755958.js.map +1 -0
  12. package/dist/chunk-611.26848ba322eb3c41ce8b.js +8 -0
  13. package/dist/chunk-611.26848ba322eb3c41ce8b.js.map +1 -0
  14. package/dist/chunk-633.9552786aee4e7f99f623.js +15 -0
  15. package/dist/chunk-633.9552786aee4e7f99f623.js.map +1 -0
  16. package/dist/{chunk-701.f889b987b306d1385fea.js → chunk-701.8b1211e0545b404ca702.js} +4 -3
  17. package/dist/chunk-701.8b1211e0545b404ca702.js.map +1 -0
  18. package/dist/chunk-813.4998affef210c5dbd815.js +46 -0
  19. package/dist/chunk-813.4998affef210c5dbd815.js.map +1 -0
  20. package/dist/{chunk-884.0b5eb6e714183df75751.js → chunk-884.ce155145c201a7fd4e8b.js} +2 -1
  21. package/dist/chunk-884.ce155145c201a7fd4e8b.js.map +1 -0
  22. package/dist/chunk-949.505f8d4e1df3d922358f.js +2 -0
  23. package/dist/chunk-949.505f8d4e1df3d922358f.js.map +1 -0
  24. package/dist/chunk-actions.218163a53759832011b1.js +2 -0
  25. package/dist/chunk-actions.218163a53759832011b1.js.map +1 -0
  26. package/dist/chunk-code-editor.5079bb8da3a832f77b2c.js +2 -0
  27. package/dist/chunk-code-editor.5079bb8da3a832f77b2c.js.map +1 -0
  28. package/dist/chunk-phone-formatter.9a315c77d97352ad918e.js +2 -0
  29. package/dist/chunk-phone-formatter.9a315c77d97352ad918e.js.map +1 -0
  30. package/dist/{chunk-vendor-fontawesome.59c67cc6e8cf4d762bb7.js → chunk-vendor-fontawesome.372a6bb756adfb917a41.js} +2 -2
  31. package/dist/chunk-vendor-icons.5c5ab8af221c75ca9bc9.js +1 -0
  32. package/dist/{chunk-vendor-quill.ddf2e2c68559be7ed070.js → chunk-vendor-quill.1d9f8692d353d9f469ed.js} +3 -3
  33. package/dist/index.js +12 -11
  34. package/dist/index.js.map +1 -0
  35. package/package.json +1 -1
  36. package/dist/chunk-143.39af604d9af22d8b4513.js +0 -1
  37. package/dist/chunk-44.3b929811214b0276c5eb.js +0 -1
  38. package/dist/chunk-489.8ef0a71673bfba55c26d.js +0 -1
  39. package/dist/chunk-498.b77ca77c31c09ef8c750.js +0 -45
  40. package/dist/chunk-545.1e08f075dba19cb052f8.js +0 -1
  41. package/dist/chunk-611.b4dcaf300768f3d73431.js +0 -13
  42. package/dist/chunk-682.63d76a78144769a58a04.js +0 -9
  43. package/dist/chunk-949.e403ce6c9a0f3b9f0503.js +0 -1
  44. package/dist/chunk-actions.5b629c0c74503f03cd88.js +0 -1
  45. package/dist/chunk-code-editor.d01e84325bc39afb5f1c.js +0 -1
  46. package/dist/chunk-phone-formatter.ade5abe6f90ce2c3f4e9.js +0 -1
  47. package/dist/chunk-vendor-icons.057b7e430d6e2e1dbe4b.js +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack:///./packages/apps/admin/src/routes/entities/modules/path/actions.js","webpack:///./packages/apps/admin/src/routes/entities/components/Action/LazyAction.js","webpack:///./packages/apps/admin/src/routes/entities/components/ActionView/ActionView.js","webpack:///./packages/apps/admin/src/routes/entities/components/ActionView/ActionViewContainer.js","webpack:///./packages/apps/admin/src/routes/entities/components/CreateView/CreateView.js","webpack:///./packages/apps/admin/src/routes/entities/components/CreateView/CreateViewContainer.js","webpack:///./packages/apps/admin/src/routes/entities/components/DocsView/DocsView.js","webpack:///./packages/apps/admin/src/routes/entities/components/DocsView/index.js","webpack:///./packages/apps/admin/src/routes/entities/components/ListView/DocsViewAdapter.js","webpack:///./packages/apps/admin/src/routes/entities/components/ListView/ListView.js","webpack:///./packages/apps/admin/src/routes/entities/components/ListView/ListViewContainer.js","webpack:///./packages/apps/admin/src/routes/entities/components/EditView/EditView.js","webpack:///./packages/apps/admin/src/routes/entities/components/EditView/EditViewContainer.js","webpack:///./packages/apps/admin/src/routes/entities/utils/relationPersistor.js","webpack:///./packages/apps/admin/src/routes/entities/components/RelationsView/DocsViewAdapter.js","webpack:///./packages/apps/admin/src/routes/entities/components/RelationsView/ListView.js","webpack:///./packages/apps/admin/src/routes/entities/components/RelationsView/StyledComponents.js","webpack:///./packages/apps/admin/src/routes/entities/components/RelationsView/RelationBox.js","webpack:///./packages/apps/admin/src/routes/entities/components/RelationsView/RelationsView.js","webpack:///./packages/apps/admin/src/routes/entities/components/RelationsView/RelationViewContainer.js","webpack:///./packages/apps/admin/src/routes/entities/components/RelationsView/index.js","webpack:///./packages/apps/admin/src/routes/entities/components/DetailView/StyledComponents.js","webpack:///./packages/apps/admin/src/routes/entities/components/DetailView/DetailView.js","webpack:///./packages/apps/admin/src/routes/entities/components/DetailView/DetaiViewContainer.js","webpack:///./packages/apps/admin/src/routes/entities/components/EntityRecordRoute/EntityRecordRoute.js","webpack:///./packages/apps/admin/src/routes/entities/components/EntityRecordRoute/index.js","webpack:///./packages/apps/admin/src/routes/entities/components/EntityRoute/EntityRoute.js","webpack:///./packages/apps/admin/src/routes/entities/components/EntityRoute/index.js","webpack:///./packages/apps/admin/src/routes/entities/components/EntitiesOverview/EntitiesOverview.js","webpack:///./packages/apps/admin/src/routes/entities/components/EntitiesOverview/index.js","webpack:///./packages/apps/admin/src/routes/entities/components/Breadcrumbs/BreadcrumbsContainer.js","webpack:///./packages/apps/admin/src/routes/entities/components/ErrorView/EntityErrorView.js","webpack:///./packages/apps/admin/src/routes/entities/components/ErrorView/ErrorViewContainer.js","webpack:///./packages/apps/admin/src/routes/entities/components/EntitiesRoute/EntitiesRoute.js","webpack:///./packages/apps/admin/src/routes/entities/components/EntitiesRoute/EntitiesRouteContainer.js","webpack:///./packages/apps/admin/src/routes/entities/components/EntitiesRoute/index.js","webpack:///./packages/apps/admin/src/routes/entities/modules/path/reducer.js","webpack:///./packages/apps/admin/src/routes/entities/utils/url.js","webpack:///./packages/apps/admin/src/routes/entities/modules/path/sagas.js","webpack:///./packages/apps/admin/src/routes/entities/modules/path/index.js","webpack:///./packages/apps/admin/src/routes/entities/route.js","webpack:///./packages/core/app-extensions/src/display/functions.js","webpack:///./packages/core/app-extensions/src/display/index.js","webpack:///./node_modules/redux-form/es/getFormInitialValues.js","webpack:///./node_modules/redux-form/es/selectors/getFormInitialValues.js","webpack:///./packages/core/entity-detail/src/util/modes.js","webpack:///./packages/core/entity-detail/src/util/detailFooter/types.js","webpack:///./packages/core/entity-detail/src/util/detailFooter/helpers.js","webpack:///./packages/core/entity-detail/src/components/DetailFooter/StyledComponents.js","webpack:///./packages/core/entity-detail/src/components/DetailFooter/FooterItem.js","webpack:///./packages/core/entity-detail/src/components/DetailFooter/TextValue.js","webpack:///./packages/core/entity-detail/src/components/DetailFooter/TimestampValue.js","webpack:///./packages/core/entity-detail/src/components/DetailFooter/DetailFooterFull.js","webpack:///./packages/core/entity-detail/src/components/DetailFooter/DetailFooterReduced.js","webpack:///./packages/core/entity-detail/src/components/DetailFooter/DetailFooter.js","webpack:///./packages/core/entity-detail/src/containers/DetailFooterContainer.js","webpack:///./packages/core/entity-detail/src/components/SubGrid/SubGrid.js","webpack:///./packages/core/entity-detail/src/components/SubGrid/index.js","webpack:///./packages/core/entity-detail/src/modules/entityDetail/actions.js","webpack:///./packages/core/entity-detail/src/containers/SubGridContainer.js","webpack:///./packages/core/entity-detail/src/util/detailView/fromFieldFactories/subGrid.js","webpack:///./packages/core/entity-detail/src/components/ErrorItems/ErrorItems.js","webpack:///./packages/core/entity-detail/src/components/ErrorItems/index.js","webpack:///./packages/core/entity-detail/src/components/Actions/StyledComponents.js","webpack:///./packages/core/entity-detail/src/components/Actions/SaveButton.js","webpack:///./packages/core/entity-detail/src/components/Actions/MarkButton.js","webpack:///./packages/core/entity-detail/src/components/DetailForm/StyledComponents.js","webpack:///./packages/core/entity-detail/src/components/DetailForm/DetailForm.js","webpack:///./packages/core/entity-detail/src/containers/DetailFormContainer.js","webpack:///./packages/core/entity-detail/src/components/DetailView/DetailView.js","webpack:///./packages/core/entity-detail/src/containers/DetailViewContainer.js","webpack:///./packages/core/entity-detail/src/customActions.js","webpack:///./packages/core/entity-detail/src/input.js","webpack:///./packages/core/entity-detail/src/modules/entityDetail/reducer.js","webpack:///./packages/core/entity-detail/src/modules/entityDetail/index.js","webpack:///./packages/core/entity-detail/src/util/api/entities.js","webpack:///./packages/core/entity-detail/src/modules/entityDetail/sagas.js","webpack:///./packages/core/entity-detail/src/modules/reducers.js","webpack:///./packages/core/entity-detail/src/shortcuts.js","webpack:///./packages/core/entity-detail/src/main.js"],"names":["SET_CURRENT_VIEW_INFO","LOAD_CURRENT_ROUTE","SET_BREADCRUMBS_INFO","UPDATE_BREADCRUMBS_INFO","SET_RELATIONS","SET_CURRENT_VIEW_TITLE","SET_RELATIONS_INFO","PROPAGATE_REFRESH","INVALIDATE_LAST_BREADCRUMB","SELECT_RELATION","setCurrentViewInfo","location","currentViewInfo","type","payload","updateBreadcrumbsInfo","path","breadcrumbsInfo","setRelations","relations","setRelationsInfo","relationsInfo","selectRelation","selectedRelation","actions","lazy","resourcescheduler","delete","merge","copy","documents","export","props","appId","LazyAction","consoleLogger","ActionComponent","connect","emitAction","action","actionEmitter","Suspense","fallback","LoadMask","ActionView","history","match","setCurrentViewTitle","intl","useEffect","formatMessage","id","actionId","queryParams","queryStringUtil","search","selection","_get","actionProperties","navigateBack","replace","goBack","url","navigationStrategy","onSuccess","onError","onCancel","areEqual","prevProps","nextProps","Object","keys","js","length","React","mapActionCreators","currentViewTitle","state","entities","currentViewInfos","pathname","injectIntl","StyledEntityDetailAppWrapper","styled","theme","scale","chooseDocument","dispatchEmittedAction","stateDefaultValues","useState","touched","setTouched","model","reverseRelation","parentKey","entityName","name","isMultiReverseRelation","defaultValues","value","when","message","formName","mode","onEntityCreated","push","onTouchedChange","CreateView","entityKey","showActions","noLeftPadding","openResource","initialLocation","folderKey","setFolderKey","fetchFolder","useCallback","rest","then","res","body","key","routerType","sortable","searchFormType","rootNodes","embedded","selectionStyle","disableViewPersistor","scrollBehaviour","parentModel","searchFormCollapsed","saveUserPreferences","queryString","hash","substring","limit","onRowClick","parent","reverseRelationName","showLink","searchFormPosition","store","viewPersistor","onStoreCreate","level","actionAppComponent","Action","tql","onSearchFormCollapsedChange","collapsed","preferences","userPreferences","ListView","propagateRefresh","invalidateLastBreadcrumb","queryFormName","entityId","navigateToCreateRelative","relationName","entityBaseUrl","onEntityDeleted","onEntityUpdated","onRefresh","onSubGridRowClick","EditView","selectedRelations","targetEntity","onNavigateToCreate","StyledRelationsViewWrapper","isCollapsed","StyledPlaceHolder","StyledToggleCollapse","StyledToggleCollapseButton","Button","StyledPreviewBox","StyledRelationBoxes","StyledScrollbar","StyledPreviewLink","StyledLink","StyledRelationLinks","StyledRelationBox","selected","StyledRelationLabel","StyledSpan","relation","relationDisplay","msg","onClick","entity","setRelation","title","label","count","to","icon","createPermission","RelationsView","toggleCollapse","updateSelectedRelation","queryRelation","find","r","persistedSelectedRelation","RelationPreview","DocsViewAdapter","RelationBoxes","map","Typography","StyledDetailViewContainer","StyledDetailViewLeft","StyledDetailViewRight","relationViewCollapsed","setIsCollapsed","DetailView","str","word","split","exact","render","component","Detail","Edit","Relations","Entity","List","Create","Record","pathPrefix","currentView","display","Breadcrumbs","prefix","description","error","ErrorView","values","EntityErrorView","StyledWrapper","StyledContent","StyledBreadcrumbs","loadCurrentRoute","content","Overview","EntitiesRoute","ACTION_HANDLERS","reducerUtil","info","initialState","getPathInfo","entityParams","route","actionParams","mainSagas","loadRoute","updateCurrentViewInfo","loadRouteInfo","initMultiRelations","reloadRelationsInfo","getLastBreadcrumbsPath","getLastEntityInPath","loadRelationInfos","entitiesPathSelector","relationPathRegex","all","takeLatest","call","routeInfo","spawn","deriveCurrentViewInfo","put","deriveBreadcrumbs","breadcrumbs","routeInfos","baseModel","splittedRelation","i","relationStringPart","paths","relationModel","view","lastEntry","_omit","filter","e","_pickBy","show","relationsTransformed","k","_pick","sort","a","b","order","select","lastEntity","breadcrumbsPath","Boolean","join","splittedEntities","resource","relationInfoResponse","handler","container","reducers","combineReducers","sagas","enhanceEntityWithDisplayExpressions","loadDisplayExpressions","enhanceEntityWithDisplays","loadRelationDisplays","fieldDefinitions","displayExpressions","f","componentType","displayExpressionsL","__key","forEach","dE","__model","relationFields","api","dataType","displays","relationField","Array","isArray","v","v2","request","_ref","plain","getIn","form","getFormState","nonNullGetFormState","NONE","REDUCED","FULL","getFooterType","entityModel","useNiceFields","modes","types","getFooterPaths","keyField","StyledFooterWrapper","colorizeText","StyledFooterItemWrapper","StyledFooterItemLabel","declareNoneWrappingText","StyledFooterItemValue","StyledTimestampValueWrapper","StyledTimestampRelativeValue","labelId","ValueComp","valueComponent","selectUnit","Date","diffValue","unit","FormattedValue","create_timestamp","create_user","update_timestamp","update_user","version","entityDetail","DetailFooter","StyledListApp","SubGrid","formBase","detailFormName","formField","showSearchForm","gridName","navigateToCreate","tableMinHeight","locale","defaultProps","SET_FORM_DEFINITION","LOAD_DETAIL_VIEW","SET_ENTITY","SUBMIT_FORM","SET_LAST_SAVE","SET_ENTITY_MODEL","UNLOAD_DETAIL_VIEW","FIRE_TOUCHED","SET_TOUCHED","SET_ENTITY_NAME","SET_ENTITY_ID","SET_MODE","SET_FORM_NAME","SET_APP_ID","TOUCH_ALL_FIELDS","SET_DEFAULT_VALUES","NAVIGATE_TO_CREATE","SET_FIELD_DEFINITIONS","NAVIGATE_TO_ACTION","UPDATE_MARKED","SET_MARKED","setFormDefinition","formDefinition","loadDetailView","modelPaths","setEntity","submitForm","setLastSave","lastSave","now","setEntityModel","unloadDetailView","setFieldDefinitions","navigateToAction","definition","setMarked","marked","externalEvents","input","SubGridContainer","undefined","StyledErrorItemWrapper","formErrors","output","elements","hasFieldErrors","hasValidatorErrors","hasRelatedEntityErrors","validatorErrors","relatedEntityErrorsCompact","outdatedError","updateTimestamp","timeStampValue","titleId","sameEntity","ago","user","updateUser","idx","el","StyledSaveButton","hasErrors","StyledActionSpan","colors","secondary","submitting","Popover","placement","disabled","ink","look","pending","updateMarked","mouseOver","setMouseOver","stopPropagation","onMouseEnter","onMouseLeave","StyledForm","reduxForm","destroyOnUnmount","fireTouched","dirty","valid","formValues","anyTouched","formEl","useRef","customHooks","formEventProps","customRenderedActions","useMemo","save","actionDefinition","mark","embedType","env","ref","fieldMappingType","readOnly","componentMapping","DetailFooterContainer","logError","errorLogging","getFormValues","formInitialValues","getFormInitialValues","DetailForm","handleAsyncValidate","handleAyncValidate","fieldDefinitionPaths","fD","required","loadingText","DetailFormContainer","validate","asyncValidate","asyncBlurFields","new","fullscreen","getDispatchActions","actionSettings","argsFactory","updateEntity","createEntity","options","method","_paths","acceptedErrorCodes","acceptedStatusCodes","resp","errorCode","SubmissionError","errors","status","information","headers","get","pop","Error","loadDetailFormDefinition","loadEntity","loadEntityModel","updateFormSubmit","createFormSubmit","submitValidate","showNotification","loadData","loadMarked","reloadAfterAction","remoteEvent","entityDetailSelector","inputSelector","FORM_ID","formSagaConfig","formId","stateSelector","takeEvery","remoteEvents","actionExtensions","modifyFormDefinition","modifiedFormDefinition","formPaths","footerPaths","formActions","formDefaultValues","inputDefaultValues","defaultValuesFields","flattenEntity","createdEntityId","initialValues","isValidSelector","actionTouched","stateTouched","titleResourceName","messageResourceName","notification","reset","markable","fork","keepDirty","keepValues","navigateToActionRelative","isCurrentEntity","event","func","args","entityDetailReducer","entityDetailSagas","ctrl","alt","code","packageName","EXTERNAL_EVENTS","initApp","events","publicPath","DetailViewContainer","appFactory","formApp","SimpleFormApp","listApp","EntityListApp","customActions","appComponent","context","viewName","formData","detailApp","EntityDetailApp","keyDown","shortcuts","app","textResourceModules","propTypes","PropTypes","reduce"],"mappings":"gLAAaA,EAAwB,6BACxBC,EAAqB,0BACrBC,EAAuB,4BACvBC,EAA0B,+BAC1BC,EAAgB,qBAChBC,EAAyB,8BACzBC,EAAqB,0BACrBC,EAAoB,yBACpBC,EAA6B,kCAC7BC,EAAkB,uBAElBC,EAAqB,SAACC,EAAUC,GAAX,MAAgC,CAChEC,KAAMb,EACNc,QAAS,CACPH,WACAC,qBAkBSG,EAAwB,SAACC,EAAMC,GAAP,MAA4B,CAC/DJ,KAAMV,EACNW,QAAS,CACPE,OACAC,qBAISC,EAAe,SAAAC,GAAS,MAAK,CACxCN,KAAMT,EACNU,QAAS,CACPK,eAWSC,EAAmB,SAAAC,GAAa,MAAK,CAChDR,KAAMP,EACNQ,QAAS,CACPO,mBAkBSC,EAAiB,SAAAC,GAAgB,MAAK,CACjDV,KAAMJ,EACNK,QAAS,CACPS,sB,wwBCxEJ,IAAMC,EAAU,CACd,oBAAoBC,WAAK,kBAAM,kEAC/B,kBAAkBA,WAAK,kBAAM,kEAC7B,cAAcA,WAAK,kBAAM,kEACzBC,mBAAmBD,WAAK,kBAAM,gEAC9B,2BAA2BA,WAAK,kBAAM,kEACtCE,QAAQF,WAAK,kBAAM,kEACnBG,OAAOH,WAAK,kBAAM,kEAClBI,MAAMJ,WAAK,kBAAM,kEACjB,iBAAiBA,WAAK,kBAAM,kEAC5BK,WAAWL,WAAK,kBAAM,kEACtB,mBAAmBA,WAAK,kBAAM,kEAC9B,sBAAsBA,WAAK,kBAAM,kEACjC,qBAAqBA,WAAK,kBAAM,kEAChCM,QAAQN,WAAK,kBAAM,m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,cACpBuB,eAAgB6f,SAChBjc,mBAAoBic,SACpBvD,qBAAsBuD,WAGxB","file":"chunk-383.3bea29cae95f2d47b418.js","sourcesContent":["export const SET_CURRENT_VIEW_INFO = 'path/SET_CURRENT_VIEW_INFO'\nexport const LOAD_CURRENT_ROUTE = 'path/LOAD_CURRENT_ROUTE'\nexport const SET_BREADCRUMBS_INFO = 'path/SET_BREADCRUMBS_INFO'\nexport const UPDATE_BREADCRUMBS_INFO = 'path/UPDATE_BREADCRUMBS_INFO'\nexport const SET_RELATIONS = 'path/SET_RELATIONS'\nexport const SET_CURRENT_VIEW_TITLE = 'path/SET_CURRENT_VIEW_TITLE'\nexport const SET_RELATIONS_INFO = 'path/SET_RELATIONS_INFO'\nexport const PROPAGATE_REFRESH = 'path/PROPAGATE_REFRESH'\nexport const INVALIDATE_LAST_BREADCRUMB = 'path/INVALIDATE_LAST_BREADCRUMB'\nexport const SELECT_RELATION = 'path/SELECT_RELATION'\n\nexport const setCurrentViewInfo = (location, currentViewInfo) => ({\n type: SET_CURRENT_VIEW_INFO,\n payload: {\n location,\n currentViewInfo\n }\n})\n\nexport const loadCurrentRoute = location => ({\n type: LOAD_CURRENT_ROUTE,\n payload: {\n location\n }\n})\n\nexport const setBreadcrumbsInfo = breadcrumbsInfo => ({\n type: SET_BREADCRUMBS_INFO,\n payload: {\n breadcrumbsInfo\n }\n})\n\nexport const updateBreadcrumbsInfo = (path, breadcrumbsInfo) => ({\n type: UPDATE_BREADCRUMBS_INFO,\n payload: {\n path,\n breadcrumbsInfo\n }\n})\n\nexport const setRelations = relations => ({\n type: SET_RELATIONS,\n payload: {\n relations\n }\n})\n\nexport const setCurrentViewTitle = currentViewTitle => ({\n type: SET_CURRENT_VIEW_TITLE,\n payload: {\n currentViewTitle\n }\n})\n\nexport const setRelationsInfo = relationsInfo => ({\n type: SET_RELATIONS_INFO,\n payload: {\n relationsInfo\n }\n})\n\nexport const propagateRefresh = location => ({\n type: PROPAGATE_REFRESH,\n payload: {\n location\n }\n})\n\nexport const invalidateLastBreadcrumb = location => ({\n type: INVALIDATE_LAST_BREADCRUMB,\n payload: {\n location\n }\n})\n\nexport const selectRelation = selectedRelation => ({\n type: SELECT_RELATION,\n payload: {\n selectedRelation\n }\n})\n","import PropTypes from 'prop-types'\nimport {lazy, Suspense} from 'react'\nimport {connect} from 'react-redux'\nimport {actionEmitter} from 'tocco-app-extensions'\nimport {LoadMask} from 'tocco-ui'\nimport {consoleLogger} from 'tocco-util'\n\nconst actions = {\n 'widget-code-copy': lazy(() => import(/* webpackChunkName: \"actions\" */ './actions/WidgetCodeCopy')),\n 'user-qr-action': lazy(() => import(/* webpackChunkName: \"actions\" */ './actions/UserQrAction')),\n 'input-edit': lazy(() => import(/* webpackChunkName: \"actions\" */ './actions/InputEdit')),\n resourcescheduler: lazy(() => import(/* webpackChunkName: \"actions\" */ './actions/ResourceScheduler')),\n 'show-output-jobs-action': lazy(() => import(/* webpackChunkName: \"actions\" */ './actions/ShowOutputJobsAction')),\n delete: lazy(() => import(/* webpackChunkName: \"actions\" */ './actions/Delete')),\n merge: lazy(() => import(/* webpackChunkName: \"actions\" */ './actions/Merge')),\n copy: lazy(() => import(/* webpackChunkName: \"actions\" */ './actions/Copy')),\n 'entity-report': lazy(() => import(/* webpackChunkName: \"actions\" */ './actions/EntityReport')),\n documents: lazy(() => import(/* webpackChunkName: \"actions\" */ './actions/Documents')),\n 'password-update': lazy(() => import(/* webpackChunkName: \"actions\" */ './actions/PasswordUpdate')),\n 'widget-config-edit': lazy(() => import(/* webpackChunkName: \"actions\" */ './actions/WidgetConfigEdit')),\n 'connect-principal': lazy(() => import(/* webpackChunkName: \"actions\" */ './actions/ConnectPrincipal')),\n export: lazy(() => import(/* webpackChunkName: \"actions\" */ './actions/Export'))\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 (\n <Suspense fallback={renderLoader()}>\n <ActionComponent {...props} />\n </Suspense>\n )\n}\n\nLazyAction.propTypes = {\n appId: PropTypes.string.isRequired\n}\n\nexport default LazyAction\n","import _get from 'lodash/get'\nimport PropTypes from 'prop-types'\nimport React, {useEffect} from 'react'\nimport {queryString as queryStringUtil, js} from 'tocco-util'\n\nimport {goBack} from '../../../../utils/routing'\nimport navigationStrategy from '../../utils/navigationStrategy'\nimport {currentViewPropType} from '../../utils/propTypes'\nimport Action from '../Action'\n\nconst ActionView = ({history, match, setCurrentViewTitle, currentViewInfo, intl}) => {\n const {location} = history\n useEffect(() => {\n if (currentViewInfo) {\n setCurrentViewTitle(intl.formatMessage({id: `client.actions.${currentViewInfo.actionId}.title`}))\n }\n\n return () => {\n setCurrentViewTitle(null)\n }\n }, [currentViewInfo, setCurrentViewTitle, intl])\n\n if (!currentViewInfo) {\n return null\n }\n\n const queryParams = queryStringUtil.fromQueryString(location.search)\n const selection = _get(location, 'state.selection', queryParams.actionProperties)\n const actionProperties = _get(location, 'state.definition.properties', queryParams.actionProperties)\n\n const navigateBack = () => {\n history.replace(goBack(match.url, 2))\n }\n\n return (\n <Action\n history={history}\n match={match}\n appId={currentViewInfo.actionId}\n selection={selection}\n actionProperties={actionProperties}\n navigationStrategy={navigationStrategy(history, match)}\n onSuccess={navigateBack}\n onError={navigateBack}\n onCancel={navigateBack}\n />\n )\n}\n\nActionView.propTypes = {\n intl: PropTypes.object.isRequired,\n currentViewInfo: currentViewPropType,\n setCurrentViewTitle: PropTypes.func.isRequired,\n history: PropTypes.shape({\n replace: PropTypes.func.isRequired,\n location: PropTypes.shape({\n search: PropTypes.string,\n state: PropTypes.shape({\n selection: PropTypes.object,\n definition: PropTypes.shape({\n appId: PropTypes.string\n })\n })\n })\n }).isRequired,\n match: PropTypes.object\n}\n\nconst areEqual = (prevProps, nextProps) => {\n const diff = Object.keys(js.difference(prevProps, nextProps))\n return diff.length === 0\n}\n\nexport default React.memo(ActionView, areEqual)\n","import {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\n\nimport {setCurrentViewTitle} from '../../modules/path/actions'\nimport ActionView from './ActionView'\nconst mapActionCreators = {\n setCurrentViewTitle\n}\n\nconst mapStateToProps = (state, props) => ({\n currentViewInfo: state.entities.path.currentViewInfos[props.history.location.pathname]\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(ActionView))\n","import _get from 'lodash/get'\nimport PropTypes from 'prop-types'\nimport {useState} from 'react'\nimport {Prompt} from 'react-router'\nimport styled from 'styled-components'\nimport EntityDetailApp from 'tocco-entity-detail/src/main'\nimport {theme, scale} from 'tocco-ui'\n\nimport navigationStrategy from '../../utils/navigationStrategy'\nimport {currentViewPropType} from '../../utils/propTypes'\n\nconst StyledEntityDetailAppWrapper = styled.div`\n margin: 0;\n background-color: ${theme.color('paper')};\n padding: 0 0 0 ${scale.space(0)};\n overflow: hidden;\n height: 100%;\n`\n\nconst CreateView = props => {\n const {currentViewInfo, history, match, intl, chooseDocument, dispatchEmittedAction} = props\n const {location} = history\n const stateDefaultValues = _get(location, 'state.defaultValues', [])\n const [touched, setTouched] = useState(false)\n\n const mode = 'create'\n\n if (!currentViewInfo) {\n return null\n }\n const {model, reverseRelation, parentKey} = currentViewInfo\n const entityName = model.name\n\n const isMultiReverseRelation = _get(model, `paths.${reverseRelation}.multi`, false)\n\n const defaultValues = [\n ...(reverseRelation && parentKey\n ? [{id: reverseRelation, value: isMultiReverseRelation ? [parentKey] : parentKey}]\n : []),\n ...stateDefaultValues\n ]\n\n const handleEntityCreated = ({id}) => {\n setTouched(false)\n history.push(match.url.replace(/create$/, id))\n }\n\n const msg = id => intl.formatMessage({id})\n const handleToucheChanged = ({touched}) => setTouched(touched)\n\n return (\n <StyledEntityDetailAppWrapper>\n <Prompt when={touched} message={msg('client.entity-browser.detail.confirmTouchedFormLeave')} />\n <EntityDetailApp\n entityName={entityName}\n formName={entityName}\n mode={mode}\n defaultValues={defaultValues}\n emitAction={action => {\n dispatchEmittedAction(action)\n }}\n navigationStrategy={navigationStrategy(history, match)}\n chooseDocument={chooseDocument}\n onEntityCreated={handleEntityCreated}\n onTouchedChange={handleToucheChanged}\n />\n </StyledEntityDetailAppWrapper>\n )\n}\n\nCreateView.propTypes = {\n intl: PropTypes.object,\n match: PropTypes.object,\n history: PropTypes.object,\n currentViewInfo: currentViewPropType,\n chooseDocument: PropTypes.func.isRequired,\n dispatchEmittedAction: PropTypes.func.isRequired\n}\n\nexport default CreateView\n","import {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\nimport {actionEmitter} from 'tocco-app-extensions'\nimport {chooseDocument} from 'tocco-docs-browser/src/main'\n\nimport CreateView from './CreateView'\n\nconst mapActionCreators = {\n chooseDocument: chooseDocument.actions.chooseDocument,\n dispatchEmittedAction: actionEmitter.dispatchEmittedAction\n}\n\nconst mapStateToProps = (state, props) => ({\n currentViewInfo: state.entities.path.currentViewInfos[props.history.location.pathname]\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(CreateView))\n","import PropTypes from 'prop-types'\nimport {useEffect, useState, useCallback} from 'react'\nimport {rest} from 'tocco-app-extensions'\nimport DocsBrowserApp from 'tocco-docs-browser/src/main'\n\nconst DocsView = ({entityName, entityKey, showActions, noLeftPadding, openResource, initialLocation}) => {\n const [folderKey, setFolderKey] = useState(null)\n\n const fetchFolder = useCallback(async () => {\n rest.simpleRequest('entities/2.0/' + entityName + '/' + entityKey + '/entitydocs/folder').then(res => {\n setFolderKey(res.body.key)\n })\n }, [entityName, entityKey])\n\n useEffect(() => {\n fetchFolder()\n }, [fetchFolder])\n\n return (\n folderKey && (\n <DocsBrowserApp\n routerType=\"routerless\"\n initialLocation={initialLocation}\n noLeftPadding={noLeftPadding}\n sortable={false}\n searchFormType=\"none\"\n rootNodes={[\n {\n key: folderKey,\n entityName: 'Folder'\n }\n ]}\n embedded={true}\n showActions={showActions}\n {...(showActions === false ? {selectionStyle: 'none'} : {})}\n disableViewPersistor={true}\n {...(openResource ? {openResource} : {})}\n scrollBehaviour=\"inline\"\n />\n )\n )\n}\n\nDocsView.propTypes = {\n entityName: PropTypes.string.isRequired,\n entityKey: PropTypes.string.isRequired,\n showActions: PropTypes.bool.isRequired,\n noLeftPadding: PropTypes.bool,\n openResource: PropTypes.func,\n initialLocation: PropTypes.string\n}\n\nexport default DocsView\n","import DocsView from './DocsView'\n\nexport default DocsView\n","import PropTypes from 'prop-types'\n\nimport {currentViewPropType} from '../../utils/propTypes'\nimport DocsView from '../DocsView'\n\nconst DocsViewAdapter = ({currentViewInfo, initialLocation}) => (\n <DocsView\n noLeftPadding={false}\n entityName={currentViewInfo.parentModel.name}\n entityKey={currentViewInfo.parentKey}\n showActions={true}\n initialLocation={initialLocation}\n />\n)\n\nDocsViewAdapter.propTypes = {\n currentViewInfo: currentViewPropType,\n initialLocation: PropTypes.string\n}\n\nexport default DocsViewAdapter\n","import PropTypes from 'prop-types'\nimport queryString from 'query-string'\nimport EntityListApp from 'tocco-entity-list/src/main'\nimport {viewPersistor} from 'tocco-util'\n\nimport navigationStrategy from '../../utils/navigationStrategy'\nimport {currentViewPropType} from '../../utils/propTypes'\nimport Action from '../Action/LazyAction'\nimport DocsViewAdapter from './DocsViewAdapter'\n\nconst ListView = ({match, history, currentViewInfo, emitAction, searchFormCollapsed, saveUserPreferences}) => {\n if (!currentViewInfo) {\n return null\n }\n\n const queryParams = queryString.parse(history.location.search)\n\n const handleRowClick = ({id}) => {\n history.push(match.url.replace(/list$/, '') + id)\n }\n\n const initialLocation = history.location.hash ? history.location.hash.substring(1) : null\n\n if (currentViewInfo.model.name === 'Resource') {\n return <DocsViewAdapter currentViewInfo={currentViewInfo} initialLocation={initialLocation} />\n }\n\n return (\n <EntityListApp\n emitAction={emitAction}\n limit={25}\n id={`${currentViewInfo.model.name}_list`}\n entityName={currentViewInfo.model.name}\n formName={queryParams.formName || currentViewInfo.model.name}\n onRowClick={handleRowClick}\n {...(currentViewInfo.reverseRelation && {\n parent: {\n key: currentViewInfo.parentKey,\n reverseRelationName: currentViewInfo.reverseRelation,\n model: currentViewInfo.parentModel.name\n }\n })}\n showLink={true}\n navigationStrategy={navigationStrategy(history, match)}\n searchFormPosition=\"left\"\n searchFormType=\"admin\"\n scrollBehaviour=\"inline\"\n store={viewPersistor.viewInfoSelector(history.location.pathname).store}\n onStoreCreate={store => {\n viewPersistor.persistViewInfo(history.location.pathname, {store}, currentViewInfo.level)\n }}\n actionAppComponent={Action}\n tql={queryParams.tql}\n searchFormCollapsed={searchFormCollapsed}\n onSearchFormCollapsedChange={({collapsed}) => {\n saveUserPreferences({'admin.list.searchFormCollapsed': collapsed})\n }}\n />\n )\n}\n\nListView.propTypes = {\n match: PropTypes.object.isRequired,\n emitAction: PropTypes.func.isRequired,\n history: PropTypes.object.isRequired,\n currentViewInfo: currentViewPropType,\n persistedViewInfo: PropTypes.shape({\n store: PropTypes.object\n }),\n searchFormCollapsed: PropTypes.bool,\n saveUserPreferences: PropTypes.func\n}\n\nexport default ListView\n","import _get from 'lodash/get'\nimport {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\nimport {actionEmitter} from 'tocco-app-extensions'\n\nimport {saveUserPreferences} from '../../../../modules/preferences/actions'\nimport ListView from './ListView'\nconst mapActionCreators = {\n emitAction: action => actionEmitter.dispatchEmittedAction(action),\n saveUserPreferences\n}\n\nconst mapStateToProps = (state, props) => ({\n currentViewInfo: state.entities.path.currentViewInfos[props.history.location.pathname],\n searchFormCollapsed: _get(state.preferences.userPreferences, 'admin.list.searchFormCollapsed', false)\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(ListView))\n","import PropTypes from 'prop-types'\nimport queryString from 'query-string'\nimport {useState} from 'react'\nimport {Prompt} from 'react-router'\nimport styled from 'styled-components'\nimport EntityDetailApp from 'tocco-entity-detail/src/main'\nimport {scale, theme} from 'tocco-ui'\n\nimport {goBack} from '../../../../utils/routing'\nimport navigationStrategy from '../../utils/navigationStrategy'\nimport {currentViewPropType} from '../../utils/propTypes'\nimport Action from '../Action'\n\nexport const StyledEntityDetailAppWrapper = styled.div`\n margin: 0;\n background-color: ${theme.color('paper')};\n padding: 0 0 0 ${scale.space(0)};\n overflow: hidden;\n height: 100%;\n`\n\nconst EditView = props => {\n const {\n currentViewInfo,\n history,\n match,\n intl,\n chooseDocument,\n emitAction,\n propagateRefresh,\n invalidateLastBreadcrumb\n } = props\n\n const [touched, setTouched] = useState(false)\n const mode = 'update'\n\n if (!currentViewInfo || currentViewInfo.pathname !== history.location.pathname) {\n return null\n }\n\n const queryFormName = queryString.parse(location.search).formName\n\n const handleToucheChanged = ({touched}) => {\n setTouched(touched)\n }\n\n const navigateToCreateRelative = (relationName, state) => {\n if (relationName) {\n const entityBaseUrl = goBack(match.url, 1)\n history.push({\n pathname: `${entityBaseUrl}/${relationName}/create`,\n state\n })\n } else {\n const entityBaseUrl = goBack(match.url, 2)\n history.push({\n pathname: entityBaseUrl + '/create',\n state\n })\n }\n }\n\n const handleEntityDeleted = () => {\n const entityBaseUrl = goBack(match.url, 2)\n history.push(entityBaseUrl)\n }\n\n const handleEntityUpdated = () => {\n const location = history.location\n invalidateLastBreadcrumb(location)\n }\n\n const handleRefresh = () => {\n const location = history.location\n propagateRefresh(location)\n }\n\n const handleSubGridRowClick = ({id, relationName}) => {\n const entityBaseUrl = goBack(match.url)\n history.push(`${entityBaseUrl}/${relationName}/${id}`)\n }\n\n const entityName = currentViewInfo.model.name\n const msg = id => intl.formatMessage({id})\n\n return (\n <StyledEntityDetailAppWrapper>\n <Prompt\n when={touched}\n message={location => {\n if (history.location.pathname !== location.pathname) {\n return msg('client.entity-browser.detail.confirmTouchedFormLeave')\n }\n\n return false\n }}\n />\n <EntityDetailApp\n entityName={entityName}\n entityId={currentViewInfo.key}\n formName={queryFormName || entityName}\n mode={mode}\n emitAction={emitAction}\n onTouchedChange={handleToucheChanged}\n navigationStrategy={{...navigationStrategy(history, match), navigateToCreateRelative}}\n chooseDocument={chooseDocument}\n onEntityDeleted={handleEntityDeleted}\n onEntityUpdated={handleEntityUpdated}\n onRefresh={handleRefresh}\n actionAppComponent={Action}\n onSubGridRowClick={handleSubGridRowClick}\n />\n </StyledEntityDetailAppWrapper>\n )\n}\n\nEditView.propTypes = {\n intl: PropTypes.object,\n match: PropTypes.object,\n history: PropTypes.object,\n currentViewInfo: currentViewPropType,\n chooseDocument: PropTypes.func.isRequired,\n emitAction: PropTypes.func.isRequired,\n propagateRefresh: PropTypes.func.isRequired,\n invalidateLastBreadcrumb: PropTypes.func.isRequired\n}\n\nexport default EditView\n","import {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\nimport {actionEmitter} from 'tocco-app-extensions'\nimport {chooseDocument} from 'tocco-docs-browser/src/main'\n\nimport {propagateRefresh, invalidateLastBreadcrumb} from '../../modules/path/actions'\nimport EditView from './EditView'\n\nconst mapActionCreators = {\n chooseDocument: chooseDocument.actions.chooseDocument,\n emitAction: action => actionEmitter.dispatchEmittedAction(action),\n propagateRefresh,\n invalidateLastBreadcrumb\n}\n\nconst mapStateToProps = (state, props) => ({\n currentViewInfo: state.entities.path.currentViewInfos[props.history.location.pathname]\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(EditView))\n","const selectedRelations = {}\n\nexport const getRelation = entity => selectedRelations[entity]\n\nexport const setRelation = (entity, selectedRelation) => {\n selectedRelations[entity] = selectedRelation\n}\n","import PropTypes from 'prop-types'\n\nimport {currentViewPropType} from '../../utils/propTypes'\nimport DocsView from '../DocsView'\n\nconst DocsViewAdapter = ({currentViewInfo, history, selectedRelation}) => (\n <DocsView\n entityName={currentViewInfo.model.name}\n entityKey={currentViewInfo.key}\n showActions={false}\n noLeftPadding={true}\n history={history}\n openResource={location => {\n history.push(`${selectedRelation.relationName}/list#${location}`)\n }}\n />\n)\n\nDocsViewAdapter.propTypes = {\n history: PropTypes.object.isRequired,\n selectedRelation: PropTypes.shape({\n relationName: PropTypes.string.isRequired\n }).isRequired,\n currentViewInfo: currentViewPropType\n}\n\nexport default DocsViewAdapter\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport EntityListApp from 'tocco-entity-list/src/main'\nimport {viewPersistor} from 'tocco-util'\n\nimport {goBack} from '../../../../utils/routing'\nimport navigationStrategy from '../../utils/navigationStrategy'\nimport {currentViewPropType} from '../../utils/propTypes'\n\nconst ListView = ({selectedRelation, currentViewInfo, match, history, emitAction}) => {\n return (\n <EntityListApp\n id={'preview' + selectedRelation.reverseRelationName + selectedRelation.targetEntity}\n key={selectedRelation.reverseRelationName + selectedRelation.targetEntity}\n entityName={selectedRelation.targetEntity}\n formName={selectedRelation.targetEntity}\n parent={{\n key: currentViewInfo.key,\n reverseRelationName: selectedRelation.reverseRelationName,\n model: currentViewInfo.model.name,\n relationName: selectedRelation.relationName\n }}\n showLink={true}\n navigationStrategy={navigationStrategy(history, match)}\n onRowClick={({id}) => {\n const entityBaseUrl = match.url.replace(/detail$/, '')\n history.push(`${entityBaseUrl}${selectedRelation.relationName}/${id}`)\n }}\n onNavigateToCreate={() => {\n const entityBaseUrl = goBack(match.url)\n history.push(entityBaseUrl + '/' + selectedRelation.relationName + '/create')\n }}\n searchFormType=\"fulltext\"\n selectionStyle=\"none\"\n store={viewPersistor.viewInfoSelector(history.location.pathname)[`store-${selectedRelation.relationName}`]}\n onStoreCreate={store => {\n viewPersistor.persistViewInfo(\n currentViewInfo.pathname,\n {[`store-${selectedRelation.relationName}`]: store},\n currentViewInfo.level\n )\n }}\n showActions={false}\n limit={15}\n emitAction={emitAction}\n scrollBehaviour=\"inline\"\n />\n )\n}\n\nListView.propTypes = {\n selectedRelation: PropTypes.shape({\n reverseRelationName: PropTypes.string,\n targetEntity: PropTypes.string,\n relationName: PropTypes.string\n }).isRequired,\n currentViewInfo: currentViewPropType,\n match: PropTypes.object.isRequired,\n history: PropTypes.object.isRequired,\n emitAction: PropTypes.func.isRequired\n}\n\nexport default React.memo(ListView)\n","import styled from 'styled-components'\nimport {AdminLink as StyledLink, StyledSpan, theme, scale, StyledScrollbar, Button} from 'tocco-ui'\n\nexport const StyledRelationsViewWrapper = styled.div`\n display: ${({isCollapsed}) => (isCollapsed ? 'none' : 'flex')};\n height: 100%;\n flex-direction: column;\n`\n\nexport const StyledPlaceHolder = styled.div`\n display: ${({isCollapsed}) => (isCollapsed ? 'flex' : 'none')};\n flex: 1;\n height: 100%;\n width: 25px;\n background: ${theme.color('paper')};\n padding-top: ${scale.space(-1.5)};\n padding-left: ${scale.space(-2.5)};\n align-items: flex-start;\n\n &:hover {\n cursor: pointer;\n }\n`\n\nexport const StyledToggleCollapse = styled.div`\n display: flex;\n background-color: ${theme.color('paper')};\n padding-top: ${scale.space(-1.5)};\n padding-bottom: ${scale.space(-1.5)};\n`\n\nexport const StyledToggleCollapseButton = styled(Button)`\n font-size: ${scale.font(0)};\n padding: 0;\n margin-left: auto;\n\n &:hover,\n ${/* sc-selector */ StyledPlaceHolder}:hover & {\n background-color: transparent;\n color: ${theme.color('secondaryLight')};\n }\n`\n\nexport const StyledPreviewBox = styled.div`\n background-color: ${theme.color('paper')};\n padding: ${scale.space(-1)};\n margin-top: 3px;\n display: flex;\n flex-direction: column;\n flex: 1;\n`\n\nexport const StyledRelationBoxes = styled.div`\n background-color: ${theme.color('paper')};\n padding: ${scale.space(-1)};\n display: grid;\n grid-template-columns: repeat(auto-fit, 170px);\n grid-gap: ${scale.space(-2)};\n justify-content: space-between;\n overflow-y: auto;\n align-content: flex-start;\n height: fit-content;\n min-height: 150px;\n max-height: 20%;\n ${StyledScrollbar}\n`\n\nexport const StyledPreviewLink = styled(StyledLink)`\n padding-left: ${scale.space(-0.5)};\n\n &:nth-child(2) {\n padding-left: 0;\n }\n`\n\nexport const StyledRelationLinks = styled.div`\n display: none;\n margin-left: auto;\n\n * {\n color: ${theme.color('text')};\n padding-left: ${scale.space(-4.5)};\n }\n`\n\nexport const StyledRelationBox = styled.div`\n border-radius: ${theme.radii('large')};\n padding: ${scale.space(-2.7)} ${scale.space(-1)};\n display: flex;\n background-color: ${({selected}) => selected && theme.color('secondary')};\n height: fit-content;\n\n &&& {\n * {\n color: ${({selected}) => selected && theme.color('paper')};\n box-sizing: initial;\n }\n }\n ${({selected}) =>\n selected &&\n `\n ${StyledRelationLinks} {\n display: flex;\n }\n `};\n\n // allow hover styles only on non-touch devices\n @media (hover: hover) and (pointer: fine) {\n &:hover ${StyledRelationLinks} {\n display: flex;\n }\n\n && {\n :hover {\n background-color: ${theme.color('secondaryLight')};\n\n * {\n color: ${theme.color('paper')};\n }\n cursor: pointer;\n }\n }\n\n ${/* sc-selector */ StyledLink}:hover * {\n color: ${theme.color('secondary')};\n }\n }\n`\n\nexport const StyledRelationLabel = styled(StyledSpan)`\n && {\n max-width: 110px;\n }\n`\n","import PropTypes from 'prop-types'\nimport {AdminLink as StyledLink, Icon} from 'tocco-ui'\n\nimport {setRelation} from '../../utils/relationPersistor'\nimport {StyledRelationBox, StyledRelationLabel, StyledRelationLinks} from './StyledComponents'\n\nconst RelationBox = ({relation, history, match, relationsInfo, selectRelation, selectedRelation, intl, entityName}) => {\n const {relationName, targetEntity, relationDisplay} = relation\n\n const msg = id => intl.formatMessage({id})\n const hasCreateRights = () => relationsInfo[relationName]?.createPermission\n\n const getRelationCountLabel = () =>\n relationsInfo[relationName]?.count > 0 ? (\n <StyledRelationLabel>&nbsp;({relationsInfo[relationName].count})</StyledRelationLabel>\n ) : null\n\n const handleBoxClick = () => {\n selectRelation(relation)\n history.replace({\n search: `?relation=${relationName}`\n })\n setRelation(entityName, relationName)\n }\n\n return (\n <StyledRelationBox selected={selectedRelation?.relationName === relationName} onClick={handleBoxClick}>\n <StyledRelationLabel title={relationDisplay.label}>{relationDisplay.label}</StyledRelationLabel>\n {getRelationCountLabel()}\n <StyledRelationLinks>\n <StyledLink\n aria-label={msg('client.admin.entities.relationsView.relationLinkView')}\n to={match.url.replace(/(relations|detail)$/, relationName)}\n >\n <Icon icon=\"arrow-right\" />\n </StyledLink>\n {hasCreateRights() && targetEntity !== 'Resource' && (\n <StyledLink\n aria-label={msg('client.admin.entities.relationsView.relationLinkCreate')}\n to={match.url.replace(/(relations|detail)$/, relationName) + '/create'}\n >\n <Icon icon=\"plus\" />\n </StyledLink>\n )}\n </StyledRelationLinks>\n </StyledRelationBox>\n )\n}\n\nRelationBox.propTypes = {\n relation: PropTypes.object.isRequired,\n history: PropTypes.object.isRequired,\n match: PropTypes.object.isRequired,\n relationsInfo: PropTypes.objectOf(\n PropTypes.shape({\n count: PropTypes.number,\n createPermission: PropTypes.bool\n })\n ),\n intl: PropTypes.object.isRequired,\n selectRelation: PropTypes.func.isRequired,\n selectedRelation: PropTypes.object,\n entityName: PropTypes.string\n}\n\nexport default RelationBox\n","import _get from 'lodash/get'\nimport PropTypes from 'prop-types'\nimport queryString from 'query-string'\nimport React, {useCallback, useEffect} from 'react'\nimport {Icon, Typography} from 'tocco-ui'\nimport {js} from 'tocco-util'\n\nimport {currentViewPropType} from '../../utils/propTypes'\nimport {getRelation} from '../../utils/relationPersistor'\nimport DocsViewAdapter from './DocsViewAdapter'\nimport ListView from './ListView'\nimport RelationBox from './RelationBox'\nimport {\n StyledPlaceHolder,\n StyledPreviewBox,\n StyledPreviewLink,\n StyledRelationBoxes,\n StyledRelationsViewWrapper,\n StyledToggleCollapse,\n StyledToggleCollapseButton\n} from './StyledComponents'\n\nconst RelationsView = props => {\n const {\n history,\n match,\n currentViewInfo,\n relations,\n relationsInfo,\n emitAction,\n intl,\n isCollapsed,\n toggleCollapse,\n selectedRelation,\n selectRelation\n } = props\n const entityName = _get(currentViewInfo, 'model.name')\n\n const updateSelectedRelation = useCallback(() => {\n if (relations?.length > 0) {\n const queryRelation = queryString.parse(history.location.search).relation\n if (queryRelation) {\n selectRelation(relations.find(r => r.relationName === queryRelation))\n } else {\n const persistedSelectedRelation = getRelation(entityName)\n if (persistedSelectedRelation) {\n selectRelation(relations.find(r => r.relationName === persistedSelectedRelation))\n } else {\n selectRelation(relations[0])\n }\n }\n }\n }, [relations, entityName, history.location.search, selectRelation])\n\n useEffect(updateSelectedRelation, [updateSelectedRelation])\n useEffect(() => (!selectedRelation ? updateSelectedRelation() : null), [selectedRelation, updateSelectedRelation])\n\n if (!relations || relations.length === 0 || !currentViewInfo) {\n return null\n }\n\n const msg = id => intl.formatMessage({id})\n const hasCreateRights = relationName => relationsInfo[relationName]?.createPermission\n const RelationPreview = selectedRelation\n ? selectedRelation.targetEntity === 'Resource'\n ? DocsViewAdapter\n : ListView\n : () => <React.Fragment />\n\n const RelationBoxes = relations.map(relation => (\n <RelationBox key={`relation-${relation.relationName}`} relation={relation} entityName={entityName} {...props} />\n ))\n\n return (\n <>\n <StyledRelationsViewWrapper isCollapsed={isCollapsed}>\n <StyledToggleCollapse>\n <StyledToggleCollapseButton icon=\"chevron-right\" onClick={toggleCollapse} />\n </StyledToggleCollapse>\n <StyledRelationBoxes>{RelationBoxes}</StyledRelationBoxes>\n {selectedRelation && (\n <StyledPreviewBox>\n <Typography.H4>\n {selectedRelation.relationDisplay.label}\n <StyledPreviewLink\n aria-label={msg('client.admin.entities.relationsView.relationLinkView')}\n to={match.url.replace(/(relations|detail)$/, selectedRelation.relationName)}\n >\n <Icon icon=\"arrow-right\" />\n </StyledPreviewLink>\n {hasCreateRights(selectedRelation.relationName) && selectedRelation.targetEntity !== 'Resource' && (\n <StyledPreviewLink\n aria-label={msg('client.admin.entities.relationsView.relationLinkCreate')}\n to={match.url.replace(/(relations|detail)$/, selectedRelation.relationName) + '/create'}\n >\n <Icon icon=\"plus\" />\n </StyledPreviewLink>\n )}\n </Typography.H4>\n <RelationPreview\n selectedRelation={selectedRelation}\n match={match}\n history={history}\n currentViewInfo={currentViewInfo}\n emitAction={emitAction}\n />\n </StyledPreviewBox>\n )}\n </StyledRelationsViewWrapper>\n <StyledPlaceHolder onClick={toggleCollapse} isCollapsed={isCollapsed}>\n <StyledToggleCollapseButton icon={'chevron-left'} isCollapsed={isCollapsed} />\n </StyledPlaceHolder>\n </>\n )\n}\n\nRelationsView.propTypes = {\n history: PropTypes.object.isRequired,\n match: PropTypes.object.isRequired,\n currentViewInfo: currentViewPropType,\n relations: PropTypes.array,\n relationsInfo: PropTypes.objectOf(\n PropTypes.shape({\n count: PropTypes.number,\n createPermission: PropTypes.bool\n })\n ),\n emitAction: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n isCollapsed: PropTypes.bool,\n toggleCollapse: PropTypes.func.isRequired,\n selectRelation: PropTypes.func.isRequired,\n selectedRelation: PropTypes.object\n}\n\nconst areEqual = (prevProps, nextProps) => {\n const diff = Object.keys(js.difference(prevProps, nextProps))\n return diff.length === 0\n}\n\nexport default React.memo(RelationsView, areEqual)\n","import {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\nimport {actionEmitter} from 'tocco-app-extensions'\n\nimport {selectRelation} from '../../modules/path/actions'\nimport RelationsView from './RelationsView'\n\nconst mapStateToProps = (state, props) => ({\n currentViewInfo: state.entities.path.currentViewInfos[props.history.location.pathname],\n relations: state.entities.path.relations,\n relationsInfo: state.entities.path.relationsInfo,\n selectedRelation: state.entities.path.selectedRelation\n})\n\nconst mapActionCreators = {\n emitAction: action => actionEmitter.dispatchEmittedAction(action),\n selectRelation\n}\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(RelationsView))\n","import RelationsView from './RelationViewContainer'\n\nexport default RelationsView\n","import styled from 'styled-components'\n\nexport const StyledDetailViewContainer = styled.div`\n display: flex;\n flex-direction: row;\n height: 100%;\n\n .react-bs-container-body {\n height: auto !important;\n }\n`\n\nexport const StyledDetailViewLeft = styled.div`\n flex: 1;\n margin-right: 1rem;\n ${({isCollapsed}) =>\n !isCollapsed &&\n ` @media(max - width: 1024px) {\n flex: none;\n width: 40%;\n }`}\n`\n\nexport const StyledDetailViewRight = styled.div`\n flex: ${({isCollapsed}) => (isCollapsed ? '0' : '1')};\n`\n","import PropTypes from 'prop-types'\nimport {useState, useEffect} from 'react'\n\nimport {currentViewPropType} from '../../utils/propTypes'\nimport EditView from '../EditView'\nimport RelationsView from '../RelationsView'\nimport {StyledDetailViewContainer, StyledDetailViewLeft, StyledDetailViewRight} from './StyledComponents'\n\nconst DetailView = ({match, history, currentViewInfo, relationViewCollapsed, saveUserPreferences}) => {\n const [isCollapsed, setIsCollapsed] = useState(false)\n const toggleCollapse = () => {\n setIsCollapsed(!isCollapsed)\n onSearchFormCollapsedChange(!isCollapsed)\n }\n\n useEffect(() => {\n setIsCollapsed(relationViewCollapsed)\n }, [relationViewCollapsed])\n\n const onSearchFormCollapsedChange = collapsed => {\n saveUserPreferences({'admin.detail.relationViewCollapsed': collapsed})\n }\n\n return (\n <StyledDetailViewContainer>\n <StyledDetailViewLeft isCollapsed={isCollapsed}>\n <EditView match={match} history={history} />\n </StyledDetailViewLeft>\n <StyledDetailViewRight isCollapsed={isCollapsed}>\n <RelationsView match={match} history={history} isCollapsed={isCollapsed} toggleCollapse={toggleCollapse} />\n </StyledDetailViewRight>\n </StyledDetailViewContainer>\n )\n}\n\nDetailView.propTypes = {\n intl: PropTypes.object,\n match: PropTypes.object,\n history: PropTypes.object,\n currentViewInfo: currentViewPropType,\n relationViewCollapsed: PropTypes.bool,\n saveUserPreferences: PropTypes.func.isRequired\n}\n\nexport default DetailView\n","import _get from 'lodash/get'\nimport {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\n\nimport {saveUserPreferences} from '../../../../modules/preferences/actions'\nimport DetailView from './DetailView'\nconst mapActionCreators = {\n saveUserPreferences\n}\n\nconst mapStateToProps = (state, props) => ({\n currentViewInfo: state.entities.path.currentViewInfos[props.history.location.pathname],\n relationViewCollapsed: _get(state.preferences.userPreferences, 'admin.detail.relationViewCollapsed', false)\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(DetailView))\n","/* eslint-disable max-len */\nimport PropTypes from 'prop-types'\nimport {Redirect, Route, Switch} from 'react-router-dom'\n\nimport Action from '../../subroutes/action'\nimport Detail from '../../subroutes/detail'\nimport Edit from '../../subroutes/edit'\nimport Entity from '../../subroutes/entity'\nimport Relations from '../../subroutes/relations'\n\nfunction wordCount(str, word) {\n return str.split(word).length - 1\n}\n\nconst EntityRecordRoute = ({match}) => {\n const count = wordCount(match.path, ':relation')\n\n return (\n <Switch>\n <Route\n exact\n path={`${match.url}`}\n render={({match}) => <Redirect to={`${match.url.replace(/\\/$/, '')}/detail`} />}\n />\n <Route path={`${match.path}/detail`} component={Detail} />\n <Route path={`${match.path}/edit`} component={Edit} />\n <Route path={`${match.path}/relations`} component={Relations} />\n <Route path={`${match.path}/action`} component={Action} />\n <Route path={`${match.path}/:relation_${count}`} component={Entity} />\n </Switch>\n )\n}\n\nEntityRecordRoute.propTypes = {\n match: PropTypes.object.isRequired\n}\n\nexport default EntityRecordRoute\n","import EntityRecordRoute from './EntityRecordRoute'\n\nexport default EntityRecordRoute\n","import PropTypes from 'prop-types'\nimport {Redirect, Route, Switch} from 'react-router-dom'\n\nimport Action from '../../subroutes/action'\nimport Create from '../../subroutes/create'\nimport List from '../../subroutes/list'\nimport Record from '../../subroutes/record'\n\nconst EntityRoute = ({match}) => (\n <Switch>\n <Route exact path={match.url} render={({match}) => <Redirect to={`${match.url.replace(/\\/$/, '')}/list`} />} />\n <Route path={`${match.path}/action/:id`} component={Action} />\n <Route path={`${match.path}/list`} component={List} />\n <Route path={`${match.path}/create`} component={Create} />\n <Route path={`${match.path}/:key`} component={Record} />\n </Switch>\n)\n\nEntityRoute.propTypes = {\n match: PropTypes.object.isRequired\n}\n\nexport default EntityRoute\n","import EntityRoute from './EntityRoute'\n\nexport default EntityRoute\n","import {AdminLink as StyledLink, Typography} from 'tocco-ui'\n\nconst EntitiesOverview = props => {\n return (\n <div>\n <Typography.H2>Entities Overview</Typography.H2>\n <Typography.Span>List of all available Entities</Typography.Span>\n <ul>\n <li>\n <StyledLink to=\"/e/User\">User</StyledLink>\n </li>\n <li>\n <StyledLink to=\"/e/Address\">Address</StyledLink>\n </li>\n </ul>\n </div>\n )\n}\n\nEntitiesOverview.propTypes = {}\n\nexport default EntitiesOverview\n","import EntitiesOverview from './EntitiesOverview'\n\nexport default EntitiesOverview\n","import {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\nimport {Breadcrumbs} from 'tocco-ui'\n\nconst mapActionCreators = {}\n\nconst mapStateToProps = (state, props) => ({\n pathPrefix: '/e',\n breadcrumbsInfo: state.entities.path.breadcrumbsInfo,\n currentView: state.entities.path.currentViewTitle\n ? {\n display: state.entities.path.currentViewTitle,\n title: state.entities.path.currentViewTitle\n }\n : null\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(Breadcrumbs))\n","import {FormattedMessage} from 'react-intl'\n\nimport ErrorView from '../../../../components/ErrorView'\nimport {currentViewPropType} from '../../utils/propTypes'\n\nconst EntityErrorView = ({currentViewInfo}) => {\n const prefix = 'client.admin.entity.errorView.'\n const title = currentViewInfo.type === 'detail' ? 'detailTitle' : 'defaultTitle'\n\n const description =\n currentViewInfo.type === 'detail'\n ? 'detailDescription'\n : currentViewInfo.type === 'list' && currentViewInfo.error.relationName\n ? 'relationDescription'\n : 'listDescription'\n\n return (\n <ErrorView\n title={<FormattedMessage id={prefix + title} />}\n message={<FormattedMessage id={prefix + description} values={currentViewInfo.error} />}\n />\n )\n}\n\nEntityErrorView.propTypes = {\n currentViewInfo: currentViewPropType\n}\n\nexport default EntityErrorView\n","import {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\n\nimport EntityErrorView from './EntityErrorView'\n\nconst mapStateToProps = (state, props) => ({\n currentViewInfo: state.entities.path.currentViewInfos[props.history.location.pathname]\n})\n\nexport default connect(mapStateToProps)(injectIntl(EntityErrorView))\n","import PropTypes from 'prop-types'\nimport {useEffect} from 'react'\nimport {Route, Switch} from 'react-router-dom'\nimport styled from 'styled-components'\n\nimport Action from '../../subroutes/action'\nimport Entity from '../../subroutes/entity'\nimport Overview from '../../subroutes/overview'\nimport {currentViewPropType} from '../../utils/propTypes'\nimport Breadcrumbs from '../Breadcrumbs'\nimport ErrorView from '../ErrorView'\n\nconst 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\nconst StyledContent = styled.div`\n grid-area: content;\n overflow: hidden;\n`\n\nconst StyledBreadcrumbs = styled.div`\n grid-area: breadcrumbs;\n`\n\nconst EntitiesRoute = ({match, history, loadCurrentRoute, currentViewInfo}) => {\n const location = history.location\n\n useEffect(() => {\n loadCurrentRoute(location)\n }, [location, loadCurrentRoute])\n\n const content =\n currentViewInfo && currentViewInfo.error ? (\n <ErrorView history={history} />\n ) : (\n <Switch>\n <Route path={`${match.url}/action/:actionId`} component={Action} />\n <Route path={`${match.url}/:entity`} component={Entity} />\n <Route exact path={match.url} component={Overview} />\n </Switch>\n )\n\n return (\n <StyledWrapper>\n <StyledBreadcrumbs>\n <Breadcrumbs />\n </StyledBreadcrumbs>\n <StyledContent>{content}</StyledContent>\n </StyledWrapper>\n )\n}\n\nEntitiesRoute.propTypes = {\n loadCurrentRoute: PropTypes.func.isRequired,\n history: PropTypes.object.isRequired,\n match: PropTypes.object.isRequired,\n currentViewInfo: currentViewPropType\n}\n\nexport default EntitiesRoute\n","import {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\n\nimport {loadCurrentRoute} from '../../modules/path/actions'\nimport EntitiesRoute from './EntitiesRoute'\n\nconst mapActionCreators = {\n loadCurrentRoute\n}\n\nconst mapStateToProps = (state, props) => ({\n currentViewInfo: state.entities.path.currentViewInfos[props.history.location.pathname]\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(EntitiesRoute))\n","import EntitiesRoute from './EntitiesRouteContainer'\n\nexport default EntitiesRoute\n","import {reducer as reducerUtil} from 'tocco-util'\n\nimport * as actions from './actions'\n\nexport const setCurrentViewInfo = (state, {payload: {location, currentViewInfo}}) => ({\n ...state,\n currentViewInfos: {\n ...state.currentViewInfos,\n [location]: {\n ...state.currentViewInfos[location],\n ...currentViewInfo\n }\n }\n})\n\nexport const updateBreadcrumbsInfo = (state, {payload: {path, breadcrumbsInfo}}) => ({\n ...state,\n breadcrumbsInfo: state.breadcrumbsInfo.map(info => (info.path === path ? {...info, ...breadcrumbsInfo} : info))\n})\n\nconst ACTION_HANDLERS = {\n [actions.SET_CURRENT_VIEW_INFO]: setCurrentViewInfo,\n [actions.SET_BREADCRUMBS_INFO]: reducerUtil.singleTransferReducer('breadcrumbsInfo'),\n [actions.UPDATE_BREADCRUMBS_INFO]: updateBreadcrumbsInfo,\n [actions.SET_RELATIONS]: reducerUtil.singleTransferReducer('relations'),\n [actions.SET_RELATIONS_INFO]: reducerUtil.singleTransferReducer('relationsInfo'),\n [actions.SET_CURRENT_VIEW_TITLE]: reducerUtil.singleTransferReducer('currentViewTitle'),\n [actions.SELECT_RELATION]: reducerUtil.singleTransferReducer('selectedRelation')\n}\n\nconst initialState = {\n currentViewInfos: {},\n breadcrumbsInfo: [],\n relations: null,\n relationsInfo: {},\n selectedRelation: 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 {route} from 'tocco-util'\n\nconst entityUrlRegex = '/e/:entity/:key?/:relation*/:view(list|detail|edit|create|relations|action)/:actionId?'\nconst actionUrlRegex = '/e/action/:actionId'\n\n/**\n * Returns an object with actionId, entity, key, relation and view for given url\n *\n * @param pathname {String} url / path starting with /e/\n */\nexport const getPathInfo = pathname => {\n const entityParams = route.extractParamsFromPath(entityUrlRegex, pathname)\n const actionParams = route.extractParamsFromPath(actionUrlRegex, pathname)\n\n return entityParams || actionParams\n}\n","import _omit from 'lodash/omit'\nimport _pick from 'lodash/pick'\nimport _pickBy from 'lodash/pickBy'\nimport {all, call, put, select, spawn, takeLatest} from 'redux-saga/effects'\nimport {rest} from 'tocco-app-extensions'\nimport {viewPersistor, consoleLogger} from 'tocco-util'\n\nimport {getPathInfo} from '../../utils/url'\nimport * as actions from './actions'\n\nexport const entitiesPathSelector = state => state.entities.path\n\nconst relationPathRegex = /[^/]+\\/?[^/]+/g\nconst isEven = n => n % 2 === 0\n\nexport default function* mainSagas() {\n yield all([\n takeLatest(actions.LOAD_CURRENT_ROUTE, loadRoute),\n takeLatest(actions.PROPAGATE_REFRESH, reloadRelationsInfo),\n takeLatest(actions.INVALIDATE_LAST_BREADCRUMB, invalidateLastBreadcrumb)\n ])\n}\n\nexport function* loadRoute({payload: {location}}) {\n const {pathname} = location\n\n const routeInfo = yield call(loadRouteInfo, pathname)\n\n if (routeInfo.length > 0) {\n const currentViewInfo = yield call(updateCurrentViewInfo, pathname, routeInfo)\n yield call(updateBreadcrumbsInfo, routeInfo)\n\n if (currentViewInfo.type === 'detail' && !currentViewInfo.error) {\n yield spawn(initMultiRelations, currentViewInfo.model, currentViewInfo.key)\n }\n\n yield call(viewPersistor.clearPersistedViews, currentViewInfo.level + 1)\n }\n}\n\nfunction* updateCurrentViewInfo(pathname, routeInfo) {\n const currentViewInfo = yield call(deriveCurrentViewInfo, pathname, routeInfo)\n yield put(actions.setCurrentViewInfo(pathname, currentViewInfo))\n return currentViewInfo\n}\n\nfunction* updateBreadcrumbsInfo(routeInfo) {\n const breadcrumbs = yield call(deriveBreadcrumbs, routeInfo)\n yield put(actions.setBreadcrumbsInfo(breadcrumbs))\n return breadcrumbs\n}\n\nexport function* loadRouteInfo(pathname) {\n const path = yield call(getPathInfo, pathname)\n const routeInfos = []\n\n if (path === null) {\n return routeInfos\n }\n\n if (path.entity) {\n let baseModel\n try {\n baseModel = yield call(rest.fetchModel, path.entity)\n routeInfos.push({\n type: 'list',\n model: baseModel\n })\n } catch (e) {\n routeInfos.push({\n type: 'list',\n error: {\n entityName: path.entity\n }\n })\n return routeInfos\n }\n\n if (path.key) {\n const entityExists = yield call(rest.entityExists, baseModel.name, path.key)\n\n if (entityExists) {\n const display = yield call(rest.fetchDisplay, baseModel.name, path.key)\n routeInfos.push({\n type: 'detail',\n key: path.key,\n model: baseModel,\n display\n })\n } else {\n routeInfos.push({\n type: 'detail',\n error: {\n entityName: baseModel.label,\n key: path.key\n }\n })\n\n return routeInfos\n }\n\n if (path.relation) {\n const splittedRelation = path.relation.split('/')\n\n for (let i = 0; i < splittedRelation.length; i++) {\n const relationStringPart = splittedRelation[i]\n\n const parent = routeInfos[routeInfos.length - 1]\n if (isEven(i)) {\n const relationName = relationStringPart\n const relation = parent.model.paths[relationName]\n if (!relation) {\n routeInfos.push({\n type: 'list',\n error: {\n relationName,\n entityName: parent.model.name\n }\n })\n return routeInfos\n }\n const targetEntity = relation.targetEntity\n\n const relationModel = yield call(rest.fetchModel, targetEntity)\n\n routeInfos.push({\n type: 'list',\n model: relationModel,\n relationName,\n parent\n })\n } else {\n const key = relationStringPart\n const model = parent.model\n const entityExists = yield call(rest.entityExists, model.name, key)\n\n if (entityExists) {\n const display = yield call(rest.fetchDisplay, model.name, key)\n routeInfos.push({\n type: 'detail',\n model,\n key,\n display,\n relationName: parent.relationName,\n parent: parent.parent\n })\n } else {\n routeInfos.push({\n type: 'detail',\n error: {\n entityName: model.name,\n key\n }\n })\n return routeInfos\n }\n }\n }\n }\n }\n\n if (path.view === 'create') {\n const entity = routeInfos[routeInfos.length - 1]\n const parent = routeInfos[routeInfos.length - 2]\n routeInfos.push({\n type: 'create',\n model: entity.model,\n parent,\n relationName: entity.relationName\n })\n } else if (path.actionId) {\n routeInfos.push({\n type: 'action',\n actionId: path.actionId\n })\n }\n } else if (path.actionId) {\n routeInfos.push({\n type: 'action',\n actionId: path.actionId\n })\n }\n\n return routeInfos\n}\n\nexport const deriveCurrentViewInfo = (pathname, routeInfo) => {\n const lastEntry = routeInfo[routeInfo.length - 1]\n const parent = lastEntry.parent\n\n return {\n ..._omit(lastEntry, ['parent']),\n pathname,\n level: routeInfo.length - 1,\n ...(parent &&\n lastEntry.relationName && {\n parentKey: parent.key,\n reverseRelation: parent.model.paths[lastEntry.relationName].reverseRelationName,\n parentModel: parent.model\n })\n }\n}\n\nexport const deriveBreadcrumbs = routeInfos => {\n let path = ''\n return routeInfos\n .map(routeInfo => {\n if (routeInfo.error) {\n return {type: 'error'}\n }\n if (routeInfo.type === 'action') {\n return null\n }\n path = (path ? path + '/' : '') + (routeInfo.key ? routeInfo.key : routeInfo.relationName || routeInfo.model.name)\n return {\n type: routeInfo.type,\n display: routeInfo.display || routeInfo.model.label,\n path: path + '/' + routeInfo.type\n }\n })\n .filter(e => e)\n}\n\nexport function* initMultiRelations(model, key) {\n const relations = _pickBy(model.paths, (value, key) => value.relationDisplay && value.relationDisplay.show)\n\n const relationsTransformed = Object.keys(relations)\n .map(k =>\n _pick(relations[k], [\n 'relationName',\n 'reverseRelationName',\n 'targetEntity',\n 'relationDisplay.label',\n 'relationDisplay.order'\n ])\n )\n .sort((a, b) => (a.relationDisplay.order > b.relationDisplay.order ? 1 : -1))\n\n yield put(actions.selectRelation(null))\n yield put(actions.setRelations(relationsTransformed))\n yield call(loadRelationInfos, model.name, key)\n}\n\nexport function* reloadRelationsInfo({payload: {location}}) {\n const {pathname} = location\n const {currentViewInfos} = yield select(entitiesPathSelector)\n const currentViewInfo = currentViewInfos[pathname]\n if (currentViewInfo.type === 'detail' && !currentViewInfo.error) {\n yield spawn(loadRelationInfos, currentViewInfo.model.name, currentViewInfo.key)\n yield put(actions.selectRelation(null))\n }\n}\n\nexport function* invalidateLastBreadcrumb({payload: {location}}) {\n const {pathname} = location\n\n const path = yield call(getPathInfo, pathname)\n\n if (path?.entity && path?.key) {\n try {\n const lastEntity = yield call(getLastEntityInPath, path)\n if (lastEntity) {\n const {entityName, key} = lastEntity\n yield call(rest.invalidateDisplay, entityName, key)\n const display = yield call(rest.fetchDisplay, entityName, key)\n\n yield put(actions.setCurrentViewInfo(pathname, {display}))\n\n const breadcrumbsPath = yield call(getLastBreadcrumbsPath, pathname)\n yield put(actions.updateBreadcrumbsInfo(breadcrumbsPath, {display}))\n }\n } catch (e) {\n // could not load model or delete cache\n consoleLogger.logError('breadcrumbs invalidation failed', e)\n }\n }\n}\n\nfunction* getLastBreadcrumbsPath(pathname) {\n const path = yield call(getPathInfo, pathname)\n\n if (path === null || !path.entity) {\n return ''\n }\n\n // concatenates defined path segments separated with a slash => ${entity}/${key}/${relation}/${view}\n return [path.entity, path.key, path.relation, path.view].filter(Boolean).join('/')\n}\n\nfunction* getLastEntityInPath(path) {\n if (!path || !path.entity || !path.key || path.view === 'action') {\n return null\n }\n\n const baseModel = yield call(rest.fetchModel, path.entity)\n\n if (!path.relation) {\n // no relations => base entity is the last entity\n return {entityName: baseModel.name, key: path.key}\n }\n\n const splittedEntities = path.relation.match(relationPathRegex)\n if (splittedEntities.length < 1) {\n return null\n }\n\n let parentModel = baseModel\n let lastEntity = null\n\n for (let i = 0; i < splittedEntities.length; i++) {\n const [relationName, key] = splittedEntities[i].split('/')\n const relation = parentModel.paths[relationName]\n\n if (!relation || !key) {\n // no key = no entity (e.g. list or create view)\n return null\n }\n\n parentModel = yield call(rest.fetchModel, relation.targetEntity)\n lastEntity = {entityName: parentModel.name, key}\n }\n\n return lastEntity\n}\n\nexport function* loadRelationInfos(model, key) {\n const resource = `client/entities/${model}/${key}/relations`\n const relationInfoResponse = yield call(rest.requestSaga, resource)\n const relationsInfo = relationInfoResponse.body.relations\n yield put(actions.setRelationsInfo(relationsInfo))\n}\n","import {fork, all} from 'redux-saga/effects'\n\nimport reducer from './reducer'\nimport moduleSagas from './sagas'\n\nexport function* sagas() {\n yield all([fork(moduleSagas)])\n}\n\nexport default reducer\n","import {combineReducers} from 'redux'\n\nimport EntitiesRoute from './components/EntitiesRoute'\nimport path from './modules/path'\nimport sagas from './modules/path/sagas'\n\nexport default {\n container: EntitiesRoute,\n reducers: {\n entities: combineReducers({path})\n },\n sagas: [sagas]\n}\n","import {call} from 'redux-saga/effects'\nimport {api} from 'tocco-util'\n\nimport rest from '../rest'\n\nexport function* enhanceEntityWithDisplayExpressions(entity, formName, fieldDefinitions, mode) {\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\nfunction* 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 return yield call(rest.fetchDisplayExpressions, formName, mode, keys, paths, entityName)\n }\n}\n\nexport function* enhanceEntityWithDisplays(entity, fieldDefinitions) {\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 entity[relationField] = Array.isArray(value)\n ? value.filter(v => v !== null).map(v2 => ({...v2, display: displays[v2.model][v2.key]}))\n : {...value, display: displays[value.model][value.key]}\n }\n })\n}\n\nfunction* 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","import {enhanceEntityWithDisplayExpressions, enhanceEntityWithDisplays} from './functions'\n\nexport default {\n enhanceEntityWithDisplayExpressions,\n enhanceEntityWithDisplays\n}\n","import createGetFormInitialValues from './selectors/getFormInitialValues';\nimport plain from './structure/plain';\nexport default createGetFormInitialValues(plain);","export default function createGetFormInitialValues(_ref) {\n var getIn = _ref.getIn;\n return function (form, getFormState) {\n return function (state) {\n var nonNullGetFormState = getFormState || function (state) {\n return getIn(state, 'form');\n };\n\n return getIn(nonNullGetFormState(state), form + \".initial\");\n };\n };\n}","export default {\n CREATE: 'create',\n UPDATE: 'update'\n}\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 styled from 'styled-components'\nimport {colorizeText, StyledSpan, theme, scale, declareNoneWrappingText} from 'tocco-ui'\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 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>\n <FormattedMessage id={labelId} />:\n </StyledFooterItemLabel>\n <StyledFooterItemValue>\n <ValueComp />\n </StyledFooterItemValue>\n </StyledFooterItemWrapper>\n)\n\nFooterItem.propTypes = {\n labelId: PropTypes.string.isRequired,\n valueComponent: PropTypes.func.isRequired\n}\n\nexport default FooterItem\n","import 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 {selectUnit} from '@formatjs/intl-utils'\nimport PropTypes from 'prop-types'\nimport {FormattedRelativeTime} from 'react-intl'\nimport {FormattedValue} from 'tocco-ui'\n\nimport {StyledTimestampRelativeValue, StyledTimestampValueWrapper} from './StyledComponents'\n\nconst TimestampValue = ({value}) => {\n const {value: diffValue, unit} = selectUnit(new Date(value))\n\n return (\n <StyledTimestampValueWrapper>\n <FormattedValue value={value} type=\"datetime\" />\n <StyledTimestampRelativeValue>\n (<FormattedRelativeTime value={diffValue} unit={unit} />)\n </StyledTimestampRelativeValue>\n </StyledTimestampValueWrapper>\n )\n}\n\nTimestampValue.propTypes = {\n value: PropTypes.string.isRequired\n}\n\nexport default TimestampValue\n","import PropTypes from 'prop-types'\n\nimport FooterItem from './FooterItem'\nimport {StyledFooterWrapper} from './StyledComponents'\nimport TextValue from './TextValue'\nimport TimestampValue from './TimestampValue'\n\nconst DetailFooterFull = ({entity, keyField}) => (\n <StyledFooterWrapper>\n <div>\n <FooterItem\n labelId=\"client.entity-detail.footer.created\"\n valueComponent={() => <TimestampValue value={entity.paths.create_timestamp.value} />}\n />\n <FooterItem\n labelId=\"client.entity-detail.footer.by\"\n valueComponent={() => <TextValue value={entity.paths.create_user.value} />}\n />\n </div>\n <div>\n <FooterItem\n labelId=\"client.entity-detail.footer.updated\"\n valueComponent={() => <TimestampValue value={entity.paths.update_timestamp.value} />}\n />\n <FooterItem\n labelId=\"client.entity-detail.footer.by\"\n valueComponent={() => <TextValue value={entity.paths.update_user.value} />}\n />\n </div>\n <div>\n <FooterItem\n labelId=\"client.entity-detail.footer.version\"\n valueComponent={() => <TextValue value={entity.paths.version.value} />}\n />\n <FooterItem\n labelId=\"client.entity-detail.footer.key\"\n valueComponent={() => <TextValue value={entity.paths[keyField].value} />}\n />\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 PropTypes from 'prop-types'\n\nimport FooterItem from './FooterItem'\nimport {StyledFooterWrapper} from './StyledComponents'\nimport TextValue from './TextValue'\n\nconst DetailFooterReduced = ({entity, keyField}) => (\n <StyledFooterWrapper>\n <div>\n <FooterItem\n labelId=\"client.entity-detail.footer.key\"\n valueComponent={() => <TextValue value={entity.paths[keyField].value} />}\n />\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 PropTypes from 'prop-types'\n\nimport {getFooterType} from '../../util/detailFooter/helpers'\nimport types from '../../util/detailFooter/types'\nimport DetailFooterFull from './DetailFooterFull'\nimport DetailFooterReduced from './DetailFooterReduced'\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 {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\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 styled from 'styled-components'\nimport EntityListApp from 'tocco-entity-list/src/main'\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 ? 'simple_advanced' : '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 scrollBehaviour=\"inline\"\n tableMinHeight=\"300px\"\n locale={props.locale}\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 locale: PropTypes.string\n}\n\nexport default SubGrid\n","import SubGrid from './SubGrid'\n\nexport default SubGrid\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 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 {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 locale: state.intl.locale\n})\n\nconst mapActionCreators = {\n onRowClick: e =>\n 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 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 {selectUnit} from '@formatjs/intl-utils'\nimport PropTypes from 'prop-types'\nimport {FormattedMessage, FormattedRelativeTime} from 'react-intl'\nimport styled from 'styled-components'\nimport {form} from 'tocco-app-extensions'\nimport {scale, Typography} from 'tocco-ui'\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 <StyledErrorItemWrapper key=\"hasFieldErrors\">\n <FormattedMessage id=\"client.entity-detail.invalidFieldsError\" />\n </StyledErrorItemWrapper>\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) => (\n <form.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) => (\n <form.ErrorItem key={idx} message={message} />\n ))}\n </StyledErrorItemWrapper>\n )\n }\n\n if (elements.length > 0) {\n output = <>{elements.map(el => el)}</>\n }\n return output\n}\n\nErrorItems.propTypes = {\n formErrors: PropTypes.object\n}\n\nexport default ErrorItems\n","import ErrorItems from './ErrorItems'\n\nexport default ErrorItems\n","import styled from 'styled-components'\nimport {Button, theme} from 'tocco-ui'\n\nexport const StyledSaveButton = styled(Button)`\n ${({hasErrors}) =>\n hasErrors &&\n `\n background-color: ${theme.color('paper')};\n `}\n display: block;\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 PropTypes from 'prop-types'\nimport {Popover} from 'tocco-ui'\n\nimport modes from '../../util/modes'\nimport ErrorItems from '../ErrorItems'\nimport {StyledSaveButton} from './StyledComponents'\n\nconst SaveButton = ({submitting, mode, intl, hasErrors, formErrors, icon}) => {\n const msg = id => intl.formatMessage({id})\n\n return (\n <Popover content={hasErrors ? <ErrorItems formErrors={formErrors} /> : null} 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 PropTypes from 'prop-types'\nimport {useState, useEffect} from 'react'\nimport {connect} from 'react-redux'\nimport {Icon, Typography} from 'tocco-ui'\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 (\n <Typography.Span>\n <StyledActionSpan\n marked={marked}\n onClick={handleClick}\n onMouseEnter={() => setMouseOver(true)}\n onMouseLeave={() => setMouseOver(false)}\n >\n <Icon icon={marked || mouseOver ? 'star-full' : 'star'} />\n </StyledActionSpan>\n </Typography.Span>\n )\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 {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}) =>\n hasErrors &&\n `\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 PropTypes from 'prop-types'\nimport {useEffect, useMemo, useRef} from 'react'\nimport {reduxForm} from 'redux-form'\nimport {form} from 'tocco-app-extensions'\nimport {react as customHooks, env} from 'tocco-util'\n\nimport DetailFooterContainer from '../../containers/DetailFooterContainer'\nimport SubGrid from '../../util/detailView/fromFieldFactories/subGrid'\nimport {SaveButton, MarkButton} from '../Actions'\nimport {StyledForm} from './StyledComponents'\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 customHooks.useAutofocus(formEl)\n const formEventProps = form.hooks.useFormEvents({submitForm})\n\n useEffect(() => {\n fireTouched(dirty && anyTouched)\n }, [dirty, anyTouched, fireTouched])\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 ),\n mark: actionDefinition => <MarkButton {...actionDefinition} />\n }),\n [submitting, mode, valid, anyTouched, formErrors, intl]\n )\n\n const embedType = env.getEmbedType()\n\n return (\n <StyledForm {...formEventProps} ref={formEl}>\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 {embedType === 'admin' && <DetailFooterContainer />}\n </StyledForm>\n )\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 {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\nimport {getFormValues, getFormInitialValues} from 'redux-form'\nimport {errorLogging, form} from 'tocco-app-extensions'\n\nimport DetailForm from '../components/DetailForm/DetailForm'\nimport {unloadDetailView, submitForm, fireTouched} from '../modules/entityDetail/actions'\n\nconst mapActionCreators = {\n unloadDetailView,\n submitForm,\n fireTouched,\n logError: errorLogging.logError\n}\n\nconst mapStateToProps = state => ({\n formDefinition: state.entityDetail.formDefinition,\n entity: state.entityDetail.entity,\n formValues: getFormValues('detailForm')(state),\n formErrors: form.selectors.getFormErrors('detailForm')(state),\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 {useEffect} from 'react'\nimport {form} from 'tocco-app-extensions'\nimport {LoadMask} from 'tocco-ui'\n\nimport DetailFormContainer from '../../containers/DetailFormContainer'\n\nconst DetailView = ({unloadDetailView, mode, formInitialValues, fieldDefinitions, formDefinition, intl}) => {\n useEffect(() => {\n return () => {\n unloadDetailView()\n }\n }, [unloadDetailView])\n\n const handleAsyncValidate = form.hooks.useAsyncValidation({formInitialValues, fieldDefinitions, mode})\n const handleAyncValidate = form.hooks.useSyncValidation({fieldDefinitions, formDefinition})\n\n const msg = id => intl.formatMessage({id})\n const fieldDefinitionPaths = fieldDefinitions.map(fD => fD.path)\n\n return (\n <LoadMask required={[formInitialValues]} loadingText={msg('client.entity-detail.loadingText')}>\n <DetailFormContainer\n mode={mode}\n validate={handleAyncValidate}\n asyncValidate={handleAsyncValidate}\n asyncBlurFields={fieldDefinitionPaths}\n />\n </LoadMask>\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 formDefinition: PropTypes.object.isRequired,\n entityName: PropTypes.string.isRequired,\n entityId: PropTypes.string,\n formInitialValues: PropTypes.shape({\n initial: PropTypes.objectOf(PropTypes.string)\n })\n}\n","import {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\nimport {getFormInitialValues} from 'redux-form'\nimport {errorLogging} from 'tocco-app-extensions'\n\nimport DetailView from '../components/DetailView/DetailView'\nimport {loadDetailView, unloadDetailView} from '../modules/entityDetail/actions'\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 formDefinition: state.entityDetail.formDefinition,\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 {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 {action} from 'tocco-util'\n\nimport {\n loadDetailView,\n setAppId,\n setDefaultValues,\n setEntityId,\n setEntityName,\n setFormName,\n setMode\n} from './modules/entityDetail/actions'\n\nexport const getDispatchActions = input => {\n const actions = action.getDispatchActions(input, actionSettings)\n\n if (actions.length > 0) {\n actions.push(loadDetailView())\n }\n\n return actions\n}\n\nconst actionSettings = [\n {\n name: 'entityName',\n action: setEntityName,\n argsFactory: input => [input.entityName]\n },\n {\n name: 'entityId',\n action: setEntityId,\n argsFactory: input => [input.entityId || null]\n },\n {\n name: 'mode',\n action: setMode,\n argsFactory: input => [input.mode]\n },\n {\n name: 'formName',\n action: setFormName,\n argsFactory: input => [input.formName]\n },\n {\n name: 'id',\n action: setAppId,\n argsFactory: input => [input.id]\n },\n {\n name: 'defaultValues',\n action: setDefaultValues,\n argsFactory: input => [input.defaultValues]\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, {formSagaConfig} from './sagas'\n\nexport {sagas, formSagaConfig}\nexport default reducer\n","import {SubmissionError} from 'redux-form/es/SubmissionError'\nimport {call} from 'redux-saga/effects'\nimport {form, rest} from 'tocco-app-extensions'\n\nexport function* updateEntity(entity, fieldDefinitions, 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, fieldDefinitions, 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, fieldDefinitions, paths = []) {\n const options = {\n method: 'POST',\n queryParams: {\n _paths: paths.join(',')\n },\n body: entity,\n acceptedErrorCodes: ['VALIDATION_FAILED'],\n acceptedStatusCodes: [403, 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, fieldDefinitions, resp.body.errors))\n }\n\n if (resp.status === 403) {\n throw new rest.ForbiddenException()\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","import {actions as formActions, isValid as isValidSelector} from 'redux-form'\nimport {all, call, fork, put, select, takeEvery, takeLatest} from 'redux-saga/effects'\nimport {\n actions as actionExtensions,\n externalEvents,\n form,\n notification,\n remoteEvents,\n rest,\n display\n} from 'tocco-app-extensions'\nimport {api} from 'tocco-util'\n\nimport {createEntity, updateEntity} from '../../util/api/entities'\nimport {getFooterPaths} from '../../util/detailFooter/helpers'\nimport modes from '../../util/modes'\nimport * as actions from './actions'\n\nexport const formInitialValueSelector = (state, formId) => state.form[formId].initial\n\nexport const entityDetailSelector = state => state.entityDetail\n\nexport const inputSelector = state => state.input\n\nexport const FORM_ID = 'detailForm'\n\nexport const formSagaConfig = {\n formId: FORM_ID,\n stateSelector: entityDetailSelector\n}\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, form.sagasUtils.touchAllFields, formSagaConfig),\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 takeLatest(actions.UPDATE_MARKED, updateMarked),\n takeLatest(actionExtensions.actions.ACTION_INVOKED, reloadAfterAction)\n ])\n}\n\nexport function* loadDetailFormDefinition(formName, mode) {\n const {modifyFormDefinition} = yield select(inputSelector)\n const formDefinition = yield call(rest.fetchForm, formName, mode)\n const modifiedFormDefinition = modifyFormDefinition ? modifyFormDefinition(formDefinition) : formDefinition\n yield put(actions.setFormDefinition(modifiedFormDefinition))\n const fieldDefinitions = yield call(form.getFieldDefinitions, modifiedFormDefinition)\n yield put(actions.setFieldDefinitions(fieldDefinitions))\n return {formDefinition: modifiedFormDefinition, 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}, fieldDefinitions)\n yield put(formActions.initialize(FORM_ID, formValues))\n } else {\n yield call(loadData)\n }\n}\n\nexport function* updateFormSubmit(entity, fieldDefinitions) {\n const updateResponse = yield call(updateEntity, entity, fieldDefinitions)\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, fieldDefinitions) {\n const createdEntityId = yield call(createEntity, entity, fieldDefinitions)\n yield put(externalEvents.fireExternalEvent('onEntityCreated', {id: createdEntityId}))\n yield call(showNotification, 'success', 'createSuccessfulTitle', 'createSuccessfulMessage')\n}\n\nexport function* submitValidate() {\n const {formValues, initialValues, mode, fieldDefinitions} = yield call(\n form.sagasUtils.getCurrentEntityState,\n formSagaConfig\n )\n yield call(form.submitValidation, formValues, initialValues, fieldDefinitions, mode)\n}\n\nexport function* submitForm() {\n try {\n const isValid = yield select(isValidSelector(FORM_ID))\n if (!isValid) {\n yield call(form.sagasUtils.handleInvalidForm, formSagaConfig)\n } else {\n yield put(formActions.startSubmit(FORM_ID))\n const {mode, fieldDefinitions} = yield select(entityDetailSelector)\n yield call(submitValidate)\n const entity = yield call(form.sagasUtils.getEntityForSubmit, formSagaConfig)\n if (mode === modes.UPDATE) {\n yield call(updateFormSubmit, entity, fieldDefinitions)\n } else if (mode === modes.CREATE) {\n yield call(createFormSubmit, entity, fieldDefinitions)\n }\n }\n } catch (error) {\n yield call(form.sagasUtils.handleSubmitError, formSagaConfig, 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(\n externalEvents.fireExternalEvent('onTouchedChange', {\n touched: actionTouched\n })\n )\n yield put(actions.setTouched(actionTouched))\n }\n}\n\nexport function* showNotification(type, titleResourceName, messageResourceName) {\n yield put(\n notification.toaster({\n type,\n title: `client.entity-detail.${titleResourceName}`,\n body: `client.entity-detail.${messageResourceName}`\n })\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* loadData(reset = true) {\n const {entityName, entityId, fieldDefinitions, formName, entityModel, mode} = 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(display.enhanceEntityWithDisplayExpressions, flattenEntity, formName, fieldDefinitions, mode)\n yield call(display.enhanceEntityWithDisplays, flattenEntity, fieldDefinitions)\n\n const formValues = yield call(form.entityToFormValues, flattenEntity, fieldDefinitions)\n\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, true)\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 (event.type === 'action-trigger-event') {\n yield put(event.payload.func(...event.payload.args))\n } else 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","import {reducer as form} from 'redux-form'\n\nimport entityDetailReducer, {sagas as entityDetailSagas, formSagaConfig} from './entityDetail'\n\nexport default {\n entityDetail: entityDetailReducer,\n form\n}\n\nexport const sagas = [entityDetailSagas]\nexport {formSagaConfig}\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 {\n actionEmitter,\n actions,\n appFactory,\n errorLogging,\n externalEvents,\n formData,\n keyDown,\n notification,\n form\n} from 'tocco-app-extensions'\nimport EntityListApp from 'tocco-entity-list/src/main'\nimport SimpleFormApp from 'tocco-simple-form/src/main'\nimport {navigationStrategy, reducer as reducerUtil} from 'tocco-util'\n\nimport {SaveButton} from './components/Actions'\nimport ErrorItems from './components/ErrorItems'\nimport DetailViewContainer from './containers/DetailViewContainer'\nimport customActions from './customActions'\nimport {getDispatchActions} from './input'\nimport reducers, {sagas, formSagaConfig} from './modules/reducers'\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 form.addToStore(store, formSagaConfig)\n actions.addToStore(store, {\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 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 app = appFactory.createApp(packageName, content, store, {\n input,\n events,\n actions: getDispatchActions(input),\n publicPath,\n textResourceModules: ['component', 'common', 'entity-list', 'entity-detail']\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\nconst EntityDetailApp = props => {\n const {component} = appFactory.useApp({initApp, props, packageName: props.id, externalEvents: EXTERNAL_EVENTS})\n return component\n}\n\nEntityDetailApp.propTypes = {\n entityName: PropTypes.string.isRequired,\n entityId: PropTypes.string,\n formName: PropTypes.string.isRequired,\n mode: PropTypes.oneOf(['update', 'create']),\n defaultValues: PropTypes.array,\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 modifyFormDefinition: PropTypes.func\n}\n\nexport default EntityDetailApp\nexport {SaveButton, ErrorItems}\n"],"sourceRoot":""}