tocco-admin 1.0.8 → 1.0.12
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.
- package/changelog.md +12 -0
- package/dist/chunk-207.d0f723a065f98fb4a50d.js +2 -0
- package/dist/chunk-207.d0f723a065f98fb4a50d.js.map +1 -0
- package/dist/chunk-404.9a698fdc051c69bf1ffa.js +2 -0
- package/dist/chunk-404.9a698fdc051c69bf1ffa.js.map +1 -0
- package/dist/chunk-actions.20eff8b3e149c54d77f2.js +2 -0
- package/dist/chunk-actions.20eff8b3e149c54d77f2.js.map +1 -0
- package/dist/{chunk-docs-actions.fe615fd8e3c8ff68c449.js → chunk-docs-actions.9c46b27e36cc37c3782e.js} +2 -2
- package/dist/chunk-docs-actions.9c46b27e36cc37c3782e.js.map +1 -0
- package/dist/chunk-vendor-icons.b288cd57b9a131a2c6cd.js +1 -0
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
- package/dist/chunk-207.cc1646ee6c7a19f6220b.js +0 -2
- package/dist/chunk-207.cc1646ee6c7a19f6220b.js.map +0 -1
- package/dist/chunk-404.e573ba4c4c7cedc843f3.js +0 -2
- package/dist/chunk-404.e573ba4c4c7cedc843f3.js.map +0 -1
- package/dist/chunk-actions.c7efc5f5036d72d3b972.js +0 -2
- package/dist/chunk-actions.c7efc5f5036d72d3b972.js.map +0 -1
- package/dist/chunk-docs-actions.fe615fd8e3c8ff68c449.js.map +0 -1
- package/dist/chunk-vendor-icons.aae1dc235d12dd74b38e.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["webpack:///./packages/admin/src/routes/entities/modules/path/actions.js","webpack:///./packages/admin/src/routes/entities/components/Action/LazyAction.js","webpack:///./packages/admin/src/routes/entities/components/ActionView/ActionView.js","webpack:///./packages/admin/src/routes/entities/components/ActionView/ActionViewContainer.js","webpack:///./packages/admin/src/routes/entities/components/CreateView/CreateView.js","webpack:///./packages/admin/src/routes/entities/components/CreateView/CreateViewContainer.js","webpack:///./packages/admin/src/routes/entities/components/DocsView/DocsView.js","webpack:///./packages/admin/src/routes/entities/components/DocsView/index.js","webpack:///./packages/admin/src/routes/entities/components/ListView/DocsViewAdapter.js","webpack:///./packages/admin/src/routes/entities/components/ListView/ListView.js","webpack:///./packages/admin/src/routes/entities/components/ListView/ListViewContainer.js","webpack:///./packages/admin/src/routes/entities/components/EditView/EditView.js","webpack:///./packages/admin/src/routes/entities/components/EditView/EditViewContainer.js","webpack:///./packages/admin/src/routes/entities/utils/relationPersistor.js","webpack:///./packages/admin/src/routes/entities/components/RelationsView/DocsViewAdapter.js","webpack:///./packages/admin/src/routes/entities/components/RelationsView/ListView.js","webpack:///./packages/admin/src/routes/entities/components/RelationsView/StyledComponents.js","webpack:///./packages/admin/src/routes/entities/components/RelationsView/RelationBox.js","webpack:///./packages/admin/src/routes/entities/components/RelationsView/RelationsView.js","webpack:///./packages/admin/src/routes/entities/components/RelationsView/RelationViewContainer.js","webpack:///./packages/admin/src/routes/entities/components/RelationsView/index.js","webpack:///./packages/admin/src/routes/entities/components/DetailView/StyledComponents.js","webpack:///./packages/admin/src/routes/entities/components/DetailView/DetailView.js","webpack:///./packages/admin/src/routes/entities/components/DetailView/DetaiViewContainer.js","webpack:///./packages/admin/src/routes/entities/components/EntityRecordRoute/EntityRecordRoute.js","webpack:///./packages/admin/src/routes/entities/components/EntityRecordRoute/index.js","webpack:///./packages/admin/src/routes/entities/components/EntityRoute/EntityRoute.js","webpack:///./packages/admin/src/routes/entities/components/EntityRoute/index.js","webpack:///./packages/admin/src/routes/entities/components/EntitiesOverview/EntitiesOverview.js","webpack:///./packages/admin/src/routes/entities/components/EntitiesOverview/index.js","webpack:///./packages/admin/src/routes/entities/components/Breadcrumbs/BreadcrumbsContainer.js","webpack:///./packages/admin/src/routes/entities/components/ErrorView/EntityErrorView.js","webpack:///./packages/admin/src/routes/entities/components/ErrorView/ErrorViewContainer.js","webpack:///./packages/admin/src/routes/entities/components/EntitiesRoute/EntitiesRoute.js","webpack:///./packages/admin/src/routes/entities/components/EntitiesRoute/EntitiesRouteContainer.js","webpack:///./packages/admin/src/routes/entities/components/EntitiesRoute/index.js","webpack:///./packages/admin/src/routes/entities/modules/path/reducer.js","webpack:///./packages/admin/src/routes/entities/utils/url.js","webpack:///./packages/admin/src/routes/entities/modules/path/sagas.js","webpack:///./packages/admin/src/routes/entities/modules/path/index.js","webpack:///./packages/admin/src/routes/entities/route.js","webpack:///./node_modules/redux-form/es/getFormInitialValues.js","webpack:///./node_modules/redux-form/es/selectors/getFormInitialValues.js","webpack:///./packages/entity-detail/src/util/modes.js","webpack:///./packages/entity-detail/src/util/detailFooter/types.js","webpack:///./packages/entity-detail/src/util/detailFooter/helpers.js","webpack:///./packages/entity-detail/src/components/DetailFooter/StyledComponents.js","webpack:///./packages/entity-detail/src/components/DetailFooter/FooterItem.js","webpack:///./packages/entity-detail/src/components/DetailFooter/TextValue.js","webpack:///./packages/entity-detail/src/components/DetailFooter/TimestampValue.js","webpack:///./packages/entity-detail/src/components/DetailFooter/DetailFooterFull.js","webpack:///./packages/entity-detail/src/components/DetailFooter/DetailFooterReduced.js","webpack:///./packages/entity-detail/src/components/DetailFooter/DetailFooter.js","webpack:///./packages/entity-detail/src/containers/DetailFooterContainer.js","webpack:///./packages/entity-detail/src/components/SubGrid/SubGrid.js","webpack:///./packages/entity-detail/src/components/SubGrid/index.js","webpack:///./packages/entity-detail/src/modules/entityDetail/actions.js","webpack:///./packages/entity-detail/src/containers/SubGridContainer.js","webpack:///./packages/entity-detail/src/util/detailView/fromFieldFactories/subGrid.js","webpack:///./packages/entity-detail/src/components/DetailForm/StyledComponents.js","webpack:///./packages/entity-detail/src/components/DetailForm/MarkButton.js","webpack:///./packages/entity-detail/src/components/ErrorItems/ErrorItems.js","webpack:///./packages/entity-detail/src/components/ErrorItems/index.js","webpack:///./packages/entity-detail/src/components/DetailForm/SaveButton.js","webpack:///./packages/entity-detail/src/components/DetailForm/DetailForm.js","webpack:///./packages/entity-detail/src/containers/DetailFormContainer.js","webpack:///./packages/entity-detail/src/components/DetailView/DetailView.js","webpack:///./packages/entity-detail/src/containers/DetailViewContainer.js","webpack:///./packages/entity-detail/src/customActions.js","webpack:///./packages/entity-detail/src/input.js","webpack:///./packages/entity-detail/src/modules/entityDetail/reducer.js","webpack:///./packages/entity-detail/src/modules/entityDetail/index.js","webpack:///./packages/entity-detail/src/util/api/entities.js","webpack:///./packages/entity-detail/src/modules/entityDetail/sagas.js","webpack:///./packages/entity-detail/src/modules/reducers.js","webpack:///./packages/entity-detail/src/shortcuts.js","webpack:///./packages/entity-detail/src/main.js","webpack:///./packages/admin/node_modules/path-to-regexp/index.js"],"names":["setCurrentViewInfo","location","currentViewInfo","type","payload","updateBreadcrumbsInfo","path","breadcrumbsInfo","setRelations","relations","setRelationsInfo","relationsInfo","selectRelation","selectedRelation","actions","lazy","resourcescheduler","delete","merge","copy","documents","LoadMask","props","appId","LazyAction","consoleLogger","ActionComponent","connect","emitAction","action","actionEmitter","Suspense","fallback","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","folderKey","setFolderKey","fetchFolder","rest","then","res","body","key","sortable","searchFormType","rootNodes","embedded","selectionStyle","disableViewPersistor","scrollBehaviour","parentModel","searchFormCollapsed","saveUserPreferences","queryString","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","icon","relation","relationDisplay","msg","onClick","entity","setRelation","title","label","count","aria-label","to","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","pathParts","pathToRegexp","exec","reduce","acc","pathPart","idx","parseResult","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","_ref","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","defaultProps","SET_LAST_SAVE","setFormDefinition","formDefinition","loadDetailView","modelPaths","setEntity","submitForm","setLastSave","lastSave","now","setEntityModel","unloadDetailView","setFieldDefinitions","fieldDefinitions","navigateToAction","definition","setMarked","marked","externalEvents","input","SubGridContainer","undefined","StyledForm","StyledSaveButton","hasErrors","StyledActionSpan","colors","secondary","updateMarked","mouseOver","setMouseOver","stopPropagation","onMouseEnter","onMouseLeave","ErrorItem","StyledErrorItemWrapper","formErrors","output","elements","hasFieldErrors","hasValidatorErrors","hasRelatedEntityErrors","validatorErrors","relatedEntityErrorsCompact","outdatedError","updateTimestamp","timeStampValue","titleId","sameEntity","ago","user","updateUser","el","submitting","Popover","placement","data-cy","disabled","ink","look","pending","DetailFooterContainer","reduxForm","destroyOnUnmount","fireTouched","dirty","valid","formValues","anyTouched","formEl","useRef","customHooks","customRenderedActions","useMemo","save","actionDefinition","mark","onSubmit","event","preventDefault","onKeyDown","target","tagName","ref","fieldMappingType","readOnly","componentMapping","logError","errorLogging","getFormValues","getFormSyncErrors","getFormAsyncErrors","getFormSubmitErrors","_error","formInitialValues","getFormInitialValues","DetailForm","validateSingleton","_isEmpty","this","required","loadingText","DetailFormContainer","validate","getSyncValidation","asyncValidate","handledAsyncValidate","asyncBlurFields","fD","new","fullscreen","getDispatchActions","updateEntity","createEntity","options","method","_paths","acceptedErrorCodes","acceptedStatusCodes","resp","errorCode","SubmissionError","errors","status","information","headers","get","pop","Error","autoComplete","onChange","loadDetailFormDefinition","loadEntity","loadEntityModel","updateFormSubmit","createFormSubmit","touchAllFields","handleSubmitError","getCurrentEntityState","submitValidate","getEntityForSubmit","getFormErrors","locationFieldFocus","focusErrorField","handleInvalidForm","showNotification","loadDisplayExpressions","loadRelationDisplays","enhanceEntityWithDisplayExpressions","enhanceEntityWithDisplays","loadData","loadMarked","reloadAfterAction","remoteEvent","asyncValidationStop","formInitialValueSelector","formId","initial","entityDetailSelector","FORM_ID","inputSelector","takeEvery","remoteEvents","debounce","formActionTypes","actionExtensions","fieldName","autoCompleteEndpoint","triggerField","response","currentFieldValue","formActions","meta","field","fieldDefinition","fd","formPaths","footerPaths","formDefaultValues","inputDefaultValues","defaultValuesFields","api","flattenEntity","createdEntityId","f","validationErrors","notification","duration","initialFormValues","initialValues","dirtyFields","dirtyFieldNames","focusField","element","document","getElementById","focus","errorField","locationField","locationMapping","postcode","firstErrorField","isValidSelector","actionTouched","stateTouched","titleResourceName","messageResourceName","__key","__model","result","relationFields","request","displayExpressions","componentType","displayExpressionsL","forEach","dE","dataType","displays","relationField","newValue","Array","isArray","v","v2","reset","markable","fork","keepDirty","keepValues","navigateToActionRelative","isCurrentEntity","entityDetailReducer","entityDetailSagas","ctrl","alt","code","EXTERNAL_EVENTS","DetailViewContainer","initApp","events","publicPath","appFactory","formApp","SimpleFormApp","listApp","EntityListApp","customActions","appComponent","context","viewName","formData","detailApp","EntityDetailApp","keyDown","shortcuts","dispatchActions","app","textResourceModules","packageName","propTypes","PropTypes","module","exports","parse","compile","tokensToFunction","tokensToRegExp","PATH_REGEXP","RegExp","tokens","index","defaultDelimiter","delimiter","whitelist","pathEscaped","m","escaped","offset","slice","prev","capture","group","modifier","c","indexOf","repeat","optional","pattern","escapeGroup","escapeString","substr","matches","data","encode","encodeURIComponent","token","segment","TypeError","j","test","String","flags","sensitive","strict","start","end","endsWith","concat","route","endToken","isEndDelimited","groups","source","regexpToRegexp","parts","arrayToRegexp","stringToRegexp"],"mappings":"8KAWa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OtD,EAGlB,IAAI2oB,EAAS3oB,EAAK4oB,OAAO/mB,MAAM,aAE/B,GAAI8mB,EACF,IAAK,IAAIvY,EAAI,EAAGA,EAAIuY,EAAOnlB,OAAQ4M,IACjC9M,EAAKkC,KAAK,CACRT,KAAMqL,EACNjD,OAAQ,KACRiZ,UAAW,KACXc,UAAU,EACVD,QAAQ,EACRE,QAAS,OAKf,OAAOnnB,EA2GE6oB,CAAe7oB,EAAMsD,GAG1B0f,MAAMC,QAAQjjB,GAnGpB,SAAwBA,EAAMsD,EAAM+Y,GAGlC,IAFA,IAAIyM,EAAQ,GAEH1Y,EAAI,EAAGA,EAAIpQ,EAAKwD,OAAQ4M,IAC/B0Y,EAAMtjB,KAAK8I,EAAatO,EAAKoQ,GAAI9M,EAAM+Y,GAASuM,QAGlD,OAAO,IAAI5C,OAAO,MAAQ8C,EAAMpX,KAAK,KAAO,IAAKuW,EAAM5L,IA6F9C0M,CAAoC,EAAQzlB,EAAM+Y,GAlF7D,SAAyBrc,EAAMsD,EAAM+Y,GACnC,OAAOyJ,EAAeH,EAAM3lB,EAAMqc,GAAU/Y,EAAM+Y,GAoF3C2M,CAAqC,EAAQ1lB,EAAM+Y","file":"chunk-404.9a698fdc051c69bf1ffa.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 React, {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 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}\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])\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 React, {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 React, {useEffect, useState} from 'react'\nimport {rest} from 'tocco-app-extensions'\nimport DocsBrowserApp from 'tocco-docs-browser/src/main'\n\nconst DocsView = ({entityName, entityKey, showActions, noLeftPadding, openResource}) => {\n const [folderKey, setFolderKey] = useState(null)\n\n const fetchFolder = async () => {\n rest.simpleRequest('entities/2.0/' + entityName + '/' + entityKey + '/entitydocs/folder').then(res => {\n setFolderKey(res.body.key)\n })\n }\n\n useEffect(() => {\n fetchFolder()\n }, [])\n\n return (\n folderKey && (\n <DocsBrowserApp\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}\n\nexport default DocsView\n","import DocsView from './DocsView'\n\nexport default DocsView\n","import React from 'react'\n\nimport {currentViewPropType} from '../../utils/propTypes'\nimport DocsView from '../DocsView'\n\nconst DocsViewAdapter = ({currentViewInfo}) => (\n <DocsView\n noLeftPadding={false}\n entityName={currentViewInfo.parentModel.name}\n entityKey={currentViewInfo.parentKey}\n showActions={true}\n />\n)\n\nDocsViewAdapter.propTypes = {\n currentViewInfo: currentViewPropType\n}\n\nexport default DocsViewAdapter\n","import PropTypes from 'prop-types'\nimport queryString from 'query-string'\nimport React from 'react'\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 if (currentViewInfo.model.name === 'Resource') {\n return <DocsViewAdapter currentViewInfo={currentViewInfo} />\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 React, {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'\nimport React from 'react'\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=\"simple\"\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 React from 'react'\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> ({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, {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 = () => {\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 }\n\n useEffect(updateSelectedRelation, [relations])\n useEffect(() => (!selectedRelation ? updateSelectedRelation() : null), [selectedRelation])\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 React, {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 React from 'react'\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 React from 'react'\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 React from 'react'\nimport {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 React from 'react'\nimport {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 React, {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])\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 pathToRegexp from 'path-to-regexp'\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 pathParts = []\n const re = pathToRegexp(entityUrlRegex, pathParts)\n const res = re.exec(pathname)\n\n if (res !== null) {\n return pathParts.reduce((acc, pathPart, idx) => {\n return {\n ...acc,\n [pathPart.name]: res[idx + 1]\n }\n }, {})\n }\n\n const actionPathRegex = pathToRegexp(actionUrlRegex, pathParts)\n const parseResult = actionPathRegex.exec(pathname)\n\n if (parseResult !== null) {\n return {\n actionId: parseResult[1]\n }\n }\n\n return null\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: 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 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 React from 'react'\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 React from 'react'\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 React from 'react'\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'\nimport React from 'react'\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'\nimport React from 'react'\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'\nimport React from 'react'\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 React from 'react'\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 ? 'basic' : 'none'}\n navigationStrategy={props.navigationStrategy}\n showLink={true}\n onRowClick={e => {\n if (props.onRowClick) {\n props.onRowClick({\n id: e.id,\n gridName: props.formField.path,\n relationName: props.formField.path\n })\n }\n }}\n onNavigateToCreate={() => {\n props.navigateToCreate(props.formField.path)\n }}\n parent={{\n key: props.entityKey,\n reverseRelationName: props.formField.reverseRelation,\n model: props.entityName,\n relationName: props.formField.path\n }}\n emitAction={props.emitAction}\n store={viewPersistor.viewInfoSelector(id).store}\n onStoreCreate={store => {\n viewPersistor.persistViewInfo(id, {store})\n }}\n scrollBehaviour=\"inline\"\n tableMinHeight=\"300px\"\n />\n </StyledListApp>\n )\n}\n\nSubGrid.defaultProps = {\n limit: 5\n}\n\nSubGrid.propTypes = {\n entityKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n entityName: PropTypes.string.isRequired,\n detailFormName: PropTypes.string.isRequired,\n formField: PropTypes.shape({\n path: PropTypes.string,\n targetEntity: PropTypes.string,\n reverseRelation: PropTypes.string\n }).isRequired,\n onRowClick: PropTypes.func,\n navigateToCreate: PropTypes.func.isRequired,\n showSubGridsCreateButton: PropTypes.bool,\n appId: PropTypes.string,\n showSearchForm: PropTypes.bool,\n limit: PropTypes.number,\n emitAction: PropTypes.func.isRequired,\n navigationStrategy: PropTypes.objectOf(PropTypes.func)\n}\n\nexport default SubGrid\n","import SubGrid from './SubGrid'\n\nexport default SubGrid\n","export const SET_FORM_DEFINITION = 'entityDetail/SET_FORM_DEFINITION'\nexport const LOAD_DETAIL_VIEW = 'entityDetail/LOAD_DETAIL_VIEW'\nexport const SET_ENTITY = 'entityDetail/SET_ENTITY'\nexport const SUBMIT_FORM = 'entityDetail/SUBMIT_FORM'\nexport const SET_LAST_SAVE = 'entityDetail/SET_LAST_SAVE'\nexport const SET_ENTITY_MODEL = 'entityDetail/SET_ENTITY_MODEL'\nexport const UNLOAD_DETAIL_VIEW = 'entityDetail/UNLOAD_DETAIL_VIEW'\nexport const FIRE_TOUCHED = 'entityDetail/FIRE_TOUCHED'\nexport const SET_TOUCHED = 'entityDetail/SET_TOUCHED'\nexport const SET_ENTITY_NAME = 'entityDetail/SET_ENTITY_NAME'\nexport const SET_ENTITY_ID = 'entityDetail/SET_ENTITY_ID'\nexport const SET_MODE = 'entityDetail/SET_MODE'\nexport const SET_FORM_NAME = 'entityDetail/SET_FORM_NAME'\nexport const UPLOAD_DOCUMENT = 'entityDetail/UPLOAD_DOCUMENT'\nexport const SET_APP_ID = 'entityDetail/SET_APP_ID'\nexport const TOUCH_ALL_FIELDS = 'entityDetail/TOCH_ALL_FIELDS'\nexport const SET_DEFAULT_VALUES = 'entityDetail/SET_DEFAULT_VALUES'\nexport const NAVIGATE_TO_CREATE = 'entityDetail/NAVIGATE_TO_CREATE'\nexport const SET_FIELD_DEFINITIONS = 'entityDetail/SET_FIELD_DEFINITIONS'\nexport const NAVIGATE_TO_ACTION = 'entityDetail/NAVIGATE_TO_ACTION'\nexport const UPDATE_MARKED = 'entityDetail/UPDATE_MARKED'\nexport const SET_MARKED = 'entityDetail/SET_MARKED'\n\nexport const setFormDefinition = formDefinition => ({\n type: SET_FORM_DEFINITION,\n payload: {\n formDefinition\n }\n})\n\nexport const loadDetailView = (modelPaths, entityId) => ({\n type: LOAD_DETAIL_VIEW,\n payload: {\n modelPaths,\n entityId\n }\n})\n\nexport const setEntity = entity => ({\n type: SET_ENTITY,\n payload: {\n entity\n }\n})\n\nexport const submitForm = () => ({\n type: SUBMIT_FORM\n})\n\nexport const setLastSave = (lastSave = Date.now()) => ({\n type: SET_LAST_SAVE,\n payload: {\n lastSave\n }\n})\n\nexport const setEntityModel = entityModel => ({\n type: SET_ENTITY_MODEL,\n payload: {\n entityModel\n }\n})\n\nexport const unloadDetailView = () => ({\n type: UNLOAD_DETAIL_VIEW\n})\n\nexport const fireTouched = touched => ({\n type: FIRE_TOUCHED,\n payload: {\n touched\n }\n})\n\nexport const setTouched = touched => ({\n type: SET_TOUCHED,\n payload: {\n touched\n }\n})\n\nexport const setEntityName = entityName => ({\n type: SET_ENTITY_NAME,\n payload: {\n entityName\n }\n})\n\nexport const setEntityId = entityId => ({\n type: SET_ENTITY_ID,\n payload: {\n entityId\n }\n})\n\nexport const setMode = mode => ({\n type: SET_MODE,\n payload: {\n mode\n }\n})\nexport const setFormName = formName => ({\n type: SET_FORM_NAME,\n payload: {\n formName\n }\n})\n\nexport const setAppId = appId => ({\n type: SET_APP_ID,\n payload: {\n appId\n }\n})\n\nexport const touchAllFields = () => ({\n type: TOUCH_ALL_FIELDS\n})\n\nexport const setDefaultValues = defaultValues => ({\n type: SET_DEFAULT_VALUES,\n payload: {\n defaultValues\n }\n})\n\nexport const navigateToCreate = relationName => ({\n type: NAVIGATE_TO_CREATE,\n payload: {\n relationName\n }\n})\n\nexport const setFieldDefinitions = fieldDefinitions => ({\n type: SET_FIELD_DEFINITIONS,\n payload: {\n fieldDefinitions\n }\n})\n\nexport const navigateToAction = (definition, selection) => ({\n type: NAVIGATE_TO_ACTION,\n payload: {\n definition,\n selection\n }\n})\n\nexport const updateMarked = (entityName, entityId, marked) => ({\n type: UPDATE_MARKED,\n payload: {\n entityName,\n entityId,\n marked\n }\n})\n\nexport const setMarked = marked => ({\n type: SET_MARKED,\n payload: {\n marked\n }\n})\n","import {connect} from 'react-redux'\nimport {externalEvents, actionEmitter} from 'tocco-app-extensions'\n\nimport SubGrid from '../components/SubGrid'\nimport {navigateToCreate} from './../modules/entityDetail/actions'\n\nconst mapStateToProps = (state, props) => ({\n appId: state.entityDetail.appId,\n entityKey: state.entityDetail.entity.key,\n entityName: state.entityDetail.entity.model,\n detailFormName: state.entityDetail.formDefinition.id,\n navigationStrategy: state.input.navigationStrategy\n})\n\nconst mapActionCreators = {\n onRowClick: e =>\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 React from 'react'\n\nimport SubGridContainer from '../../../containers/SubGridContainer'\n\nexport default (formField, key) => (\n <SubGridContainer\n key={key}\n formField={formField}\n showSearchForm={formField.showSearchForm}\n limit={formField.limit || undefined}\n />\n)\n","import 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 React, {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 {selectUnit} from '@formatjs/intl-utils'\nimport PropTypes from 'prop-types'\nimport React from 'react'\nimport {FormattedMessage, FormattedRelativeTime} from 'react-intl'\nimport styled from 'styled-components'\nimport {form} from 'tocco-app-extensions'\nimport {FormattedValue, scale, Typography} from 'tocco-ui'\n\nexport const ErrorItem = ({message}) => (\n <div>\n <FormattedValue type=\"html\" value={message} />\n </div>\n)\n\nErrorItem.propTypes = {\n message: PropTypes.string.isRequired\n}\n\nconst StyledErrorItemWrapper = styled.div`\n &:not(:last-child) {\n margin-bottom: ${scale.space(0.4)};\n }\n`\n\nconst ErrorItems = ({formErrors}) => {\n let output = null\n const elements = []\n\n const hasFieldErrors = form.formErrorsUtil.hasFieldErrors(formErrors)\n const hasValidatorErrors = form.formErrorsUtil.hasValidatorErrors(formErrors)\n const hasRelatedEntityErrors = form.formErrorsUtil.hasRelatedEntityErrors(formErrors)\n const validatorErrors = form.formErrorsUtil.getValidatorErrors(formErrors)\n const relatedEntityErrorsCompact = form.formErrorsUtil.getRelatedEntityErrorsCompact(formErrors)\n const hasOutdatedError = form.formErrorsUtil.hasOutdatedError(formErrors)\n\n if (hasOutdatedError) {\n const outdatedError = form.formErrorsUtil.getOutdatedError(formErrors)\n const {value: timeStampValue, unit} = selectUnit(new Date(outdatedError.updateTimestamp))\n\n const titleId = `client.entity-detail.${outdatedError.sameEntity ? 'outdated' : 'relatedOutdated'}ErrorTitle`\n\n elements.push(\n <StyledErrorItemWrapper key=\"outDatedError\">\n <Typography.H5>\n <FormattedMessage\n id={titleId}\n values={{\n model: outdatedError.model,\n key: outdatedError.key\n }}\n />\n </Typography.H5>\n <FormattedMessage\n id=\"client.entity-detail.outdatedErrorDescription\"\n values={{\n ago: <FormattedRelativeTime value={timeStampValue} unit={unit} />,\n user: outdatedError.updateUser\n }}\n />\n </StyledErrorItemWrapper>\n )\n }\n\n if (hasFieldErrors) {\n elements.push(\n !hasValidatorErrors && !hasRelatedEntityErrors ? (\n <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 <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 <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 PropTypes from 'prop-types'\nimport React from 'react'\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 React, {useEffect, useMemo, useRef} from 'react'\nimport {reduxForm} from 'redux-form'\nimport {form} from 'tocco-app-extensions'\nimport {react as customHooks} from 'tocco-util'\n\nimport DetailFooterContainer from '../../containers/DetailFooterContainer'\nimport SubGrid from '../../util/detailView/fromFieldFactories/subGrid'\nimport MarkButton from './MarkButton'\nimport SaveButton from './SaveButton'\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 useEffect(() => {\n fireTouched(dirty && anyTouched)\n }, [dirty, anyTouched])\n\n customHooks.useAutofocus(formEl)\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]\n )\n\n const handleSubmit = event => {\n event.preventDefault()\n submitForm()\n }\n\n const handleKeyPress = event => {\n if (event.key === 'Enter' && event.target.tagName !== 'TEXTAREA') {\n event.preventDefault() // disable save on enter key down\n }\n }\n\n return (\n <StyledForm onSubmit={handleSubmit} onKeyDown={handleKeyPress} 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 <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 _get from 'lodash/get'\nimport {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\nimport {\n getFormValues,\n getFormInitialValues,\n getFormSyncErrors,\n getFormAsyncErrors,\n getFormSubmitErrors\n} from 'redux-form'\nimport {errorLogging} from 'tocco-app-extensions'\n\nimport DetailForm from '../components/DetailForm/DetailForm'\nimport {unloadDetailView, submitForm, fireTouched} from '../modules/entityDetail/actions'\n\nconst mapActionCreators = {\n unloadDetailView,\n submitForm,\n fireTouched,\n logError: errorLogging.logError\n}\n\nconst getFormGeneralErrors = formName => state => _get(state, `form.${formName}.error`, {})\n\nconst mapStateToProps = state => ({\n formDefinition: state.entityDetail.formDefinition,\n entity: state.entityDetail.entity,\n formValues: getFormValues('detailForm')(state),\n formErrors: {\n ...getFormSyncErrors('detailForm')(state),\n ...getFormAsyncErrors('detailForm')(state),\n ...getFormSubmitErrors('detailForm')(state),\n _error: getFormGeneralErrors('detailForm')(state)\n },\n formInitialValues: getFormInitialValues('detailForm')(state),\n lastSave: state.entityDetail.lastSave\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(DetailForm))\n","import _isEmpty from 'lodash/isEmpty'\nimport PropTypes from 'prop-types'\nimport React from 'react'\nimport {form} from 'tocco-app-extensions'\nimport {LoadMask} from 'tocco-ui'\n\nimport DetailFormContainer from '../../containers/DetailFormContainer'\nimport modes from '../../util/modes'\n\nclass DetailView extends React.Component {\n componentWillUnmount() {\n this.props.unloadDetailView()\n }\n\n handledAsyncValidate = formValues =>\n form.asyncValidation(\n formValues,\n this.props.mode === modes.CREATE ? {} : this.props.formInitialValues,\n this.props.fieldDefinitions,\n this.props.mode\n )\n\n getSyncValidation = () => {\n if (!this.validateSingleton && !_isEmpty(this.props.fieldDefinitions)) {\n this.validateSingleton = form.syncValidation(this.props.fieldDefinitions)\n }\n return this.validateSingleton\n }\n\n msg = id => this.props.intl.formatMessage({id})\n\n render() {\n const props = this.props\n\n return (\n <LoadMask required={[props.formInitialValues]} loadingText={this.msg('client.entity-detail.loadingText')}>\n <DetailFormContainer\n mode={this.props.mode}\n validate={this.getSyncValidation()}\n asyncValidate={this.handledAsyncValidate}\n asyncBlurFields={this.props.fieldDefinitions.map(fD => fD.path)}\n />\n </LoadMask>\n )\n }\n}\n\nexport default DetailView\n\nDetailView.propTypes = {\n intl: PropTypes.object.isRequired,\n mode: PropTypes.oneOf(['update', 'create']),\n loadDetailView: PropTypes.func.isRequired,\n unloadDetailView: PropTypes.func.isRequired,\n logError: PropTypes.func.isRequired,\n entityModel: PropTypes.object.isRequired,\n fieldDefinitions: PropTypes.arrayOf(\n PropTypes.shape({\n path: PropTypes.string,\n id: PropTypes.string,\n validation: PropTypes.object\n })\n ).isRequired,\n entityName: PropTypes.string.isRequired,\n entityId: PropTypes.string,\n formInitialValues: PropTypes.shape({\n initial: PropTypes.objectOf(PropTypes.string)\n })\n}\n","import {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 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 {\n loadDetailView,\n setEntityName,\n setEntityId,\n setFormName,\n setMode,\n setAppId,\n setDefaultValues\n} from './modules/entityDetail/actions'\n\nexport const getDispatchActions = input => [\n setEntityName(input.entityName),\n setEntityId(input.entityId ? input.entityId : null),\n setMode(input.mode),\n setFormName(input.formName),\n setAppId(input.id),\n setDefaultValues(input.defaultValues),\n loadDetailView()\n]\n","import {reducer as reducerUtil} from 'tocco-util'\n\nimport * as actions from './actions'\n\nconst ACTION_HANDLERS = {\n [actions.SET_ENTITY_NAME]: reducerUtil.singleTransferReducer('entityName'),\n [actions.SET_FORM_NAME]: reducerUtil.singleTransferReducer('formName'),\n [actions.SET_ENTITY_ID]: reducerUtil.singleTransferReducer('entityId'),\n [actions.SET_MODE]: reducerUtil.singleTransferReducer('mode'),\n [actions.SET_FORM_DEFINITION]: reducerUtil.singleTransferReducer('formDefinition'),\n [actions.SET_ENTITY]: reducerUtil.singleTransferReducer('entity'),\n [actions.SET_LAST_SAVE]: reducerUtil.singleTransferReducer('lastSave'),\n [actions.SET_ENTITY_MODEL]: reducerUtil.singleTransferReducer('entityModel'),\n [actions.SET_TOUCHED]: reducerUtil.singleTransferReducer('touched'),\n [actions.SET_APP_ID]: reducerUtil.singleTransferReducer('appId'),\n [actions.SET_DEFAULT_VALUES]: reducerUtil.singleTransferReducer('defaultValues'),\n [actions.SET_FIELD_DEFINITIONS]: reducerUtil.singleTransferReducer('fieldDefinitions'),\n [actions.SET_MARKED]: reducerUtil.singleTransferReducer('marked')\n}\n\nconst initialState = {\n appId: '',\n entityName: '',\n entityId: '',\n formName: '',\n mode: '',\n formDefinition: {},\n entity: {},\n entityModel: {},\n touched: false,\n defaultValues: {},\n fieldDefinitions: [],\n marked: false\n}\n\nexport default function reducer(state = initialState, action) {\n const handler = ACTION_HANDLERS[action.type]\n return handler ? handler(state, action) : state\n}\n","import reducer from './reducer'\nimport sagas from './sagas'\n\nexport {sagas}\nexport default reducer\n","import {SubmissionError} from 'redux-form/es/SubmissionError'\nimport {call} from 'redux-saga/effects'\nimport {form, rest} from 'tocco-app-extensions'\n\nexport function* updateEntity(entity, paths = []) {\n const options = {\n method: 'PATCH',\n queryParams: {\n _paths: paths.join(',')\n },\n body: entity,\n acceptedErrorCodes: ['VALIDATION_FAILED'],\n acceptedStatusCodes: [404, 409]\n }\n const resource = `entities/2.0/${entity.model}/${entity.key}`\n const resp = yield call(rest.requestSaga, resource, options)\n\n if (resp.body.errorCode === 'VALIDATION_FAILED') {\n throw new SubmissionError(form.validationErrorToFormError(entity, resp.body.errors))\n }\n\n if (resp.status === 409 && resp.body.information) {\n throw new rest.InformationError(resp.body.information)\n }\n\n return resp.body\n}\n\nconst SUCCESSFUL_SAVED_STATUS = 201\n\nexport function* createEntity(entity, paths = []) {\n const options = {\n method: 'POST',\n queryParams: {\n _paths: paths.join(',')\n },\n body: entity,\n acceptedErrorCodes: ['VALIDATION_FAILED'],\n acceptedStatusCodes: [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, 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 {selectUnit} from '@formatjs/intl-utils'\nimport _get from 'lodash/get'\nimport React from 'react'\nimport {FormattedMessage, FormattedRelativeTime} from 'react-intl'\nimport {\n actions as formActions,\n getFormAsyncErrors,\n getFormSubmitErrors,\n getFormSyncErrors,\n getFormValues,\n isValid as isValidSelector\n} from 'redux-form'\nimport * as formActionTypes from 'redux-form/es/actionTypes'\nimport {SubmissionError} from 'redux-form/es/SubmissionError'\nimport {all, call, debounce, fork, put, select, takeEvery, takeLatest} from 'redux-saga/effects'\nimport {\n actions as actionExtensions,\n errorLogging,\n externalEvents,\n form,\n notification,\n remoteEvents,\n rest\n} from 'tocco-app-extensions'\nimport {api} from 'tocco-util'\n\nimport {ErrorItem} from '../../components/ErrorItems/ErrorItems'\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\nconst FORM_ID = 'detailForm'\n\nexport const inputSelector = state => state.input\n\nexport default function* sagas() {\n yield all([\n takeLatest(actions.LOAD_DETAIL_VIEW, loadDetailView),\n takeLatest(actions.UNLOAD_DETAIL_VIEW, unloadDetailView),\n takeLatest(actions.TOUCH_ALL_FIELDS, touchAllFields),\n takeEvery(actions.SUBMIT_FORM, submitForm),\n takeEvery(actions.FIRE_TOUCHED, fireTouched),\n takeEvery(actions.NAVIGATE_TO_CREATE, navigateToCreate),\n takeEvery(remoteEvents.REMOTE_EVENT, remoteEvent),\n takeLatest(actions.NAVIGATE_TO_ACTION, navigateToAction),\n debounce(500, formActionTypes.CHANGE, onChange),\n takeEvery(formActionTypes.STOP_ASYNC_VALIDATION, asyncValidationStop),\n takeLatest(actions.UPDATE_MARKED, updateMarked),\n takeLatest(actionExtensions.actions.ACTION_INVOKED, reloadAfterAction)\n ])\n}\n\nexport function* autoComplete(fieldName, autoCompleteEndpoint) {\n const options = {\n method: 'POST',\n body: {\n triggerField: fieldName,\n entity: yield call(getEntityForSubmit)\n },\n acceptedStatusCodes: [403]\n }\n\n const response = yield call(rest.requestSaga, autoCompleteEndpoint, options)\n const values = _get(response, 'body.values', [])\n const formValues = yield select(getFormValues(FORM_ID))\n\n yield all(\n Object.keys(values).map(fieldName => {\n const value = values[fieldName]\n const currentFieldValue = formValues[fieldName]\n if (value.mode === 'override' || (value.mode === 'if_empty' && form.isValueEmpty(currentFieldValue))) {\n return put(formActions.change(FORM_ID, fieldName, value.value))\n }\n return null\n })\n )\n}\n\nexport function* onChange({meta}) {\n const {field} = meta\n const fieldDefinition = (yield select(entityDetailSelector)).fieldDefinitions.find(fd => fd.id === field)\n if (fieldDefinition && fieldDefinition.autoCompleteEndpoint) {\n yield call(autoComplete, field, fieldDefinition.autoCompleteEndpoint)\n }\n}\n\nexport function* loadDetailFormDefinition(formName, mode) {\n const formDefinition = yield call(rest.fetchForm, formName, mode)\n yield put(actions.setFormDefinition(formDefinition))\n const fieldDefinitions = yield call(form.getFieldDefinitions, formDefinition)\n yield put(actions.setFieldDefinitions(fieldDefinitions))\n return {formDefinition, fieldDefinitions}\n}\n\nexport function* loadEntity(entityName, entityId, fieldDefinitions) {\n const formPaths = yield call(form.getUsedPaths, fieldDefinitions)\n const {mode, entityModel} = yield select(entityDetailSelector)\n const footerPaths = yield call(getFooterPaths, mode, entityModel)\n const paths = [...formPaths, ...footerPaths]\n const entity = yield call(rest.fetchEntity, entityName, entityId, {paths})\n yield put(actions.setEntity(entity))\n return entity\n}\n\nexport function* unloadDetailView() {\n yield put(actions.setEntity(null))\n yield put(formActions.destroy(FORM_ID))\n}\n\nexport function* loadEntityModel(entityName) {\n const entityModel = yield call(rest.fetchModel, entityName)\n yield put(actions.setEntityModel(entityModel))\n return entityModel\n}\n\nexport function* loadDetailView() {\n const {entityName, formName, mode, defaultValues} = yield select(entityDetailSelector)\n\n const model = yield call(loadEntityModel, entityName)\n const {fieldDefinitions} = yield call(loadDetailFormDefinition, formName, mode)\n\n if (mode === modes.CREATE) {\n yield put(actions.setEntity({paths: {}, model: entityName}))\n const formDefaultValues = yield call(form.getDefaultValues, fieldDefinitions)\n const inputDefaultValues = defaultValues ? yield call(form.transformInputValues, defaultValues, model) : {}\n const defaultValuesFields = {...formDefaultValues, ...inputDefaultValues}\n const flattenEntity = yield call(api.getFlattenEntity, {model: entityName})\n const formValues = yield call(form.entityToFormValues, {...flattenEntity, ...defaultValuesFields})\n yield put(formActions.initialize(FORM_ID, formValues))\n } else {\n yield call(loadData)\n }\n}\n\nexport function* updateFormSubmit(entity) {\n const updateResponse = yield call(updateEntity, entity)\n if (updateResponse.status === 404) {\n // record was most likely moved to another business unit\n yield put(externalEvents.fireExternalEvent('onEntityDeleted'))\n } else {\n yield call(loadData)\n\n yield put(externalEvents.fireExternalEvent('onEntityUpdated'))\n yield call(showNotification, 'success', 'saveSuccessfulTitle', 'saveSuccessfulMessage')\n yield put(actions.setLastSave())\n yield put(formActions.stopSubmit(FORM_ID))\n }\n}\n\nexport function* createFormSubmit(entity) {\n const createdEntityId = yield call(createEntity, entity)\n yield put(externalEvents.fireExternalEvent('onEntityCreated', {id: createdEntityId}))\n yield call(showNotification, 'success', 'createSuccessfulTitle', 'createSuccessfulMessage')\n}\n\nexport function* touchAllFields() {\n const {fieldDefinitions} = yield select(entityDetailSelector)\n yield put(formActions.touch(FORM_ID, ...fieldDefinitions.map(f => form.transformFieldName(f.path || f.id))))\n}\n\nexport function* handleSubmitError(error) {\n if (error instanceof SubmissionError) {\n yield put(formActions.stopSubmit(FORM_ID, error.errors))\n yield call(handleInvalidForm)\n\n const validationErrors = yield call(form.formErrorsUtil.getValidatorErrors, error.errors)\n const message =\n validationErrors && validationErrors.length > 0\n ? validationErrors.join('<br>')\n : 'client.entity-detail.saveAbortedMessage'\n\n yield put(\n notification.toaster({\n type: 'warning',\n title: 'client.entity-detail.saveAbortedTitle',\n body: () => <ErrorItem message={message} />,\n /*\n * normally a toaster of the type warning has a duration of -1 and the toaster must be manually closed\n * as the validation error is also shown as a mouseover of the save button the toaster can disappear\n * without manual closing\n */\n duration: 5000\n })\n )\n } else if (error instanceof rest.InformationError) {\n yield put(\n notification.toaster({\n type: 'info',\n title: 'client.entity-detail.saveAbortedTitle',\n body: error.message\n })\n )\n yield put(formActions.stopSubmit(FORM_ID))\n } else if (error instanceof rest.ForbiddenException) {\n yield put(\n notification.toaster({\n type: 'error',\n title: 'client.entity-detail.saveAbortedTitle',\n body: 'client.entity-detail.noPermission'\n })\n )\n yield put(formActions.stopSubmit(FORM_ID))\n } else if (error instanceof rest.ClientQuestionCancelledException) {\n yield put(formActions.stopSubmit(FORM_ID))\n } else {\n yield put(errorLogging.logError('client.common.unexpectedError', 'client.entity-detail.saveError', error))\n yield put(formActions.stopSubmit(FORM_ID))\n }\n}\n\nexport function* getCurrentEntityState() {\n const formValues = yield select(getFormValues(FORM_ID))\n const initialFormValues = yield select(formInitialValueSelector, FORM_ID)\n const {mode} = yield select(entityDetailSelector)\n const initialValues = mode === modes.CREATE ? {} : initialFormValues\n const dirtyFields = yield call(form.getDirtyFields, initialValues, formValues, mode === modes.CREATE)\n\n return {\n formValues,\n initialValues,\n mode,\n dirtyFields\n }\n}\n\nexport function* submitValidate() {\n const {formValues, initialValues, mode} = yield call(getCurrentEntityState)\n yield call(form.submitValidation, formValues, initialValues, mode)\n}\n\nexport function* getEntityForSubmit() {\n const {formValues, dirtyFields} = yield call(getCurrentEntityState)\n const flattenEntity = yield call(form.formValuesToFlattenEntity, formValues)\n const dirtyFieldNames = dirtyFields.map(fieldName => form.transformFieldNameBack(fieldName))\n return yield call(api.toEntity, flattenEntity, dirtyFieldNames)\n}\n\nexport function* getPaths() {\n const {fieldDefinitions} = yield select(entityDetailSelector)\n return yield call(form.getUsedPaths, fieldDefinitions)\n}\n\nexport function* getFormErrors() {\n return {\n ...(yield select(getFormSyncErrors(FORM_ID))),\n ...(yield select(getFormAsyncErrors(FORM_ID))),\n ...(yield select(getFormSubmitErrors(FORM_ID)))\n }\n}\n\nexport function focusField(fieldName) {\n const element = document.getElementById(form.getFieldId(FORM_ID, fieldName))\n if (element) {\n element.focus()\n return true\n }\n\n return false\n}\n\nexport function* locationFieldFocus(errorField) {\n const {fieldDefinitions} = yield select(entityDetailSelector)\n const locationField = fieldDefinitions.find(f => f.locationMapping && f.locationMapping.postcode === errorField)\n yield call(focusField, locationField.id)\n}\n\nexport function* focusErrorField() {\n const formErrors = yield call(getFormErrors)\n const firstErrorField = yield call(form.formErrorsUtil.getFirstErrorField, formErrors)\n if (firstErrorField) {\n const focusSet = yield call(focusField, firstErrorField)\n\n if (!focusSet) {\n yield call(locationFieldFocus, firstErrorField)\n }\n }\n}\n\nexport function* handleInvalidForm() {\n yield call(touchAllFields)\n yield call(focusErrorField)\n}\n\nexport function* submitForm() {\n try {\n const isValid = yield select(isValidSelector(FORM_ID))\n if (!isValid) {\n yield call(handleInvalidForm)\n } else {\n yield put(formActions.startSubmit(FORM_ID))\n const {mode} = yield select(entityDetailSelector)\n yield call(submitValidate)\n const entity = yield call(getEntityForSubmit)\n if (mode === modes.UPDATE) {\n yield call(updateFormSubmit, entity)\n } else if (mode === modes.CREATE) {\n yield call(createFormSubmit, entity)\n }\n }\n } catch (error) {\n yield call(handleSubmitError, error)\n }\n}\n\nexport function* fireTouched({payload}) {\n const {touched: actionTouched} = payload\n const {touched: stateTouched} = yield select(entityDetailSelector)\n\n if (actionTouched !== stateTouched) {\n yield put(\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* loadDisplayExpressions(formName, mode, paths, entities) {\n if (paths && paths.length > 0) {\n const keys = entities.map(e => e.__key)\n const entityName = entities[0].__model\n const result = yield call(rest.fetchDisplayExpressions, formName, mode, keys, paths, entityName)\n return result\n }\n}\n\nexport function* loadRelationDisplays(relationFields, entities) {\n if (relationFields && relationFields.length > 0) {\n const request = yield call(api.getPathDisplayRequest, entities, relationFields, {})\n return yield call(rest.fetchDisplays, request)\n }\n}\n\nexport function* enhanceEntityWithDisplayExpressions(entity) {\n const {fieldDefinitions, formName, mode} = yield select(entityDetailSelector)\n const displayExpressions = fieldDefinitions.filter(f => f.componentType === 'display').map(f => f.id)\n const displayExpressionsL = yield call(loadDisplayExpressions, formName, mode, displayExpressions, [entity])\n if (displayExpressionsL) {\n Object.keys(displayExpressionsL[entity.__key]).forEach(dE => {\n entity[dE] = displayExpressionsL[entity.__key][dE]\n })\n }\n}\n\nexport function* enhanceEntityWithDisplays(entity) {\n const {fieldDefinitions} = yield select(entityDetailSelector)\n const relationFields = fieldDefinitions.filter(f => api.relationFieldTypes.includes(f.dataType)).map(f => f.path)\n\n const displays = yield call(loadRelationDisplays, relationFields, [entity])\n\n relationFields.forEach(relationField => {\n const value = entity[relationField]\n if (value) {\n const newValue = Array.isArray(value)\n ? value.filter(v => v !== null).map(v2 => ({...v2, display: displays[v2.model][v2.key]}))\n : {...value, display: displays[value.model][value.key]}\n entity[relationField] = newValue\n }\n })\n}\n\nexport function* loadData(reset = true) {\n const {entityName, entityId, fieldDefinitions, entityModel} = yield select(entityDetailSelector)\n\n if (entityModel.markable === true) {\n yield fork(loadMarked, entityName, entityId)\n }\n\n const entity = yield call(loadEntity, entityName, entityId, fieldDefinitions)\n const flattenEntity = yield call(api.getFlattenEntity, entity)\n\n yield call(enhanceEntityWithDisplayExpressions, flattenEntity)\n yield call(enhanceEntityWithDisplays, flattenEntity)\n\n const formValues = yield call(form.entityToFormValues, flattenEntity)\n const options = reset ? {} : {keepDirty: true, keepValues: false}\n yield put(formActions.initialize(FORM_ID, formValues, options))\n}\n\nexport function* loadMarked(entityName, entityId) {\n const marked = yield call(rest.fetchMarked, entityName, entityId)\n yield put(actions.setMarked(marked))\n}\n\nexport function* updateMarked({payload: {entityName, entityId, marked}}) {\n yield put(actions.setMarked(marked))\n yield call(rest.setMarked, entityName, entityId, marked)\n}\n\nexport function* reloadAfterAction({payload}) {\n const {definition} = payload\n if (definition.id !== 'delete') {\n yield call(loadData, 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 (isCurrentEntity(event, entityName, entityId)) {\n switch (event.type) {\n case 'entity-delete-event':\n yield put(externalEvents.fireExternalEvent('onEntityDeleted'))\n break\n case 'entity-update-event':\n yield call(loadData, false)\n break\n }\n }\n}\n\nexport function* asyncValidationStop({payload}) {\n if (payload) {\n const hasOutdatedError = form.formErrorsUtil.hasOutdatedError(payload)\n if (hasOutdatedError) {\n const outdatedError = form.formErrorsUtil.getOutdatedError(payload)\n const {value: timeStampValue, unit} = selectUnit(new Date(outdatedError.updateTimestamp))\n const titleId = `client.entity-detail.${outdatedError.sameEntity ? 'outdated' : 'relatedOutdated'}ErrorTitle`\n\n yield put(\n notification.toaster({\n type: 'warning',\n key: 'outdated-warning',\n title: (\n <FormattedMessage\n id={titleId}\n values={{\n model: outdatedError.model,\n key: outdatedError.key\n }}\n />\n ),\n body: (\n <FormattedMessage\n id=\"client.entity-detail.outdatedErrorDescription\"\n values={{\n ago: <FormattedRelativeTime value={timeStampValue} unit={unit} />,\n user: outdatedError.updateUser\n }}\n />\n )\n })\n )\n }\n }\n}\n","import {reducer as form} from 'redux-form'\n\nimport entityDetailReducer, {sagas as entityDetailSagas} from './entityDetail'\n\nexport default {\n entityDetail: entityDetailReducer,\n form\n}\n\nexport const sagas = [entityDetailSagas]\n","import {submitForm} from './modules/entityDetail/actions'\n\nexport default [\n {\n ctrl: true,\n alt: true,\n code: 'KeyS',\n actions: [submitForm()]\n }\n]\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport {\n actionEmitter,\n actions,\n appFactory,\n errorLogging,\n externalEvents,\n formData,\n keyDown,\n notification\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 DetailViewContainer from './containers/DetailViewContainer'\nimport customActions from './customActions'\nimport {getDispatchActions} from './input'\nimport reducers, {sagas} 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 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 dispatchActions = getDispatchActions(input)\n\n const app = appFactory.createApp(packageName, content, store, {\n input,\n events,\n actions: dispatchActions,\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 formName: PropTypes.string.isRequired,\n mode: PropTypes.oneOf(['update', 'create']),\n ...EXTERNAL_EVENTS.reduce((propTypes, event) => {\n propTypes[event] = PropTypes.func\n return propTypes\n }, {}),\n navigationStrategy: navigationStrategy.propTypes,\n chooseDocument: PropTypes.func,\n actionAppComponent: PropTypes.func\n}\n\nexport default EntityDetailApp\n","/**\n * Expose `pathToRegexp`.\n */\nmodule.exports = pathToRegexp\nmodule.exports.parse = parse\nmodule.exports.compile = compile\nmodule.exports.tokensToFunction = tokensToFunction\nmodule.exports.tokensToRegExp = tokensToRegExp\n\n/**\n * Default configs.\n */\nvar DEFAULT_DELIMITER = '/'\n\n/**\n * The main path matching regexp utility.\n *\n * @type {RegExp}\n */\nvar PATH_REGEXP = new RegExp([\n // Match escaped characters that would otherwise appear in future matches.\n // This allows the user to escape special characters that won't transform.\n '(\\\\\\\\.)',\n // Match Express-style parameters and un-named parameters with a prefix\n // and optional suffixes. Matches appear as:\n //\n // \":test(\\\\d+)?\" => [\"test\", \"\\d+\", undefined, \"?\"]\n // \"(\\\\d+)\" => [undefined, undefined, \"\\d+\", undefined]\n '(?:\\\\:(\\\\w+)(?:\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))?|\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))([+*?])?'\n].join('|'), 'g')\n\n/**\n * Parse a string for the raw tokens.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!Array}\n */\nfunction parse (str, options) {\n var tokens = []\n var key = 0\n var index = 0\n var path = ''\n var defaultDelimiter = (options && options.delimiter) || DEFAULT_DELIMITER\n var whitelist = (options && options.whitelist) || undefined\n var pathEscaped = false\n var res\n\n while ((res = PATH_REGEXP.exec(str)) !== null) {\n var m = res[0]\n var escaped = res[1]\n var offset = res.index\n path += str.slice(index, offset)\n index = offset + m.length\n\n // Ignore already escaped sequences.\n if (escaped) {\n path += escaped[1]\n pathEscaped = true\n continue\n }\n\n var prev = ''\n var name = res[2]\n var capture = res[3]\n var group = res[4]\n var modifier = res[5]\n\n if (!pathEscaped && path.length) {\n var k = path.length - 1\n var c = path[k]\n var matches = whitelist ? whitelist.indexOf(c) > -1 : true\n\n if (matches) {\n prev = c\n path = path.slice(0, k)\n }\n }\n\n // Push the current path onto the tokens.\n if (path) {\n tokens.push(path)\n path = ''\n pathEscaped = false\n }\n\n var repeat = modifier === '+' || modifier === '*'\n var optional = modifier === '?' || modifier === '*'\n var pattern = capture || group\n var delimiter = prev || defaultDelimiter\n\n tokens.push({\n name: name || key++,\n prefix: prev,\n delimiter: delimiter,\n optional: optional,\n repeat: repeat,\n pattern: pattern\n ? escapeGroup(pattern)\n : '[^' + escapeString(delimiter === defaultDelimiter ? delimiter : (delimiter + defaultDelimiter)) + ']+?'\n })\n }\n\n // Push any remaining characters.\n if (path || index < str.length) {\n tokens.push(path + str.substr(index))\n }\n\n return tokens\n}\n\n/**\n * Compile a string to a template function for the path.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!function(Object=, Object=)}\n */\nfunction compile (str, options) {\n return tokensToFunction(parse(str, options))\n}\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nfunction tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (data, options) {\n var path = ''\n var encode = (options && options.encode) || encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n continue\n }\n\n var value = data ? data[token.name] : undefined\n var segment\n\n if (Array.isArray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but got array')\n }\n\n if (value.length === 0) {\n if (token.optional) continue\n\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j], token)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\"')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n segment = encode(String(value), token)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but got \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n continue\n }\n\n if (token.optional) continue\n\n throw new TypeError('Expected \"' + token.name + '\" to be ' + (token.repeat ? 'an array' : 'a string'))\n }\n\n return path\n }\n}\n\n/**\n * Escape a regular expression string.\n *\n * @param {string} str\n * @return {string}\n */\nfunction escapeString (str) {\n return str.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, '\\\\$1')\n}\n\n/**\n * Escape the capturing group by escaping special characters and meaning.\n *\n * @param {string} group\n * @return {string}\n */\nfunction escapeGroup (group) {\n return group.replace(/([=!:$/()])/g, '\\\\$1')\n}\n\n/**\n * Get the flags for a regexp from the options.\n *\n * @param {Object} options\n * @return {string}\n */\nfunction flags (options) {\n return options && options.sensitive ? '' : 'i'\n}\n\n/**\n * Pull out keys from a regexp.\n *\n * @param {!RegExp} path\n * @param {Array=} keys\n * @return {!RegExp}\n */\nfunction regexpToRegexp (path, keys) {\n if (!keys) return path\n\n // Use a negative lookahead to match only capturing groups.\n var groups = path.source.match(/\\((?!\\?)/g)\n\n if (groups) {\n for (var i = 0; i < groups.length; i++) {\n keys.push({\n name: i,\n prefix: null,\n delimiter: null,\n optional: false,\n repeat: false,\n pattern: null\n })\n }\n }\n\n return path\n}\n\n/**\n * Transform an array into a regexp.\n *\n * @param {!Array} path\n * @param {Array=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction arrayToRegexp (path, keys, options) {\n var parts = []\n\n for (var i = 0; i < path.length; i++) {\n parts.push(pathToRegexp(path[i], keys, options).source)\n }\n\n return new RegExp('(?:' + parts.join('|') + ')', flags(options))\n}\n\n/**\n * Create a path regexp from string input.\n *\n * @param {string} path\n * @param {Array=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction stringToRegexp (path, keys, options) {\n return tokensToRegExp(parse(path, options), keys, options)\n}\n\n/**\n * Expose a function for taking tokens and returning a RegExp.\n *\n * @param {!Array} tokens\n * @param {Array=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction tokensToRegExp (tokens, keys, options) {\n options = options || {}\n\n var strict = options.strict\n var start = options.start !== false\n var end = options.end !== false\n var delimiter = options.delimiter || DEFAULT_DELIMITER\n var endsWith = [].concat(options.endsWith || []).map(escapeString).concat('$').join('|')\n var route = start ? '^' : ''\n\n // Iterate over the tokens and create our regexp string.\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n route += escapeString(token)\n } else {\n var capture = token.repeat\n ? '(?:' + token.pattern + ')(?:' + escapeString(token.delimiter) + '(?:' + token.pattern + '))*'\n : token.pattern\n\n if (keys) keys.push(token)\n\n if (token.optional) {\n if (!token.prefix) {\n route += '(' + capture + ')?'\n } else {\n route += '(?:' + escapeString(token.prefix) + '(' + capture + '))?'\n }\n } else {\n route += escapeString(token.prefix) + '(' + capture + ')'\n }\n }\n }\n\n if (end) {\n if (!strict) route += '(?:' + escapeString(delimiter) + ')?'\n\n route += endsWith === '$' ? '$' : '(?=' + endsWith + ')'\n } else {\n var endToken = tokens[tokens.length - 1]\n var isEndDelimited = typeof endToken === 'string'\n ? endToken[endToken.length - 1] === delimiter\n : endToken === undefined\n\n if (!strict) route += '(?:' + escapeString(delimiter) + '(?=' + endsWith + '))?'\n if (!isEndDelimited) route += '(?=' + escapeString(delimiter) + '|' + endsWith + ')'\n }\n\n return new RegExp(route, flags(options))\n}\n\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n *\n * @param {(string|RegExp|Array)} path\n * @param {Array=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction pathToRegexp (path, keys, options) {\n if (path instanceof RegExp) {\n return regexpToRegexp(path, keys)\n }\n\n if (Array.isArray(path)) {\n return arrayToRegexp(/** @type {!Array} */ (path), keys, options)\n }\n\n return stringToRegexp(/** @type {string} */ (path), keys, options)\n}\n"],"sourceRoot":""}
|