tocco-admin 1.0.18 → 1.0.21
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 +17 -0
- package/dist/chunk-229.2ea952f1867a78801d4b.js +1 -0
- package/dist/{chunk-314.06fbc31e051912aa797d.js → chunk-314.fd36699dbd136490aa1f.js} +1 -2
- package/dist/{chunk-378.d89c9e1aceb1eda54046.js → chunk-333.6e7bb6ee20346be796e1.js} +1 -2
- package/dist/chunk-335.7cef6cf94cd9ea8910eb.js +1 -0
- package/dist/chunk-342.8f3c7176df159e2a140e.js +6 -0
- package/dist/chunk-404.34b136a50b9cf1357c4f.js +1 -0
- package/dist/{chunk-413.a87d7653543f87fb986b.js → chunk-413.8f9875231f3ea3dc91b3.js} +1 -2
- package/dist/{chunk-51.6b8c9d2c2b4f89de46ce.js → chunk-51.ff992f4a4488d7d44357.js} +1 -2
- package/dist/{chunk-696.c28466168bbf1bd96ac6.js → chunk-696.4246384f89ce1ee8933f.js} +1 -2
- package/dist/{chunk-82.31084b7daa6e3ae23a98.js → chunk-82.fe992385267f6eb716e8.js} +1 -2
- package/dist/chunk-actions.66c72d85dd44315566fe.js +1 -0
- package/dist/chunk-code-editor.64a44ea8d4fed4580847.js +1 -0
- package/dist/{chunk-vendor-fontawesome.f71ea56f6b7b560a21a4.js → chunk-vendor-fontawesome.7d3f7dd081d6f37ee4c9.js} +1 -1
- package/dist/chunk-vendor-icons.c1cc12e8f9e141eb191b.js +1 -0
- package/dist/index.js +3 -4
- package/package.json +1 -2
- package/dist/chunk-163.c0d9544ec345494b1a2e.js +0 -7
- package/dist/chunk-163.c0d9544ec345494b1a2e.js.map +0 -1
- package/dist/chunk-314.06fbc31e051912aa797d.js.map +0 -1
- package/dist/chunk-368.fdad57fbc3465d09373f.js +0 -2
- package/dist/chunk-368.fdad57fbc3465d09373f.js.map +0 -1
- package/dist/chunk-378.d89c9e1aceb1eda54046.js.map +0 -1
- package/dist/chunk-395.e670367a30bd131e5c51.js +0 -2
- package/dist/chunk-395.e670367a30bd131e5c51.js.map +0 -1
- package/dist/chunk-413.a87d7653543f87fb986b.js.map +0 -1
- package/dist/chunk-51.6b8c9d2c2b4f89de46ce.js.map +0 -1
- package/dist/chunk-696.c28466168bbf1bd96ac6.js.map +0 -1
- package/dist/chunk-82.31084b7daa6e3ae23a98.js.map +0 -1
- package/dist/chunk-actions.3b4aac3f72ded7dcb505.js +0 -2
- package/dist/chunk-actions.3b4aac3f72ded7dcb505.js.map +0 -1
- package/dist/chunk-code-editor.73b0f627952f5dd27561.js +0 -2
- package/dist/chunk-code-editor.73b0f627952f5dd27561.js.map +0 -1
- package/dist/chunk-docs-actions.f33942c4f1459f1d1376.js +0 -2
- package/dist/chunk-docs-actions.f33942c4f1459f1d1376.js.map +0 -1
- package/dist/chunk-vendor-icons.dafd17ccd5a526750a0a.js +0 -1
- package/dist/index.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
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:///./packages/app-extensions/src/selection/selectionTypes.js","webpack:///./packages/app-extensions/src/selection/proptype.js","webpack:///./packages/app-extensions/src/selection/selection.js","webpack:///./packages/app-extensions/src/selection/index.js","webpack:///./packages/delete/src/modules/delete/actions.js","webpack:///./packages/delete/src/components/InfoPart/LinkPopOver.js","webpack:///./packages/delete/src/components/InfoPart/InfoPart.js","webpack:///./packages/delete/src/components/DeleteProgress/StyledComponents.js","webpack:///./packages/delete/src/components/DeleteProgress/DeleteProgress.js","webpack:///./packages/delete/src/components/DeleteProgress/DeleteProgressContainer.js","webpack:///./packages/delete/src/components/DeleteProgress/index.js","webpack:///./packages/tocco-ui/src/SignalBox/StyledSignalBox.js","webpack:///./packages/tocco-ui/src/SignalBox/SignalBox.js","webpack:///./packages/delete/src/components/Dialog/StyledComponents.js","webpack:///./packages/delete/src/components/Dialog/Dialog.js","webpack:///./packages/delete/src/components/Dialog/DialogContainer.js","webpack:///./packages/delete/src/components/Delete/Delete.js","webpack:///./packages/delete/src/components/Delete/DeleteContainer.js","webpack:///./packages/delete/src/components/Delete/index.js","webpack:///./packages/delete/src/modules/delete/reducer.js","webpack:///./packages/delete/src/utils/deleteRequestParser.js","webpack:///./packages/delete/src/modules/delete/sagas.js","webpack:///./packages/delete/src/modules/reducers.js","webpack:///./packages/delete/src/main.js","webpack:///./packages/tocco-ui/src/CodeEditor/requestHelper.js","webpack:///./packages/tocco-ui/src/CodeEditor/TqlConstants.js","webpack:///./packages/tocco-ui/src/CodeEditor/TqlHighlighter.js","webpack:///./packages/tocco-ui/src/CodeEditor/FtlHighlighter.js","webpack:///./packages/tocco-ui/src/CodeEditor/TqlAutoCompleter.js","webpack:///./packages/tocco-ui/src/CodeEditor/ToccoFtlMode.js","webpack:///./packages/tocco-ui/src/CodeEditor/TqlMode.js","webpack:///./packages/tocco-ui/src/CodeEditor/AceEditor.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","useCallback","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","ID","QUERY","PropTypes","ids","propName","componentName","selectionTypes","Error","query","isRequired","getEntities","fetchEntities","getSingleKey","expectedEntityName","propType","setDeleteDialogInfo","dialogInfo","doDelete","setEntitiesToDelete","entitiesToDelete","relatedEntity","children","maxCountLink","keysOtherBu","Popover","placement","NonBreakingText","rootEntities","relatedEntities","entries","rootEntityName","rootEntity","entityLabel","ListLink","entityKeys","prev","curr","linkText","Count","slice","Content","StyledIconWrapper","size","rootEntitiesDeletable","relatedDeletable","del","input","DeleteProgress","ALLOWED_CONDITIONS","design","COLORS","shadeColor","StyledSignalBox","condition","getColor","StyledSignalListItem","propTypes","SignalBox","child","meta","defaultProps","StyledSectionWrapper","StyledButtonsWrapper","StyledButton","rootEntitiesNotDeletable","relatedNotDeletable","hasUnreadableEntities","disabled","every","ink","Dialog","loadDialogInfo","deletingInProgress","required","loadingText","Delete","deleteStatus","transformRootEntity","applyKeys","includes","entityNameReal","keyReal","isEntityDeletable","entityToDelete","affectedEntities","affectedEntity","getDialogInfo","response","currentBuId","deletable","relatedAttr","businessUnitId","Array","from","Set","transformRelatedEntities","unreadableEntities","getEntitiesToDelete","deleteEntityPropType","getDeleteBodyFromSelection","getDeleteEndpoint","inputSelector","textResourceSelector","messages","entitiesToDeleteSelector","selectionUtil","entityModel","customDeleteEndpoint","deleteEndpoint","method","deleteResponse","principal","currentBusinessUnit","acceptedStatusCodes","textResources","ok","deletedEntities","remoteEvents","externalEvents","status","information","deleteSagas","EXTERNAL_EVENTS","initApp","events","publicPath","appFactory","handleNotifications","notification","textResourceModules","DeleteApp","packageName","sendRequest","endpoint","request","extractBody","json","operators","atoms","types","placeholders","functions","implicitModel","commonWhere","token","regex","caseInsensitive","customRules","start","next","rootwhere","comparison","exists","existswhere","countwhere","$rules","_mergeWith","objValue","srcValue","_isArray","concat","undefined","normalizeRules","ace","TextHighlightRules","ToccoFtlLangHighlightRules","qstring","defaultToken","ToccoFtlHighlightRules","tqlDirectives","startRules","unshift","apply","embedRules","addRules","tqlEndRules","TqlHighlighter","mergingRules","HtmlHighlightRules","TokenIterator","getTokenType","substring","lastIndexOf","isCurrentTokenOfType","iterator","getCurrentToken","findLastPathStep","stepBackward","modelToken","trim","stepBackUntilToken","handleParentheses","parenCount","findLastModelScope","findCurrentPath","stepForward","backtrack","stepBack","steps","lastStep","isArray","forEach","step","findCurrentModelScope","determineAvailablePaths","createIterator","callback","modelScope","determineModelScope","currentPath","relationSteps","sourceModel","resolvePart","buildResolveUrl","fields","f","fieldName","resolvePath","pathCompletions","caption","score","errors","loadAllAvailableModels","models","modelCompletions","getAvailableFunctions","toUpperCase","defaultScore","getCompletions","editor","session","pos","createIteratorAtCurrentPosition","row","column","currentToken","previousToken","placeholder","ToccoFtlMode","HighlightRules","completer","TqlAutoCompleter","Mode","TqlMode","implicitModelName","snippedIdField","StyledEditor","modeMappings","groovy","GroovyMode","html","HtmlMode","xml","XmlMode","properties","PropertiesMode","JsonMode","htmlmixed","freemarkermixed","ftl","less","LessMode","drools","DroolsMode","text","TextMode","setEditorConfiguration","showGutter","editorOptions","_isString","Promise","resolve","_isObject","field","moduleEntity","loadImplicitModel","getMode","editorMode","getSession","setMode","setTheme","v","setOption","renderer","setShowGutter","resize","onChange","containerReference","useRef","editorReference","editorConfig","useMemo","aceEditor","current","setValue","on","getValue","destroy","ref","module","exports","parse","compile","options","tokensToFunction","tokensToRegExp","PATH_REGEXP","RegExp","tokens","index","defaultDelimiter","delimiter","whitelist","pathEscaped","m","escaped","offset","capture","group","modifier","c","indexOf","repeat","optional","pattern","escapeGroup","escapeString","substr","matches","data","encode","encodeURIComponent","segment","TypeError","j","test","String","flags","sensitive","strict","end","endsWith","route","endToken","isEndDelimited","groups","source","regexpToRegexp","parts","arrayToRegexp","stringToRegexp"],"mappings":"6KAWaA,EAAqB,SAACC,EAAUC,GAAX,MAAgC,CAChEC,KAZmC,6BAanCC,QAAS,CACPH,WACAC,qBAkBSG,EAAwB,SAACC,EAAMC,GAAP,MAA4B,CAC/DJ,KA/BqC,+BAgCrCC,QAAS,CACPE,OACAC,qBAISC,EAAe,SAAAC,GAAS,MAAK,CACxCN,KAtC2B,qBAuC3BC,QAAS,CACPK,eAWSC,EAAmB,SAAAC,GAAa,MAAK,CAChDR,KAlDgC,0BAmDhCC,QAAS,CACPO,mBAkBSC,EAAiB,SAAAC,GAAgB,MAAK,CACjDV,KApE6B,uBAqE7BC,QAAS,CACPS,sB,wKCxEEC,EAAU,CACd,oBAAoBC,WAAK,kBAAM,kEAC/B,kBAAkBA,WAAK,kBAAM,kEAC7B,cAAcA,WAAK,kBAAM,kEACzBC,mBAAmBD,WAAK,kBAAM,kEAC9B,2BAA2BA,WAAK,kBAAM,kEACtCE,QAAQF,WAAK,kBAAM,iEACnBG,OAAOH,WAAK,kBAAM,kEAClBI,MAAMJ,WAAK,kBAAM,kEACjBK,WAAWL,WAAK,kBAAM,kEACtB,mBAAmBA,WAAK,kBAAM,kEAC9B,sBAAsBA,WAAK,kBAAM,kEACjC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EAAKqQ,GAAI/M,EAAM6hB,GAAS2C,QAGlD,OAAO,IAAIvC,OAAO,MAAQyC,EAAMrW,KAAK,KAAO,IAAK0V,EAAMlC,IA6F9C8C,CAAoC,EAAQ3kB,EAAM6hB,GAlF7D,SAAyBnlB,EAAMsD,EAAM6hB,GACnC,OAAOE,EAAeJ,EAAMjlB,EAAMmlB,GAAU7hB,EAAM6hB,GAoF3C+C,CAAqC,EAAQ5kB,EAAM6hB","file":"chunk-code-editor.73b0f627952f5dd27561.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 'connect-principal': lazy(() => import(/* webpackChunkName: \"actions\" */ './actions/ConnectPrincipal'))\n}\n\nconst renderLoader = () => <LoadMask />\n\nconst LazyAction = props => {\n const {appId} = props\n const LazyAction = actions[appId]\n\n if (!LazyAction) {\n consoleLogger.logError(`no action found with id: ${appId}`)\n return null\n }\n\n const ActionComponent = connect(null, {\n emitAction: action => actionEmitter.dispatchEmittedAction(action)\n })(LazyAction)\n\n return (\n <Suspense fallback={renderLoader()}>\n <ActionComponent {...props} />\n </Suspense>\n )\n}\n\nLazyAction.propTypes = {\n appId: PropTypes.string.isRequired\n}\n\nexport default LazyAction\n","import _get from 'lodash/get'\nimport PropTypes from 'prop-types'\nimport React, {useEffect} from 'react'\nimport {queryString as queryStringUtil, js} from 'tocco-util'\n\nimport {goBack} from '../../../../utils/routing'\nimport navigationStrategy from '../../utils/navigationStrategy'\nimport {currentViewPropType} from '../../utils/propTypes'\nimport Action from '../Action'\n\nconst ActionView = ({history, match, setCurrentViewTitle, currentViewInfo, intl}) => {\n const {location} = history\n useEffect(() => {\n if (currentViewInfo) {\n setCurrentViewTitle(intl.formatMessage({id: `client.actions.${currentViewInfo.actionId}.title`}))\n }\n\n return () => {\n setCurrentViewTitle(null)\n }\n }, [currentViewInfo, setCurrentViewTitle, intl])\n\n if (!currentViewInfo) {\n return null\n }\n\n const queryParams = queryStringUtil.fromQueryString(location.search)\n const selection = _get(location, 'state.selection', queryParams.actionProperties)\n const actionProperties = _get(location, 'state.definition.properties', queryParams.actionProperties)\n\n const navigateBack = () => {\n history.replace(goBack(match.url, 2))\n }\n\n return (\n <Action\n history={history}\n match={match}\n appId={currentViewInfo.actionId}\n selection={selection}\n actionProperties={actionProperties}\n navigationStrategy={navigationStrategy(history, match)}\n onSuccess={navigateBack}\n onError={navigateBack}\n onCancel={navigateBack}\n />\n )\n}\n\nActionView.propTypes = {\n intl: PropTypes.object.isRequired,\n currentViewInfo: currentViewPropType,\n setCurrentViewTitle: PropTypes.func.isRequired,\n history: PropTypes.shape({\n replace: PropTypes.func.isRequired,\n location: PropTypes.shape({\n search: PropTypes.string,\n state: PropTypes.shape({\n selection: PropTypes.object,\n definition: PropTypes.shape({\n appId: PropTypes.string\n })\n })\n })\n }).isRequired,\n match: PropTypes.object\n}\n\nconst areEqual = (prevProps, nextProps) => {\n const diff = Object.keys(js.difference(prevProps, nextProps))\n return diff.length === 0\n}\n\nexport default React.memo(ActionView, areEqual)\n","import {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\n\nimport {setCurrentViewTitle} from '../../modules/path/actions'\nimport ActionView from './ActionView'\nconst mapActionCreators = {\n setCurrentViewTitle\n}\n\nconst mapStateToProps = (state, props) => ({\n currentViewInfo: state.entities.path.currentViewInfos[props.history.location.pathname]\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(ActionView))\n","import _get from 'lodash/get'\nimport PropTypes from 'prop-types'\nimport 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, useCallback} from 'react'\nimport {rest} from 'tocco-app-extensions'\nimport DocsBrowserApp from 'tocco-docs-browser/src/main'\n\nconst DocsView = ({entityName, entityKey, showActions, noLeftPadding, openResource}) => {\n const [folderKey, setFolderKey] = useState(null)\n\n const fetchFolder = useCallback(async () => {\n rest.simpleRequest('entities/2.0/' + entityName + '/' + entityKey + '/entitydocs/folder').then(res => {\n setFolderKey(res.body.key)\n })\n }, [entityName, entityKey])\n\n useEffect(() => {\n fetchFolder()\n }, [fetchFolder])\n\n return (\n folderKey && (\n <DocsBrowserApp\n 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, {useCallback, useEffect} from 'react'\nimport {Icon, Typography} from 'tocco-ui'\nimport {js} from 'tocco-util'\n\nimport {currentViewPropType} from '../../utils/propTypes'\nimport {getRelation} from '../../utils/relationPersistor'\nimport DocsViewAdapter from './DocsViewAdapter'\nimport ListView from './ListView'\nimport RelationBox from './RelationBox'\nimport {\n StyledPlaceHolder,\n StyledPreviewBox,\n StyledPreviewLink,\n StyledRelationBoxes,\n StyledRelationsViewWrapper,\n StyledToggleCollapse,\n StyledToggleCollapseButton\n} from './StyledComponents'\n\nconst RelationsView = props => {\n const {\n history,\n match,\n currentViewInfo,\n relations,\n relationsInfo,\n emitAction,\n intl,\n isCollapsed,\n toggleCollapse,\n selectedRelation,\n selectRelation\n } = props\n const entityName = _get(currentViewInfo, 'model.name')\n\n const updateSelectedRelation = useCallback(() => {\n if (relations?.length > 0) {\n const queryRelation = queryString.parse(history.location.search).relation\n if (queryRelation) {\n selectRelation(relations.find(r => r.relationName === queryRelation))\n } else {\n const persistedSelectedRelation = getRelation(entityName)\n if (persistedSelectedRelation) {\n selectRelation(relations.find(r => r.relationName === persistedSelectedRelation))\n } else {\n selectRelation(relations[0])\n }\n }\n }\n }, [relations, entityName, history.location.search, selectRelation])\n\n useEffect(updateSelectedRelation, [updateSelectedRelation])\n useEffect(() => (!selectedRelation ? updateSelectedRelation() : null), [selectedRelation, updateSelectedRelation])\n\n if (!relations || relations.length === 0 || !currentViewInfo) {\n return null\n }\n\n const msg = id => intl.formatMessage({id})\n const hasCreateRights = relationName => relationsInfo[relationName]?.createPermission\n const RelationPreview = selectedRelation\n ? selectedRelation.targetEntity === 'Resource'\n ? DocsViewAdapter\n : ListView\n : () => <React.Fragment />\n\n const RelationBoxes = relations.map(relation => (\n <RelationBox key={`relation-${relation.relationName}`} relation={relation} entityName={entityName} {...props} />\n ))\n\n return (\n <>\n <StyledRelationsViewWrapper isCollapsed={isCollapsed}>\n <StyledToggleCollapse>\n <StyledToggleCollapseButton icon=\"chevron-right\" onClick={toggleCollapse} />\n </StyledToggleCollapse>\n <StyledRelationBoxes>{RelationBoxes}</StyledRelationBoxes>\n {selectedRelation && (\n <StyledPreviewBox>\n <Typography.H4>\n {selectedRelation.relationDisplay.label}\n <StyledPreviewLink\n aria-label={msg('client.admin.entities.relationsView.relationLinkView')}\n to={match.url.replace(/(relations|detail)$/, selectedRelation.relationName)}\n >\n <Icon icon=\"arrow-right\" />\n </StyledPreviewLink>\n {hasCreateRights(selectedRelation.relationName) && selectedRelation.targetEntity !== 'Resource' && (\n <StyledPreviewLink\n aria-label={msg('client.admin.entities.relationsView.relationLinkCreate')}\n to={match.url.replace(/(relations|detail)$/, selectedRelation.relationName) + '/create'}\n >\n <Icon icon=\"plus\" />\n </StyledPreviewLink>\n )}\n </Typography.H4>\n <RelationPreview\n selectedRelation={selectedRelation}\n match={match}\n history={history}\n currentViewInfo={currentViewInfo}\n emitAction={emitAction}\n />\n </StyledPreviewBox>\n )}\n </StyledRelationsViewWrapper>\n <StyledPlaceHolder onClick={toggleCollapse} isCollapsed={isCollapsed}>\n <StyledToggleCollapseButton icon={'chevron-left'} isCollapsed={isCollapsed} />\n </StyledPlaceHolder>\n </>\n )\n}\n\nRelationsView.propTypes = {\n history: PropTypes.object.isRequired,\n match: PropTypes.object.isRequired,\n currentViewInfo: currentViewPropType,\n relations: PropTypes.array,\n relationsInfo: PropTypes.objectOf(\n PropTypes.shape({\n count: PropTypes.number,\n createPermission: PropTypes.bool\n })\n ),\n emitAction: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n isCollapsed: PropTypes.bool,\n toggleCollapse: PropTypes.func.isRequired,\n selectRelation: PropTypes.func.isRequired,\n selectedRelation: PropTypes.object\n}\n\nconst areEqual = (prevProps, nextProps) => {\n const diff = Object.keys(js.difference(prevProps, nextProps))\n return diff.length === 0\n}\n\nexport default React.memo(RelationsView, areEqual)\n","import {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\nimport {actionEmitter} from 'tocco-app-extensions'\n\nimport {selectRelation} from '../../modules/path/actions'\nimport RelationsView from './RelationsView'\n\nconst mapStateToProps = (state, props) => ({\n currentViewInfo: state.entities.path.currentViewInfos[props.history.location.pathname],\n relations: state.entities.path.relations,\n relationsInfo: state.entities.path.relationsInfo,\n selectedRelation: state.entities.path.selectedRelation\n})\n\nconst mapActionCreators = {\n emitAction: action => actionEmitter.dispatchEmittedAction(action),\n selectRelation\n}\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(RelationsView))\n","import RelationsView from './RelationViewContainer'\n\nexport default RelationsView\n","import styled from 'styled-components'\n\nexport const StyledDetailViewContainer = styled.div`\n display: flex;\n flex-direction: row;\n height: 100%;\n\n .react-bs-container-body {\n height: auto !important;\n }\n`\n\nexport const StyledDetailViewLeft = styled.div`\n flex: 1;\n margin-right: 1rem;\n ${({isCollapsed}) =>\n !isCollapsed &&\n ` @media(max - width: 1024px) {\n flex: none;\n width: 40%;\n }`}\n`\n\nexport const StyledDetailViewRight = styled.div`\n flex: ${({isCollapsed}) => (isCollapsed ? '0' : '1')};\n`\n","import PropTypes from 'prop-types'\nimport 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, loadCurrentRoute])\n\n const content =\n currentViewInfo && currentViewInfo.error ? (\n <ErrorView history={history} />\n ) : (\n <Switch>\n <Route path={`${match.url}/action/:actionId`} component={Action} />\n <Route path={`${match.url}/:entity`} component={Entity} />\n <Route exact path={match.url} component={Overview} />\n </Switch>\n )\n\n return (\n <StyledWrapper>\n <StyledBreadcrumbs>\n <Breadcrumbs />\n </StyledBreadcrumbs>\n <StyledContent>{content}</StyledContent>\n </StyledWrapper>\n )\n}\n\nEntitiesRoute.propTypes = {\n loadCurrentRoute: PropTypes.func.isRequired,\n history: PropTypes.object.isRequired,\n match: PropTypes.object.isRequired,\n currentViewInfo: currentViewPropType\n}\n\nexport default EntitiesRoute\n","import {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\n\nimport {loadCurrentRoute} from '../../modules/path/actions'\nimport EntitiesRoute from './EntitiesRoute'\n\nconst mapActionCreators = {\n loadCurrentRoute\n}\n\nconst mapStateToProps = (state, props) => ({\n currentViewInfo: state.entities.path.currentViewInfos[props.history.location.pathname]\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(EntitiesRoute))\n","import EntitiesRoute from './EntitiesRouteContainer'\n\nexport default EntitiesRoute\n","import {reducer as reducerUtil} from 'tocco-util'\n\nimport * as actions from './actions'\n\nexport const setCurrentViewInfo = (state, {payload: {location, currentViewInfo}}) => ({\n ...state,\n currentViewInfos: {\n ...state.currentViewInfos,\n [location]: {\n ...state.currentViewInfos[location],\n ...currentViewInfo\n }\n }\n})\n\nexport const updateBreadcrumbsInfo = (state, {payload: {path, breadcrumbsInfo}}) => ({\n ...state,\n breadcrumbsInfo: state.breadcrumbsInfo.map(info => (info.path === path ? {...info, ...breadcrumbsInfo} : info))\n})\n\nconst ACTION_HANDLERS = {\n [actions.SET_CURRENT_VIEW_INFO]: setCurrentViewInfo,\n [actions.SET_BREADCRUMBS_INFO]: reducerUtil.singleTransferReducer('breadcrumbsInfo'),\n [actions.UPDATE_BREADCRUMBS_INFO]: updateBreadcrumbsInfo,\n [actions.SET_RELATIONS]: reducerUtil.singleTransferReducer('relations'),\n [actions.SET_RELATIONS_INFO]: reducerUtil.singleTransferReducer('relationsInfo'),\n [actions.SET_CURRENT_VIEW_TITLE]: reducerUtil.singleTransferReducer('currentViewTitle'),\n [actions.SELECT_RELATION]: reducerUtil.singleTransferReducer('selectedRelation')\n}\n\nconst initialState = {\n currentViewInfos: {},\n breadcrumbsInfo: [],\n relations: null,\n relationsInfo: {},\n selectedRelation: null\n}\n\nexport default function reducer(state = initialState, action) {\n const handler = ACTION_HANDLERS[action.type]\n return handler ? handler(state, action) : state\n}\n","import 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","export default {\n ID: 'ID',\n QUERY: 'QUERY'\n}\n","import PropTypes from 'prop-types'\n\nimport selectionTypes from './selectionTypes'\n\nexport default PropTypes.shape({\n entityName: PropTypes.string.isRequired,\n ids: (props, propName, componentName) => {\n if (props.selection && props.selection.type === selectionTypes.ID && !props.selection[propName]) {\n return new Error(`Selection.ids prop not defined. Component: ${componentName}'.`)\n }\n },\n query: (props, propName, componentName) => {\n if (props.selection && props.selection.type === selectionTypes.QUERY && !props.selection[propName]) {\n return new Error(`Selection.query prop not defined. Component: ${componentName}'.`)\n }\n },\n type: PropTypes.oneOf(Object.keys(selectionTypes)).isRequired,\n count: PropTypes.number\n})\n","import {call} from 'redux-saga/effects'\nimport {consoleLogger} from 'tocco-util'\n\nimport selectionTypes from './selectionTypes'\n\nconst limit = 100000\n/**\n * Helper to get all entitiy keys of a selection.\n * @param {object} selection - selection object\n * @param {function} fetchEntities - rest helper function\n * @returns {object} Object containing entityName and an array of keys (limited if selection is query)\n */\nexport function* getEntities(selection, fetchEntities) {\n const {entityName} = selection\n if (selection.type === selectionTypes.QUERY) {\n const entities = yield call(fetchEntities, selection.entityName, {...selection.query, limit})\n\n if (entities.length > limit) {\n yield call(consoleLogger.logError, `Selected records exceed limit of ${limit}`)\n }\n\n return {\n entityName,\n keys: entities.map(e => e.key)\n }\n }\n\n return {\n entityName,\n keys: selection.ids\n }\n}\n\n/**\n * Helper to get single entity key of a seletion.\n * Throws error\n * - if wront entity is selected\n * - if `selection.type` is not `ID`\n * - if none or more than one entity is selected\n * @param {object} selection - selection object\n * @param {string} expectedEntityName - selected entityName\n * @returns {string} ID of single selected entity\n */\nexport const getSingleKey = (selection, expectedEntityName) => {\n if (selection.entityName !== expectedEntityName) {\n throw new Error(`Only selection of ${expectedEntityName} supported`)\n }\n if (selection.type !== 'ID') {\n throw new Error('Only ID selection type supported')\n }\n if (!selection.ids || selection.ids.length !== 1) {\n throw new Error(`Exactly one ${expectedEntityName} must be selected`)\n }\n return selection.ids[0]\n}\n","import propType from './proptype'\nimport {getEntities, getSingleKey} from './selection'\nimport selectionTypes from './selectionTypes'\nexport default {\n getEntities,\n getSingleKey,\n propType,\n selectionTypes\n}\n","export const LOAD_DIALOG_INFO = 'root/LOAD_DIALOG_INFO'\nexport const SET_DIALOG_INFO = 'delete/SET_DELETE_DIALOG_INFO'\nexport const DO_DELETE = 'delete/DO_DELETE'\nexport const SET_DELETING_IN_PROGRESS = 'delete/SET_DELETING_IN_PROGRESS'\nexport const ON_CANCEL = 'delete/ON_CANCEL'\nexport const SET_ENTITIES_TO_DELETE = 'delete/SET_ENTITIES_TO_DELETE'\n\nexport const loadDialogInfo = () => ({\n type: LOAD_DIALOG_INFO\n})\n\nexport const setDeleteDialogInfo = dialogInfo => ({\n type: SET_DIALOG_INFO,\n payload: {\n dialogInfo\n }\n})\n\nexport const doDelete = () => ({\n type: DO_DELETE\n})\n\nexport const setDeletingInProgress = deletingInProgress => ({\n type: SET_DELETING_IN_PROGRESS,\n payload: {\n deletingInProgress\n }\n})\n\nexport const onCancel = () => ({\n type: ON_CANCEL\n})\n\nexport const setEntitiesToDelete = entitiesToDelete => ({\n type: SET_ENTITIES_TO_DELETE,\n payload: {\n entitiesToDelete\n }\n})\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport {FormattedMessage} from 'react-intl'\nimport {Popover, Typography} from 'tocco-ui'\n\nimport {deleteEntityPropType} from '../../utils/deleteRequestParser'\n\nconst LinkPopOver = ({relatedEntity, children, maxCountLink}) => {\n if (relatedEntity.keys.length < maxCountLink && relatedEntity.keysOtherBu.length === 0) {\n return children\n }\n\n const content = (\n <>\n {relatedEntity.keys.length > maxCountLink && (\n <Typography.P>\n <FormattedMessage id=\"client.delete.tooManyRecords\" />\n </Typography.P>\n )}\n {relatedEntity.keysOtherBu.length > 0 && (\n <Typography.P>\n <FormattedMessage id=\"client.delete.recordInOtherBU\" values={{count: relatedEntity.keysOtherBu.length}} />\n </Typography.P>\n )}\n </>\n )\n\n return (\n <Popover content={content} placement=\"top\">\n {children}\n </Popover>\n )\n}\n\nLinkPopOver.propTypes = {\n relatedEntity: deleteEntityPropType.isRequired,\n maxCountLink: PropTypes.number.isRequired,\n children: PropTypes.element\n}\n\nexport default LinkPopOver\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport styled from 'styled-components'\nimport {Typography} from 'tocco-ui'\nimport {navigationStrategy} from 'tocco-util'\n\nimport {deleteEntityPropType} from '../../utils/deleteRequestParser'\nimport LinkPopOver from './LinkPopOver'\n\nconst NonBreakingText = styled.span`\n white-space: nowrap;\n`\n\nconst InfoPart = ({rootEntities, relatedEntities, maxCountLink, navigationStrategy}) => (\n <Typography.Span>\n <Typography.B>\n {Object.entries(rootEntities)\n .map(([rootEntityName, rootEntity]) => (\n <span key={`root-entity-${rootEntityName}`}>\n {rootEntity.entityLabel} (\n {rootEntity.keys.length > 0 && navigationStrategy.ListLink ? (\n <navigationStrategy.ListLink entityName={rootEntityName} entityKeys={rootEntity.keys}>\n {rootEntity.keys.length}\n </navigationStrategy.ListLink>\n ) : (\n <Typography.Span>{rootEntity.keys.length}</Typography.Span>\n )}\n )\n </span>\n ))\n .reduce((prev, curr) => [prev, ', ', curr])}\n </Typography.B>\n {Object.keys(relatedEntities).length > 0 && (\n <>\n <span> / </span>\n {Object.keys(relatedEntities)\n .map(entityName => {\n const relatedEntity = relatedEntities[entityName]\n const linkText = [...relatedEntity.keys, ...relatedEntity.keysOtherBu].length\n\n const Count =\n relatedEntity.keys.length > 0 && navigationStrategy.ListLink ? (\n <navigationStrategy.ListLink\n entityName={entityName}\n entityKeys={relatedEntity.keys.slice(0, maxCountLink)}\n >\n {linkText}\n </navigationStrategy.ListLink>\n ) : (\n <Typography.Span>{linkText}</Typography.Span>\n )\n\n const Content = (\n <LinkPopOver relatedEntity={relatedEntity} maxCountLink={maxCountLink}>\n {Count}\n </LinkPopOver>\n )\n\n return (\n <React.Fragment key={'entity-info-' + entityName}>\n <NonBreakingText>\n {relatedEntity.entityLabel} ({Content})\n </NonBreakingText>\n </React.Fragment>\n )\n })\n .reduce((prev, curr) => [prev, ', ', curr])}\n </>\n )}\n </Typography.Span>\n)\n\nInfoPart.propTypes = {\n rootEntities: PropTypes.objectOf(\n PropTypes.shape({\n entityLabel: PropTypes.string.isRequired,\n keys: PropTypes.arrayOf(PropTypes.string).isRequired\n })\n ).isRequired,\n relatedEntities: PropTypes.objectOf(deleteEntityPropType).isRequired,\n maxCountLink: PropTypes.number,\n navigationStrategy: navigationStrategy.propTypes\n}\n\nexport default InfoPart\n","import styled from 'styled-components'\nimport {scale} from 'tocco-ui'\n\nexport const StyledIconWrapper = styled.div`\n margin-bottom: ${scale.space(0.2)};\n`\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport {FormattedMessage} from 'react-intl'\nimport {LoadingSpinner, Typography} from 'tocco-ui'\nimport {navigationStrategy} from 'tocco-util'\n\nimport {deleteInfoPropType} from '../../utils/deleteRequestParser'\nimport InfoPart from '../InfoPart'\nimport {StyledIconWrapper} from './StyledComponents'\n\nconst DeleteProgress = ({dialogInfo, navigationStrategy}) => {\n return (\n <>\n <StyledIconWrapper>\n <LoadingSpinner size=\"30px\" />\n </StyledIconWrapper>\n <Typography.P>\n <FormattedMessage id=\"client.delete.deleteInProgress\" />\n </Typography.P>\n <InfoPart\n key=\"infopart-deletable\"\n rootEntities={dialogInfo.rootEntitiesDeletable}\n relatedEntities={dialogInfo.relatedDeletable}\n maxCountLink={100}\n navigationStrategy={navigationStrategy}\n />\n </>\n )\n}\n\nDeleteProgress.propTypes = {\n dialogInfo: deleteInfoPropType.isRequired,\n intl: PropTypes.object.isRequired,\n navigationStrategy: navigationStrategy.propTypes\n}\n\nexport default DeleteProgress\n","import {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\n\nimport {doDelete} from '../../modules/delete/actions'\nimport DeleteProgress from './DeleteProgress'\n\nconst mapActionCreators = {\n doDelete\n}\n\nconst mapStateToProps = (state, props) => ({\n dialogInfo: state.del.dialogInfo,\n navigationStrategy: state.input.navigationStrategy\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(DeleteProgress))\n","import DeleteProgress from './DeleteProgressContainer'\n\nexport default DeleteProgress\n","import _get from 'lodash/get'\nimport styled from 'styled-components'\n\nimport {StyledSignalListItem} from '../SignalList'\nimport {design, scale, shadeColor, theme} from '../utilStyles'\n\nconst ALLOWED_CONDITIONS = [\n design.condition.BASE,\n design.condition.DANGER,\n design.condition.SUCCESS,\n design.condition.WARNING\n]\n\nconst COLORS = {\n [design.condition.DANGER]: theme.color('signal.danger.paper'),\n [design.condition.SUCCESS]: theme.color('signal.success.paper'),\n [design.condition.WARNING]: theme.color('signal.warning.paper'),\n [design.condition.BASE]: props => shadeColor(_get(props.theme, 'colors.paper'), 1)\n}\n\nconst getColor = props => {\n const color = COLORS[props.condition]\n return color || shadeColor(_get(props.theme, 'colors.paper'), 1)\n}\n\nconst StyledSignalBox = styled.div`\n && {\n background-color: ${props => getColor(props)};\n padding: ${scale.space(-1)};\n margin-bottom: ${scale.space(-1)};\n border-radius: ${theme.radii('radii.regular')};\n\n &:last-child {\n margin-bottom: 0;\n }\n\n ${StyledSignalListItem} {\n color: inherit;\n }\n }\n`\n\nStyledSignalBox.propTypes = {\n condition: design.oneOfPropTypeAndCompletelyMapped(ALLOWED_CONDITIONS, COLORS)\n}\n\nexport {ALLOWED_CONDITIONS, StyledSignalBox as default}\n","import PropTypes from 'prop-types'\nimport React from 'react'\n\nimport Typography from '../Typography'\nimport {design} from '../utilStyles'\nimport StyledSignalBox, {ALLOWED_CONDITIONS} from './StyledSignalBox'\n\n/**\n * Emphasize important information by context. Group them by utilizing several instances of <SignalBox/>.\n */\nconst SignalBox = props => (\n <StyledSignalBox condition={props.condition}>\n {props.title && <Typography.H5>{props.title}</Typography.H5>}\n {React.Children.map(props.children, child => React.cloneElement(child))}\n {props.meta && <Typography.Small>{props.meta}</Typography.Small>}\n </StyledSignalBox>\n)\n\nSignalBox.defaultProps = {\n condition: design.condition.BASE\n}\n\nSignalBox.propTypes = {\n /**\n * Prefer <SignalList.List/> and <SignalList.Item/> to list items over any other typographic component.\n */\n children: PropTypes.node,\n /**\n * Background is colorized according condition. Default value is 'base'.\n * Possible values: base|danger|success|warning\n */\n condition: PropTypes.oneOf(ALLOWED_CONDITIONS),\n /**\n * Add loosely related but still important information as meta text (e.g. date, id, type).\n */\n meta: PropTypes.string,\n /**\n * Summarize information from whole signal box concise.\n */\n title: PropTypes.string\n}\n\nexport default SignalBox\n","import styled from 'styled-components'\nimport {StyledButton, scale} from 'tocco-ui'\n\nexport const StyledSectionWrapper = styled.div`\n padding-top: ${scale.space(0.6)};\n`\n\nexport const StyledButtonsWrapper = styled.div`\n display: flex;\n justify-content: flex-end;\n\n ${StyledButton} {\n margin-right: 0;\n }\n`\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport {FormattedMessage} from 'react-intl'\nimport {Button, Typography, SignalBox} from 'tocco-ui'\nimport {navigationStrategy} from 'tocco-util'\n\nimport {deleteInfoPropType} from '../../utils/deleteRequestParser'\nimport InfoPart from '../InfoPart'\nimport {StyledSectionWrapper, StyledButtonsWrapper} from './StyledComponents'\n\nconst Dialog = ({\n dialogInfo: {\n rootEntitiesDeletable,\n rootEntitiesNotDeletable,\n relatedDeletable,\n relatedNotDeletable,\n hasUnreadableEntities\n },\n doDelete,\n onCancel,\n navigationStrategy\n}) => (\n <>\n <Typography.P>\n <FormattedMessage id=\"client.delete.confirmText\" />\n </Typography.P>\n <InfoPart\n key=\"infopart-deletable\"\n rootEntities={rootEntitiesDeletable}\n relatedEntities={relatedDeletable}\n maxCountLink={100}\n navigationStrategy={navigationStrategy}\n />\n {Object.keys(rootEntitiesNotDeletable).length > 0 && (\n <StyledSectionWrapper>\n <Typography.P>\n <FormattedMessage id=\"client.delete.textNotDeletable\" />\n </Typography.P>\n <InfoPart\n key=\"infopart-notdeletable\"\n rootEntities={rootEntitiesNotDeletable}\n relatedEntities={relatedNotDeletable}\n maxCountLink={100}\n navigationStrategy={navigationStrategy}\n />\n </StyledSectionWrapper>\n )}\n {hasUnreadableEntities && (\n <StyledSectionWrapper>\n <SignalBox condition=\"warning\">\n <Typography.Span>\n <FormattedMessage id=\"client.delete.unreadableEntities\" />\n </Typography.Span>\n </SignalBox>\n </StyledSectionWrapper>\n )}\n <StyledSectionWrapper>\n <StyledButtonsWrapper>\n <Button\n onClick={doDelete}\n disabled={Object.keys(rootEntitiesDeletable).every(entity => rootEntitiesDeletable[entity].keys.length === 0)}\n >\n <FormattedMessage id=\"client.delete.deleteButton\" />\n </Button>\n <Button ink=\"primary\" onClick={onCancel}>\n <FormattedMessage id=\"client.delete.cancelButton\" />\n </Button>\n </StyledButtonsWrapper>\n </StyledSectionWrapper>\n </>\n)\n\nDialog.propTypes = {\n onCancel: PropTypes.func.isRequired,\n doDelete: PropTypes.func.isRequired,\n dialogInfo: deleteInfoPropType.isRequired,\n navigationStrategy: navigationStrategy.propTypes\n}\n\nexport default Dialog\n","import {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\n\nimport {doDelete, onCancel} from '../../modules/delete/actions'\nimport Dialog from './Dialog'\n\nconst mapActionCreators = {\n doDelete,\n onCancel\n}\n\nconst mapStateToProps = (state, props) => ({\n dialogInfo: state.del.dialogInfo,\n navigationStrategy: state.input.navigationStrategy\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(Dialog))\n","import PropTypes from 'prop-types'\nimport React, {useEffect} from 'react'\nimport {LoadMask} from 'tocco-ui'\n\nimport {deleteInfoPropType} from '../../utils/deleteRequestParser'\nimport DeleteProgress from '../DeleteProgress'\nimport Dialog from '../Dialog'\n\nconst Delete = ({loadDialogInfo, dialogInfo, deletingInProgress, intl}) => {\n useEffect(() => {\n loadDialogInfo()\n }, [loadDialogInfo])\n\n const msg = id => intl.formatMessage({id})\n\n if (deletingInProgress) {\n return <DeleteProgress />\n }\n\n return (\n <LoadMask required={[dialogInfo]} loadingText={msg('client.delete.loadingText')}>\n {dialogInfo && <Dialog />}\n </LoadMask>\n )\n}\n\nDelete.propTypes = {\n loadDialogInfo: PropTypes.func.isRequired,\n dialogInfo: deleteInfoPropType,\n deletingInProgress: PropTypes.bool,\n intl: PropTypes.object.isRequired\n}\n\nexport default Delete\n","import {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\n\nimport {loadDialogInfo} from '../../modules/delete/actions'\nimport Delete from './Delete'\n\nconst mapActionCreators = {\n loadDialogInfo\n}\n\nconst mapStateToProps = (state, props) => ({\n dialogInfo: state.del.dialogInfo,\n deletingInProgress: state.del.deletingInProgress\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(Delete))\n","import Delete from './DeleteContainer'\n\nexport default Delete\n","import {reducer as reducerUtil} from 'tocco-util'\n\nimport * as actions from './actions'\n\nconst ACTION_HANDLERS = {\n [actions.SET_DIALOG_INFO]: reducerUtil.singleTransferReducer('dialogInfo'),\n [actions.SET_ENTITIES_TO_DELETE]: reducerUtil.singleTransferReducer('entitiesToDelete'),\n [actions.SET_DELETING_IN_PROGRESS]: reducerUtil.singleTransferReducer('deletingInProgress')\n}\n\nconst initialState = {\n dialogInfo: null,\n entitiesToDelete: null,\n deletingInProgress: 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 _get from 'lodash/get'\nimport PropTypes from 'prop-types'\n\nconst deleteStatus = {\n DELETABLE: 'DELETABLE',\n DENIED_BY_CASCADE: 'DENIED_BY_CASCADE',\n NO_DELETE_PERMISSION: 'NO_DELETE_PERMISSION'\n}\n\nconst transformRelatedEntities = (relatedEntities, entityToDelete, deletable, currentBuId) => ({\n ...entityToDelete.affectedEntities.reduce(\n (acc, affectedEntity) => ({\n ...acc,\n ...(deletable || affectedEntity.deleteStatus !== deleteStatus.DELETABLE\n ? {\n [affectedEntity.entityName]: {\n ..._get(acc, affectedEntity.entityName, {\n keys: [],\n keysOtherBu: [],\n entityLabel: affectedEntity.entityLabel\n }),\n ...(affectedEntity.businessUnitId === null || affectedEntity.businessUnitId === currentBuId\n ? {\n keys: Array.from(\n new Set([..._get(acc, [affectedEntity.entityName, 'keys'], []), affectedEntity.key])\n )\n }\n : {\n keysOtherBu: Array.from(\n new Set([..._get(acc, [affectedEntity.entityName, 'keysOtherBu'], []), affectedEntity.key])\n )\n })\n }\n }\n : {})\n }),\n {...relatedEntities}\n )\n})\n\nconst transformRootEntity = (rootEntities, entity, applyKeys = true) => {\n const {entityName, entityLabel, key} = entity.rootEntity\n if (key.includes('/')) {\n const [entityNameReal, keyReal] = key.split('/')\n return {\n ...rootEntities,\n [entityNameReal]: {\n entityLabel,\n keys: [..._get(rootEntities, [entityNameReal, 'keys'], []), ...(applyKeys ? [keyReal] : [])]\n }\n }\n } else {\n return {\n ...rootEntities,\n [entityName]: {\n entityLabel,\n keys: [..._get(rootEntities, [entityName, 'keys'], []), ...(applyKeys ? [key] : [])]\n }\n }\n }\n}\n\nconst isEntityDeletable = entityToDelete =>\n entityToDelete.rootEntity.deleteStatus === deleteStatus.DELETABLE &&\n !entityToDelete.affectedEntities.find(affectedEntity => affectedEntity.deleteStatus !== deleteStatus.DELETABLE)\n\nexport const getDialogInfo = (response, currentBuId) => {\n const {entitiesToDelete} = response\n\n return entitiesToDelete.reduce(\n (acc, entityToDelete) => {\n const deletable = isEntityDeletable(entityToDelete)\n const relatedAttr = deletable ? 'relatedDeletable' : 'relatedNotDeletable'\n return {\n ...acc,\n rootEntitiesDeletable: transformRootEntity(acc.rootEntitiesDeletable, entityToDelete, deletable),\n ...(!deletable && {\n rootEntitiesNotDeletable: transformRootEntity(acc.rootEntitiesNotDeletable, entityToDelete)\n }),\n [relatedAttr]: transformRelatedEntities(acc[relatedAttr], entityToDelete, deletable, currentBuId)\n }\n },\n {\n rootEntitiesDeletable: {},\n rootEntitiesNotDeletable: {},\n relatedDeletable: {},\n relatedNotDeletable: {},\n hasUnreadableEntities: !!entitiesToDelete.find(e => e.unreadableEntities)\n }\n )\n}\n\nexport const getEntitiesToDelete = ({entitiesToDelete}) => ({\n entityName: _get(entitiesToDelete, '[0].rootEntity.entityName'),\n keys: entitiesToDelete.reduce(\n (acc, entityToDelete) => [...acc, ...(isEntityDeletable(entityToDelete) ? [entityToDelete.rootEntity.key] : [])],\n []\n )\n})\n\nexport const deleteEntityPropType = PropTypes.shape({\n entityLabel: PropTypes.string,\n keys: PropTypes.arrayOf(PropTypes.string),\n keysOtherBu: PropTypes.arrayOf(PropTypes.string)\n})\n\nexport const deleteInfoPropType = PropTypes.shape({\n rootEntitiesDeletable: PropTypes.objectOf(deleteEntityPropType).isRequired,\n rootEntitiesNotDeletable: PropTypes.objectOf(deleteEntityPropType).isRequired,\n relatedDeletable: PropTypes.objectOf(deleteEntityPropType).isRequired,\n relatedNotDeletable: PropTypes.objectOf(deleteEntityPropType).isRequired,\n hasUnreadableEntities: PropTypes.bool\n})\n","import {takeLatest, all, call, put, select} from 'redux-saga/effects'\nimport {rest, externalEvents, selection as selectionUtil} from 'tocco-app-extensions'\n\nimport {getDialogInfo, getEntitiesToDelete} from '../../utils/deleteRequestParser'\nimport * as actions from './actions'\n\nexport const inputSelector = state => state.input\nexport const textResourceSelector = state => state.intl.messages\nexport const entitiesToDeleteSelector = state => state.del.entitiesToDelete\n\nexport function* getDeleteBodyFromSelection() {\n const {selection} = yield select(inputSelector)\n\n const entities = yield call(selectionUtil.getEntities, selection, rest.fetchEntities)\n\n return {\n entityModel: entities.entityName,\n keys: entities.keys\n }\n}\n\nexport function* getDeleteEndpoint() {\n const {customDeleteEndpoint} = yield select(inputSelector)\n return customDeleteEndpoint || 'client/delete'\n}\n\nexport function* loadDialogInfo() {\n const body = yield call(getDeleteBodyFromSelection)\n const deleteEndpoint = yield call(getDeleteEndpoint)\n\n const [deleteResponse, principal] = yield all([\n call(rest.requestSaga, `${deleteEndpoint}/dialog`, {method: 'POST', body}),\n call(rest.fetchPrincipal)\n ])\n\n const dialogInfo = yield call(getDialogInfo, deleteResponse.body, principal.currentBusinessUnit.id)\n yield put(actions.setDeleteDialogInfo(dialogInfo))\n\n const entitiesToDelete = yield call(getEntitiesToDelete, deleteResponse.body)\n yield put(actions.setEntitiesToDelete(entitiesToDelete))\n}\n\nexport function* doDelete() {\n const entitiesToDelete = yield select(entitiesToDeleteSelector)\n\n yield put(actions.setDeletingInProgress(true))\n const body = {\n entityModel: entitiesToDelete.entityName,\n keys: entitiesToDelete.keys\n }\n\n const deleteEndpoint = yield call(getDeleteEndpoint)\n\n const response = yield call(rest.requestSaga, deleteEndpoint, {\n method: 'POST',\n body,\n acceptedStatusCodes: [409]\n })\n\n const textResources = yield select(textResourceSelector)\n if (response.ok) {\n const {body} = response\n\n const entities = Object.keys(body.deletedEntities).reduce((acc, entityName) => {\n return [...acc, ...body.deletedEntities[entityName].map(key => ({entityName, key}))]\n }, [])\n\n const remoteEvents = [\n {\n type: 'entity-delete-event',\n payload: {\n entities\n }\n }\n ]\n\n yield put(\n externalEvents.fireExternalEvent('onSuccess', {\n message: textResources['client.delete.successfullyMessage'],\n remoteEvents\n })\n )\n } else {\n if (response.status === 409 && response.body.information) {\n yield put(externalEvents.fireExternalEvent('onError', {message: response.body.information}))\n } else {\n yield put(externalEvents.fireExternalEvent('onError', {message: textResources['client.delete.errorMessage']}))\n }\n }\n}\n\nexport function* onCancel() {\n yield put(externalEvents.fireExternalEvent('onCancel'))\n}\n\nexport default function* mainSagas() {\n yield all([\n takeLatest(actions.LOAD_DIALOG_INFO, loadDialogInfo),\n takeLatest(actions.DO_DELETE, doDelete),\n takeLatest(actions.ON_CANCEL, onCancel)\n ])\n}\n","import del, {sagas as deleteSagas} from './delete'\n\nexport default {\n del\n}\n\nexport const sagas = [deleteSagas]\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport {actionEmitter, appFactory, externalEvents, notification, selection} from 'tocco-app-extensions'\nimport {reducer as reducerUtil} from 'tocco-util'\n\nimport Delete from './components/Delete'\nimport reducers, {sagas} from './modules/reducers'\n\nconst packageName = 'delete'\n\nconst EXTERNAL_EVENTS = ['onSuccess', 'onCancel', 'onError', 'emitAction']\n\nconst initApp = (id, input, events, publicPath) => {\n const content = <Delete />\n\n const store = appFactory.createStore(reducers, sagas, input, packageName)\n actionEmitter.addToStore(store, events.emitAction)\n const handleNotifications = !events.emitAction\n notification.addToStore(store, handleNotifications)\n externalEvents.addToStore(store, events)\n\n return appFactory.createApp(packageName, content, store, {\n input,\n events,\n actions: [],\n publicPath,\n textResourceModules: ['component', 'common', packageName]\n })\n}\n\n;(() => {\n if (__DEV__ && __PACKAGE_NAME__ === packageName) {\n const input = require('./dev/input.json')\n\n if (!__NO_MOCK__) {\n const fetchMock = require('fetch-mock').default\n fetchMock.config.overwriteRoutes = false\n const setupFetchMocks = require('./dev/fetchMocks').default\n setupFetchMocks(packageName, fetchMock)\n fetchMock.spy()\n }\n\n const app = initApp(packageName, input)\n\n if (module.hot) {\n module.hot.accept('./modules/reducers', () => {\n const reducers = require('./modules/reducers').default\n reducerUtil.hotReloadReducers(app.store, reducers)\n })\n }\n\n appFactory.renderApp(app.component)\n } else {\n appFactory.registerAppInRegistry(packageName, initApp)\n }\n})()\n\nconst DeleteApp = props => {\n const {component} = appFactory.useApp({initApp, props, packageName, externalEvents: EXTERNAL_EVENTS})\n return component\n}\n\nDeleteApp.propTypes = {\n selection: selection.propType.isRequired,\n customDeleteEndpoint: PropTypes.string\n}\n\nexport default DeleteApp\n","import {request} from 'tocco-util'\n\nexport const sendRequest = endpoint => request.executeRequest(`rest/${endpoint}`)\n\nexport const extractBody = response => (response.status === 200 ? response.json() : null)\n","export const operators = ['==', '!=', '<=', '>=', '<', '>', '~=']\nexport const atoms = ['true', 'false', 'null']\nexport const types = [\n 'string',\n 'long',\n 'serial',\n 'bool',\n 'boolean',\n 'double',\n 'float',\n 'time',\n 'timestamp',\n 'char',\n 'varchar',\n 'date',\n 'datetime'\n]\nexport const placeholders = [\n 'now_date',\n 'yesterday_date',\n 'tomorrow_date',\n 'today_date',\n 'now_start',\n 'yesterday_start',\n 'tomorrow_start',\n 'today_start',\n 'now',\n 'yesterday',\n 'tomorrow',\n 'today',\n 'currentUsername',\n 'currentUser',\n 'currentBu'\n]\nexport const functions = [\n 'in',\n 'dateadd',\n 'datetimeadd',\n 'duedate',\n 'birthdayin',\n 'fulltext',\n 'likeall',\n 'distance',\n 'inboundingbox'\n]\n","import ace from 'ace-builds/src-min-noconflict/ace'\nimport 'ace-builds/src-min-noconflict/mode-text'\nimport _isArray from 'lodash/isArray'\nimport _mergeWith from 'lodash/mergeWith'\n\nimport {atoms, functions, operators, placeholders, types} from './TqlConstants'\n\nexport default implicitModel =>\n class TqlHighlightRules extends ace.require('ace/mode/text_highlight_rules').TextHighlightRules {\n constructor() {\n super()\n\n const commonWhere = [\n {\n token: 'keyword.operator.conjunction',\n regex: /(\\s*)(and|or|not)($|\\s+)/,\n caseInsensitive: true\n },\n {\n token: 'support.class.relation',\n regex: /rel/,\n push: 'model'\n },\n {\n token: 'keyword.exists',\n regex: /exists\\s*/,\n push: 'exists',\n caseInsensitive: true\n },\n {\n token: 'keyword.count',\n regex: /count\\s*/,\n push: 'count',\n caseInsensitive: true\n },\n {\n token: [\n 'keyword.function.nice_function',\n 'paren.lparen.function_arguments',\n 'text.function_arguments',\n 'paren.rparen',\n 'text.whitespace'\n ],\n regex: `((?:${functions.join('|')})\\\\s*)(\\\\()(.*?)(\\\\))($|\\\\s+)`,\n caseInsensitive: true\n },\n {\n token: 'keyword.other.chaining',\n regex: /\\./\n },\n {\n token: 'support.function.field',\n regex: /([a-z_]+)($|\\s+)/,\n push: 'comparison'\n }\n ]\n\n const customRules = {\n start: implicitModel\n ? [\n {\n token: 'keyword.where',\n regex: /\\s*/,\n next: 'rootwhere',\n caseInsensitive: true\n }\n ]\n : [\n {\n token: 'keyword.find',\n regex: /find($|\\s+)/,\n push: 'model',\n caseInsensitive: true\n },\n {\n token: 'keyword.where',\n regex: /where($|\\s+)/,\n next: 'rootwhere',\n caseInsensitive: true\n }\n ],\n model: [\n {\n token: 'support.class.model',\n regex: /[A-Z][a-z_0-9]*\\s*/,\n next: 'pop'\n }\n ],\n rootwhere: [\n {\n token: 'keyword.order_by',\n regex: /order by($|\\s+)/,\n next: 'order',\n caseInsensitive: true\n },\n ...commonWhere\n ],\n comparison: [\n {\n token: 'keyword.operator.comparison',\n regex: `(${operators.join('|')})\\\\s*`,\n next: 'value'\n }\n ],\n value: [\n {\n token: 'string',\n regex: /\".*?\"\\s*/,\n next: 'pop'\n },\n {\n token: 'constant.numeric',\n regex: /\\d+(.\\d+)?\\s*/,\n next: 'pop'\n },\n {\n token: 'constant.language.tocco_placeholder',\n regex: `\\\\:(${placeholders.join('|')})\\\\s*`,\n next: 'pop',\n caseInsensitive: true\n },\n {\n token: 'constant.language',\n regex: `(${atoms.join('|')})\\\\s*`,\n next: 'pop',\n caseInsensitive: true\n },\n {\n token: 'support.type',\n regex: `(${types.join('|')}):\\\\s*`,\n caseInsensitive: true\n }\n ],\n exists: [\n {\n token: 'paren.lparen',\n regex: /\\(\\s*/\n },\n {\n token: 'support.class.relation',\n regex: /rel/,\n push: 'model'\n },\n {\n token: 'keyword.other.chaining',\n regex: /\\./\n },\n {\n token: 'keyword.where',\n regex: /where($|\\s+)/,\n next: 'existswhere',\n caseInsensitive: true\n },\n {\n token: 'paren.rparen',\n regex: /\\)\\s*/,\n next: 'pop'\n }\n ],\n existswhere: [\n ...commonWhere,\n {\n token: 'paren.rparen',\n regex: /\\)\\s*/,\n next: 'pop'\n }\n ],\n count: [\n {\n token: 'paren.lparen',\n regex: /\\(\\s*/\n },\n {\n token: 'support.class.relation',\n regex: /rel/,\n push: 'model'\n },\n {\n token: 'keyword.other.chaining',\n regex: /\\./\n },\n {\n token: 'keyword.where',\n regex: /where($|\\s+)/,\n next: 'countwhere',\n caseInsensitive: true\n },\n {\n token: 'paren.rparen',\n regex: /\\)\\s*/,\n next: 'comparison'\n }\n ],\n countwhere: [\n ...commonWhere,\n {\n token: 'paren.rparen',\n regex: /\\)\\s*/,\n next: 'comparison'\n }\n ],\n order: [\n {\n token: 'support.class.relation',\n regex: /rel/,\n push: 'model'\n },\n {\n token: 'keyword.other.chaining',\n regex: /\\./\n },\n {\n token: ['support.function.field', 'keyword.direction', 'separator'],\n regex: /([a-z_]+\\s*)(asc|desc)?($|,|\\s+)/\n }\n ]\n }\n this.$rules = _mergeWith(this.$rules, customRules, (objValue, srcValue) =>\n _isArray(objValue) ? objValue.concat(srcValue) : undefined\n )\n\n this.normalizeRules()\n }\n }\n","import ace from 'ace-builds/src-min-noconflict/ace'\nimport 'ace-builds/src-min-noconflict/mode-text'\nimport 'ace-builds/src-min-noconflict/mode-html'\nimport _isArray from 'lodash/isArray'\nimport _mergeWith from 'lodash/mergeWith'\n\nimport TqlHighlighter from './TqlHighlighter'\n\n/** this is a copy from https://github.com/ajaxorg/ace/blob/master/lib/ace/mode/ftl_highlight_rules.js but with angled\n * brackets replaced with square brackets as described in\n * https://freemarker.apache.org/docs/dgui_misc_alternativesyntax.html\n *\n * TODO add auto-complete? only for tocco functions? TOCDEV-4496\n * TODO implement possibility to switch between the two and open PR with ACE repository? TOCDEV-4495\n **/\nexport class ToccoFtlLangHighlightRules extends ace.require('ace/mode/text_highlight_rules').TextHighlightRules {\n constructor() {\n super()\n\n const stringBuiltIns =\n '\\\\?|substring|cap_first|uncap_first|capitalize|chop_linebreak|date|time|datetime|' +\n 'ends_with|html|groups|index_of|j_string|js_string|json_string|last_index_of|length|lower_case|' +\n 'left_pad|right_pad|contains|matches|number|replace|rtf|url|split|starts_with|string|trim|' +\n 'upper_case|word_list|xhtml|xml'\n const numberBuiltIns = 'c|round|floor|ceiling'\n const dateBuiltIns = 'iso_[a-z_]+'\n const seqBuiltIns = 'first|last|seq_contains|seq_index_of|seq_last_index_of|reverse|size|sort|sort_by|chunk'\n const hashBuiltIns = 'keys|values'\n const xmlBuiltIns = 'children|parent|root|ancestors|node_name|node_type|node_namespace'\n const expertBuiltIns =\n 'byte|double|float|int|long|short|number_to_date|number_to_time|number_to_datetime|' +\n 'eval|has_content|interpret|is_[a-z_]+|namespacenew'\n const allBuiltIns =\n stringBuiltIns + numberBuiltIns + dateBuiltIns + seqBuiltIns + hashBuiltIns + xmlBuiltIns + expertBuiltIns\n\n const deprecatedBuiltIns = 'default|exists|if_exists|web_safe'\n\n const variables =\n 'data_model|error|globals|lang|locale|locals|main|namespace|node|current_node|' +\n 'now|output_encoding|template_name|url_escaping_charset|vars|version'\n\n const operators = 'gt|gte|lt|lte|as|in|using'\n\n const reserved = 'true|false'\n\n const attributes =\n 'encoding|parse|locale|number_format|date_format|time_format|datetime_format|time_zone|' +\n 'url_escaping_charset|classic_compatible|strip_whitespace|strip_text|strict_syntax|ns_prefixes|' +\n 'attributes'\n\n this.$rules = {\n start: [\n {\n token: 'constant.character.entity',\n regex: /&[^;]+;/\n },\n {\n token: 'support.function',\n regex: '\\\\?(' + allBuiltIns + ')'\n },\n {\n token: 'support.function.deprecated',\n regex: '\\\\?(' + deprecatedBuiltIns + ')'\n },\n {\n token: 'language.variable',\n regex: '\\\\.(?:' + variables + ')'\n },\n {\n token: 'constant.language',\n regex: '\\\\b(' + reserved + ')\\\\b'\n },\n {\n token: 'keyword.operator',\n regex: '\\\\b(?:' + operators + ')\\\\b'\n },\n {\n token: 'entity.other.attribute-name',\n regex: attributes\n },\n {\n token: 'string', //\n regex: /['\"]/,\n next: 'qstring'\n },\n {\n // Deal with variable names that contains number\n // e.g. <#if var42 == 42 >\n token: function (value) {\n if (value.match('^[+-]?\\\\d+(?:(?:\\\\.\\\\d*)?(?:[eE][+-]?\\\\d+)?)?$')) {\n return 'constant.numeric'\n } else {\n return 'variable'\n }\n },\n regex: /[\\w.+-]+/\n },\n {\n token: 'keyword.operator',\n regex:\n '!|\\\\.|\\\\$|%|&|\\\\*|\\\\-\\\\-|\\\\-|\\\\+\\\\+|\\\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|&&|\\\\|\\\\||\\\\?\\\\:' +\n '|\\\\*=|%=|\\\\+=|\\\\-=|&=|\\\\^='\n },\n {\n token: 'paren.lparen',\n regex: '[[({]'\n },\n {\n token: 'paren.rparen',\n regex: '[\\\\])}]'\n },\n {\n token: 'text',\n regex: '\\\\s+'\n }\n ],\n\n qstring: [\n {\n token: 'constant.character.escape',\n regex: '\\\\\\\\[nrtvef\\\\\\\\\"$]'\n },\n {\n token: 'string',\n regex: /['\"]/,\n next: 'start'\n },\n {\n defaultToken: 'string'\n }\n ]\n }\n }\n}\n\nexport default class ToccoFtlHighlightRules extends ace.require('ace/mode/html_highlight_rules').HtmlHighlightRules {\n constructor() {\n super()\n\n const directives =\n 'assign|attempt|break|case|compress|default|elseif|else|escape|fallback|function|flush|' +\n 'ftl|global|if|import|include|list|local|lt|macro|nested|noescape|noparse|nt|recover|recurse|return|rt|' +\n 'setting|stop|switch|t|visit'\n\n const tqlDirectives = ['query', 'queryCount']\n\n const startRules = [\n {\n token: 'keyword.function',\n regex: `\\\\[@(${tqlDirectives.join('|')}).*?]`,\n push: 'tql-start'\n },\n {\n token: 'comment',\n regex: '\\\\[#--',\n next: 'ftl-dcomment'\n },\n {\n token: 'string.interpolated',\n regex: '\\\\${',\n push: 'ftl-start'\n },\n {\n token: 'keyword.function',\n regex: '\\\\[/?#(' + directives + ')',\n push: 'ftl-start'\n },\n {\n token: 'keyword.other',\n regex: '\\\\[/?@[a-zA-Z\\\\.]+',\n push: 'ftl-start'\n }\n ]\n\n const endRules = [\n {\n token: 'keyword',\n regex: '/?\\\\]',\n next: 'pop'\n },\n {\n token: 'string.interpolated',\n regex: '}',\n next: 'pop'\n }\n ]\n\n for (const key in this.$rules) {\n this.$rules[key].unshift.apply(this.$rules[key], startRules)\n }\n\n this.embedRules(ToccoFtlLangHighlightRules, 'ftl-', endRules, ['start'])\n\n this.addRules({\n 'ftl-dcomment': [\n {\n token: 'comment',\n regex: '--\\\\]',\n next: 'pop'\n },\n {\n defaultToken: 'comment'\n }\n ]\n })\n\n const tqlEndRules = [\n {\n token: 'keyword.function',\n regex: `\\\\[/@(${tqlDirectives.join('|')})]`,\n next: 'pop'\n }\n ]\n\n this.embedRules(TqlHighlighter(), 'tql-', tqlEndRules, ['start'])\n\n const mergingRules = {\n 'tql-rootwhere': [\n {\n token: 'keyword.function',\n regex: `\\\\[/@(${tqlDirectives.join('|')})]`,\n next: 'pop'\n }\n ],\n 'tql-order': [\n {\n token: 'keyword.function',\n regex: `\\\\[/@(${tqlDirectives.join('|')})]`,\n next: 'pop'\n }\n ]\n }\n this.$rules = _mergeWith(this.$rules, mergingRules, (objValue, srcValue) =>\n _isArray(objValue) ? objValue.concat(srcValue) : undefined\n )\n\n this.normalizeRules()\n }\n}\n","import ace from 'ace-builds/src-min-noconflict/ace'\n\nimport {extractBody, sendRequest} from './requestHelper'\nimport {functions, placeholders, types} from './TqlConstants'\n\nconst TokenIterator = ace.require('ace/token_iterator').TokenIterator\nconst getTokenType = token => (token ? token.type.substring(token.type.lastIndexOf('.') + 1) : null)\n\nconst isCurrentTokenOfType = (iterator, type) => getTokenType(iterator.getCurrentToken()) === type\n\nconst findLastPathStep = iterator => {\n if (isCurrentTokenOfType(iterator, 'model')) {\n iterator.stepBackward()\n }\n if (isCurrentTokenOfType(iterator, 'field') || isCurrentTokenOfType(iterator, 'relation')) {\n iterator.stepBackward()\n }\n if (isCurrentTokenOfType(iterator, 'chaining')) {\n iterator.stepBackward()\n } else {\n return null\n }\n\n if (isCurrentTokenOfType(iterator, 'model')) {\n const modelToken = iterator.getCurrentToken()\n iterator.stepBackward()\n iterator.stepBackward()\n return modelToken ? modelToken.value.trim() : null\n } else {\n return null\n }\n}\n\nconst stepBackUntilToken = (iterator, type) => {\n while (!isCurrentTokenOfType(iterator, type)) {\n if (!iterator.stepBackward()) {\n return false\n }\n }\n return true\n}\n\nconst handleParentheses = (iterator, parenCount) => {\n if (isCurrentTokenOfType(iterator, 'rparen')) {\n return 1\n } else if (parenCount > 0 && isCurrentTokenOfType(iterator, 'lparen')) {\n iterator.stepBackward()\n return -1\n } else {\n return 0\n }\n}\n\nconst findLastModelScope = iterator => {\n let parenCount = 0\n while (iterator.getCurrentToken()) {\n if (parenCount === 0 && isCurrentTokenOfType(iterator, 'where')) {\n const modelToken = iterator.stepBackward()\n return modelToken ? [modelToken.value.trim(), ...findCurrentPath(iterator)] : []\n }\n if (isCurrentTokenOfType(iterator, 'order_by')) {\n if (stepBackUntilToken(iterator, 'find')) {\n const modelToken = iterator.stepForward()\n return modelToken ? modelToken.value.trim() : []\n } else {\n return []\n }\n }\n parenCount += handleParentheses(iterator, parenCount)\n if (!iterator.stepBackward()) {\n return null\n }\n }\n return null\n}\n\nconst backtrack = (iterator, stepBack) => {\n const steps = []\n let lastStep = stepBack(iterator)\n while (lastStep) {\n if (Array.isArray(lastStep)) {\n lastStep.forEach(step => steps.unshift(step))\n } else {\n steps.unshift(lastStep)\n }\n lastStep = stepBack(iterator)\n }\n return steps\n}\n\nexport const findCurrentPath = iterator => backtrack(iterator, findLastPathStep)\nexport const findCurrentModelScope = iterator => backtrack(iterator, findLastModelScope)\n\n/**\n * built-in language completions use 1000000, which also seems to just be some magic number\n * keyword and local completions seem to be somewhere around 100 based on some experiments with ordering\n **/\nconst defaultScore = 1000\n\nconst loadModels = () =>\n sendRequest('entities')\n .then(extractBody)\n .then(body => (body ? body.entities : {}))\n .then(entities => (entities ? Object.keys(entities) : []))\n\nconst buildRelationLabel = relation =>\n relation.relationName.substring(3) !== relation.targetEntity\n ? `${relation.relationName} (${relation.targetEntity})`\n : relation.relationName\n\nconst buildResolveUrl = (sourceModel, relationSteps) => {\n const resolvePart = relationSteps.length > 0 ? '/resolve?path=' + relationSteps.join('.') : ''\n return `entities/${sourceModel}/model${resolvePart}`\n}\n\nconst resolvePath = ([sourceModel, ...relationSteps]) =>\n sendRequest(buildResolveUrl(sourceModel, relationSteps))\n .then(extractBody)\n .then(body => {\n if (!body) {\n return []\n }\n const fields = body.fields || []\n const relations = body.relations || []\n return [\n ...fields.map(f => ({\n label: `${f.fieldName} (${f.type})`,\n value: f.fieldName,\n type: 'field'\n })),\n ...relations.map(r => ({\n label: buildRelationLabel(r),\n value: r.relationName,\n type: 'relation'\n }))\n ]\n })\n\nconst determineModelScope = (createIterator, implicitModel) => {\n if (implicitModel) {\n const [...modelScope] = findCurrentModelScope(createIterator())\n return {baseModel: implicitModel, modelScope}\n } else {\n const [baseModel, ...modelScope] = findCurrentModelScope(createIterator())\n return {baseModel, modelScope}\n }\n}\n\nconst determineAvailablePaths = (createIterator, callback, implicitModel) => {\n const {baseModel, modelScope} = determineModelScope(createIterator, implicitModel)\n if (!baseModel) {\n return\n }\n const currentPath = findCurrentPath(createIterator())\n const relationSteps = [...modelScope, ...currentPath].map(model => `rel${model}`)\n const fullPath = [baseModel, ...relationSteps]\n resolvePath(fullPath)\n .then(paths => {\n const pathCompletions = paths.map(path => ({\n caption: path.label,\n value: path.value,\n meta: path.type,\n score: defaultScore\n }))\n callback(null, pathCompletions)\n })\n .catch(errors => callback(errors))\n}\n\nconst loadAllAvailableModels = callback =>\n loadModels()\n .then(models => {\n const modelCompletions = models.map(model => ({\n caption: model,\n value: model,\n meta: 'model',\n score: defaultScore\n }))\n callback(null, modelCompletions)\n })\n .catch(errors => callback(errors))\n\nconst getAvailableFunctions = () =>\n functions\n .map(f => f.toUpperCase())\n .map(f => ({\n caption: f,\n value: `${f}()`,\n meta: 'function',\n score: defaultScore - 30\n }))\n\nconst getAvailableTypes = () =>\n types.map(type => ({\n caption: type,\n value: `${type}:`,\n meta: 'type',\n score: defaultScore - 20\n }))\n\nconst getAvailablePlaceholders = () =>\n placeholders.map(placeholder => ({\n caption: placeholder,\n value: `:${placeholder}`,\n meta: 'placeholder',\n score: defaultScore - 10\n }))\n\nexport default implicitModel => ({\n getCompletions: (editor, session, pos, prefix, callback) => {\n const createIteratorAtCurrentPosition = () => new TokenIterator(session, pos.row, pos.column)\n\n const iterator = createIteratorAtCurrentPosition()\n const currentToken = iterator.getCurrentToken()\n const previousToken = iterator.stepBackward() ? iterator.getCurrentToken() : null\n switch (getTokenType(currentToken)) {\n case 'chaining':\n case 'relation':\n case 'separator':\n case 'order_by':\n case 'count':\n case 'exists':\n case 'field':\n case 'function_arguments':\n determineAvailablePaths(createIteratorAtCurrentPosition, callback, implicitModel)\n break\n case 'where':\n case 'conjunction':\n determineAvailablePaths(createIteratorAtCurrentPosition, callback, implicitModel)\n callback(null, getAvailableFunctions())\n break\n case 'nice_function':\n callback(null, getAvailableFunctions())\n break\n case 'find':\n loadAllAvailableModels(callback)\n break\n case 'type':\n case 'tocco_placeholder':\n case 'comparison':\n callback(null, getAvailableTypes())\n callback(null, getAvailablePlaceholders())\n break\n case 'model':\n determineAvailablePaths(createIteratorAtCurrentPosition, callback, implicitModel)\n if (previousToken && getTokenType(previousToken) !== 'relation') {\n loadAllAvailableModels(callback)\n }\n break\n case null:\n // this happens when nothing has been entered, which is a valid start with an implicit model, treat like where\n if (implicitModel) {\n determineAvailablePaths(createIteratorAtCurrentPosition, callback, implicitModel)\n }\n callback(null, getAvailableFunctions())\n break\n }\n }\n})\n","import ace from 'ace-builds/src-min-noconflict/ace'\nimport 'ace-builds/src-min-noconflict/mode-ftl'\n\nimport ToccoFtlHighlightRules from './FtlHighlighter'\nimport TqlAutoCompleter from './TqlAutoCompleter'\n\nexport default class ToccoFtlMode extends ace.require('ace/mode/ftl').Mode {\n constructor() {\n super()\n this.HighlightRules = ToccoFtlHighlightRules\n this.completer = TqlAutoCompleter()\n }\n}\n","import ace from 'ace-builds/src-min-noconflict/ace'\nimport 'ace-builds/src-min-noconflict/mode-text'\n\nimport TqlAutoCompleter from './TqlAutoCompleter'\nimport TqlHighlighter from './TqlHighlighter'\n\nexport default class TqlMode extends ace.require('ace/mode/text').Mode {\n constructor({implicitModelName}) {\n super()\n this.HighlightRules = TqlHighlighter(implicitModelName)\n this.completer = TqlAutoCompleter(implicitModelName)\n this.snippedIdField = null // TODO implement? TOCDEV-4499\n }\n}\n","import ace from 'ace-builds/src-min-noconflict/ace'\nimport 'ace-builds/webpack-resolver'\nimport {Mode as DroolsMode} from 'ace-builds/src-min-noconflict/mode-drools'\nimport {Mode as GroovyMode} from 'ace-builds/src-min-noconflict/mode-groovy'\nimport {Mode as HtmlMode} from 'ace-builds/src-min-noconflict/mode-html'\nimport {Mode as JsonMode} from 'ace-builds/src-min-noconflict/mode-json'\nimport {Mode as LessMode} from 'ace-builds/src-min-noconflict/mode-less'\nimport {Mode as PropertiesMode} from 'ace-builds/src-min-noconflict/mode-properties'\nimport {Mode as TextMode} from 'ace-builds/src-min-noconflict/mode-text'\nimport {Mode as XmlMode} from 'ace-builds/src-min-noconflict/mode-xml'\nimport _get from 'lodash/get'\nimport _isObject from 'lodash/isObject'\nimport _isString from 'lodash/isString'\nimport React, {useEffect, useMemo, useRef} from 'react'\nimport styled from 'styled-components'\n\nimport AceEditorPropTypes from './AceEditorPropTypes'\nimport 'ace-builds/src-min-noconflict/snippets/ftl'\nimport 'ace-builds/src-min-noconflict/snippets/groovy'\nimport 'ace-builds/src-min-noconflict/snippets/html'\nimport 'ace-builds/src-min-noconflict/snippets/less'\nimport 'ace-builds/src-min-noconflict/snippets/xml'\nimport 'ace-builds/src-min-noconflict/snippets/properties'\nimport 'ace-builds/src-min-noconflict/snippets/json'\nimport 'ace-builds/src-min-noconflict/snippets/drools'\nimport 'ace-builds/src-min-noconflict/theme-textmate'\nimport 'ace-builds/src-min-noconflict/ext-language_tools'\nimport {extractBody, sendRequest} from './requestHelper'\nimport ToccoFtlMode from './ToccoFtlMode'\nimport TqlMode from './TqlMode'\n\nconst StyledEditor = styled.div`\n width: 100%;\n z-index: 0; /* gutter lays over menu otherwise */\n`\n\nconst modeMappings = {\n groovy: () => new GroovyMode(),\n html: () => new HtmlMode(),\n xml: () => new XmlMode(),\n properties: () => new PropertiesMode(),\n json: () => new JsonMode(),\n htmlmixed: () => new ToccoFtlMode(),\n freemarkermixed: () => new ToccoFtlMode(),\n ftl: () => new ToccoFtlMode(),\n tql: props => new TqlMode(props),\n less: () => new LessMode(),\n drools: () => new DroolsMode(),\n text: () => new TextMode()\n}\n\nconst getMode = (mode, props) => _get(modeMappings, mode, mode)(props)\n\nconst loadImplicitModel = implicitModel => {\n if (_isString(implicitModel)) {\n return Promise.resolve(implicitModel)\n } else if (_isObject(implicitModel)) {\n return sendRequest(`entities/2.0/${implicitModel.entityModel}/${implicitModel.key}?_paths=${implicitModel.field}`)\n .then(extractBody)\n .then(moduleEntity => _get(moduleEntity, ['paths', 'entity_name', 'value'], null))\n } else {\n return Promise.resolve(null)\n }\n}\n\nconst setEditorConfiguration = (editor, {mode, theme, showGutter, editorOptions = {}, implicitModel}) => {\n loadImplicitModel(implicitModel)\n .then(implicitModelName => getMode(mode, {implicitModelName}))\n .then(editorMode => editor.getSession().setMode(editorMode))\n editor.setTheme(`ace/theme/${theme}`)\n Object.entries(editorOptions).forEach(([k, v]) => {\n editor.setOption(k, v)\n })\n editor.renderer.setShowGutter(showGutter)\n editor.resize()\n}\n\nconst AceEditor = props => {\n const {mode, theme = 'textmate', value, onChange, showGutter = true, editorOptions = {}, implicitModel} = props\n const containerReference = useRef(null)\n const editorReference = useRef(null)\n\n const editorConfig = useMemo(\n () => ({mode, theme, showGutter, editorOptions, implicitModel}),\n [mode, theme, showGutter, editorOptions, implicitModel]\n )\n\n // only on mount\n useEffect(() => {\n const aceEditor = ace.edit(containerReference.current)\n aceEditor.getSession().setValue(value || '')\n aceEditor.on('change', () => onChange(aceEditor.getValue()))\n setEditorConfiguration(aceEditor, editorConfig)\n editorReference.current = aceEditor\n\n return () => aceEditor.destroy()\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n useEffect(() => {\n if (editorReference.current) {\n setEditorConfiguration(editorReference.current, editorConfig)\n }\n }, [editorConfig])\n useEffect(() => {\n /* ace handles its state internally, always resetting the value confuses it.\n * this way we only set the value when it is different from the current state, i.e. when it is overwritten through\n * code. feel free to rewrite this with better ideas.\n */\n if (editorReference.current && value !== editorReference.current.getValue()) {\n editorReference.current.getSession().setValue(value)\n }\n }, [value])\n\n return <StyledEditor ref={containerReference} />\n}\n\nAceEditor.propTypes = AceEditorPropTypes\n\nexport default AceEditor\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":""}
|