tocco-admin 1.0.9 → 1.0.10
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 +3 -0
- package/dist/{chunk-207.7fff2d78053814c11b73.js → chunk-207.5b6831b57c6d0933d161.js} +2 -2
- package/dist/{chunk-207.7fff2d78053814c11b73.js.map → chunk-207.5b6831b57c6d0933d161.js.map} +1 -1
- package/dist/chunk-404.a940ebd544a68614070d.js +2 -0
- package/dist/chunk-404.a940ebd544a68614070d.js.map +1 -0
- package/dist/{chunk-actions.fa5783e35d7c4d16eaee.js → chunk-actions.122f368790631a506e84.js} +2 -2
- package/dist/chunk-actions.122f368790631a506e84.js.map +1 -0
- package/dist/{chunk-docs-actions.cb048459addfc8261dc1.js → chunk-docs-actions.9c46b27e36cc37c3782e.js} +2 -2
- package/dist/chunk-docs-actions.9c46b27e36cc37c3782e.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/dist/chunk-404.bb594fd38132d44f8a29.js +0 -2
- package/dist/chunk-404.bb594fd38132d44f8a29.js.map +0 -1
- package/dist/chunk-actions.fa5783e35d7c4d16eaee.js.map +0 -1
- package/dist/chunk-docs-actions.cb048459addfc8261dc1.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["webpack:///./packages/copy/src/components/CopyProgress/CopyProgress.js","webpack:///./packages/copy/src/components/CopyProgress/CopyProgressContainer.js","webpack:///./packages/copy/src/modules/copy/actions.js","webpack:///./packages/copy/src/components/CopyProgress/index.js","webpack:///./packages/copy/src/modules/copy/sagas.js","webpack:///./packages/copy/src/modules/reducers.js","webpack:///./packages/copy/src/main.js","webpack:///./packages/admin/src/routes/entities/components/Action/actions/Documents.js","webpack:///./packages/input-edit/src/modules/inputEdit/actions.js","webpack:///./packages/input-edit/src/modules/inputEditSearch/actions.js","webpack:///./packages/input-edit/src/modules/inputEditTable/actions.js","webpack:///./packages/input-edit/src/components/InputEditInformation/StyledInputEditInformation.js","webpack:///./packages/input-edit/src/components/InputEditInformation/InputEditInformation.js","webpack:///./packages/input-edit/src/components/InputEditInformation/InputEditInformationContainer.js","webpack:///./packages/input-edit/src/components/InputEditSearch/InputEditSearch.js","webpack:///./packages/input-edit/src/components/InputEditSearch/InputEditSearchContainer.js","webpack:///./packages/input-edit/src/modules/inputEditPagination/actions.js","webpack:///./packages/input-edit/src/components/InputEditTable/keyHandler.js","webpack:///./packages/input-edit/src/components/InputEditTable/StyledComponents.js","webpack:///./packages/input-edit/src/components/InputEditTable/InputEditTable.js","webpack:///./packages/input-edit/src/components/InputEditTable/InputEditTableContainer.js","webpack:///./packages/input-edit/src/components/InputEdit/StyledInputEdit.js","webpack:///./packages/input-edit/src/components/InputEdit/InputEdit.js","webpack:///./packages/input-edit/src/components/InputEdit/InputEditContainer.js","webpack:///./packages/input-edit/src/modules/inputEditInformation/actions.js","webpack:///./packages/input-edit/src/modules/inputEdit/reducer.js","webpack:///./packages/input-edit/src/modules/inputEdit/index.js","webpack:///./packages/input-edit/src/modules/inputEdit/sagas.js","webpack:///./packages/input-edit/src/modules/inputEditInformation/reducer.js","webpack:///./packages/input-edit/src/modules/inputEditInformation/index.js","webpack:///./packages/input-edit/src/modules/inputEditInformation/sagas.js","webpack:///./packages/input-edit/src/modules/inputEditPagination/reducer.js","webpack:///./packages/input-edit/src/modules/inputEditPagination/index.js","webpack:///./packages/input-edit/src/modules/inputEditTable/utils.js","webpack:///./packages/input-edit/src/modules/inputEditTable/sagas.js","webpack:///./packages/input-edit/src/modules/inputEditPagination/sagas.js","webpack:///./packages/input-edit/src/modules/inputEditSearch/reducer.js","webpack:///./packages/input-edit/src/modules/inputEditSearch/index.js","webpack:///./packages/input-edit/src/modules/inputEditSearch/sagas.js","webpack:///./packages/input-edit/src/modules/inputEditTable/reducer.js","webpack:///./packages/input-edit/src/modules/inputEditTable/index.js","webpack:///./packages/input-edit/src/modules/reducers.js","webpack:///./packages/input-edit/src/main.js","webpack:///./packages/merge/src/modules/merge/actions.js","webpack:///./packages/merge/src/util/manyRelationEntityCount.js","webpack:///./packages/merge/src/components/GlobalStyledComponents.js","webpack:///./packages/merge/src/components/MergeSummary/StyledComponents.js","webpack:///./packages/merge/src/components/MergeSummary/MergeSummary.js","webpack:///./packages/merge/src/components/MergeSummary/MergeSummaryContainer.js","webpack:///./packages/merge/src/components/MergeSummary/index.js","webpack:///./packages/merge/src/util/sourceData.js","webpack:///./packages/merge/src/components/MergeTable/StyledComponents.js","webpack:///./packages/merge/src/components/MergeTable/Selection.js","webpack:///./packages/merge/src/components/MergeTable/CellRender.js","webpack:///./packages/merge/src/components/MergeTable/MergeErrors.js","webpack:///./packages/merge/src/components/MergeTable/MergeTable.js","webpack:///./packages/merge/src/components/MergeTable/MergeTableContainer.js","webpack:///./packages/merge/src/components/MergeTable/index.js","webpack:///./packages/merge/src/components/Merge/StyledComponents.js","webpack:///./packages/merge/src/components/Merge/Merge.js","webpack:///./packages/merge/src/components/Merge/MergeContainer.js","webpack:///./packages/merge/src/components/Merge/index.js","webpack:///./packages/merge/src/modules/merge/reducer.js","webpack:///./packages/merge/src/modules/merge/sagas.js","webpack:///./packages/merge/src/modules/merge/index.js","webpack:///./packages/merge/src/modules/reducers.js","webpack:///./packages/merge/src/main.js","webpack:///./packages/admin/src/routes/entities/components/Action/actions/PasswordUpdate.js","webpack:///./packages/tocco-util/src/color/hexToRgb.js","webpack:///./packages/tocco-util/src/color/contrast.js","webpack:///./packages/tocco-util/src/color/index.js","webpack:///./packages/scheduler/src/utils/conflicts.js","webpack:///./packages/scheduler/src/utils/calendar.js","webpack:///./packages/scheduler/src/utils/time.js","webpack:///./packages/scheduler/src/components/Conflict/Conflict.js","webpack:///./packages/scheduler/src/components/Conflict/index.js","webpack:///./packages/tocco-ui/src/DatePicker/LazyDatePicker.js","webpack:///./packages/scheduler/src/components/NavigationFullCalendar/StyledNavigationFullCalendar.js","webpack:///./packages/scheduler/src/components/NavigationFullCalendar/NavigationFullCalendar.js","webpack:///./packages/scheduler/src/components/NavigationFullCalendar/index.js","webpack:///./packages/scheduler/src/components/FullCalendar/ResourceLabelContent.js","webpack:///./packages/scheduler/src/components/FullCalendar/StyledFullCalendar.js","webpack:///./packages/scheduler/src/components/FullCalendar/FullCalendar.js","webpack:///./packages/scheduler/src/components/FullCalendar/index.js","webpack:///./packages/scheduler/src/components/Scheduler/Scheduler.js","webpack:///./packages/scheduler/src/components/Scheduler/index.js","webpack:///./packages/scheduler/src/modules/scheduler/actions.js","webpack:///./packages/scheduler/src/containers/SchedulerContainer.js","webpack:///./packages/scheduler/src/input.js","webpack:///./packages/scheduler/src/modules/scheduler/reducer.js","webpack:///./packages/scheduler/src/modules/scheduler/index.js","webpack:///./packages/scheduler/src/modules/scheduler/sagas.js","webpack:///./packages/scheduler/src/modules/reducers.js","webpack:///./packages/scheduler/src/main.js","webpack:///./packages/resource-scheduler/src/modules/resourceScheduler/actions.js","webpack:///./packages/resource-scheduler/src/containers/SchedulerAppContainer.js","webpack:///./packages/resource-scheduler/src/components/SearchPanel/SearchPanel.js","webpack:///./packages/resource-scheduler/src/components/ResourceScheduler/StyledResourceScheduler.js","webpack:///./packages/resource-scheduler/src/components/ResourceScheduler/ResourceScheduler.js","webpack:///./packages/resource-scheduler/src/components/ResourceScheduler/index.js","webpack:///./packages/resource-scheduler/src/containers/ResourceSchedulerContainer.js","webpack:///./packages/resource-scheduler/src/modules/resourceScheduler/reducer.js","webpack:///./packages/resource-scheduler/src/modules/resourceScheduler/index.js","webpack:///./packages/resource-scheduler/src/utils/rest.js","webpack:///./packages/resource-scheduler/src/modules/resourceScheduler/sagas.js","webpack:///./packages/resource-scheduler/src/modules/reducers.js","webpack:///./packages/resource-scheduler/src/main.js","webpack:///./packages/admin/src/routes/entities/components/Action/actions/ResourceScheduler.js","webpack:///./packages/admin/src/routes/entities/components/Action/actions/ShowOutputJobsAction.js","webpack:///./packages/user-qr-action/src/utils/qrCodeUtils.js","webpack:///./packages/user-qr-action/src/components/UserQrCode/UserQrCode.js","webpack:///./packages/user-qr-action/src/components/UserQrCode/index.js","webpack:///./packages/user-qr-action/src/modules/qrCode/actions.js","webpack:///./packages/user-qr-action/src/containers/UserQrCodeContainer.js","webpack:///./packages/user-qr-action/src/modules/qrCode/reducer.js","webpack:///./packages/user-qr-action/src/modules/qrCode/index.js","webpack:///./packages/user-qr-action/src/modules/qrCode/sagas.js","webpack:///./packages/user-qr-action/src/modules/reducers.js","webpack:///./packages/user-qr-action/src/main.js","webpack:///./packages/widget-code-copy/src/modules/widgetCode/actions.js","webpack:///./packages/widget-code-copy/src/utils/widgetCode.js","webpack:///./packages/widget-code-copy/src/components/StyledComponents.js","webpack:///./packages/widget-code-copy/src/components/WidgetCodeCopy.js","webpack:///./packages/widget-code-copy/src/components/WidgetCodeCopyContainer.js","webpack:///./packages/widget-code-copy/src/modules/widgetCode/reducer.js","webpack:///./packages/widget-code-copy/src/modules/widgetCode/index.js","webpack:///./packages/widget-code-copy/src/modules/widgetCode/sagas.js","webpack:///./packages/widget-code-copy/src/modules/reducers.js","webpack:///./packages/widget-code-copy/src/main.js"],"names":["StyledDiv","styled","size","startCopy","useEffect","mapActionCreators","type","connect","CopyProgress","sagas","copy","getValues","getPaths","inputSelector","state","input","all","takeLatest","select","selection","navigationStrategy","formName","context","call","selectionUtil","rest","entities","keys","length","entityName","values","put","externalEvents","navigateToCreateRelative","defaultValues","Error","entityKey","paths","sourceEntity","Object","entries","map","id","value","Array","isArray","v","key","filter","d","formDefinition","form","fields","f","ignoreCopy","path","e","copySagas","EXTERNAL_EVENTS","initApp","events","publicPath","content","store","appFactory","reducers","actions","textResourceModules","CopyApp","props","packageName","component","propTypes","PropTypes","reduce","event","to","pathname","setSelection","payload","setHandleNotifications","handleNotifications","setSelectionUpdateInProgress","updateInProgress","SET_INITIALIZED","setForm","setInitialized","initialized","SET_SORTING","initializeTable","setValue","inputDataKey","node","setDataFormColumns","dataFormColumns","setActionDefinitions","actionDefinitions","setDataLoadingInProgress","dataLoadingInProgress","StyledInputEditInformation","StyledStatedValueWrapper","information","info","Field","field","StatedValue","label","immutable","hasValue","formField","dataType","inputEditInformation","InputEditInformation","handleChange","setSearchFields","tql","transformFormValuesToTql","fieldType","getFieldType","tqlBuilder","container","children","find","child","onChange","_debounce","noButtons","validate","mappingType","mode","searchQueries","inputEditSearch","InputEditSearch","SET_CURRENT_PAGE","arrowKeyHandler","includes","document","activeElement","tagName","preventDefault","split","rowIndex","columnIndex","currentIndex","Number","parseInt","indexDiff","idToFocus","elementToFocus","getElementById","focusElement","findHorizontalElementToFocus","adjustedIndex","disabled","setTimeout","focus","borderColor","theme","shadeColor","_get","baseSpace","scale","StyledTableWrapper","StyledCell","declareFocus","dataCellRenderer","lighten","colors","secondaryLight","declareFont","fontWeight","fieldDefinition","data","breakWords","inputEditForm","updateValue","sorting","setSorting","totalCount","currentPage","recordsPerPage","setCurrentPage","useState","columns","setColumns","columnPosition","setColumnPosition","dataColumns","api","inputColumns","c","idx","sortable","definition","resizable","dynamic","CellRenderer","rowData","column","rowIdx","row","readonly","options","pk","FormattedValue","EditableValue","changedValue","onFocus","target","inputCellRenderer","cc","sort","a","b","findIndex","onKeyDown","Table","onSortingChange","onColumnPositionChange","dragColumn","dropColumn","acc","paginationInfo","onPageChange","add","inputEditTable","inputEditPagination","InputEditTable","StyledPaneWrapper","sharedSplitPaneStyles","css","StyledScrollbar","StyledPanelWrapperLeft","isCollapsed","StyledPanelWrapperRight","StyledInputEditSearchWrapper","StyledLeftPane","StyledActionsWrapper","StyledToggleCollapse","StyledPlaceHolder","StyledToggleCollapseButton","Button","GlobalStyles","notification","updateSelection","initializeSearch","initializeInformation","setIsCollapsed","toggleCollapse","Actions","onClick","icon","notify","inputEdit","InputEdit","initialState","ACTION_HANDLERS","reducerUtil","action","handler","emit","reload","updateInputDatas","inputEditSelector","takeEvery","actionEmitter","inputEditAction","method","body","initialize","transformResponseData","response","dataRecord","splitObj","isInputField","isNaN","inputFields","entityFields","__key","processDataForm","loadData","handleResponse","inputEditTableSelector","inputEditSearchSelector","searchQueriesSelector","inputEditPaginationSelector","dataForm","readonlyActions","componentType","scope","actionProperties","inputEditDataForm","editFormDefinition","editColumns","forEach","title","take","searchFormActions","newSorting","newSearchQueries","newPage","getPathsFromTable","searchBean","limit","page","where","join","transformedData","count","flatMap","calculatedValues","actionsToPut","setSearchQueries","getOpposite","order","val","contains","s","currentSorting","inputEditReducer","inputEditSearchReducer","inputEditPaginationReducer","inputEditInformationReducer","inputEditSagas","inputEditTableSagas","inputEditSearchSagas","inputEditPaginationSagas","inputEditInformationSagas","emitAction","errorLogging","cache","InputEditApp","setSourceData","sourceData","setTargetEntity","setMergeResponse","mergeResponse","setMergeError","errorMsg","validationErrors","ManyRelationEntityCount","model","totalKeys","Typography","ListLink","entityKeys","slice","StyledButtonWrapper","StyledButton","StyledSummarySuccessWrapper","StyledMessageWrapper","StyledResultsWrapper","StyledIconWrapper","close","mapToEntityList","_groupBy","entityLabel","list","entity","prev","curr","notCopiedRelations","notDeletedEntities","look","ink","showPermissionMessage","merge","injectIntl","MergeSummary","getAllPaths","getAllRelations","Set","relations","r","relationName","getSortedPathsAndRelations","counters","name","other","getAllPathsAndRelations","sortByLabel","labels","o","getDisplay","fallbackDisplay","displaysPerModel","displays","undefined","display","StyledMergeErrorWrapper","StyledSummaryErrorWrapper","StyledError","StyledLabelWrapper","StyledStatusWrapper","isChecked","areEqual","prevProps","nextProps","js","ManyRelationsCheckBox","React","entityData","setSelectedMultipleAll","isSelected","checked","for","relationEntity","RelationsCheckBoxes","setSelectedMultiple","selectedMultiple","setSelected","numberTotal","numberSelected","allRowsSelectionState","MultiCheckbox","FormattedValueRadio","setSelectedSingle","writable","mappedType","mapActionCreatorsCell","relatedEntityKey","CellRendererContainer","selectedSingle","selected","single","multiple","selectedMultipleAll","multipleAll","entityValidatorErrors","mergeErrorMsg","allMergerValidationErrors","mergeValidationErrors","fieldValidators","validator","msg","index","entityValidators","Boolean","LabelCellRenderer","columnName","allPaths","mapActionCreatorsColumn","ColumnHeaderRendererContainer","targetEntity","mergeStrategyDisplay","status","LoadMask","mergePending","executeMerge","useMemo","pathRows","relationRows","relation","getDataRows","ColumnHeaderRenderer","PathCellRenderer","pathColumns","HeaderRenderer","getColumnDefinition","selectionStyle","MergeTable","StyledMerge","mergeDone","Merge","setTargetEntityMultiple","obj","_setWith","_omit","array","mainSagas","loadSourceData","getMergeBody","mergeSelector","push","mergeRelations","_uniq","sourceKey","resource","acceptedStatusCodes","headers","errorCode","errors","message","entitiy","remoteEvents","fork","moduleSagas","mergeSagas","MergeApp","closeModal","username","ids","showOldPasswordField","success","hexToRgb","hex","fallBack","normalizeHex","result","exec","g","startsWith","padEnd","calculateLight","colorItem","Math","pow","calculateLumiance","color","hexColor","brightValue","darkValue","rgbColor","freeze","EXISTING","ACCEPTED","NONE","getResourceId","getResources","calendars","calendar","calendarType","entityModel","getFormattedTime","date","format","replace","conflictStatus","intl","conflicts","accepted","textResource","formatMessage","DatePickerComponent","lazy","Suspense","fallback","getButtonInkProps","viewType","changeRange","changeView","chooseNext","choosePrev","chooseToday","goToDate","isLoading","refresh","ButtonGroup","style","marginLeft","pending","fieldValue","onCalendarRemove","defaultChecked","className","extendedProps","StyledFullCalendarWrapper","StyledMemoizedFullCalender","CalendarGlobalPrintStyle","createGlobalStyle","FullCalendar","resources","onDateRangeChange","onRefresh","onCalendarRemoveAll","locale","onEventClick","calendarEl","useRef","wrapperEl","moment","current","getApi","batchRendering","getEventSources","eS","remove","addEventSource","JSON","stringify","loadedResources","l","addResource","headerContent","visibility","view","startDate","activeStart","endDate","activeEnd","renderEventContent","eventInfo","time","start","twix","end","monthFormat","dayFormat","tooltipDescriptionContent","description","conflict","eventInfoStyleAttributes","styleAttr","Popover","isPlainHtml","placement","timeText","memoizedFullCalendar","resourceOrder","schedulerLicenseKey","licence","process","plugins","adaptivePlugin","resourceTimelinePlugin","interactionPlugin","ref","initialView","headerToolbar","height","resourceAreaWidth","resourceAreaColumns","labelText","resourceLabelContent","eventClick","eventContent","firstDay","slotMinTime","slotMaxTime","views","dayView","slotLabelFormat","weekView","weekday","month","day","weekViewSimple","slotDuration","monthView","omitCommas","next","today","gotoDate","getDate","defaultProps","accumulator","source","resourceId","backgroundColor","backgroundHexColor","setIsLoading","dateRange","scheduler","Scheduler","getDispatchActions","setCalendars","schedulerReducer","schedulerSagas","SchedulerContainer","SchedulerApp","react","dispatch","allDay","SET_DATE_RANGE","updateRequestedCalendars","setDateRange","removeRequestedCalendar","resourceScheduler","PanelHeaderContent","aria-hidden","position","design","SearchPanel","requestedCalendars","calendarTypes","Panel","formBase","showSearchForm","selectable","onSelectChange","simpleSearchFields","disableSelectionController","showActions","scrollBehaviour","getSearchLists","memo","resizerStyle","background","width","cursor","StyledSplitPanelWrapperLeft","StyledSplitPanelWrapperRight","StyledSplitPane","SplitPane","SchedulerAppContainer","defaultSize","minSize","ResourceScheduler","typesToRemove","adjustedValue","transformRequestedCalendars","_reduce","calendarTypeId","loadCalendarTypes","retrieveCalendars","resourceSchedulerSelector","getTime","calendarsResponse","resourceSchedulerReducer","resourceSchedulerSagas","ResourceSchedulerContainer","dispatchActions","ResourceSchedulerApp","selectionPropType","match","history","entityBaseUrl","goBack","url","createHref","window","open","search","encodeURIComponent","appendField","fieldName","outputPrefix","output","fieldData","StyledContainer","StyledContent","fetchData","string","lastname","firstname","address","buildUserMecardString","QRCode","setData","qrCode","UserQrCode","userKey","query","bean","consoleLogger","qrCodeReducer","qrCodeSagas","UserQrActionApp","setWidgetConfig","widgetConfig","generateWidgetCode","domain","getBaseUrl","StyledWidgetCode","StyledCode","fetchWidgetConfig","copyWidgetCode","required","widgetCode","WidgetCodeCopy","widgetCodeSelector","widgetConfigKey","widgetCodeReducer","widgetCodeSagas","WidgetCodeCopyApp"],"mappings":"8dAKA,IAAMA,EAAYC,oBAAH,0BAAGA,CAAH,K,EAeX,kBAACD,EAAD,KACE,kBAAC,IAAD,CAAgBE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oBL,WAAkB,CAACL,WAASU,QAAOC,eAAatC,eAAgB0B,KAA7Ea,WAITqrB,GAAkBprB,UAAY,CAC5BrD,UAAWsD,uBAGb","file":"chunk-actions.122f368790631a506e84.js","sourcesContent":["import PropTypes from 'prop-types'\nimport React, {useEffect} from 'react'\nimport styled from 'styled-components'\nimport {LoadingSpinner} from 'tocco-ui'\n\nconst StyledDiv = styled.div`\n text-align: center;\n display: block;\n margin-left: auto;\n margin-right: auto;\n width: 100%;\n height: 40px;\n`\n\nconst CopyProgress = ({startCopy}) => {\n useEffect(() => {\n startCopy()\n }, [])\n\n return (\n <StyledDiv>\n <LoadingSpinner size=\"30px\" />\n </StyledDiv>\n )\n}\n\nCopyProgress.propTypes = {\n startCopy: PropTypes.func.isRequired\n}\n\nexport default CopyProgress\n","import {connect} from 'react-redux'\n\nimport {startCopy} from '../../modules/copy/actions'\nimport CopyProgress from './CopyProgress'\n\nconst mapActionCreators = {\n startCopy\n}\n\nexport default connect(null, mapActionCreators)(CopyProgress)\n","export const START_COPY = 'copy/START_COPY'\n\nexport const startCopy = () => ({\n type: START_COPY\n})\n","import CopyProgressContainer from './CopyProgressContainer'\n\nexport default CopyProgressContainer\n","import {all, call, put, select, takeLatest} from 'redux-saga/effects'\nimport {rest, form, externalEvents, selection as selectionUtil} from 'tocco-app-extensions'\n\nimport * as actions from './actions'\n\nexport const inputSelector = state => state.input\n\nexport default function* sagas() {\n yield all([takeLatest(actions.START_COPY, copy)])\n}\n\nexport function* copy() {\n const {\n selection,\n navigationStrategy,\n context: {formName}\n } = yield select(inputSelector)\n const entities = yield call(selectionUtil.getEntities, selection, rest.fetchEntities)\n\n if (entities.keys.length === 1) {\n const values = yield call(getValues, entities.entityName, entities.keys[0], formName)\n yield put(externalEvents.fireExternalEvent('onCancel'))\n yield call(navigationStrategy.navigateToCreateRelative, null, {defaultValues: values})\n } else {\n throw new Error('Invalid selection')\n }\n}\n\nexport function* getValues(entityName, entityKey, formName) {\n const paths = yield call(getPaths, formName)\n const sourceEntity = yield call(rest.fetchEntity, entityName, entityKey, {paths})\n\n return Object.entries(sourceEntity.paths)\n .map(([id, valueObject]) => {\n const value = valueObject.value\n if (value === null || value === '' || (Array.isArray(value) && value.length === 0)) {\n return null\n }\n\n const valueTransformed = Array.isArray(value)\n ? value.map(v => v.key)\n : typeof value === 'object'\n ? value.key\n : value\n\n return {id, value: valueTransformed}\n })\n .filter(d => !!d)\n}\n\nexport function* getPaths(formName) {\n const formDefinition = yield call(rest.fetchForm, formName, 'create')\n const fields = yield call(form.getFieldDefinitions, formDefinition)\n return fields.filter(f => f.ignoreCopy !== true && f.path).map(e => e.path)\n}\n","import {sagas as copySagas} from './copy'\n\nexport default {}\nexport const sagas = [copySagas]\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport {appFactory, externalEvents, selection} from 'tocco-app-extensions'\nimport {reducer as reducerUtil, navigationStrategy} from 'tocco-util'\n\nimport CopyProgress from './components/CopyProgress'\nimport reducers, {sagas} from './modules/reducers'\n\nconst packageName = 'copy'\n\nconst EXTERNAL_EVENTS = ['emitAction', 'onSuccess', 'onCancel', 'onError']\n\nconst initApp = (id, input, events, publicPath) => {\n const content = <CopyProgress />\n\n const store = appFactory.createStore(reducers, sagas, input, packageName)\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 CopyApp = props => {\n const {component} = appFactory.useApp({initApp, props, packageName, externalEvents: EXTERNAL_EVENTS})\n return component\n}\n\nCopyApp.propTypes = {\n selection: selection.propType.isRequired,\n navigationStrategy: navigationStrategy.propTypes.isRequired,\n context: PropTypes.shape({\n formName: PropTypes.string\n }),\n ...EXTERNAL_EVENTS.reduce((propTypes, event) => {\n propTypes[event] = PropTypes.func\n return propTypes\n }, {})\n}\n\nexport default CopyApp\n","import React from 'react'\nimport {Redirect} from 'react-router-dom'\n\nconst Documents = () => <Redirect to={{pathname: '/docs'}} />\n\nexport default Documents\n","export const SET_SELECTION = 'inputEdit/SET_SELECTION'\nexport const UPDATE_SELECTION = 'inputEdit/UPDATE_SELECTION'\nexport const SET_HANDLE_NOTIFICATIONS = 'inputEdit/SET_HANDLE_NOTIFICATIONS'\nexport const SET_UPDATE_IN_PROGRESS = 'inputEdit/SET_UPDATE_IN_PROGRESS'\n\nexport const setSelection = selection => ({\n type: SET_SELECTION,\n payload: {selection}\n})\n\nexport const updateSelection = () => ({\n type: UPDATE_SELECTION,\n payload: {}\n})\n\nexport const setHandleNotifications = handleNotifications => ({\n type: SET_HANDLE_NOTIFICATIONS,\n payload: {\n handleNotifications\n }\n})\n\nexport const setSelectionUpdateInProgress = updateInProgress => ({\n type: SET_UPDATE_IN_PROGRESS,\n payload: {\n updateInProgress\n }\n})\n","export const INITIALIZE_SEARCH = 'inputEditSearch/INITIALIZE_SEARCH'\nexport const SET_FORM = 'inputEditSearch/SET_FORM'\nexport const SET_SEARCH_QUERIES = 'inputEditSearch/SET_SEARCH_QUERIES'\nexport const SET_INITIALIZED = 'inputEditSearch/SET_INITIALIZED'\n\nexport const initializeSearch = () => ({\n type: INITIALIZE_SEARCH\n})\n\nexport const setForm = form => ({\n type: SET_FORM,\n payload: {form}\n})\n\nexport const setSearchQueries = searchQueries => ({\n type: SET_SEARCH_QUERIES,\n payload: {searchQueries}\n})\n\nexport const setInitialized = initialized => ({\n type: SET_INITIALIZED,\n payload: {\n initialized\n }\n})\n","export const INITIALIZE_TABLE = 'inputEditTable/INITIALIZE_TABLE'\nexport const LOAD_DATA = 'inputEditTable/LOAD_DATA'\nexport const SET_DATA = 'inputEditTable/SET_DATA'\nexport const SET_EDIT_FORM = 'inputEditTable/SET_EDIT_FORM'\nexport const UPDATE_VALUE = 'inputEditTable/UPDATE_VALUE'\nexport const SET_VALUE = 'inputEditTable/SET_VALUE'\nexport const SET_SORTING = 'inputEditTable/SET_SORTING'\nexport const SET_DATA_FORM_COLUMNS = 'inputEditTable/SET_DATA_FORM_COLUMNS'\nexport const SET_ACTION_DEFINITIONS = 'inputEditTable/SET_ACTION_DEFINITIONS'\nexport const SET_DATA_LOADING_IN_PROGRESS = 'inputEditTable/SET_DATA_LOADING_IN_PROGRESS'\n\nexport const initializeTable = () => ({\n type: INITIALIZE_TABLE\n})\n\nexport const loadData = () => ({\n type: LOAD_DATA\n})\n\nexport const setData = data => ({\n type: SET_DATA,\n payload: {data}\n})\n\nexport const setEditForm = form => ({\n type: SET_EDIT_FORM,\n payload: form\n})\n\nexport const updateValue = (inputDataKey, node, value) => ({\n type: UPDATE_VALUE,\n payload: {\n inputDataKey,\n node,\n value\n }\n})\n\nexport const setValue = (inputDataKey, node, value) => ({\n type: SET_VALUE,\n payload: {\n inputDataKey,\n node,\n value\n }\n})\n\nexport const setSorting = (field, add) => ({\n type: SET_SORTING,\n payload: {\n field,\n add\n }\n})\n\nexport const setDataFormColumns = dataFormColumns => ({\n type: SET_DATA_FORM_COLUMNS,\n payload: {\n dataFormColumns\n }\n})\n\nexport const setActionDefinitions = actionDefinitions => ({\n type: SET_ACTION_DEFINITIONS,\n payload: {\n actionDefinitions\n }\n})\n\nexport const setDataLoadingInProgress = dataLoadingInProgress => ({\n type: SET_DATA_LOADING_IN_PROGRESS,\n payload: {\n dataLoadingInProgress\n }\n})\n","import styled from 'styled-components'\n\nexport const StyledInputEditInformation = styled.div``\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport styled from 'styled-components'\nimport {field} from 'tocco-app-extensions'\nimport {StatedValue} from 'tocco-ui'\n\nimport {StyledInputEditInformation} from './StyledInputEditInformation'\n\nconst StyledStatedValueWrapper = styled.div`\n & > div > div > span {\n display: inline-block;\n margin-top: 5px;\n padding-bottom: 3px;\n }\n`\n\nconst InputEditInformation = ({information}) => (\n <StyledInputEditInformation>\n {information.map(info => {\n const Field = field.factory('readOnly', info.type)\n return (\n <StyledStatedValueWrapper key={info.id}>\n <StatedValue key={info.id} label={info.label} immutable={true} hasValue={true}>\n <Field\n formField={{\n dataType: info.type\n }}\n value={info.value}\n />\n </StatedValue>\n </StyledStatedValueWrapper>\n )\n })}\n </StyledInputEditInformation>\n)\n\nInputEditInformation.propTypes = {\n information: PropTypes.array.isRequired\n}\n\nexport default InputEditInformation\n","import {connect} from 'react-redux'\n\nimport InputEditInformation from './InputEditInformation'\n\nconst mapStateToProps = state => ({\n information: state.inputEditInformation.information\n})\n\nexport default connect(mapStateToProps)(InputEditInformation)\n","import _debounce from 'lodash/debounce'\nimport PropTypes from 'prop-types'\nimport React from 'react'\nimport SimpleFormApp from 'tocco-simple-form/src/main'\nimport {tqlBuilder} from 'tocco-util'\n\nconst InputEditSearch = ({form, setSearchFields}) => {\n return form.children ? (\n <SimpleFormApp\n form={form}\n onChange={_debounce(handleChange(form, setSearchFields), 500)}\n noButtons={true}\n validate={false}\n mappingType=\"search\"\n mode=\"search\"\n />\n ) : null\n}\n\nconst handleChange =\n (form, setSearchFields) =>\n ({values}) => {\n if (Object.keys(values).length > 0) {\n const tql = transformFormValuesToTql(values, form)\n setSearchFields(tql)\n } else {\n setSearchFields([])\n }\n }\n\nconst transformFormValuesToTql = (values, form) =>\n Object.entries(values)\n .map(([path, value]) => ({\n path,\n fieldType: getFieldType(path, form),\n value\n }))\n .filter(({path, fieldType, value}) => value && (!Array.isArray(value) || value.length > 0))\n .map(({path, fieldType, value}) => tqlBuilder.getTql(path, value, fieldType))\n .filter(tql => tql.length > 0)\n\nconst getFieldType = (path, form) => {\n const container = form.children.find(child => child.children.length > 0)\n if (container) {\n const field = container.children.find(child => child.id === path)\n\n return field.children.length > 0 ? field.children[0].dataType : field.dataType\n }\n}\n\nInputEditSearch.propTypes = {\n form: PropTypes.object.isRequired,\n setSearchFields: PropTypes.func.isRequired\n}\n\nexport default InputEditSearch\n","import {connect} from 'react-redux'\n\nimport {setSearchQueries} from '../../modules/inputEditSearch/actions'\nimport InputEditSearch from './InputEditSearch'\n\nconst mapActionCreators = {\n setSearchFields: setSearchQueries\n}\n\nconst mapStateToProps = state => ({\n form: state.inputEditSearch.form\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(InputEditSearch)\n","export const SET_CURRENT_PAGE = 'inputEditPagination/SET_CURRENT_PAGE'\nexport const SET_TOTAL_COUNT = 'inputEditPagination/SET_TOTAL_COUNT'\n\nexport const setCurrentPage = currentPage => ({\n type: SET_CURRENT_PAGE,\n payload: {currentPage}\n})\n\nexport const setTotalCount = totalCount => ({\n type: SET_TOTAL_COUNT,\n payload: {\n totalCount\n }\n})\n","export const arrowKeyHandler = event => {\n if (\n ['INPUT', 'TEXTAREA'].includes(document.activeElement.tagName) &&\n ['ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowUp'].includes(event.key)\n ) {\n event.preventDefault()\n const [rowIndex, columnIndex] = document.activeElement.id.split(':')\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n const currentIndex = Number.parseInt(rowIndex)\n const indexDiff = event.key === 'ArrowUp' ? -1 : 1\n const idToFocus = `${currentIndex + indexDiff}:${columnIndex}`\n const elementToFocus = document.getElementById(idToFocus)\n focusElement(elementToFocus)\n } else if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {\n const currentIndex = Number.parseInt(columnIndex)\n const indexDiff = event.key === 'ArrowLeft' ? -1 : 1\n const elementToFocus = findHorizontalElementToFocus(rowIndex, currentIndex, indexDiff)\n focusElement(elementToFocus)\n }\n }\n}\n\n/**\n * there might be readonly fields mixed in, so we need to check the rest of the fields\n * @param rowIndex which row to navigate in\n * @param currentIndex last checked cell index\n * @param indexDiff which direction to move in\n * @returns {HTMLElement}\n */\nconst findHorizontalElementToFocus = (rowIndex, currentIndex, indexDiff) => {\n const adjustedIndex = currentIndex + indexDiff\n const idToFocus = `${rowIndex}:${adjustedIndex}`\n const elementToFocus = document.getElementById(idToFocus)\n if (elementToFocus) {\n if (['INPUT', 'TEXTAREA'].includes(elementToFocus.tagName) && !elementToFocus.disabled) {\n return elementToFocus\n } else {\n return findHorizontalElementToFocus(rowIndex, adjustedIndex, indexDiff)\n }\n } else {\n return elementToFocus\n }\n}\n\nconst focusElement = elementToFocus => {\n if (elementToFocus) {\n // Reacts NumberFormat is clingy and steals focus when using left and right arrow keys, so we steal it back\n setTimeout(() => {\n elementToFocus.focus()\n }, 0)\n }\n}\n","import _get from 'lodash/get'\nimport {lighten} from 'polished'\nimport styled from 'styled-components'\nimport {scale, shadeColor, theme, declareFont, declareFocus} from 'tocco-ui'\n\nconst borderColor = ({theme}) => shadeColor(_get(theme, 'colors.paper'), 3)\nconst baseSpace = scale.space(-1)\n\nexport const StyledTable = styled.table`\n background-color: ${theme.color('paper')};\n border-collapse: collapse;\n border-spacing: 0;\n width: 100%;\n margin-top: ${baseSpace};\n margin-bottom: ${baseSpace};\n table-layout: fixed;\n min-width: 900px;\n`\n\nexport const StyledTableWrapper = styled.div`\n width: 100%;\n height: 100%;\n overflow: auto;\n`\n\nexport const StyledCell = styled.div`\n display: flex;\n align-items: center;\n width: 100%;\n\n && {\n input,\n textarea,\n &.single-select > span > div {\n border: 1px solid ${borderColor};\n padding-left: ${baseSpace};\n\n &:not([disabled]):hover {\n cursor: pointer;\n }\n ${declareFocus}\n }\n\n &.single-select > span {\n display: inline-block;\n width: 100%;\n margin-left: 5px;\n margin-bottom: 5px;\n background-color: ${theme.color('paper')};\n }\n\n &.single-select button {\n margin-bottom: 2px;\n margin-right: 2px;\n }\n }\n`\n\nexport const StyledTableRow = styled.tr`\n &:hover {\n ${StyledCell} {\n background-color: ${({theme}) => lighten(0.25, theme.colors.secondaryLight)};\n }\n }\n`\n\nexport const StyledHeader = styled.th`\n padding: ${baseSpace};\n background-color: ${theme.color('paper')};\n text-align: left;\n border-bottom: 2px solid ${borderColor};\n ${declareFont({fontWeight: theme.fontWeight('bold')})};\n user-select: none;\n text-overflow: ellipsis;\n\n &:hover {\n background-color: ${({theme}) => lighten(0.25, theme.colors.secondaryLight)};\n }\n`\n","import PropTypes from 'prop-types'\nimport React, {useEffect, useState} from 'react'\nimport {field} from 'tocco-app-extensions'\nimport {Table, EditableValue, FormattedValue} from 'tocco-ui'\nimport {api} from 'tocco-util'\n\nimport {arrowKeyHandler} from './keyHandler'\nimport {StyledCell, StyledTableWrapper} from './StyledComponents'\n\nconst dataCellRenderer = (fieldDefinition, data) => {\n const {path, dataType} = fieldDefinition\n const Field = field.factory('list', dataType)\n const value = data[path]\n\n return (\n <StyledCell key={path}>\n <Field type={dataType} formField={fieldDefinition} value={value} breakWords={false} />\n </StyledCell>\n )\n}\n\nconst keyBuilder = (row, column) => `${row}:${column}`\n\nconst inputCellRenderer = (fieldDefinition, data, updateValue, rowIdx) => {\n const {readonly, id, dataType, options} = fieldDefinition.definition\n\n const pk = data.pk\n const value = data[id]\n\n if (readonly) {\n return (\n <StyledCell key={id}>\n <FormattedValue id={id} type={dataType} value={value} options={options} />\n </StyledCell>\n )\n } else {\n return (\n <StyledCell key={id}>\n <EditableValue\n id={keyBuilder(rowIdx, fieldDefinition.idx)}\n type={dataType}\n value={value}\n options={options}\n events={{\n onChange: changedValue => {\n updateValue(pk, id, changedValue)\n },\n onFocus: ({target}) => target.select()\n }}\n />\n </StyledCell>\n )\n }\n}\n\nconst InputEditTable = ({\n data,\n dataFormColumns,\n inputEditForm,\n updateValue,\n sorting,\n setSorting,\n dataLoadingInProgress,\n totalCount,\n currentPage,\n recordsPerPage,\n setCurrentPage\n}) => {\n const [columns, setColumns] = useState([])\n const [columnPosition, setColumnPosition] = useState([])\n\n useEffect(() => {\n const dataColumns = api.getColumnDefinition(dataFormColumns, sorting, dataCellRenderer)\n\n const inputColumns = inputEditForm.map((c, idx) => ({\n idx: idx,\n id: c.id,\n label: c.label,\n sorting: {\n sortable: false\n },\n definition: c,\n resizable: true,\n dynamic: true,\n CellRenderer: ({rowData, column, rowIdx}) => inputCellRenderer(column, rowData, updateValue, rowIdx)\n }))\n\n const cc = [...dataColumns, ...inputColumns].sort(\n (a, b) => columnPosition.findIndex(e => e === a.id) - columnPosition.findIndex(e => e === b.id)\n )\n setColumns(cc)\n }, [columnPosition, dataFormColumns, inputEditForm, sorting])\n\n const onColumnPositionChange = (dragColumn, dropColumn) => {\n setColumnPosition(\n columns.reduce((acc, c) => {\n return [...acc, ...(c.id === dropColumn ? [c.id, dragColumn] : []), ...(c.id === dragColumn ? [] : [c.id])]\n }, [])\n )\n }\n\n if (columns.length === 0) {\n return null\n }\n\n return (\n <StyledTableWrapper onKeyDown={arrowKeyHandler}>\n <Table\n dataLoadingInProgress={dataLoadingInProgress}\n columns={columns}\n data={data}\n onSortingChange={setSorting}\n onColumnPositionChange={onColumnPositionChange}\n paginationInfo={{\n currentPage,\n recordsPerPage,\n totalCount\n }}\n onPageChange={setCurrentPage}\n />\n </StyledTableWrapper>\n )\n}\n\nInputEditTable.propTypes = {\n data: PropTypes.array.isRequired,\n dataFormColumns: PropTypes.arrayOf(PropTypes.shape({id: PropTypes.string})),\n sorting: PropTypes.arrayOf(\n PropTypes.shape({\n field: PropTypes.string,\n order: PropTypes.string\n })\n ),\n inputEditForm: PropTypes.array.isRequired,\n updateValue: PropTypes.func.isRequired,\n setSorting: PropTypes.func.isRequired,\n dataLoadingInProgress: PropTypes.bool,\n totalCount: PropTypes.number,\n currentPage: PropTypes.number.isRequired,\n recordsPerPage: PropTypes.number.isRequired,\n setCurrentPage: PropTypes.func.isRequired\n}\n\nexport default InputEditTable\n","import {connect} from 'react-redux'\n\nimport {setCurrentPage} from '../../modules/inputEditPagination/actions'\nimport {updateValue, setSorting} from '../../modules/inputEditTable/actions'\nimport InputEditTable from './InputEditTable'\n\nconst mapActionCreators = {\n updateValue,\n setSorting,\n setCurrentPage\n}\n\nconst mapStateToProps = state => {\n return {\n data: state.inputEditTable.data,\n dataFormColumns: state.inputEditTable.dataFormColumns,\n inputEditForm: state.inputEditTable.inputEditForm,\n sorting: state.inputEditTable.sorting,\n dataLoadingInProgress: state.inputEditTable.dataLoadingInProgress,\n totalCount: state.inputEditPagination.totalCount,\n currentPage: state.inputEditPagination.currentPage,\n recordsPerPage: state.inputEditPagination.recordsPerPage\n }\n}\n\nexport default connect(mapStateToProps, mapActionCreators)(InputEditTable)\n","import styled, {css} from 'styled-components'\nimport {Button, scale, StyledScrollbar, theme} from 'tocco-ui'\n\nexport const StyledPaneWrapper = styled.div`\n display: flex;\n height: 100%;\n`\n\nconst sharedSplitPaneStyles = css`\n background-color: ${theme.color('paper')};\n padding-top: ${scale.space(-0.53)};\n ${StyledScrollbar}\n`\n\nexport const StyledPanelWrapperLeft = styled.div`\n && {\n display: ${({isCollapsed}) => (isCollapsed ? 'none' : 'block')};\n min-width: 265px;\n width: 16%;\n margin-right: 1rem;\n ${sharedSplitPaneStyles}\n }\n`\n\nexport const StyledPanelWrapperRight = styled.div`\n && {\n width: 100%;\n display: flex;\n flex-direction: column;\n ${sharedSplitPaneStyles}\n }\n`\n\nexport const StyledInputEditSearchWrapper = styled.div`\n margin-bottom: ${scale.space(0)};\n`\n\nexport const StyledLeftPane = styled.div`\n padding: 0 ${scale.space(-1)};\n`\n\nexport const StyledActionsWrapper = styled.div`\n border-bottom: 3px solid ${theme.color('backgroundBody')};\n padding: 0 8px 8px;\n`\n\nexport const StyledToggleCollapse = styled.div`\n display: flex;\n background-color: ${theme.color('paper')};\n padding: 0 ${scale.space(-0.53)} ${scale.space(-0.53)} ${scale.space(-1.7)};\n`\n\nexport const StyledPlaceHolder = styled.div`\n display: ${({isCollapsed}) => (isCollapsed ? 'flex' : 'none')};\n flex: 1;\n height: 100%;\n width: 25px;\n margin-right: ${scale.space(-0.375)};\n background: ${theme.color('paper')};\n padding-top: ${scale.space(-0.53)};\n align-items: flex-start;\n\n &:hover {\n cursor: pointer;\n }\n\n ${StyledToggleCollapse} {\n padding: 0 0 ${scale.space(-0.53)} ${scale.space(-1.7)};\n }\n`\n\nexport const StyledToggleCollapseButton = styled(Button)`\n font-size: ${scale.font(0)};\n padding: 0;\n\n &:hover,\n &:focus,\n ${/* sc-selector */ StyledPlaceHolder}:hover & {\n background-color: transparent;\n color: ${theme.color('secondaryLight')};\n }\n`\n","import PropTypes from 'prop-types'\nimport React, {useEffect, useState} from 'react'\nimport {actions, notification, selection as selectionPropType} from 'tocco-app-extensions'\nimport {GlobalStyles} from 'tocco-ui'\n\nimport InputEditInformation from '../InputEditInformation'\nimport InputEditSearch from '../InputEditSearch'\nimport InputEditTable from '../InputEditTable/InputEditTableContainer'\nimport {\n StyledPanelWrapperLeft,\n StyledPanelWrapperRight,\n StyledLeftPane,\n StyledActionsWrapper,\n StyledInputEditSearchWrapper,\n StyledPaneWrapper,\n StyledToggleCollapse,\n StyledToggleCollapseButton,\n StyledPlaceHolder\n} from './StyledInputEdit'\n\nconst InputEdit = ({\n selection,\n handleNotifications,\n updateSelection,\n initializeTable,\n initializeSearch,\n initializeInformation,\n actionDefinitions\n}) => {\n useEffect(() => {\n updateSelection()\n }, [selection])\n useEffect(() => {\n initializeTable()\n initializeSearch()\n initializeInformation()\n }, [selection])\n\n const [isCollapsed, setIsCollapsed] = useState(false)\n const toggleCollapse = () => {\n setIsCollapsed(!isCollapsed)\n }\n\n const Actions = actionDefinitions.map(definition => (\n <actions.Action key={definition.id} definition={definition} selection={selection} />\n ))\n\n return (\n <>\n <GlobalStyles />\n {handleNotifications && <notification.Notifications />}\n <StyledPaneWrapper>\n <StyledPlaceHolder onClick={toggleCollapse} isCollapsed={isCollapsed}>\n <StyledToggleCollapse isCollapsed={isCollapsed}>\n <StyledToggleCollapseButton icon=\"chevron-right\" isCollapsed={isCollapsed} />\n </StyledToggleCollapse>\n </StyledPlaceHolder>\n <StyledPanelWrapperLeft isCollapsed={isCollapsed}>\n <StyledToggleCollapse>\n <StyledToggleCollapseButton icon=\"chevron-left\" onClick={toggleCollapse} />\n </StyledToggleCollapse>\n <StyledLeftPane>\n <StyledInputEditSearchWrapper>\n <InputEditSearch />\n </StyledInputEditSearchWrapper>\n <InputEditInformation />\n </StyledLeftPane>\n </StyledPanelWrapperLeft>\n <StyledPanelWrapperRight>\n <StyledActionsWrapper>{Actions}</StyledActionsWrapper>\n <InputEditTable />\n </StyledPanelWrapperRight>\n </StyledPaneWrapper>\n </>\n )\n}\n\nInputEdit.propTypes = {\n selection: selectionPropType.propType.isRequired,\n handleNotifications: PropTypes.bool,\n updateSelection: PropTypes.func.isRequired,\n initializeTable: PropTypes.func.isRequired,\n initializeSearch: PropTypes.func.isRequired,\n initializeInformation: PropTypes.func.isRequired,\n actionDefinitions: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.string.isRequired\n })\n ),\n notify: PropTypes.func.isRequired\n}\n\nexport default InputEdit\n","import {connect} from 'react-redux'\nimport {notification} from 'tocco-app-extensions'\n\nimport {updateSelection} from '../../modules/inputEdit/actions'\nimport {initializeInformation} from '../../modules/inputEditInformation/actions'\nimport {initializeSearch} from '../../modules/inputEditSearch/actions'\nimport {initializeTable} from '../../modules/inputEditTable/actions'\nimport InputEdit from './InputEdit'\n\nconst mapActionCreators = {\n updateSelection,\n initializeTable,\n initializeSearch,\n initializeInformation,\n notify: notification.toaster\n}\n\nconst mapStateToProps = state => ({\n selection: state.inputEdit.selection,\n actionDefinitions: state.inputEditTable.actionDefinitions,\n handleNotifications: state.inputEdit.handleNotifications\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(InputEdit)\n","export const INITIALIZE_INFORMATION = 'inputEditInformation/INITIALIZE_INFORMATION'\nexport const SET_INFORMATION = 'inputEditInformation/SET_INFORMATION'\n\nexport const initializeInformation = () => ({\n type: INITIALIZE_INFORMATION\n})\n\nexport const setInformation = information => ({\n type: SET_INFORMATION,\n payload: {information}\n})\n","import {reducer as reducerUtil} from 'tocco-util'\n\nimport {SET_SELECTION, SET_HANDLE_NOTIFICATIONS, SET_UPDATE_IN_PROGRESS} from './actions'\n\nconst initialState = {\n selection: null,\n handleNotifications: false,\n updateInProgress: false\n}\n\nconst ACTION_HANDLERS = {\n [SET_SELECTION]: reducerUtil.singleTransferReducer('selection'),\n [SET_HANDLE_NOTIFICATIONS]: reducerUtil.singleTransferReducer('handleNotifications'),\n [SET_UPDATE_IN_PROGRESS]: reducerUtil.singleTransferReducer('updateInProgress')\n}\n\nexport default function reducer(state = initialState, action) {\n const handler = ACTION_HANDLERS[action.type]\n return handler ? handler(state, action) : state\n}\n","import reducer from './reducer'\nimport sagas from './sagas'\n\nexport {sagas}\nexport default reducer\n","import {all, call, put, select, takeEvery, takeLatest} from 'redux-saga/effects'\nimport {actionEmitter, actions, rest} from 'tocco-app-extensions'\n\nimport * as inputEditTableActions from '../inputEditTable/actions'\nimport * as inputEditAction from './actions'\nimport {UPDATE_SELECTION} from './actions'\n\nconst inputEditSelector = state => state.inputEdit\n\nexport default function* sagas() {\n yield all([\n takeEvery(actions.actions.ACTION_INVOKE, emit),\n takeLatest(UPDATE_SELECTION, updateInputDatas),\n takeLatest(actions.actions.ACTION_INVOKED, reload)\n ])\n}\n\nexport function* emit(action) {\n yield put(actionEmitter.emitAction(action))\n}\n\nexport function* reload() {\n yield put(inputEditTableActions.initializeTable())\n}\n\nexport function* updateInputDatas() {\n yield put(inputEditAction.setSelectionUpdateInProgress(true))\n const {selection} = yield select(inputEditSelector)\n yield call(rest.requestSaga, 'inputEdit/update-input-datas', {method: 'POST', body: selection})\n yield put(inputEditAction.setSelectionUpdateInProgress(false))\n}\n","import {reducer as reducerUtil} from 'tocco-util'\n\nimport * as actions from './actions'\n\nconst initialState = {\n information: []\n}\n\nconst ACTION_HANDLERS = {\n [actions.SET_INFORMATION]: reducerUtil.singleTransferReducer('information')\n}\n\nexport default function reducer(state = initialState, action) {\n const handler = ACTION_HANDLERS[action.type]\n return handler ? handler(state, action) : state\n}\n","import reducer from './reducer'\nimport sagas from './sagas'\n\nexport {sagas}\nexport default reducer\n","import {all, takeLatest, call, put, select} from 'redux-saga/effects'\nimport {rest} from 'tocco-app-extensions'\n\nimport * as actions from '../inputEditInformation/actions'\n\nconst inputEditSelector = state => state.inputEdit\n\nexport default function* sagas() {\n yield all([takeLatest(actions.INITIALIZE_INFORMATION, initialize)])\n}\n\nexport function* initialize() {\n const {selection} = yield select(inputEditSelector)\n const {body} = yield call(rest.requestSaga, 'inputEdit/information', {method: 'POST', body: selection})\n yield put(actions.setInformation(body))\n}\n","import {reducer as reducerUtil} from 'tocco-util'\n\nimport {SET_CURRENT_PAGE, SET_TOTAL_COUNT} from './actions'\n\nconst initialState = {\n totalCount: 0,\n currentPage: 1,\n recordsPerPage: 25\n}\n\nconst ACTION_HANDLERS = {\n [SET_TOTAL_COUNT]: reducerUtil.singleTransferReducer('totalCount'),\n [SET_CURRENT_PAGE]: reducerUtil.singleTransferReducer('currentPage')\n}\n\nexport default function reducer(state = initialState, action) {\n const handler = ACTION_HANDLERS[action.type]\n return handler ? handler(state, action) : state\n}\n","import reducer from './reducer'\nimport sagas from './sagas'\n\nexport {sagas}\nexport default reducer\n","import {api} from 'tocco-util'\n\nexport const transformResponseData = response =>\n response.body.data\n .map(dataRecord => {\n const splitObj = Object.keys(dataRecord).reduce(\n (acc, key) => {\n const isInputField = !isNaN(parseInt(key)) || key === 'rating' // textchoice has no exams but is an input\n return {\n ...acc,\n ...(isInputField\n ? {\n inputFields: {\n ...acc.inputFields,\n [key]: dataRecord[key]\n }\n }\n : {\n entityFields: {\n ...acc.entityFields,\n [key]: dataRecord[key]\n }\n })\n }\n },\n {\n inputFields: {},\n entityFields: {}\n }\n )\n\n return {...splitObj.inputFields, ...api.flattenPaths(splitObj.entityFields)}\n })\n .map(dataRecord => ({...dataRecord, __key: dataRecord.pk}))\n","import {all, call, put, select, take, takeEvery, takeLatest} from 'redux-saga/effects'\nimport {notification, rest} from 'tocco-app-extensions'\n\nimport * as inputEditActions from '../inputEdit/actions'\nimport {setTotalCount} from '../inputEditPagination/actions'\nimport * as searchFormActions from '../inputEditSearch/actions'\nimport * as actions from './actions'\nimport {transformResponseData} from './utils'\n\nexport const inputSelector = state => state.input\nexport const inputEditSelector = state => state.inputEdit\nexport const inputEditTableSelector = state => state.inputEditTable\nexport const inputEditSearchSelector = state => state.inputEditSearch\nexport const searchQueriesSelector = state => state.inputEditSearch.searchQueries\nexport const inputEditPaginationSelector = state => state.inputEditPagination\n\nexport default function* sagas() {\n yield all([\n takeLatest(actions.INITIALIZE_TABLE, initialize),\n takeLatest(actions.LOAD_DATA, loadData),\n takeEvery(actions.UPDATE_VALUE, updateValue),\n takeLatest(actions.SET_SORTING, loadData)\n ])\n}\n\nexport function* processDataForm(dataForm, readonly, readonlyActions = []) {\n const actionDefinitions = dataForm.children\n .find(child => child.id === 'main-action-bar')\n .children.filter(child => child.componentType === 'action')\n .filter(child => !readonly || readonlyActions.includes(child.id))\n .map(child => ({\n ...child,\n scope: 'detail'\n }))\n\n yield put(actions.setActionDefinitions(actionDefinitions))\n\n const dataFormColumns = dataForm.children.find(child => child.componentType === 'table').children\n\n yield put(actions.setDataFormColumns(dataFormColumns))\n}\n\nexport function* initialize() {\n yield put(actions.setDataLoadingInProgress(true))\n const {selection} = yield select(inputEditSelector)\n const {actionProperties} = yield select(inputSelector)\n const inputEditDataForm =\n actionProperties && actionProperties.inputEditDataForm ? actionProperties.inputEditDataForm : 'Input_edit_data'\n const [editFormDefinition, dataForm] = yield all([\n call(rest.requestSaga, 'inputEdit/form', {method: 'POST', body: selection}),\n call(rest.fetchForm, inputEditDataForm, 'list')\n ])\n const {editColumns, readonly, readonlyActions} = editFormDefinition.body\n if (readonly) {\n editColumns.forEach(c => (c.readonly = true))\n yield put(\n notification.toaster({\n type: 'info',\n title: 'client.actions.InputEdit.input_closed'\n })\n )\n }\n yield put(actions.setEditForm({inputEditForm: editColumns}))\n yield call(processDataForm, dataForm, readonly, readonlyActions)\n\n const {initialized: searchFormInitialized} = yield select(inputEditSearchSelector)\n if (!searchFormInitialized) {\n yield take(searchFormActions.SET_INITIALIZED)\n }\n const {updateInProgress} = yield select(inputEditSelector)\n if (updateInProgress) {\n yield take(({payload, type}) => type === inputEditActions.SET_UPDATE_IN_PROGRESS && !payload.updateInProgress)\n }\n yield call(loadData, {})\n}\n\nexport function* loadData({newSorting, newSearchQueries, newPage}) {\n yield put(actions.setDataLoadingInProgress(true))\n const {selection} = yield select(inputEditSelector)\n const sorting = newSorting || (yield select(inputEditTableSelector)).sorting\n const searchQueries = newSearchQueries || (yield select(searchQueriesSelector))\n const currentPage = newPage || (yield select(inputEditPaginationSelector)).currentPage\n const {recordsPerPage} = yield select(inputEditPaginationSelector)\n const dataFormColumns = (yield select(inputEditTableSelector)).dataFormColumns\n const paths = getPathsFromTable(dataFormColumns)\n const searchBean = rest.buildRequestQuery({\n limit: recordsPerPage,\n sorting,\n page: currentPage,\n where: searchQueries.join(' and '),\n paths: paths\n })\n const response = yield call(rest.requestSaga, 'inputEdit/data/search', {\n method: 'POST',\n body: {\n selection,\n searchBean\n }\n })\n\n const transformedData = yield call(transformResponseData, response)\n yield put(actions.setData(transformedData))\n yield put(setTotalCount(response.body.count))\n yield put(actions.setDataLoadingInProgress(false))\n}\n\nconst getPathsFromTable = dataFormColumns => [\n 'pk',\n ...dataFormColumns.flatMap(column => column.children.map(field => field.path))\n]\n\nexport function* updateValue({payload: {inputDataKey, node, value}}) {\n yield put(actions.setValue(inputDataKey, node, value))\n\n const response = yield call(rest.requestSaga, 'inputEdit/data', {\n method: 'POST',\n body: {\n inputDataKey,\n node,\n value\n }\n })\n yield handleResponse(response)\n}\n\nfunction* handleResponse(response) {\n const values = response.body.calculatedValues\n if (values) {\n const actionsToPut = values.map(value => actions.setValue(value.inputDataKey, value.node, value.value))\n yield all(actionsToPut.map(action => put(action)))\n }\n}\n","import {all, takeLatest, call} from 'redux-saga/effects'\n\nimport * as actions from '../inputEditPagination/actions'\nimport {loadData} from '../inputEditTable/sagas'\n\nexport default function* sagas() {\n yield all([takeLatest(actions.SET_CURRENT_PAGE, setCurrentPage)])\n}\n\nexport function* setCurrentPage({payload: {currentPage}}) {\n yield call(loadData, {newPage: currentPage})\n}\n","import {reducer as reducerUtil} from 'tocco-util'\n\nimport * as actions from './actions'\n\nconst initialState = {\n form: {},\n initialized: false,\n searchQueries: []\n}\n\nconst ACTION_HANDLERS = {\n [actions.SET_FORM]: reducerUtil.singleTransferReducer('form'),\n [actions.SET_SEARCH_QUERIES]: reducerUtil.singleTransferReducer('searchQueries'),\n [actions.SET_INITIALIZED]: reducerUtil.singleTransferReducer('initialized')\n}\n\nexport default function reducer(state = initialState, action) {\n const handler = ACTION_HANDLERS[action.type]\n return handler ? handler(state, action) : state\n}\n","import reducer from './reducer'\nimport sagas from './sagas'\n\nexport {sagas}\nexport default reducer\n","import {all, takeLatest, call, put, select} from 'redux-saga/effects'\nimport {rest} from 'tocco-app-extensions'\n\nimport * as actions from '../inputEditSearch/actions'\nimport {loadData} from '../inputEditTable/sagas'\n\nexport const inputEditSelector = state => state.inputEdit\nexport const inputEditSearchSelector = state => state.inputEditSearch\n\nexport default function* sagas() {\n yield all([\n takeLatest(actions.INITIALIZE_SEARCH, initialize),\n takeLatest(actions.SET_SEARCH_QUERIES, setSearchQueries)\n ])\n}\n\nexport function* initialize() {\n const form = yield call(rest.fetchForm, 'Input_edit_data', 'search')\n yield put(actions.setForm(form))\n}\n\nexport function* setSearchQueries({payload}) {\n const {initialized} = yield select(inputEditSearchSelector)\n if (initialized) {\n yield call(loadData, {newSearchQueries: payload.searchQueries})\n } else {\n yield put(actions.setInitialized(true))\n }\n}\n","import {reducer as reducerUtil} from 'tocco-util'\n\nimport * as actions from './actions'\n\nconst initialState = {\n actionDefinitions: [],\n dataFormColumns: [],\n data: [],\n inputEditForm: [],\n sorting: [],\n dataLoadingInProgress: false\n}\n\nconst setValue = (state, action) => {\n const {inputDataKey, node, value} = action.payload\n return {\n ...state,\n data: state.data.reduce((acc, val) => {\n if (val.pk === inputDataKey) {\n return [\n ...acc,\n {\n ...val,\n [node]: value\n }\n ]\n }\n return [...acc, val]\n }, [])\n }\n}\n\nconst defaultOrder = 'asc'\nconst getOpposite = order => (order === 'asc' ? 'desc' : 'asc')\nconst setSorting = (state, {payload: {field, add}}) => {\n if (!add) {\n const currentSorting = state.sorting\n const order =\n currentSorting.length > 0 && currentSorting[0].field === field\n ? getOpposite(currentSorting[0].order)\n : defaultOrder\n return {\n ...state,\n sorting: [{field, order}]\n }\n } else {\n const contains = state.sorting.filter(s => s.field === field)\n const order = contains.length > 0 ? getOpposite(contains[0].order) : defaultOrder\n\n return {\n ...state,\n sorting: [...state.sorting.filter(s => s.field !== field), {field, order}]\n }\n }\n}\n\nconst ACTION_HANDLERS = {\n [actions.SET_DATA_FORM_COLUMNS]: reducerUtil.singleTransferReducer('dataFormColumns'),\n [actions.SET_ACTION_DEFINITIONS]: reducerUtil.singleTransferReducer('actionDefinitions'),\n [actions.SET_EDIT_FORM]: reducerUtil.singleTransferReducer('inputEditForm'),\n [actions.SET_DATA]: reducerUtil.singleTransferReducer('data'),\n [actions.SET_DATA_LOADING_IN_PROGRESS]: reducerUtil.singleTransferReducer('dataLoadingInProgress'),\n [actions.SET_VALUE]: setValue,\n [actions.SET_SORTING]: setSorting\n}\n\nexport default function reducer(state = initialState, action) {\n const handler = ACTION_HANDLERS[action.type]\n return handler ? handler(state, action) : state\n}\n","import reducer from './reducer'\nimport sagas from './sagas'\n\nexport {sagas}\nexport default reducer\n","import inputEditReducer, {sagas as inputEditSagas} from './inputEdit'\nimport inputEditInformationReducer, {sagas as inputEditInformationSagas} from './inputEditInformation'\nimport inputEditPaginationReducer, {sagas as inputEditPaginationSagas} from './inputEditPagination'\nimport inputEditSearchReducer, {sagas as inputEditSearchSagas} from './inputEditSearch'\nimport inputEditTableReducer, {sagas as inputEditTableSagas} from './inputEditTable'\n\nexport default {\n inputEdit: inputEditReducer,\n inputEditTable: inputEditTableReducer,\n inputEditSearch: inputEditSearchReducer,\n inputEditPagination: inputEditPaginationReducer,\n inputEditInformation: inputEditInformationReducer\n}\n\nexport const sagas = [\n inputEditSagas,\n inputEditTableSagas,\n inputEditSearchSagas,\n inputEditPaginationSagas,\n inputEditInformationSagas\n]\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport {actionEmitter, actions, appFactory, cache, errorLogging, notification} from 'tocco-app-extensions'\nimport {reducer as reducerUtil} from 'tocco-util'\n\nimport InputEdit from './components/InputEdit/InputEditContainer'\nimport {setHandleNotifications, setSelection} from './modules/inputEdit/actions'\nimport reducers, {sagas} from './modules/reducers'\n\nconst packageName = 'input-edit'\n\nconst EXTERNAL_EVENTS = ['emitAction']\n\nconst initApp = (id, input, events = {}, publicPath) => {\n const content = <InputEdit />\n\n const store = appFactory.createStore(reducers, sagas, input, packageName)\n actionEmitter.addToStore(store, events.emitAction)\n actions.addToStore(store)\n const handleNotifications = !events.emitAction\n notification.addToStore(store, handleNotifications)\n errorLogging.addToStore(store, handleNotifications)\n cache.addToStore(store)\n\n return appFactory.createApp(packageName, content, store, {\n input,\n events,\n actions: [setHandleNotifications(handleNotifications), setSelection(input.selection)],\n publicPath,\n textResourceModules: ['component', 'common', packageName]\n })\n}\n\n;(() => {\n if (__PACKAGE_NAME__ === packageName) {\n appFactory.registerAppInRegistry(packageName, initApp)\n\n if (__DEV__) {\n const input = require('./dev/input.json')\n\n if (!__NO_MOCK__) {\n const fetchMock = require('fetch-mock').default\n fetchMock.config.overwriteRoutes = false\n const setupFetchMocks = require('./dev/fetchMocks').default\n setupFetchMocks(packageName, fetchMock)\n fetchMock.spy()\n }\n\n const app = initApp(packageName, input)\n\n if (module.hot) {\n module.hot.accept('./modules/reducers', () => {\n const reducers = require('./modules/reducers').default\n reducerUtil.hotReloadReducers(app.store, reducers)\n })\n }\n\n appFactory.renderApp(app.component)\n }\n }\n})()\n\nconst InputEditApp = props => {\n const {component} = appFactory.useApp({initApp, props, packageName, externalEvents: EXTERNAL_EVENTS})\n return component\n}\n\nInputEditApp.propTypes = {\n selection: PropTypes.object,\n ...EXTERNAL_EVENTS.reduce((propTypes, event) => {\n propTypes[event] = PropTypes.func\n return propTypes\n }, {})\n}\n\nexport default InputEditApp\n","export const INITIALIZE = 'merge/INITIALIZE'\nexport const SET_SELECTION = 'merge/SET_SELECTION'\nexport const SET_SOURCE_DATA = 'merge/SET_SOURCE_DATA'\nexport const SET_SELECTED_SINGLE = 'merge/SET_SELECTED_SINGLE'\nexport const SET_SELECTED_MULTIPLE = 'merge/SET_SELECTED_MULTIPLE'\nexport const SET_SELECTED_MULTIPLE_ALL = 'merge/SET_SELECTED_MULTIPLE_ALL'\nexport const SET_TARGET_ENTITY = 'merge/SET_TARGET_ENTITY'\nexport const EXECUTE_MERGE = 'merge/EXECUTE_MERGE'\nexport const SET_MERGE_RESPONSE = 'merge/SET_MERGE_RESPONSE'\nexport const SET_MERGE_ERROR = 'merge/SET_MERGE_ERROR'\nexport const CLOSE = 'merge/CLOSE'\n\nexport const initialize = () => ({\n type: INITIALIZE\n})\n\nexport const setSelection = selection => ({\n type: SET_SELECTION,\n payload: {\n selection\n }\n})\n\nexport const setSourceData = sourceData => ({\n type: SET_SOURCE_DATA,\n payload: {\n sourceData\n }\n})\n\nexport const setSelectedSingle = (name, entityKey) => ({\n type: SET_SELECTED_SINGLE,\n payload: {\n name,\n entityKey\n }\n})\n\nexport const setSelectedMultiple = (name, entityKey, relatedEntityKey, isSelected) => ({\n type: SET_SELECTED_MULTIPLE,\n payload: {\n name,\n entityKey,\n relatedEntityKey,\n isSelected\n }\n})\n\nexport const setSelectedMultipleAll = (name, entityKey, isSelected) => ({\n type: SET_SELECTED_MULTIPLE_ALL,\n payload: {\n name,\n entityKey,\n isSelected\n }\n})\n\nexport const setTargetEntity = entityKey => ({\n type: SET_TARGET_ENTITY,\n payload: {\n entityKey\n }\n})\n\nexport const executeMerge = () => ({\n type: EXECUTE_MERGE\n})\n\nexport const setMergeResponse = mergeResponse => ({\n type: SET_MERGE_RESPONSE,\n payload: {\n mergeResponse\n }\n})\n\nexport const setMergeError = (errorMsg, validationErrors) => ({\n type: SET_MERGE_ERROR,\n payload: {\n errorMsg,\n validationErrors\n }\n})\n\nexport const close = () => ({\n type: CLOSE\n})\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport {Typography} from 'tocco-ui'\nimport {navigationStrategy} from 'tocco-util'\n\nconst maxCountLink = 100\n\nexport const ManyRelationEntityCount = ({model, keys, totalKeys, navigationStrategy}) => {\n if (totalKeys === 0) {\n return <Typography.Span>{totalKeys}</Typography.Span>\n } else {\n return (\n <navigationStrategy.ListLink entityName={model} entityKeys={keys.slice(0, maxCountLink)}>\n ({totalKeys})\n </navigationStrategy.ListLink>\n )\n }\n}\n\nManyRelationEntityCount.propTypes = {\n model: PropTypes.string.isRequired,\n keys: PropTypes.arrayOf(PropTypes.string),\n totalKeys: PropTypes.number.isRequired,\n navigationStrategy: navigationStrategy.propTypes\n}\n","import styled from 'styled-components'\nimport {Button, scale, theme} from 'tocco-ui'\n\nexport const StyledButtonWrapper = styled.div`\n border-bottom: 3px solid ${theme.color('backgroundBody')};\n`\n\nexport const StyledButton = styled(Button)`\n align-self: flex-start;\n margin-top: ${scale.space(-0.7)};\n margin-bottom: ${scale.space(-0.7)};\n margin-left: ${scale.space(0)};\n`\n","import styled from 'styled-components'\nimport {scale, theme} from 'tocco-ui'\n\nexport const StyledSummarySuccessWrapper = styled.div`\n display: grid;\n align-items: center;\n grid-template-columns: ${scale.font(10)} 1fr;\n grid-column-gap: ${scale.space(-0.5)};\n margin-bottom: ${scale.space(-0.7)};\n`\n\nexport const StyledMessageWrapper = styled.div`\n margin-bottom: ${scale.space(-0.7)};\n\n && {\n p {\n margin-bottom: 0;\n }\n }\n`\n\nexport const StyledResultsWrapper = styled.div`\n padding: ${scale.space(-1)} 0 0 ${scale.space(0)};\n`\n\nexport const StyledIconWrapper = styled.span`\n display: flex;\n align-items: center;\n color: ${theme.color('signal.success.text')};\n font-size: ${scale.font(10)};\n`\n","import _groupBy from 'lodash/groupBy'\nimport PropTypes from 'prop-types'\nimport React from 'react'\nimport {FormattedMessage} from 'react-intl'\nimport {Icon, Typography} from 'tocco-ui'\nimport {navigationStrategy} from 'tocco-util'\n\nimport {ManyRelationEntityCount} from '../../util/manyRelationEntityCount'\nimport {StyledButtonWrapper, StyledButton} from '../GlobalStyledComponents'\nimport {\n StyledSummarySuccessWrapper,\n StyledResultsWrapper,\n StyledIconWrapper,\n StyledMessageWrapper\n} from './StyledComponents'\n\nconst MergeSummary = ({mergeResponse, navigationStrategy, close}) => {\n const mapToEntityList = entities =>\n Object.entries(_groupBy(entities, e => e.entityLabel))\n .map(([entityLabel, list]) => {\n const model = entities.find(e => e.entityLabel === entityLabel).entity\n const keys = list.map(e => e.pk)\n return (\n <span key={model}>\n {entityLabel}{' '}\n <ManyRelationEntityCount\n model={model}\n keys={keys}\n totalKeys={keys.length}\n navigationStrategy={navigationStrategy}\n />\n </span>\n )\n })\n .reduce((prev, curr) => (prev === null ? [curr] : [...prev, ', ', curr]), null)\n\n const notCopiedRelations = mapToEntityList(mergeResponse.notCopiedRelations)\n const notDeletedEntities = mapToEntityList(mergeResponse.notDeletedEntities)\n\n return (\n <>\n <StyledButtonWrapper>\n <StyledButton onClick={close} look=\"raised\" ink=\"primary\">\n <FormattedMessage id=\"client.merge.close\" />\n </StyledButton>\n </StyledButtonWrapper>\n <StyledResultsWrapper>\n <StyledSummarySuccessWrapper>\n <StyledIconWrapper>\n <Icon icon={'check'} />\n </StyledIconWrapper>\n <Typography.P>\n <FormattedMessage id=\"client.merge.summary.success\" />\n </Typography.P>\n </StyledSummarySuccessWrapper>\n {(mergeResponse.notCopiedRelations.length > 0 || mergeResponse.notDeletedEntities.length > 0) && (\n <Typography.P>\n <FormattedMessage id=\"client.merge.summary.successHint\" />\n </Typography.P>\n )}\n {mergeResponse.notCopiedRelations.length > 0 && (\n <StyledMessageWrapper>\n <Typography.P>\n <FormattedMessage id=\"client.merge.summary.notCopiedRelations\" />:\n </Typography.P>\n <Typography.B>{notCopiedRelations}</Typography.B>\n </StyledMessageWrapper>\n )}\n {mergeResponse.notDeletedEntities.length > 0 && (\n <StyledMessageWrapper>\n <Typography.P>\n <FormattedMessage id=\"client.merge.summary.notDeletedEntities\" />:\n </Typography.P>\n <Typography.B>{notDeletedEntities}</Typography.B>\n </StyledMessageWrapper>\n )}\n {mergeResponse.showPermissionMessage && (\n <Typography.P>\n <FormattedMessage id=\"client.merge.summary.permission\" />\n </Typography.P>\n )}\n </StyledResultsWrapper>\n </>\n )\n}\n\nconst entityWarningPropType = PropTypes.shape({\n pk: PropTypes.string.isRequired,\n entity: PropTypes.string.isRequired,\n entityLabel: PropTypes.string.isRequired\n})\n\nMergeSummary.propTypes = {\n mergeResponse: PropTypes.shape({\n notCopiedRelations: PropTypes.arrayOf(entityWarningPropType),\n notDeletedEntities: PropTypes.arrayOf(entityWarningPropType),\n showPermissionMessage: PropTypes.bool.isRequired\n }),\n navigationStrategy: navigationStrategy.propTypes,\n close: PropTypes.func.isRequired\n}\n\nexport default MergeSummary\n","import {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\n\nimport {close} from '../../modules/merge/actions'\nimport MergeSummary from './MergeSummary'\n\nconst mapActionCreators = {\n close\n}\n\nconst mapStateToProps = state => ({\n mergeResponse: state.merge.mergeResponse,\n navigationStrategy: state.input.navigationStrategy\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(MergeSummary))\n","import MergeSummaryContainer from './MergeSummaryContainer'\n\nexport default MergeSummaryContainer\n","import React from 'react'\n\nconst getAllPaths = sourceData => Object.keys(sourceData.entities[0].paths)\nconst getAllRelations = sourceData => [...new Set(sourceData.relations.map(r => r.relationName))]\n\nconst getAllPathsAndRelations = sourceData => [...getAllPaths(sourceData), ...getAllRelations(sourceData)]\n\nconst getSortedPathsAndRelations = sourceData => {\n const counters = Object.entries(sourceData.entities[0].paths)\n .filter(([_, value]) => value.type === 'counter')\n .map(([name, _]) => name)\n\n const other = getAllPathsAndRelations(sourceData).filter(name => !counters.includes(name))\n\n const sortByLabel = list =>\n list\n .map(name => ({\n name: name,\n label: sourceData.labels[name]\n }))\n .sort((a, b) => (a.label < b.label ? -1 : 1))\n .map(o => o.name)\n\n return [...sortByLabel(counters), ...sortByLabel(other)]\n}\n\nexport const getDataRows = sourceData => {\n const pathRows = getAllPaths(sourceData).map((path, idx) => {\n return sourceData.entities.reduce(\n (acc, e) => {\n const value = e.paths[path]\n\n if (value && value.value) {\n if (value.type === 'entity') {\n value.value.display = getDisplay(sourceData, value.value.model, value.value.key)\n }\n\n if (value.type === 'entity-list') {\n value.value = value.value.map(f => {\n f.display = getDisplay(sourceData, f.model, f.key)\n return f\n })\n }\n }\n return {\n ...acc,\n [e.key]: value\n }\n },\n {__key: path}\n )\n })\n\n const relationRows = getAllRelations(sourceData).map((relation, idx) => {\n return sourceData.relations\n .filter(r => r.relationName === relation)\n .reduce(\n (acc, val) => {\n return {\n ...acc,\n [val.entityKey]: {\n type: 'relations',\n value: {\n keys: val.keys,\n totalKeys: val.totalKeys,\n relationEntity: val.relationEntity\n }\n }\n }\n },\n {__key: relation}\n )\n })\n\n const sorting = getSortedPathsAndRelations(sourceData)\n return [...pathRows, ...relationRows].sort(\n (a, b) => sorting.findIndex(e => e === a.__key) - sorting.findIndex(e => e === b.__key)\n )\n}\n\nexport const getColumnDefinition = (sourceData, ColumnHeaderRenderer, PathCellRenderer, LabelCellRenderer) => {\n const pathColumns = sourceData.entities.map(entity => ({\n id: entity.key,\n entityKey: entity.key,\n resizable: true,\n sorting: {\n sortable: false\n },\n CellRenderer: PathCellRenderer,\n HeaderRenderer: props => (\n <ColumnHeaderRenderer\n {...props}\n entityKey={entity.key}\n label={getDisplay(sourceData, entity.model, entity.key)}\n />\n )\n }))\n\n const labelColumn = {\n id: 'column-label',\n label: '',\n resizable: true,\n sorting: {\n sortable: false\n },\n CellRenderer: props => (\n <LabelCellRenderer {...props} sourceData={sourceData} allPaths={getSortedPathsAndRelations(sourceData)} />\n )\n }\n\n return [labelColumn, ...pathColumns]\n}\n\nexport const getDisplay = (sourceData, model, key) => {\n const fallbackDisplay = `PK: ${key}`\n const displaysPerModel = sourceData.displays.find(d => d.model === model)\n if (displaysPerModel === undefined) {\n return fallbackDisplay\n }\n\n const display = displaysPerModel.values.find(v => v.key === key)\n return display ? display.display : fallbackDisplay\n}\n","import styled from 'styled-components'\nimport {scale, theme, declareFont} from 'tocco-ui'\n\nexport const StyledMergeErrorWrapper = styled.div`\n ${declareFont()}\n padding: ${scale.space(-1)} 0 0 ${scale.space(0)};\n`\n\nexport const StyledSummaryErrorWrapper = styled.div`\n display: grid;\n align-items: center;\n grid-template-columns: ${scale.font(10)} 1fr;\n grid-column-gap: ${scale.space(-0.5)};\n margin-bottom: ${scale.space(-0.7)};\n`\n\nexport const StyledIconWrapper = styled.span`\n display: flex;\n align-items: center;\n color: ${theme.color('signal.danger.text')};\n font-size: ${scale.font(10)};\n`\n\nexport const StyledError = styled.p``\n\nexport const StyledLabelWrapper = styled.div`\n display: flex;\n align-items: center;\n\n label {\n vertical-align: bottom;\n }\n`\n\nexport const StyledTableWrapper = styled.div`\n flex: 1;\n`\n\nexport const StyledStatusWrapper = styled.span`\n color: ${({isChecked}) => (isChecked ? theme.color('signal.success.text') : theme.color('signal.danger.text'))};\n`\n","import _get from 'lodash/get'\nimport PropTypes from 'prop-types'\nimport React from 'react'\nimport {FormattedMessage} from 'react-intl'\nimport {field} from 'tocco-app-extensions'\nimport {FormattedValue, MultiCheckbox, Typography} from 'tocco-ui'\nimport {js, navigationStrategy} from 'tocco-util'\n\nimport {ManyRelationEntityCount} from '../../util/manyRelationEntityCount'\nimport {StyledLabelWrapper} from './StyledComponents'\n\nconst areEqual = (prevProps, nextProps) => {\n const diff = Object.keys(js.difference(prevProps, nextProps))\n return diff.length === 0\n}\n\nexport const ManyRelationsCheckBox = React.memo(\n ({entityData, entityKey, name, setSelectedMultipleAll, isSelected, navigationStrategy}) => {\n if (entityData.value.totalKeys === 0) {\n return null\n }\n\n const onChange = e => setSelectedMultipleAll(name, entityKey, e.target.checked)\n\n return (\n <StyledLabelWrapper>\n <input type=\"checkbox\" onChange={onChange} checked={isSelected} id={`${name}${entityKey}`} />\n <Typography.Label for={`${name}${entityKey}`}>\n <FormattedMessage id=\"client.merge.allRelations\" />{' '}\n <ManyRelationEntityCount\n model={entityData.value.relationEntity}\n keys={entityData.value.keys}\n totalKeys={entityData.value.totalKeys}\n navigationStrategy={navigationStrategy}\n />\n </Typography.Label>\n </StyledLabelWrapper>\n )\n },\n areEqual\n)\n\nManyRelationsCheckBox.propTypes = {\n entityData: PropTypes.shape({\n value: PropTypes.shape({\n keys: PropTypes.arrayOf(PropTypes.string),\n totalKeys: PropTypes.number.isRequired,\n relationEntity: PropTypes.string.isRequired\n })\n }),\n entityKey: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired,\n setSelectedMultipleAll: PropTypes.func.isRequired,\n isSelected: PropTypes.bool.isRequired,\n navigationStrategy: navigationStrategy.propTypes\n}\n\nexport const RelationsCheckBoxes = React.memo(\n ({entityData, entityKey, name, setSelectedMultiple, selectedMultiple}) => {\n const isSelected = key => _get(selectedMultiple, [name, key]) === entityKey\n const setSelected = (key, checked) => setSelectedMultiple(name, entityKey, key, checked)\n\n const numberTotal = entityData.value.length\n const numberSelected = entityData.value.filter(relationEntity => isSelected(relationEntity.key)).length\n const allRowsSelectionState =\n numberTotal === numberSelected ? 'checked' : numberSelected > 0 ? 'indeterminate' : 'unchecked'\n const allRowsSelectionChange = v => {\n entityData.value.forEach(relationEntity => {\n const checked = v === 'checked'\n if (isSelected(relationEntity.key) !== checked) {\n setSelected(relationEntity.key, checked)\n }\n })\n }\n\n return (\n <>\n {entityData.value.length > 0 && (\n <StyledLabelWrapper>\n <MultiCheckbox value={allRowsSelectionState} onChange={allRowsSelectionChange} id={`${name}${entityKey}`} />\n <Typography.Label for={`${name}${entityKey}`}>\n <FormattedMessage id=\"client.merge.allRelations\" />\n </Typography.Label>\n </StyledLabelWrapper>\n )}\n {entityData.value.map(relationEntity => (\n <StyledLabelWrapper key={`relation-checkbox-${relationEntity.key}`}>\n <input\n type=\"checkbox\"\n onChange={e => setSelected(relationEntity.key, e.target.checked)}\n checked={isSelected(relationEntity.key)}\n id={`${name}${entityKey}-${relationEntity.key}`}\n />\n <Typography.Label for={`${name}${entityKey}-${relationEntity.key}`}>\n <FormattedValue type=\"single-select\" value={relationEntity} />\n </Typography.Label>\n </StyledLabelWrapper>\n ))}\n </>\n )\n },\n areEqual\n)\n\nRelationsCheckBoxes.propTypes = {\n entityData: PropTypes.shape({\n value: PropTypes.array\n }),\n entityKey: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired,\n setSelectedMultiple: PropTypes.func.isRequired,\n selectedMultiple: PropTypes.objectOf(PropTypes.objectOf(PropTypes.string))\n}\n\nexport const FormattedValueRadio = React.memo(({entityData, entityKey, name, setSelectedSingle, isSelected}) => {\n const typeMapper = {\n entity: 'single-select-box'\n }\n\n const {type, writable} = entityData\n const mappedType = typeMapper[type] || type\n const onChange = () => {\n setSelectedSingle(name, entityKey)\n }\n\n const Field = field.factory('list', mappedType)\n\n return (\n <StyledLabelWrapper>\n <input\n type=\"radio\"\n name={name}\n onChange={onChange}\n checked={isSelected}\n id={`${name}${entityKey}`}\n disabled={!writable}\n />\n <Typography.Label for={`${name}${entityKey}`}>\n <Field formField={{dataType: mappedType}} value={entityData.value} />\n </Typography.Label>\n </StyledLabelWrapper>\n )\n}, areEqual)\n\nFormattedValueRadio.propTypes = {\n entityData: PropTypes.shape({\n value: PropTypes.any,\n writable: PropTypes.bool,\n type: PropTypes.string\n }),\n entityKey: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired,\n setSelectedSingle: PropTypes.func.isRequired,\n isSelected: PropTypes.bool.isRequired\n}\n","import _get from 'lodash/get'\nimport PropTypes from 'prop-types'\nimport React from 'react'\nimport {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\nimport {navigationStrategy} from 'tocco-util'\n\nimport {setSelectedMultiple, setSelectedMultipleAll, setSelectedSingle} from '../../modules/merge/actions'\nimport {FormattedValueRadio, ManyRelationsCheckBox, RelationsCheckBoxes} from './Selection'\n\nconst CellRenderer = ({\n rowData,\n column,\n setSelectedSingle,\n selectedSingle,\n setSelectedMultiple,\n selectedMultiple,\n setSelectedMultipleAll,\n selectedMultipleAll,\n navigationStrategy\n}) => {\n const {entityKey} = column\n const entityData = rowData[entityKey]\n\n const {type} = entityData\n const name = rowData.__key\n\n if (type === 'relations') {\n return (\n <ManyRelationsCheckBox\n entityData={entityData}\n entityKey={entityKey}\n name={name}\n setSelectedMultipleAll={setSelectedMultipleAll}\n isSelected={_get(selectedMultipleAll, [name], []).includes(entityKey)}\n navigationStrategy={navigationStrategy}\n />\n )\n }\n\n if (type === 'entity-list') {\n return (\n <RelationsCheckBoxes\n entityData={entityData}\n entityKey={entityKey}\n name={name}\n setSelectedMultiple={setSelectedMultiple}\n selectedMultiple={selectedMultiple}\n />\n )\n }\n\n return (\n <FormattedValueRadio\n entityData={entityData}\n entityKey={entityKey}\n name={name}\n setSelectedSingle={setSelectedSingle}\n isSelected={selectedSingle[name] === entityKey}\n />\n )\n}\n\nCellRenderer.propTypes = {\n rowData: PropTypes.objectOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n value: PropTypes.any,\n type: PropTypes.string\n }),\n PropTypes.string\n ])\n ),\n column: PropTypes.shape({\n entityKey: PropTypes.string.isRequired\n }),\n setSelectedSingle: PropTypes.func.isRequired,\n selectedSingle: PropTypes.objectOf(PropTypes.string),\n setSelectedMultiple: PropTypes.func.isRequired,\n selectedMultiple: PropTypes.objectOf(PropTypes.objectOf(PropTypes.string)),\n setSelectedMultipleAll: PropTypes.func.isRequired,\n selectedMultipleAll: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)),\n navigationStrategy: navigationStrategy.propTypes\n}\n\nconst mapActionCreatorsCell = {\n setSelectedSingle,\n setSelectedMultiple,\n setSelectedMultipleAll\n}\nconst mapStateToPropsCell = state => ({\n selectedSingle: state.merge.selected.single,\n selectedMultiple: state.merge.selected.multiple,\n selectedMultipleAll: state.merge.selected.multipleAll,\n navigationStrategy: state.input.navigationStrategy\n})\nexport const CellRendererContainer = connect(mapStateToPropsCell, mapActionCreatorsCell)(injectIntl(CellRenderer))\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport {FormattedMessage} from 'react-intl'\nimport {Icon, Typography} from 'tocco-ui'\n\nimport sourceDataPropType from '../../util/sourceDataPropType'\nimport {StyledMergeErrorWrapper, StyledSummaryErrorWrapper, StyledIconWrapper, StyledError} from './StyledComponents'\n\nconst MergeErrors = ({sourceData, mergeErrorMsg, mergeValidationErrors}) => {\n const allMergerValidationErrors = mergeValidationErrors.map(e => {\n const fieldValidators = Object.keys(e.paths).map(name =>\n Object.keys(e.paths[name]).map(validator =>\n e.paths[name][validator].map((msg, index) => (\n <StyledError key={`paths-${name}-${validator}-${index}`}>\n {sourceData.labels[name]}: {msg}\n </StyledError>\n ))\n )\n )\n\n const entityValidators = Object.keys(e.entityValidatorErrors).map(validator =>\n e.entityValidatorErrors[validator].map((msg, index) => (\n <StyledError key={`entity-${validator}-${index}`}>{msg}</StyledError>\n ))\n )\n\n return [...fieldValidators, ...entityValidators]\n })\n\n return (\n <StyledMergeErrorWrapper>\n {(allMergerValidationErrors.length > 0 || Boolean(mergeErrorMsg)) && (\n <StyledSummaryErrorWrapper>\n <StyledIconWrapper>\n <Icon icon=\"times\" />\n </StyledIconWrapper>\n <Typography.P>\n <FormattedMessage id=\"client.merge.summary.error\" />\n </Typography.P>\n </StyledSummaryErrorWrapper>\n )}\n {Boolean(mergeErrorMsg) && <StyledError>{mergeErrorMsg}</StyledError>}\n {allMergerValidationErrors}\n </StyledMergeErrorWrapper>\n )\n}\n\nexport const mergeValidationErrorsPropTypes = PropTypes.arrayOf(\n PropTypes.shape({\n model: PropTypes.string,\n key: PropTypes.string,\n paths: PropTypes.objectOf(PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string))),\n entityValidatorErrors: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string))\n })\n)\n\nMergeErrors.propTypes = {\n sourceData: sourceDataPropType,\n mergeErrorMsg: PropTypes.string,\n mergeValidationErrors: mergeValidationErrorsPropTypes\n}\n\nexport default MergeErrors\n","import PropTypes from 'prop-types'\nimport React, {useMemo} from 'react'\nimport {FormattedMessage, injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\nimport {Table, Typography, LoadMask} from 'tocco-ui'\n\nimport {setTargetEntity} from '../../modules/merge/actions'\nimport {getColumnDefinition, getDataRows} from '../../util/sourceData'\nimport sourceDataPropType from '../../util/sourceDataPropType'\nimport {StyledButton, StyledButtonWrapper} from '../GlobalStyledComponents'\nimport {CellRendererContainer} from './CellRender'\nimport MergeErrors, {mergeValidationErrorsPropTypes} from './MergeErrors'\nimport {StyledTableWrapper, StyledStatusWrapper} from './StyledComponents'\n\nconst LabelCellRenderer = ({rowIdx, sourceData, allPaths}) => {\n const columnName = allPaths[rowIdx]\n return <Typography.B>{sourceData.labels[columnName]}</Typography.B>\n}\n\nLabelCellRenderer.propTypes = {\n rowIdx: PropTypes.number,\n sourceData: sourceDataPropType,\n allPaths: PropTypes.arrayOf(PropTypes.string)\n}\n\nconst ColumnHeaderRenderer = ({label, entityKey, setTargetEntity, targetEntity, mergeStrategyDisplay}) => {\n const isChecked = targetEntity === entityKey\n const status = isChecked ? <FormattedMessage id=\"client.merge.strategy.keep\" /> : mergeStrategyDisplay\n const onChange = () => setTargetEntity(entityKey)\n\n return (\n <>\n <input type=\"radio\" name=\"column\" onChange={onChange} checked={isChecked} id={`targetEntity${entityKey}`} />\n <Typography.Label for={`targetEntity${entityKey}`}>\n <Typography.B>{label}</Typography.B>\n <StyledStatusWrapper isChecked={isChecked}> ({status})</StyledStatusWrapper>\n </Typography.Label>\n </>\n )\n}\n\nColumnHeaderRenderer.propTypes = {\n label: PropTypes.string,\n entityKey: PropTypes.string.isRequired,\n setTargetEntity: PropTypes.func.isRequired,\n targetEntity: PropTypes.string,\n mergeStrategyDisplay: PropTypes.string.isRequired\n}\n\nconst mapActionCreatorsColumn = {\n setTargetEntity\n}\nconst mapStateToPropsColumn = state => ({\n targetEntity: state.merge.selected.targetEntity,\n mergeStrategyDisplay: state.merge.sourceData.mergeStrategyDisplay\n})\nconst ColumnHeaderRendererContainer = connect(\n mapStateToPropsColumn,\n mapActionCreatorsColumn\n)(injectIntl(ColumnHeaderRenderer))\n\nconst MergeTable = ({sourceData, mergePending, mergeErrorMsg, mergeValidationErrors, executeMerge}) => {\n const data = useMemo(() => (sourceData ? getDataRows(sourceData) : []), [sourceData])\n\n const columns = useMemo(\n () =>\n sourceData\n ? getColumnDefinition(sourceData, ColumnHeaderRendererContainer, CellRendererContainer, LabelCellRenderer)\n : [],\n [sourceData]\n )\n\n if (mergePending) {\n return <LoadMask />\n }\n\n return (\n <>\n <StyledButtonWrapper>\n <StyledButton onClick={executeMerge} look=\"raised\" ink=\"primary\" disabled={sourceData === null}>\n <FormattedMessage id=\"client.merge.saveButton\" />\n </StyledButton>\n </StyledButtonWrapper>\n <StyledTableWrapper>\n <MergeErrors\n sourceData={sourceData}\n mergeErrorMsg={mergeErrorMsg}\n mergeValidationErrors={mergeValidationErrors}\n />\n <Table\n columns={columns}\n data={data}\n selectionStyle=\"none\"\n dataLoadingInProgress={sourceData === null}\n onColumnPositionChange={() => {}}\n />\n </StyledTableWrapper>\n </>\n )\n}\n\nMergeTable.propTypes = {\n sourceData: sourceDataPropType,\n mergePending: PropTypes.bool.isRequired,\n mergeErrorMsg: PropTypes.string,\n mergeValidationErrors: mergeValidationErrorsPropTypes,\n executeMerge: PropTypes.func.isRequired\n}\n\nexport default MergeTable\n","import {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\n\nimport {executeMerge} from '../../modules/merge/actions'\nimport MergeTable from './MergeTable'\n\nconst mapActionCreators = {\n executeMerge\n}\n\nconst mapStateToProps = state => ({\n sourceData: state.merge.sourceData,\n mergePending: state.merge.mergePending,\n mergeErrorMsg: state.merge.mergeErrorMsg,\n mergeValidationErrors: state.merge.mergeValidationErrors\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(MergeTable))\n","import MergeTableContainer from './MergeTableContainer'\n\nexport default MergeTableContainer\n","import styled from 'styled-components'\nimport {theme} from 'tocco-ui'\n\nexport const StyledMerge = styled.div`\n height: 100%;\n overflow: hidden;\n background-color: ${theme.color('paper')};\n display: flex;\n flex-direction: column;\n`\n","import PropTypes from 'prop-types'\nimport React, {useEffect} from 'react'\n\nimport MergeSummary from '../MergeSummary'\nimport MergeTable from '../MergeTable'\nimport {StyledMerge} from './StyledComponents'\n\nconst Merge = ({initialize, mergeDone}) => {\n useEffect(() => {\n initialize()\n }, [])\n\n return <StyledMerge>{mergeDone ? <MergeSummary /> : <MergeTable />}</StyledMerge>\n}\n\nMerge.propTypes = {\n initialize: PropTypes.func.isRequired,\n mergeDone: PropTypes.bool.isRequired\n}\n\nexport default Merge\n","import {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\n\nimport {initialize} from '../../modules/merge/actions'\nimport Merge from './Merge'\n\nconst mapActionCreators = {\n initialize\n}\n\nconst mapStateToProps = state => ({\n mergeDone: !!state.merge.mergeResponse\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(Merge))\n","import MergeContainer from './MergeContainer'\n\nexport default MergeContainer\n","import _omit from 'lodash/omit'\nimport _setWith from 'lodash/setWith'\nimport {reducer as reducerUtil} from 'tocco-util'\n\nimport * as actions from './actions'\n\nconst executeMerge = state => ({\n ...state,\n mergePending: true\n})\n\nconst mergeResponse = (state, {payload: {mergeResponse}}) => ({\n ...state,\n mergePending: false,\n mergeResponse: mergeResponse\n})\n\nconst mergeErrors = (state, {payload: {errorMsg, validationErrors}}) => ({\n ...state,\n mergePending: false,\n mergeErrorMsg: errorMsg,\n mergeValidationErrors: validationErrors\n})\n\nconst setSelectedSingle = (state, {payload: {name, entityKey}}) => ({\n ...state,\n selected: {\n ...state.selected,\n single: {\n ...state.selected.single,\n [name]: entityKey\n }\n }\n})\n\nconst setSelectedMultiple = (state, {payload: {name, entityKey, relatedEntityKey, isSelected}}) => {\n let multiple\n if (isSelected) {\n multiple = {\n ...state.selected.multiple,\n [name]: {\n ...state.selected.multiple[name],\n [relatedEntityKey]: entityKey\n }\n }\n } else {\n multiple = {...state.selected.multiple}\n multiple[name] = _omit(multiple[name], [relatedEntityKey])\n }\n return {\n ...state,\n selected: {\n ...state.selected,\n multiple: multiple\n }\n }\n}\n\nconst setSelectedMultipleAll = (state, {payload: {name, entityKey, isSelected}}) => {\n let array\n if (isSelected) {\n array = [...(state.selected.multipleAll[name] || []), entityKey]\n } else {\n array = state.selected.multipleAll[name].filter(key => key !== entityKey)\n }\n return {\n ...state,\n selected: {\n ...state.selected,\n multipleAll: {\n ...state.selected.multipleAll,\n [name]: array\n }\n }\n }\n}\n\nconst setTargetEntity = (state, {payload: {entityKey}}) => {\n const single = {}\n const multiple = {}\n\n const targetEntity = state.sourceData.entities.find(e => e.key === entityKey)\n for (const [key, obj] of Object.entries(targetEntity.paths)) {\n if (obj.type !== 'entity-list') {\n single[key] = entityKey\n }\n }\n\n state.sourceData.entities.filter(e => e.key !== entityKey).forEach(e => setTargetEntityMultiple(multiple, e))\n setTargetEntityMultiple(multiple, targetEntity)\n\n const multipleAll = state.sourceData.relations.reduce(\n (acc, val) => ({\n ...acc,\n [val.relationName]: [...(acc[val.relationName] || []), val.entityKey]\n }),\n {}\n )\n\n return {\n ...state,\n selected: {\n ...state.selected,\n targetEntity: entityKey,\n single: single,\n multiple: multiple,\n multipleAll: multipleAll\n }\n }\n}\n\nconst setTargetEntityMultiple = (multiple, entity) => {\n for (const [key, obj] of Object.entries(entity.paths)) {\n if (obj.type === 'entity-list') {\n obj.value\n .map(e => e.key)\n .forEach(relatedEntityKey => {\n _setWith(multiple, [key, relatedEntityKey], entity.key, Object)\n })\n }\n }\n}\n\nconst ACTION_HANDLERS = {\n [actions.SET_SELECTION]: reducerUtil.singleTransferReducer('selection'),\n [actions.SET_SOURCE_DATA]: reducerUtil.singleTransferReducer('sourceData'),\n [actions.EXECUTE_MERGE]: executeMerge,\n [actions.SET_MERGE_RESPONSE]: mergeResponse,\n [actions.SET_MERGE_ERROR]: mergeErrors,\n [actions.SET_SELECTED_SINGLE]: setSelectedSingle,\n [actions.SET_SELECTED_MULTIPLE]: setSelectedMultiple,\n [actions.SET_SELECTED_MULTIPLE_ALL]: setSelectedMultipleAll,\n [actions.SET_TARGET_ENTITY]: setTargetEntity\n}\n\nconst initialState = {\n selection: null,\n sourceData: null,\n mergePending: false,\n mergeResponse: null,\n mergeErrorMsg: null,\n mergeValidationErrors: [],\n selected: {\n targetEntity: null,\n single: {},\n multiple: {},\n multipleAll: {}\n }\n}\n\nexport default function reducer(state = initialState, action) {\n const handler = ACTION_HANDLERS[action.type]\n return handler ? handler(state, action) : state\n}\n","import _uniq from 'lodash/uniq'\nimport {takeLatest, all, select, call, put} from 'redux-saga/effects'\nimport {externalEvents, rest} from 'tocco-app-extensions'\n\nimport * as actions from './actions'\n\nexport const mergeSelector = state => state.merge\n\nexport default function* mainSagas() {\n yield all([\n takeLatest(actions.INITIALIZE, initialize),\n takeLatest(actions.EXECUTE_MERGE, executeMerge),\n takeLatest(actions.CLOSE, close)\n ])\n}\n\nexport function* initialize() {\n const {selection} = yield select(mergeSelector)\n yield call(loadSourceData, selection)\n}\n\nexport function* loadSourceData(selection) {\n const resource = 'merge/sourceData'\n const options = {\n method: 'POST',\n body: selection\n }\n const response = yield call(rest.requestSaga, resource, options)\n const {body: sourceData} = response\n yield put(actions.setSourceData(sourceData))\n yield put(actions.setTargetEntity(sourceData.entities[0].key))\n}\n\nexport function* getMergeBody() {\n const {selection, selected, sourceData} = yield select(mergeSelector)\n\n const paths = {}\n for (const [name, entityKey] of Object.entries(selected.single)) {\n const path = sourceData.entities.find(e => e.key === entityKey).paths[name]\n\n if (path.writable) {\n if (path.type === 'entity') {\n if (path.value === null) {\n paths[name] = null\n } else {\n paths[name] = {\n key: path.value.key\n }\n }\n } else {\n paths[name] = entityKey\n }\n }\n }\n\n for (const [name, obj] of Object.entries(selected.multiple)) {\n paths[name] = []\n Object.keys(obj).forEach(value =>\n paths[name].push({\n key: value\n })\n )\n }\n\n const mergeRelations = _uniq(sourceData.relations.map(r => r.relationName)).map(relationName => ({\n relationName: relationName,\n sourceKey: selected.multipleAll[relationName] || []\n }))\n\n return {\n selection: selection,\n targetEntity: {\n key: selected.targetEntity,\n paths: paths\n },\n mergeRelations: mergeRelations\n }\n}\n\nexport function* executeMerge() {\n const resource = 'merge/merge'\n const options = {\n method: 'POST',\n acceptedStatusCodes: [400, 500],\n headers: {'X-Client-Questions': 'true'},\n body: yield call(getMergeBody)\n }\n\n const response = yield call(rest.requestSaga, resource, options)\n\n if (response.status === 200) {\n yield put(actions.setMergeResponse(response.body))\n } else {\n if (response.body && response.body.errorCode === 'VALIDATION_FAILED') {\n yield put(actions.setMergeError(null, response.body.errors))\n } else {\n yield put(actions.setMergeError(response.body.message, []))\n }\n }\n}\n\nexport function* close() {\n const {sourceData} = yield select(mergeSelector)\n const entities = sourceData.entities.map(entitiy => ({entityName: entitiy.model, key: entitiy.key}))\n const remoteEvents = [\n {\n type: 'entity-update-event',\n payload: {\n entities\n }\n }\n ]\n\n yield put(externalEvents.fireExternalEvent('onSuccess', {remoteEvents}))\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 merge, {sagas as mergeSagas} from './merge'\n\nexport default {\n merge\n}\n\nexport const sagas = [mergeSagas]\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport {actionEmitter, appFactory, cache, externalEvents, notification} from 'tocco-app-extensions'\nimport {GlobalStyles} from 'tocco-ui'\nimport {reducer as reducerUtil} from 'tocco-util'\n\nimport Merge from './components/Merge'\nimport {setSelection} from './modules/merge/actions'\nimport reducers, {sagas} from './modules/reducers'\n\nconst packageName = 'merge'\n\nconst EXTERNAL_EVENTS = ['emitAction', 'onSuccess']\n\nconst initApp = (id, input, events = {}, publicPath) => {\n const store = appFactory.createStore(reducers, sagas, input, packageName)\n actionEmitter.addToStore(store, events.emitAction)\n externalEvents.addToStore(store, events)\n const handleNotifications = !events.emitAction\n notification.addToStore(store, handleNotifications)\n cache.addToStore(store)\n\n const content = (\n <>\n <GlobalStyles />\n {handleNotifications && <notification.Notifications />}\n <Merge />\n </>\n )\n\n return appFactory.createApp(packageName, content, store, {\n input,\n events,\n actions: [setSelection(input.selection)],\n publicPath,\n textResourceModules: ['component', 'common', packageName]\n })\n}\n\n;(() => {\n if (__PACKAGE_NAME__ === packageName) {\n appFactory.registerAppInRegistry(packageName, initApp)\n\n if (__DEV__) {\n const input = require('./dev/input.json')\n input.navigationStrategy = {}\n input.navigationStrategy.ListLink = ({children}) => children\n\n if (!__NO_MOCK__) {\n const fetchMock = require('fetch-mock').default\n fetchMock.config.overwriteRoutes = false\n const setupFetchMocks = require('./dev/fetchMocks').default\n setupFetchMocks(packageName, fetchMock)\n fetchMock.spy()\n }\n\n const app = initApp(packageName, input)\n\n if (module.hot) {\n module.hot.accept('./modules/reducers', () => {\n const reducers = require('./modules/reducers').default\n reducerUtil.hotReloadReducers(app.store, reducers)\n })\n }\n\n appFactory.renderApp(app.component)\n }\n }\n})()\n\nconst MergeApp = props => {\n const {component} = appFactory.useApp({initApp, props, packageName, externalEvents: EXTERNAL_EVENTS})\n return component\n}\n\nMergeApp.propTypes = {\n selection: PropTypes.object,\n ...EXTERNAL_EVENTS.reduce((propTypes, event) => {\n propTypes[event] = PropTypes.func\n return propTypes\n }, {})\n}\n\nexport default MergeApp\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport {connect} from 'react-redux'\nimport {notification} from 'tocco-app-extensions'\nimport {PasswordUpdateApp} from 'tocco-login/src/main'\n\nconst mapActionCreators = {\n closeModal: notification.removeModal\n}\n\nconst PasswordUpdate = ({selection, closeModal}) => (\n <PasswordUpdateApp\n username={selection.ids[0]}\n showOldPasswordField={false}\n success={() => closeModal('action-password-update')}\n />\n)\n\nPasswordUpdate.propTypes = {\n selection: PropTypes.object.isRequired,\n closeModal: PropTypes.func.isRequired\n}\n\nexport default connect(null, mapActionCreators)(PasswordUpdate)\n","const RADIX = 16\n\nexport const hexToRgb = (hex, fallBack = null) => {\n if (!hex) {\n return fallBack\n }\n\n hex = normalizeHex(hex)\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex)\n\n return result\n ? {\n r: parseInt(result[1], RADIX),\n g: parseInt(result[2], RADIX),\n b: parseInt(result[3], RADIX)\n }\n : fallBack\n}\n\nconst normalizeHex = hex => {\n if (!hex.startsWith('#')) {\n hex = '#' + hex\n }\n return hex.padEnd(7, '0')\n}\n","import {hexToRgb} from './hexToRgb'\n\nconst LUMIANCE_LIMIT = 0.25\n\nconst calculateLight = colorItem => {\n let c = colorItem / 255.0\n if (c <= 0.03928) {\n c = c / 12.92\n } else {\n c = Math.pow((c + 0.055) / 1.055, 2.4)\n }\n return c\n}\n\nconst calculateLumiance = color =>\n 0.2126 * calculateLight(color.r) + 0.7152 * calculateLight(color.g) + 0.0722 * calculateLight(color.b)\n\n/***\n * Returns a dark or bright value depending on the given color.\n * This could be used to choose a pleasant font color to a background color.\n * @param hexColor Hex Color code\n * @param brightValue Bright value can be overridden. Default is the color white as hex.\n * @param darkValue Dark value can be overridden. Default is the color black as hex.\n * @returns {string}\n */\nexport const getContrastColor = (hexColor, brightValue = '#FFFFFF', darkValue = '#000000') => {\n const rgbColor = hexToRgb(hexColor)\n\n if (rgbColor) {\n return calculateLumiance(rgbColor) > LUMIANCE_LIMIT ? darkValue : brightValue\n }\n\n return brightValue\n}\n","import {getContrastColor} from './contrast'\nimport {hexToRgb} from './hexToRgb'\n\nexport default {getContrastColor, hexToRgb}\n","export default Object.freeze({\n EXISTING: 'existing',\n ACCEPTED: 'accepted',\n NONE: 'none'\n})\n","import {color} from 'tocco-util'\n\nimport conflicts from './conflicts'\n\nconst getResourceId = (id, model) => id + model\n\nexport const getResources = calendars => {\n return calendars.map(calendar => ({\n title: calendar.label,\n id: getResourceId(calendar.key, calendar.model),\n entityKey: calendar.key,\n calendarType: calendar.calendarType,\n entityModel: calendar.model\n }))\n}\n\nconst getOptimalTextColorClass = backgroundHexColor => color.getContrastColor(backgroundHexColor, 'bright', 'dark')\n\nexport const getEvents = calendars =>\n calendars.reduce(\n (accumulator, calendar) => [\n ...accumulator,\n ...calendar.events.map(event => ({\n entity: event.source,\n resourceId: getResourceId(calendar.key, calendar.model),\n title: event.label,\n start: event.start,\n end: event.end,\n description: event.description,\n conflict: event.conflict,\n ...(event.color ? {backgroundColor: event.color, borderColor: event.color} : {}),\n styleAttr: [\n ...(event.conflict === conflicts.EXISTING ? ['conflict'] : []),\n getOptimalTextColorClass(event.color)\n ]\n }))\n ],\n []\n )\n","/**\n * Returns the hour as string\n *\n * @param {Object} moment.js datetime\n *\n * @return {String} Hours of datetime e.g. '08' or '8 PM' depending on the locale set on the moment.js object\n */\nexport const getFormattedTime = date => date.format('LT').replace(/(:|\\.|e)[0-9]{2}/, '')\n","import PropTypes from 'prop-types'\nimport React from 'react'\n\nimport conflicts from '../../utils/conflicts'\n\nconst CHECK = '\\u2713'\nconst CROSS = '\\u2715'\n\nconst Conflict = ({conflictStatus, intl}) => {\n if (!(conflictStatus === conflicts.ACCEPTED || conflictStatus === conflicts.EXISTING)) {\n return null\n }\n\n const accepted = conflictStatus === conflicts.ACCEPTED\n const textResource = `client.scheduler.conflict${accepted ? 'Accepted' : 'Existing'}`\n const icon = accepted ? CHECK : CROSS\n\n return (\n <span>\n {icon} {intl.formatMessage({id: textResource})}\n </span>\n )\n}\n\nConflict.propTypes = {\n intl: PropTypes.object.isRequired,\n conflictStatus: PropTypes.oneOf(Object.values(conflicts))\n}\n\nexport default Conflict\n","import Conflict from './Conflict'\n\nexport default Conflict\n","import React, {lazy, Suspense} from 'react'\n\nconst DatePickerComponent = lazy(() => import(/* webpackChunkName: \"vendor-date-picker\" */ './DatePicker'))\n\nconst renderLoader = () => <React.Fragment />\n\nconst LazyIcon = props => (\n <Suspense fallback={renderLoader()}>\n <DatePickerComponent {...props} />\n </Suspense>\n)\n\nexport default LazyIcon\n","import styled from 'styled-components'\nimport {scale} from 'tocco-ui'\n\nconst StyledNavigationFullCalendar = styled.div`\n display: flex;\n justify-content: space-between;\n margin: ${scale.space(-1)} ${scale.space(-2)};\n\n > div {\n display: flex;\n align-items: center;\n\n > * {\n margin-left: ${scale.space(-2)};\n }\n }\n`\n\nexport default StyledNavigationFullCalendar\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport {FormattedMessage, injectIntl} from 'react-intl'\nimport {Button, ButtonGroup, Icon, Typography, DatePicker} from 'tocco-ui'\n\nimport StyledNavigationFullCalendar from './StyledNavigationFullCalendar'\n\nconst getButtonInkProps = (viewType, type) => (viewType === type ? {ink: 'secondary'} : {})\n\nconst msg = (id, intl) => intl.formatMessage({id})\n\nconst NavigationFullCalendar = props => {\n const {\n date,\n changeRange,\n changeView,\n chooseNext,\n choosePrev,\n chooseToday,\n goToDate,\n intl,\n isLoading,\n refresh,\n title,\n type\n } = props\n\n return (\n <StyledNavigationFullCalendar>\n <div>\n <Button\n look=\"raised\"\n onClick={() => {\n chooseToday()\n changeRange()\n }}\n >\n <FormattedMessage id=\"client.scheduler.today\" />\n </Button>\n <ButtonGroup>\n <Button\n look=\"raised\"\n onClick={() => {\n choosePrev()\n changeRange()\n }}\n icon=\"chevron-left\"\n title={msg('client.scheduler.previous', intl)}\n />\n <Button\n look=\"raised\"\n onClick={() => {\n chooseNext()\n changeRange()\n }}\n icon=\"chevron-right\"\n title={msg('client.scheduler.next', intl)}\n />\n </ButtonGroup>\n <DatePicker\n value={date}\n onChange={date => {\n goToDate(date)\n changeRange()\n }}\n >\n <Typography.Span>{title}</Typography.Span>\n <Icon style={{marginLeft: '5px'}} icon=\"chevron-down\" />\n </DatePicker>\n </div>\n <div>\n <ButtonGroup>\n <Button look=\"raised\" {...getButtonInkProps('dayView', type)} onClick={() => changeView('dayView')}>\n <FormattedMessage id=\"client.scheduler.day\" />\n </Button>\n <Button\n look=\"raised\"\n {...getButtonInkProps('weekView', type)}\n {...getButtonInkProps('weekViewSimple', type)}\n onClick={() => (type !== 'weekViewSimple' ? changeView('weekViewSimple') : changeView('weekView'))}\n >\n <FormattedMessage id=\"client.scheduler.week\" />\n </Button>\n <Button look=\"raised\" {...getButtonInkProps('monthView', type)} onClick={() => changeView('monthView')}>\n <FormattedMessage id=\"client.scheduler.month\" />\n </Button>\n </ButtonGroup>\n <Button\n icon={isLoading ? '' : 'sync'}\n onClick={() => {\n if (!isLoading) {\n refresh()\n }\n }}\n pending={isLoading}\n title={msg('client.scheduler.reload', intl)}\n />\n </div>\n </StyledNavigationFullCalendar>\n )\n}\n\nNavigationFullCalendar.propTypes = {\n date: PropTypes.instanceOf(Date),\n changeRange: PropTypes.func.isRequired,\n changeView: PropTypes.func.isRequired,\n chooseNext: PropTypes.func.isRequired,\n choosePrev: PropTypes.func.isRequired,\n chooseToday: PropTypes.func.isRequired,\n goToDate: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n isLoading: PropTypes.bool,\n refresh: PropTypes.func.isRequired,\n title: PropTypes.string,\n type: PropTypes.string\n}\n\nexport {getButtonInkProps}\nexport default injectIntl(NavigationFullCalendar)\n","import NavigationFullCalendar from './NavigationFullCalendar'\n\nexport default NavigationFullCalendar\n","import PropTypes from 'prop-types'\nimport React from 'react'\n\nconst ResourceLabelContent = ({fieldValue, resource, onCalendarRemove}) => (\n <>\n <input\n type=\"checkbox\"\n defaultChecked={true}\n className=\"remove-resource-checkbox\"\n onClick={() => onCalendarRemove(resource.extendedProps.entityKey, resource.extendedProps.entityModel)}\n />\n {fieldValue}\n </>\n)\n\nResourceLabelContent.propTypes = {\n fieldValue: PropTypes.string,\n resource: PropTypes.shape({\n extendedProps: PropTypes.shape({\n entityKey: PropTypes.string,\n entityModel: PropTypes.string\n })\n }).isRequired,\n onCalendarRemove: PropTypes.func.isRequired\n}\n\nexport default ResourceLabelContent\n","import _get from 'lodash/get'\nimport styled, {createGlobalStyle} from 'styled-components'\nimport {declareFont, theme, StyledScrollbar, shadeColor, scale} from 'tocco-ui'\n\nexport const StyledFullCalendarWrapper = styled.div`\n height: 100%;\n display: grid;\n grid-template-rows: auto 1fr;\n\n .fc {\n ${declareFont()};\n\n table {\n font-size: ${scale.font(-2)};\n }\n\n // decrease header height\n .fc-datagrid-header {\n .fc-datagrid-cell-frame {\n height: 25px !important;\n }\n }\n\n .fc-timeline-slot-frame a {\n text-decoration: none;\n }\n\n // decrease header height\n .fc-timeline-slot-frame.fc-timeline-slot-frame {\n height: 25px !important;\n }\n\n .remove-resource-checkbox {\n margin-right: 6px;\n }\n\n .fc-scrollgrid {\n border-top: 0; // remove top border as it otherwise causes a double border when not scrolling\n border-color: ${({theme}) => shadeColor(_get(theme, 'colors.paper'), 1)};\n }\n\n // prevent top border from disappearing on scroll\n & .fc-scroller-harness {\n border-top: 1px solid ${({theme}) => shadeColor(_get(theme, 'colors.paper'), 1)};\n }\n\n .fc-timeline-header-row {\n th {\n font-weight: ${theme.fontWeight('regular')};\n }\n }\n\n .fc-event {\n cursor: pointer;\n\n .dark {\n color: ${theme.color('text')};\n }\n\n .bright {\n color: ${theme.color('paper')};\n }\n\n .conflict {\n border: 2px dashed ${theme.color('signal.danger.text')};\n }\n\n .fc-event-time {\n overflow: visible;\n font-size: ${scale.font(0)};\n font-weight: ${theme.fontWeight('regular')};\n }\n }\n\n .fc-event-title {\n font-size: ${scale.font(0)};\n }\n }\n`\n\nexport const StyledMemoizedFullCalender = styled.div`\n overflow-y: auto;\n ${StyledScrollbar}\n`\n\nexport const CalendarGlobalPrintStyle = createGlobalStyle`\n @media print {\n body * {\n visibility: hidden;\n }\n\n #section-to-print,\n #section-to-print * {\n visibility: visible;\n color: ${theme.color('text')};\n\n input[type='checkbox'] {\n visibility: hidden !important;\n }\n }\n\n #section-to-print {\n position: fixed;\n overflow: visible;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n\n & *:not(.fc-timeline-event-harness *) {\n overflow: visible;\n }\n }\n }\n`\n","// eslint-disable-next-line import/order\nimport ReactFullCalendar from '@fullcalendar/react'\nimport adaptivePlugin from '@fullcalendar/adaptive'\nimport interactionPlugin from '@fullcalendar/interaction'\nimport resourceTimelinePlugin from '@fullcalendar/resource-timeline'\nimport moment from 'moment'\nimport PropTypes from 'prop-types'\nimport React, {useEffect, useMemo, useRef} from 'react'\nimport 'twix'\nimport {injectIntl} from 'react-intl'\nimport {FormattedValue, Popover} from 'tocco-ui'\nimport {consoleLogger} from 'tocco-util'\n\nimport {getFormattedTime} from '../../utils/time'\nimport Conflict from '../Conflict'\nimport NavigationFullCalendar from '../NavigationFullCalendar'\nimport ResourceLabelContent from './ResourceLabelContent'\nimport {CalendarGlobalPrintStyle, StyledFullCalendarWrapper, StyledMemoizedFullCalender} from './StyledFullCalendar'\n\nconst getLicense = () => {\n const licence = process.env.FULL_CALENDAR_LICENCE\n if (licence) {\n return licence\n }\n consoleLogger.logWarning('This Version runs with the NonCommercial FullCalendar license.')\n return 'CC-Attribution-NonCommercial-NoDerivatives' // noncommercial license\n}\n\nconst MONDAY = 1\n\nconst FullCalendar = ({\n resources,\n events,\n onDateRangeChange,\n isLoading,\n onRefresh,\n onCalendarRemove,\n onCalendarRemoveAll,\n locale,\n onEventClick,\n intl\n}) => {\n const calendarEl = useRef(null)\n const wrapperEl = useRef(null)\n\n useEffect(() => {\n moment.locale(locale)\n changeRange()\n }, [])\n\n useEffect(() => {\n const calendar = calendarEl.current.getApi()\n calendar.batchRendering(() => {\n const eventSources = calendar.getEventSources()\n eventSources.forEach(eS => eS.remove())\n calendar.addEventSource(events)\n })\n }, [JSON.stringify(events)])\n\n useEffect(() => {\n const calendar = calendarEl.current.getApi()\n calendar.batchRendering(() => {\n const loadedResources = calendar.getResources()\n loadedResources.forEach(l => {\n const contains = resources.find(r => l.id === r.id)\n if (!contains) {\n l.remove()\n }\n })\n\n resources.forEach(r => {\n const contains = loadedResources.find(l => l.id === r.id)\n if (!contains) {\n calendar.addResource(r)\n }\n })\n })\n }, [JSON.stringify(resources)])\n\n const headerContent = (\n <input\n type=\"checkbox\"\n checked={true}\n onChange={() => onCalendarRemoveAll()}\n style={{visibility: resources.length > 0 ? 'visible' : 'hidden'}}\n className=\"remove-all-checkbox\"\n />\n )\n\n const changeRange = () => {\n const {view} = calendarEl.current.getApi()\n if (onDateRangeChange) {\n onDateRangeChange({startDate: view.activeStart, endDate: view.activeEnd})\n }\n }\n\n const changeView = (view = 'timelineDay') => {\n calendarEl.current.getApi().changeView(view)\n changeRange()\n }\n\n const renderEventContent = eventInfo => {\n const time = moment(eventInfo.event.start)\n .twix(moment(eventInfo.event.end))\n .format({monthFormat: 'MMMM', dayFormat: 'Do'})\n const tooltipDescriptionContent = (\n <div>\n <FormattedValue type=\"html\" value={eventInfo.event.extendedProps.description} />\n <p>{time}</p>\n <p>\n <Conflict conflictStatus={eventInfo.event.extendedProps.conflict} intl={intl} />\n </p>\n </div>\n )\n const eventInfoStyleAttributes = eventInfo.event.extendedProps.styleAttr\n\n return (\n <Popover content={tooltipDescriptionContent} isPlainHtml placement=\"top\">\n <div className={`fc-event-main-frame ${eventInfoStyleAttributes && eventInfoStyleAttributes.join(' ')}`}>\n {eventInfo.timeText && <div className=\"fc-event-time\">{eventInfo.timeText}</div>}\n <div className=\"fc-event-title-container\">\n <div className=\"fc-event-title fc-sticky\">{eventInfo.event.title || <> </>}</div>\n </div>\n </div>\n </Popover>\n )\n }\n\n const memoizedFullCalendar = useMemo(\n () => (\n <ReactFullCalendar\n resourceOrder=\"\"\n schedulerLicenseKey={getLicense()}\n locale={locale}\n plugins={[adaptivePlugin, resourceTimelinePlugin, interactionPlugin]}\n ref={calendarEl}\n initialView={'dayView'}\n headerToolbar={false}\n height=\"auto\"\n resourceAreaWidth=\"15%\"\n resourceAreaColumns={[{labelText: '', headerContent}]}\n resourceLabelContent={props => <ResourceLabelContent {...props} onCalendarRemove={onCalendarRemove} />}\n eventClick={info => {\n onEventClick(info.event)\n }}\n eventContent={renderEventContent}\n firstDay={MONDAY}\n slotMinTime=\"06:00:00\"\n slotMaxTime=\"23:00:00\"\n views={{\n dayView: {\n type: 'resourceTimelineDay',\n slotLabelFormat: info => getFormattedTime(moment(info.date).locale(locale))\n },\n weekView: {\n type: 'resourceTimelineWeek',\n slotLabelFormat: [\n {weekday: 'short', month: 'numeric', day: 'numeric'},\n info => getFormattedTime(moment(info.date).locale(locale))\n ]\n },\n weekViewSimple: {\n type: 'resourceTimelineWeek',\n slotDuration: {day: 1},\n slotLabelFormat: [\n {\n weekday: 'short',\n month: 'numeric',\n day: 'numeric'\n }\n ]\n },\n monthView: {\n type: 'resourceTimelineMonth',\n slotLabelFormat: {\n weekday: 'short',\n month: 'numeric',\n day: 'numeric',\n omitCommas: true\n }\n }\n }}\n />\n ),\n [resources.length]\n )\n\n return (\n <StyledFullCalendarWrapper ref={wrapperEl}>\n <CalendarGlobalPrintStyle />\n {calendarEl.current && (\n <NavigationFullCalendar\n changeRange={changeRange}\n changeView={changeView}\n chooseNext={() => calendarEl.current.getApi().next()}\n choosePrev={() => calendarEl.current.getApi().prev()}\n chooseToday={() => calendarEl.current.getApi().today()}\n goToDate={date => calendarEl.current.getApi().gotoDate(date)}\n date={calendarEl.current.getApi().getDate()}\n isLoading={isLoading}\n refresh={onRefresh}\n title={calendarEl.current.getApi().view.title}\n type={calendarEl.current.getApi().view.type}\n />\n )}\n <StyledMemoizedFullCalender id=\"section-to-print\">{memoizedFullCalendar}</StyledMemoizedFullCalender>\n </StyledFullCalendarWrapper>\n )\n}\n\nFullCalendar.defaultProps = {\n locale: 'en'\n}\n\nFullCalendar.propTypes = {\n intl: PropTypes.object.isRequired,\n onDateRangeChange: PropTypes.func,\n onCalendarRemove: PropTypes.func,\n onCalendarRemoveAll: PropTypes.func,\n onRefresh: PropTypes.func,\n onEventClick: PropTypes.func.isRequired,\n events: PropTypes.arrayOf(\n PropTypes.shape({\n resourceId: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n start: PropTypes.number.isRequired,\n end: PropTypes.number.isRequired,\n allDay: PropTypes.bool\n })\n ),\n resources: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.string.isRequired,\n calendarType: PropTypes.string.isRequired,\n entityKey: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired\n })\n ),\n locale: PropTypes.string,\n isLoading: PropTypes.bool\n}\n\nexport default injectIntl(FullCalendar)\n","import FullCalendar from './FullCalendar'\n\nexport default FullCalendar\n","import PropTypes from 'prop-types'\nimport React from 'react'\n\nimport {getEvents, getResources} from '../../utils/calendar'\nimport FullCalendar from '../FullCalendar'\n\nconst Scheduler = props => (\n <FullCalendar\n events={getEvents(props.calendars)}\n resources={getResources(props.calendars)}\n onDateRangeChange={props.onDateRangeChange}\n onCalendarRemove={props.onCalendarRemove}\n onCalendarRemoveAll={props.onCalendarRemoveAll}\n onEventClick={props.onEventClick}\n onRefresh={props.onRefresh}\n locale={props.locale}\n isLoading={props.isLoading}\n />\n)\n\nScheduler.propTypes = {\n calendars: PropTypes.arrayOf(\n PropTypes.shape({\n calendarType: PropTypes.string.isRequired,\n events: PropTypes.arrayOf(\n PropTypes.shape({\n description: PropTypes.string,\n start: PropTypes.number,\n end: PropTypes.number,\n allDay: PropTypes.bool\n })\n ),\n key: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n model: PropTypes.string.isRequired\n })\n ).isRequired,\n onDateRangeChange: PropTypes.func,\n onCalendarRemove: PropTypes.func,\n onCalendarRemoveAll: PropTypes.func,\n onEventClick: PropTypes.func,\n onRefresh: PropTypes.func,\n locale: PropTypes.string,\n isLoading: PropTypes.bool\n}\n\nexport default Scheduler\n","import Scheduler from './Scheduler'\n\nexport default Scheduler\n","export const SET_CALENDARS = 'scheduler/SET_CALENDARS'\nexport const ON_DATE_RANGE_CHANGE = 'scheduler/ON_DATE_RANGE_CHANGE'\nexport const ON_CALENDAR_REMOVE = 'scheduler/ON_CALENDAR_REMOVE'\nexport const ON_CALENDARS_REMOVE_ALL = 'scheduler/ON_CALENDARS_REMOVE_ALL'\nexport const ON_EVENT_CLICK = 'scheduler/ON_EVENT_CLICK'\nexport const ON_REFRESH = 'scheduler/ON_REFRESH'\nexport const REMOVE_EVENTS = 'scheduler/REMOVE_EVENTS'\nexport const SET_IS_LOADING = 'scheduler/SET_IS_LOADING'\n\nexport const setCalendars = calendars => ({\n type: SET_CALENDARS,\n payload: {\n calendars\n }\n})\n\nexport const onDateRangeChange = dateRange => ({\n type: ON_DATE_RANGE_CHANGE,\n payload: {\n dateRange\n }\n})\n\nexport const onCalendarRemoveAll = () => ({\n type: ON_CALENDARS_REMOVE_ALL\n})\n\nexport const onCalendarRemove = (id, entityModel) => ({\n type: ON_CALENDAR_REMOVE,\n payload: {\n id,\n entityModel\n }\n})\n\nexport const onEventClick = event => ({\n type: ON_EVENT_CLICK,\n payload: {\n event\n }\n})\n\nexport const onRefresh = () => ({\n type: ON_REFRESH\n})\n\nexport const removeEvents = () => ({\n type: REMOVE_EVENTS\n})\n\nexport const setIsLoading = isLoading => ({\n type: SET_IS_LOADING,\n payload: {\n isLoading\n }\n})\n","import {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\n\nimport Scheduler from '../components/Scheduler'\nimport {\n onDateRangeChange,\n onCalendarRemove,\n onCalendarRemoveAll,\n onEventClick,\n onRefresh\n} from '../modules/scheduler/actions'\n\nconst mapActionCreators = {\n onDateRangeChange,\n onCalendarRemove,\n onCalendarRemoveAll,\n onEventClick,\n onRefresh\n}\n\nconst mapStateToProps = (state, props) => {\n return {\n calendars: state.scheduler.calendars,\n locale: state.intl.locale,\n isLoading: state.scheduler.isLoading\n }\n}\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(Scheduler))\n","import {setCalendars} from './modules/scheduler/actions'\n\nexport const getDispatchActions = input => {\n const actions = []\n if (input.calendars) {\n actions.push(setCalendars(input.calendars))\n }\n\n return actions\n}\n","import {reducer as reducerUtil} from 'tocco-util'\n\nimport * as actions from './actions'\n\nconst removeEvents = state => ({\n ...state,\n calendars: state.calendars.map(calendar => ({...calendar, events: []}))\n})\n\nconst ACTION_HANDLERS = {\n [actions.SET_CALENDARS]: reducerUtil.singleTransferReducer('calendars'),\n [actions.SET_IS_LOADING]: reducerUtil.singleTransferReducer('isLoading'),\n [actions.REMOVE_EVENTS]: removeEvents\n}\n\nconst initialState = {\n calendars: [],\n isLoading: true\n}\n\nexport default function reducer(state = initialState, action) {\n const handler = ACTION_HANDLERS[action.type]\n return handler ? handler(state, action) : state\n}\n","import reducer from './reducer'\nimport sagas from './sagas'\n\nexport {sagas}\nexport default reducer\n","import {put, takeLatest, all} from 'redux-saga/effects'\nimport {externalEvents} from 'tocco-app-extensions'\n\nimport * as actions from './actions'\n\nexport default function* sagas() {\n yield all([\n takeLatest(actions.ON_DATE_RANGE_CHANGE, onDateRangeChange),\n takeLatest(actions.ON_CALENDAR_REMOVE, onCalendarRemove),\n takeLatest(actions.ON_CALENDARS_REMOVE_ALL, onCalendarRemoveAll),\n takeLatest(actions.ON_EVENT_CLICK, onEventClick),\n takeLatest(actions.ON_REFRESH, onRefresh),\n takeLatest(actions.SET_CALENDARS, setCalendars)\n ])\n}\n\nexport function* onDateRangeChange({payload}) {\n yield put(actions.setIsLoading(true))\n yield put(actions.removeEvents())\n const {dateRange} = payload\n yield put(externalEvents.fireExternalEvent('onDateRangeChange', {dateRange}))\n}\n\nexport function* onCalendarRemove({payload}) {\n yield put(actions.setIsLoading(true))\n yield put(externalEvents.fireExternalEvent('onCalendarRemove', {id: payload.id, entityModel: payload.entityModel}))\n}\n\nexport function* onCalendarRemoveAll() {\n yield put(actions.setIsLoading(true))\n yield put(externalEvents.fireExternalEvent('onCalendarRemoveAll'))\n}\n\nexport function* onEventClick({payload}) {\n const {\n event: {\n extendedProps: {entity}\n }\n } = payload\n if (entity) {\n yield put(externalEvents.fireExternalEvent('onEventClick', entity))\n }\n}\n\nexport function* onRefresh() {\n yield put(actions.setIsLoading(true))\n yield put(actions.removeEvents())\n yield put(externalEvents.fireExternalEvent('onRefresh'))\n}\n\nexport function* setCalendars() {\n yield put(actions.setIsLoading(false))\n}\n","import schedulerReducer, {sagas as schedulerSagas} from './scheduler'\n\nexport default {\n scheduler: schedulerReducer\n}\n\nexport const sagas = [schedulerSagas]\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport {appFactory, externalEvents} from 'tocco-app-extensions'\nimport {react, reducer as reducerUtil} from 'tocco-util'\n\nimport SchedulerContainer from './containers/SchedulerContainer'\nimport {getDispatchActions} from './input'\nimport reducers, {sagas} from './modules/reducers'\n\nconst packageName = 'scheduler'\n\nconst EXTERNAL_EVENTS = ['onDateRangeChange', 'onCalendarRemove', 'onCalendarRemoveAll', 'onEventClick', 'onRefresh']\n\nconst initApp = (id, input, events, publicPath) => {\n const content = <SchedulerContainer />\n\n const store = appFactory.createStore(reducers, sagas, input, packageName)\n\n externalEvents.addToStore(store, events)\n\n return appFactory.createApp(packageName, content, store, {\n input,\n events,\n actions: getDispatchActions(input),\n publicPath,\n textResourceModules: ['component', 'common', packageName]\n })\n}\n\n;(() => {\n if (__PACKAGE_NAME__ === 'scheduler') {\n appFactory.registerAppInRegistry(packageName, initApp)\n\n if (__DEV__) {\n const input = require('./dev/input.json')\n\n if (!__NO_MOCK__) {\n const fetchMock = require('fetch-mock').default\n fetchMock.config.overwriteRoutes = false\n const setupFetchMocks = require('./dev/fetchMocks').default\n setupFetchMocks(packageName, fetchMock)\n fetchMock.spy()\n }\n\n const app = initApp(input)\n\n if (module.hot) {\n module.hot.accept('./modules/reducers', () => {\n const reducers = require('./modules/reducers').default\n reducerUtil.hotReloadReducers(app.store, reducers)\n })\n }\n\n appFactory.renderApp(app.component)\n }\n }\n})()\n\nconst SchedulerApp = props => {\n const {component, store} = appFactory.useApp({initApp, props, packageName, externalEvents: EXTERNAL_EVENTS})\n\n react.useDidUpdate(() => {\n getDispatchActions(props).forEach(action => {\n if (component != null) {\n store.dispatch(action)\n }\n })\n }, [props])\n\n return component\n}\n\nSchedulerApp.propTypes = {\n calendars: PropTypes.arrayOf(\n PropTypes.shape({\n calendarType: PropTypes.string.isRequired,\n events: PropTypes.arrayOf(\n PropTypes.shape({\n description: PropTypes.string,\n start: PropTypes.number,\n end: PropTypes.number,\n allDay: PropTypes.bool\n })\n ),\n key: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n model: PropTypes.string.isRequired\n })\n ),\n ...EXTERNAL_EVENTS.reduce((propTypes, event) => ({...propTypes, [event]: PropTypes.func}), {}),\n locale: PropTypes.string\n}\n\nexport default SchedulerApp\n","export const SET_CALENDAR_TYPES = 'resourceScheduler/SET_CALENDAR_TYPES'\nexport const LOAD_CALENDAR_TYPES = 'resourceScheduler/LOAD_CALENDAR_TYPES'\nexport const INITIALIZE = 'resourceScheduler/INITIALIZE'\nexport const SEARCH_SELECTION_CHANGED = 'resourceScheduler/SEARCH_SELECTION_CHANGED'\nexport const UPDATE_REQUESTED_CALENDARS = 'resourceScheduler/UPDATE_REQUESTED_CALENDARS'\nexport const SET_CALENDARS = 'resourceScheduler/SET_CALENDARS'\nexport const SET_DATE_RANGE = 'resourceScheduler/SET_DATE_RANGE'\nexport const REMOVE_REQUESTED_CALENDAR = 'resourceScheduler/REMOVE_REQUESTED_CALENDAR'\nexport const REMOVE_ALL_CALENDARS = 'resourceScheduler/REMOVE_ALL_CALENDARS'\nexport const ON_EVENT_CLICK = 'resourceScheduler/ON_EVENT_CLICK'\nexport const ON_REFRESH = 'resourceScheduler/ON_REFRESH'\nexport const SET_HANDLE_NOTIFICATIONS = 'resourceScheduler/SET_HANDLE_NOTIFICATIONS'\n\nexport const initialize = () => ({\n type: INITIALIZE\n})\n\nexport const setCalendarTypes = calendarTypes => ({\n type: SET_CALENDAR_TYPES,\n payload: {\n calendarTypes\n }\n})\n\nexport const loadCalendarTypes = () => ({\n type: LOAD_CALENDAR_TYPES\n})\n\nexport const searchSelectionChanged = (calendarType, ids) => ({\n type: SEARCH_SELECTION_CHANGED,\n payload: {\n calendarType,\n ids\n }\n})\n\nexport const updateRequestedCalendars = (calendarType, ids) => ({\n type: UPDATE_REQUESTED_CALENDARS,\n payload: {\n calendarType,\n ids\n }\n})\n\nexport const setCalendars = calendars => ({\n type: SET_CALENDARS,\n payload: {\n calendars\n }\n})\n\nexport const setDateRange = dateRange => ({\n type: SET_DATE_RANGE,\n payload: {\n dateRange\n }\n})\n\nexport const removeRequestedCalendar = (entityModel, id) => ({\n type: REMOVE_REQUESTED_CALENDAR,\n payload: {\n entityModel,\n id\n }\n})\n\nexport const removeAllCalendars = () => ({\n type: REMOVE_ALL_CALENDARS\n})\n\nexport const onEventClick = (model, key) => ({\n type: ON_EVENT_CLICK,\n payload: {\n model,\n key\n }\n})\n\nexport const onRefresh = () => ({\n type: ON_REFRESH\n})\n\nexport const setHandleNotifications = handleNotifications => ({\n type: SET_HANDLE_NOTIFICATIONS,\n payload: {\n handleNotifications\n }\n})\n","import {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\nimport SchedulerApp from 'tocco-scheduler/src/main'\n\nimport {\n setDateRange,\n removeRequestedCalendar,\n removeAllCalendars,\n onEventClick,\n onRefresh\n} from '../modules/resourceScheduler/actions'\n\nconst mapActionCreators = {\n onDateRangeChange: ({dateRange}) => setDateRange(dateRange),\n onCalendarRemove: ({entityModel, id}) => removeRequestedCalendar(entityModel, id),\n onCalendarRemoveAll: removeAllCalendars,\n onEventClick: ({model, key}) => onEventClick(model, key),\n onRefresh\n}\n\nconst mapStateToProps = (state, props) => {\n return {\n calendars: state.resourceScheduler.calendars,\n locale: state.intl.locale\n }\n}\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(SchedulerApp))\n","import PropTypes from 'prop-types'\nimport React, {memo} from 'react'\nimport EntityListApp from 'tocco-entity-list/src/main'\nimport {design, Icon, Panel, Typography} from 'tocco-ui'\n\nconst PanelHeaderContent = ({color, label}) => (\n <Typography.Span>\n <Icon\n icon={color ? 'square-full' : 'square'}\n aria-hidden=\"true\"\n style={{...(color ? {color} : {})}}\n position={design.position.PREPEND}\n />{' '}\n {label}\n </Typography.Span>\n)\n\nPanelHeaderContent.propTypes = {\n color: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired\n}\n\nconst SearchPanel = ({updateRequestedCalendars, locale, requestedCalendars, calendarTypes, emitAction}) => {\n const handleSelect = name => selection => {\n updateRequestedCalendars(name, selection)\n }\n\n const getSearchLists = calendarTypes =>\n calendarTypes.map(calendarType => (\n <Panel.Wrapper key={calendarType.name}>\n <Panel.Header>\n <PanelHeaderContent color={calendarType.color} label={calendarType.label} />\n </Panel.Header>\n <Panel.Body>\n <EntityListApp\n emitAction={emitAction}\n locale={locale}\n id={`search-panel-${calendarType.name}`}\n entityName={calendarType.targetEntity}\n formName={calendarType.formBase}\n limit={15}\n showSearchForm={true}\n selectable={true}\n selection={requestedCalendars ? requestedCalendars[calendarType.name] || [] : []}\n onSelectChange={handleSelect(calendarType.name)}\n simpleSearchFields=\"txtFulltext, searchFilter\"\n disableSelectionController\n showActions={false}\n scrollBehaviour=\"none\"\n />\n </Panel.Body>\n </Panel.Wrapper>\n ))\n\n return <Panel.Group>{getSearchLists(calendarTypes)}</Panel.Group>\n}\n\nSearchPanel.propTypes = {\n updateRequestedCalendars: PropTypes.func.isRequired,\n calendarTypes: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string.isRequired,\n formBase: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired,\n targetEntity: PropTypes.string.isRequired,\n color: PropTypes.string\n })\n ),\n requestedCalendars: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)),\n locale: PropTypes.string,\n emitAction: PropTypes.func.isRequired\n}\n\nexport default memo(SearchPanel)\n","import styled from 'styled-components'\nimport {scale, StyledScrollbar, theme} from 'tocco-ui'\n\nconst drawerSymbol =\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==' // eslint-disable-line max-len\n\nexport const resizerStyle = {\n background: `transparent url(${drawerSymbol}) 50% no-repeat`,\n width: '11px',\n cursor: 'col-resize'\n}\n\nexport const StyledSplitPanelWrapperLeft = styled.div`\n && {\n background-color: ${theme.color('paper')};\n height: 100%;\n overflow: auto;\n padding-right: ${scale.space(-1)};\n padding-left: ${scale.space(-1)};\n padding-top: ${scale.space(-1)};\n ${StyledScrollbar}\n }\n`\n\nexport const StyledSplitPanelWrapperRight = styled.div`\n && {\n background-color: ${theme.color('paper')};\n height: 100%;\n overflow: auto;\n padding-left: ${scale.space(-1)};\n padding-right: ${scale.space(-1)};\n ${StyledScrollbar}\n }\n`\n","import PropTypes from 'prop-types'\nimport React, {useEffect} from 'react'\nimport SplitPane from 'react-split-pane'\nimport styled from 'styled-components'\nimport {notification} from 'tocco-app-extensions'\nimport {scale} from 'tocco-ui'\n\nimport SchedulerAppContainer from '../../containers/SchedulerAppContainer'\nimport SearchPanel from '../SearchPanel/SearchPanel'\nimport {resizerStyle, StyledSplitPanelWrapperLeft, StyledSplitPanelWrapperRight} from './StyledResourceScheduler'\n\nconst StyledSplitPane = styled(SplitPane)`\n position: static !important;\n\n .react-bs-container-body {\n height: auto !important;\n margin-bottom: ${scale.space(0)};\n }\n`\n\nconst ResourceScheduler = ({\n initialize,\n locale,\n calendarTypes,\n updateRequestedCalendars,\n requestedCalendars,\n handleNotifications,\n emitAction\n}) => {\n useEffect(() => {\n initialize()\n }, [])\n\n return (\n <>\n {handleNotifications && <notification.Notifications />}\n <StyledSplitPane defaultSize={325} minSize={325} resizerStyle={resizerStyle} split=\"vertical\">\n <StyledSplitPanelWrapperLeft>\n <SearchPanel\n locale={locale}\n calendarTypes={calendarTypes}\n updateRequestedCalendars={updateRequestedCalendars}\n requestedCalendars={requestedCalendars}\n emitAction={emitAction}\n />\n </StyledSplitPanelWrapperLeft>\n <StyledSplitPanelWrapperRight>\n <SchedulerAppContainer />\n </StyledSplitPanelWrapperRight>\n </StyledSplitPane>\n </>\n )\n}\n\nResourceScheduler.propTypes = {\n initialize: PropTypes.func.isRequired,\n handleNotifications: PropTypes.bool.isRequired,\n updateRequestedCalendars: PropTypes.func.isRequired,\n removeRequestedCalendar: PropTypes.func.isRequired,\n setDateRange: PropTypes.func.isRequired,\n calendars: PropTypes.arrayOf(\n PropTypes.shape({\n calendarType: PropTypes.string.isRequired,\n events: PropTypes.arrayOf(\n PropTypes.shape({\n description: PropTypes.string,\n start: PropTypes.number,\n end: PropTypes.number,\n allDay: PropTypes.bool\n })\n ),\n key: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n model: PropTypes.string.isRequired\n })\n ),\n calendarTypes: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string.isRequired,\n formBase: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired,\n targetEntity: PropTypes.string.isRequired,\n color: PropTypes.string\n })\n ),\n requestedCalendars: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)),\n locale: PropTypes.string,\n emitAction: PropTypes.func.isRequired\n}\n\nexport default ResourceScheduler\n","import ResourceScheduler from './ResourceScheduler'\n\nexport default ResourceScheduler\n","import {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\nimport {actionEmitter} from 'tocco-app-extensions'\n\nimport ResourceScheduler from '../components/ResourceScheduler'\nimport {\n initialize,\n updateRequestedCalendars,\n setDateRange,\n removeRequestedCalendar\n} from '../modules/resourceScheduler/actions'\n\nconst mapActionCreators = {\n initialize,\n updateRequestedCalendars,\n setDateRange,\n removeRequestedCalendar,\n emitAction: action => actionEmitter.dispatchEmittedAction(action)\n}\n\nconst mapStateToProps = state => {\n return {\n calendars: state.resourceScheduler.calendars,\n calendarTypes: state.resourceScheduler.calendarTypes,\n requestedCalendars: state.resourceScheduler.requestedCalendars,\n handleNotifications: state.resourceScheduler.handleNotifications,\n locale: state.intl.locale\n }\n}\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(ResourceScheduler))\n","import _omit from 'lodash/omit'\nimport {reducer as reducerUtil} from 'tocco-util'\n\nimport * as actions from './actions'\n\nconst updateRequestedCalendars = (state, {payload: {ids, calendarType}}) => ({\n ...state,\n requestedCalendars: {\n ..._omit(state.requestedCalendars, [calendarType]),\n ...(ids.length > 0 ? {[calendarType]: ids} : {})\n }\n})\n\nconst removeRequestedCalendar = (state, {payload}) => {\n const {id, entityModel} = payload\n\n const typesToRemove = state.calendarTypes.filter(type => type.targetEntity === entityModel).map(type => type.name)\n return {\n ...state,\n requestedCalendars: {\n ...Object.keys(state.requestedCalendars).reduce((acc, calendarType) => {\n const adjustedValue = state.requestedCalendars[calendarType].filter(\n key => !typesToRemove.includes(calendarType) || key !== id\n )\n\n return {\n ...acc,\n ...(adjustedValue.length > 0 && {[calendarType]: adjustedValue})\n }\n }, {})\n }\n }\n}\n\nconst removeAllCalendars = state => {\n return {\n ...state,\n requestedCalendars: {},\n calendars: []\n }\n}\n\nconst ACTION_HANDLERS = {\n [actions.SET_CALENDAR_TYPES]: reducerUtil.singleTransferReducer('calendarTypes'),\n [actions.SET_CALENDARS]: reducerUtil.singleTransferReducer('calendars'),\n [actions.SET_DATE_RANGE]: reducerUtil.singleTransferReducer('dateRange'),\n [actions.SET_HANDLE_NOTIFICATIONS]: reducerUtil.singleTransferReducer('handleNotifications'),\n [actions.UPDATE_REQUESTED_CALENDARS]: updateRequestedCalendars,\n [actions.REMOVE_REQUESTED_CALENDAR]: removeRequestedCalendar,\n [actions.REMOVE_ALL_CALENDARS]: removeAllCalendars\n}\n\nconst initialState = {\n handleNotifications: false,\n calendarTypes: [],\n requestedCalendars: {},\n calendars: [],\n dateRange: {}\n}\n\nexport default function reducer(state = initialState, action) {\n const handler = ACTION_HANDLERS[action.type]\n return handler ? handler(state, action) : state\n}\n","import reducer from './reducer'\nimport sagas from './sagas'\n\nexport {sagas}\nexport default reducer\n","import _reduce from 'lodash/reduce'\n\nexport const transformRequestedCalendars = requestedCalendars =>\n _reduce(requestedCalendars, (result, keys, calendarTypeId) => [...result, {calendarTypeId, keys}], [])\n","import {call, put, takeLatest, all, select} from 'redux-saga/effects'\nimport {rest, externalEvents} from 'tocco-app-extensions'\n\nimport {transformRequestedCalendars} from '../../utils/rest'\nimport * as actions from './actions'\n\nexport const resourceSchedulerSelector = state => state.resourceScheduler\n\nexport default function* sagas() {\n yield all([\n takeLatest(actions.INITIALIZE, initialize),\n takeLatest(actions.UPDATE_REQUESTED_CALENDARS, retrieveCalendars),\n takeLatest(actions.SET_DATE_RANGE, retrieveCalendars),\n takeLatest(actions.REMOVE_REQUESTED_CALENDAR, retrieveCalendars),\n takeLatest(actions.ON_EVENT_CLICK, onEventClick),\n takeLatest(actions.ON_REFRESH, retrieveCalendars)\n ])\n}\n\nexport function* initialize() {\n yield call(loadCalendarTypes)\n}\n\nexport function* loadCalendarTypes() {\n const calendars = yield call(rest.requestSaga, 'calendar/types')\n yield put(actions.setCalendarTypes(calendars.body.data || []))\n}\n\nexport function* retrieveCalendars() {\n const {requestedCalendars, dateRange} = yield select(resourceSchedulerSelector)\n if (Object.keys(requestedCalendars).length > 0 && dateRange.startDate && dateRange.endDate) {\n const calendars = yield call(transformRequestedCalendars, requestedCalendars)\n const calendarsResponse = yield call(rest.requestSaga, 'calendar/events', {\n method: 'POST',\n body: {\n calendars,\n start: dateRange.startDate.getTime(),\n end: dateRange.endDate.getTime()\n }\n })\n\n yield put(actions.setCalendars(calendarsResponse.body.data))\n } else {\n yield put(actions.setCalendars([]))\n }\n}\n\nexport function* onEventClick({payload}) {\n yield put(externalEvents.fireExternalEvent('onEventClick', payload))\n}\n","import resourceSchedulerReducer, {sagas as resourceSchedulerSagas} from './resourceScheduler'\n\nexport default {\n resourceScheduler: resourceSchedulerReducer\n}\n\nexport const sagas = [resourceSchedulerSagas]\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport {\n actionEmitter,\n appFactory,\n cache,\n errorLogging,\n externalEvents,\n notification,\n selection as selectionPropType\n} from 'tocco-app-extensions'\nimport {GlobalStyles} from 'tocco-ui'\nimport {reducer as reducerUtil} from 'tocco-util'\n\nimport ResourceSchedulerContainer from './containers/ResourceSchedulerContainer'\nimport reducers, {sagas} from './modules/reducers'\nimport {setHandleNotifications, updateRequestedCalendars} from './modules/resourceScheduler/actions'\n\nconst packageName = 'resource-scheduler'\n\nconst EXTERNAL_EVENTS = ['onEventClick']\n\nconst initApp = (id, input, events, publicPath) => {\n const content = (\n <>\n <GlobalStyles />\n <ResourceSchedulerContainer />\n </>\n )\n const store = appFactory.createStore(reducers, sagas, input, packageName)\n externalEvents.addToStore(store, events)\n actionEmitter.addToStore(store, events.emitAction)\n\n const handleNotifications = !events.emitAction\n\n notification.addToStore(store, handleNotifications)\n errorLogging.addToStore(store, handleNotifications)\n cache.addToStore(store)\n\n const dispatchActions = [\n ...(input.selection &&\n input.selection.type === 'ID' &&\n input.actionProperties &&\n input.actionProperties.calendarType\n ? [updateRequestedCalendars(input.actionProperties.calendarType, input.selection.ids)]\n : []),\n setHandleNotifications(handleNotifications)\n ]\n\n return appFactory.createApp(packageName, content, store, {\n input,\n events,\n actions: dispatchActions,\n publicPath,\n textResourceModules: ['component', 'common', packageName, 'entity-list', 'scheduler']\n })\n}\n\n;(() => {\n if (__PACKAGE_NAME__ === 'resource-scheduler') {\n appFactory.registerAppInRegistry(packageName, initApp)\n\n if (__DEV__) {\n const input = require('./dev/input.json')\n\n if (!__NO_MOCK__) {\n const fetchMock = require('fetch-mock').default\n fetchMock.config.overwriteRoutes = false\n\n const setupFetchMocks = require('./dev/fetchMocks').default\n setupFetchMocks(packageName, fetchMock)\n }\n\n const app = initApp('dev', input, {})\n\n if (module.hot) {\n module.hot.accept('./modules/reducers', () => {\n const reducers = require('./modules/reducers').default\n reducerUtil.hotReloadReducers(app.store, reducers)\n })\n }\n\n appFactory.renderApp(app.component)\n }\n }\n})()\n\nconst ResourceSchedulerApp = props => {\n const {component} = appFactory.useApp({initApp, props, packageName: props.id, externalEvents: EXTERNAL_EVENTS})\n return component\n}\n\nResourceSchedulerApp.propTypes = {\n id: PropTypes.string,\n locale: PropTypes.string,\n onEventClick: PropTypes.func,\n selection: selectionPropType.propType,\n actionProperties: PropTypes.shape({\n calendarType: PropTypes.string\n })\n}\n\nexport default ResourceSchedulerApp\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport {selection as selectionPropType} from 'tocco-app-extensions'\nimport ResourceSchedulerApp from 'tocco-resource-scheduler/src/main'\n\nimport {goBack} from '../../../../../utils/routing'\n\nconst ResourceScheduler = ({match, selection, actionProperties, history}) => {\n const entityBaseUrl = goBack(match.url, 2)\n return (\n <ResourceSchedulerApp\n onEventClick={({model, key}) => {\n const url = history.createHref({pathname: `${entityBaseUrl}/${model}/${key}`})\n window.open(url, '_blank')\n }}\n selection={selection}\n actionProperties={actionProperties}\n />\n )\n}\n\nResourceScheduler.propTypes = {\n match: PropTypes.shape({\n url: PropTypes.string\n }).isRequired,\n selection: selectionPropType.propType,\n actionProperties: PropTypes.shape({\n calendarType: PropTypes.string\n }),\n history: PropTypes.shape({\n createHref: PropTypes.func.isRequired\n }).isRequired\n}\n\nexport default ResourceScheduler\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport {Redirect} from 'react-router-dom'\n\nconst ShowOutputJobsAction = props => (\n <Redirect\n to={{\n pathname: '/e/Output_job/list',\n search: `tql=${encodeURIComponent(`entity==\"${props.selection.entityName}\"`)}`\n }}\n />\n)\n\nShowOutputJobsAction.propTypes = {\n selection: PropTypes.shape({\n entityName: PropTypes.string.isRequired\n }).isRequired\n}\n\nexport default ShowOutputJobsAction\n","export const buildUserMecardString = data => {\n let string = `MECARD:N:${data.lastname},${data.firstname};`\n\n string = appendField(data, 'c_address', 'ADR', string, address => address.replace(/\\s*<br\\s?\\/?>\\s*/gi, ','))\n string = appendField(data, 'phone_mobile', 'TEL', string)\n string = appendField(data, 'phone_company', 'TEL', string)\n string = appendField(data, 'phone_private', 'TEL', string)\n string = appendField(data, 'email', 'EMAIL', string)\n string = appendField(data, 'email_alternative', 'EMAIL', string)\n string = appendField(data, 'birthdate', 'BDAY', string, date => date.replace(/-/gi, ''))\n\n return string\n}\n\nconst appendField = (data, fieldName, outputPrefix, output, handler = fieldData => fieldData) => {\n if (data[fieldName] && data[fieldName].length > 0) {\n output += `${outputPrefix}:${handler(data[fieldName])};`\n }\n return output\n}\n","import PropTypes from 'prop-types'\nimport React, {useEffect} from 'react'\nimport {FormattedMessage} from 'react-intl'\nimport styled from 'styled-components'\nimport {QRCode, LoadingSpinner, Typography} from 'tocco-ui'\n\nimport {buildUserMecardString} from '../../utils/qrCodeUtils'\n\nconst StyledContainer = styled.div`\n width: 148px;\n height: 148px;\n position: relative;\n align-self: center;\n`\n\nconst StyledContent = styled.div`\n margin: 0;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n`\n\nconst UserQrCode = ({data, fetchData}) => {\n useEffect(() => {\n fetchData()\n }, [])\n\n let content\n\n if (data === undefined) {\n content = <LoadingSpinner />\n } else if (data === null) {\n content = (\n <Typography.P>\n <FormattedMessage id=\"client.user-qr-action.fetchFailed\" />\n </Typography.P>\n )\n } else {\n const string = buildUserMecardString(data)\n content = <QRCode value={string} />\n }\n\n return (\n <StyledContainer>\n <StyledContent>{content}</StyledContent>\n </StyledContainer>\n )\n}\n\nUserQrCode.propTypes = {\n data: PropTypes.shape({\n firstname: PropTypes.string.isRequired,\n lastname: PropTypes.string.isRequired,\n c_address: PropTypes.string,\n phone_mobile: PropTypes.string,\n phone_company: PropTypes.string,\n phone_private: PropTypes.string,\n email: PropTypes.string,\n email_alternative: PropTypes.string,\n birthdate: PropTypes.string\n }),\n fetchData: PropTypes.func.isRequired\n}\n\nexport default UserQrCode\n","import UserQrCode from './UserQrCode'\n\nexport default UserQrCode\n","export const FETCH_DATA = 'qrCode/FETCH_DATA'\nexport const SET_DATA = 'qrCode/SET_DATA'\n\nexport const fetchData = () => ({\n type: FETCH_DATA\n})\n\nexport const setData = data => ({\n type: SET_DATA,\n payload: {\n data\n }\n})\n","import {connect} from 'react-redux'\n\nimport UserQrCode from '../components/UserQrCode'\nimport {fetchData} from '../modules/qrCode'\n\nconst mapActionCreators = {\n fetchData\n}\n\nconst mapStateToProps = state => ({\n data: state.qrCode.data\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(UserQrCode)\n","import {reducer as reducerUtil} from 'tocco-util'\n\nimport * as actions from './actions'\n\nconst ACTION_HANDLERS = {\n [actions.SET_DATA]: reducerUtil.singleTransferReducer('data')\n}\n\nconst initialState = {\n data: undefined\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 {fetchData} from './actions'\nimport reducer from './reducer'\nimport sagas from './sagas'\n\nexport {fetchData}\nexport {sagas}\nexport default reducer\n","import {all, call, put, select, takeEvery} from 'redux-saga/effects'\nimport {rest, selection as selectionUtil} from 'tocco-app-extensions'\nimport {consoleLogger} from 'tocco-util'\n\nimport * as actions from './actions'\n\nexport const inputSelector = state => state.input\n\nexport default function* sagas() {\n yield all([takeEvery(actions.FETCH_DATA, fetchData)])\n}\n\nexport function* fetchData() {\n const {selection} = yield select(inputSelector)\n\n const userKey = selectionUtil.getSingleKey(selection, 'User')\n\n const query = {\n paths: [\n 'firstname',\n 'lastname',\n 'c_address',\n 'phone_mobile',\n 'phone_company',\n 'phone_private',\n 'email',\n 'email_alternative',\n 'birthdate'\n ]\n }\n\n try {\n const entity = yield call(rest.fetchEntity, 'User', userKey, query)\n\n let data = null\n\n if (entity) {\n data = {}\n Object.entries(entity.paths).forEach(([path, bean]) => {\n if (bean && bean.value) {\n data[path] = bean.value\n }\n })\n }\n\n yield put(actions.setData(data))\n } catch (e) {\n consoleLogger.logError('Failed to fetch data', e)\n yield put(actions.setData(null))\n }\n}\n","import qrCodeReducer, {sagas as qrCodeSagas} from './qrCode'\n\nexport default {\n qrCode: qrCodeReducer\n}\n\nexport const sagas = [qrCodeSagas]\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport {appFactory} from 'tocco-app-extensions'\nimport {reducer as reducerUtil} from 'tocco-util'\n\nimport UserQrCode from './containers/UserQrCodeContainer'\nimport reducers, {sagas} from './modules/reducers'\n\nconst packageName = 'user-qr-action'\n\nconst initApp = (id, input, events, publicPath) => {\n const content = <UserQrCode selection={input.selection} />\n\n const store = appFactory.createStore(reducers, sagas, input, packageName)\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 (__PACKAGE_NAME__ === packageName) {\n appFactory.registerAppInRegistry(packageName, initApp)\n\n if (__DEV__) {\n const input = require('./dev/input.json')\n\n if (!__NO_MOCK__) {\n const fetchMock = require('fetch-mock').default\n fetchMock.config.overwriteRoutes = false\n const setupFetchMocks = require('./dev/fetchMocks').default\n setupFetchMocks(packageName, fetchMock)\n fetchMock.spy()\n }\n\n const app = initApp(packageName, input)\n\n if (module.hot) {\n module.hot.accept('./modules/reducers', () => {\n const reducers = require('./modules/reducers').default\n reducerUtil.hotReloadReducers(app.store, reducers)\n })\n }\n\n appFactory.renderApp(app.component)\n }\n }\n})()\n\nconst UserQrActionApp = props => {\n const {component} = appFactory.useApp({initApp, props, packageName})\n return component\n}\n\nUserQrActionApp.propTypes = {\n selection: PropTypes.object\n}\n\nexport default UserQrActionApp\n","export const FETCH_WIDGET_CONFIG = 'widgetCode/FETCH_WIDGET_CONFIG'\nexport const SET_WIDGET_CONFIG = 'widgetCode/SET_WIDGET_CONFIG'\nexport const COPY_WIDGET_CODE = 'widgetCode/COPY_WIDGET_CODE'\n\nexport const fetchWidgetConfig = () => ({\n type: FETCH_WIDGET_CONFIG\n})\n\nexport const setWidgetConfig = widgetConfig => ({\n type: SET_WIDGET_CONFIG,\n payload: {\n widgetConfig\n }\n})\n\nexport const copyWidgetCode = () => ({\n type: COPY_WIDGET_CODE\n})\n","const getBaseUrl = domain => {\n if (domain === 'localhost') {\n return 'http://localhost:8080'\n }\n\n // customer.tocco.ch => widget will be added in legacy cms\n if (domain.includes('.tocco.ch')) {\n return `https://${domain}`\n }\n\n return `https://tocco.${domain}`\n}\n\nexport const generateWidgetCode = widgetConfig => {\n const {key, paths} = widgetConfig\n const domain = paths?.domain?.value\n\n const widgetCode = `<div data-tocco-widget-key=\"${key}\"></div>\n<script src=\"${getBaseUrl(domain)}/js/tocco-widget-utils/dist/bootstrap.js\" />`\n\n return widgetCode\n}\n","import styled from 'styled-components'\nimport {scale, StyledCode} from 'tocco-ui'\n\nexport const StyledWidgetCode = styled(StyledCode)`\n && {\n white-space: pre;\n padding: ${scale.space(0.3)};\n }\n`\n\nexport const StyledButtonWrapper = styled.div`\n margin-top: ${scale.space(0.6)};\n display: flex;\n justify-content: flex-end;\n`\n","import PropTypes from 'prop-types'\nimport React, {useEffect} from 'react'\nimport {FormattedMessage} from 'react-intl'\nimport {Button, LoadMask} from 'tocco-ui'\n\nimport {generateWidgetCode} from '../utils/widgetCode'\nimport {StyledButtonWrapper, StyledWidgetCode} from './StyledComponents'\n\nconst WidgetCodeCopy = ({fetchWidgetConfig, copyWidgetCode, widgetConfig}) => {\n useEffect(() => {\n fetchWidgetConfig()\n }, [])\n\n return (\n <LoadMask required={[widgetConfig]}>\n {widgetConfig && (\n <>\n <StyledWidgetCode>{generateWidgetCode(widgetConfig)}</StyledWidgetCode>\n <StyledButtonWrapper>\n <Button type=\"button\" onClick={() => copyWidgetCode()} ink=\"primary\" look=\"raised\">\n <FormattedMessage id=\"client.widget-code-copy.copy\" />\n </Button>\n </StyledButtonWrapper>\n </>\n )}\n </LoadMask>\n )\n}\n\nWidgetCodeCopy.propTypes = {\n fetchWidgetConfig: PropTypes.func.isRequired,\n copyWidgetCode: PropTypes.func.isRequired,\n widgetConfig: PropTypes.object\n}\n\nexport default WidgetCodeCopy\n","import {injectIntl} from 'react-intl'\nimport {connect} from 'react-redux'\n\nimport {fetchWidgetConfig, copyWidgetCode} from '../modules/widgetCode/actions'\nimport WidgetCodeCopy from './WidgetCodeCopy'\n\nconst mapActionCreators = {\n fetchWidgetConfig,\n copyWidgetCode\n}\n\nconst mapStateToProps = state => ({\n widgetConfig: state.widgetCode.widgetConfig\n})\n\nexport default connect(mapStateToProps, mapActionCreators)(injectIntl(WidgetCodeCopy))\n","import {reducer as reducerUtil} from 'tocco-util'\n\nimport * as actions from './actions'\n\nconst ACTION_HANDLERS = {\n [actions.SET_WIDGET_CONFIG]: reducerUtil.singleTransferReducer('widgetConfig')\n}\n\nconst initialState = {\n widgetConfig: undefined\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 {fetchWidgetConfig} from './actions'\nimport reducer from './reducer'\nimport sagas from './sagas'\n\nexport {fetchWidgetConfig}\nexport {sagas}\nexport default reducer\n","import {all, call, put, select, takeEvery, takeLatest} from 'redux-saga/effects'\nimport {rest, notification, selection as selectionUtil} from 'tocco-app-extensions'\nimport {js, consoleLogger} from 'tocco-util'\n\nimport {generateWidgetCode} from '../../utils/widgetCode'\nimport * as actions from './actions'\n\nexport const inputSelector = state => state.input\nexport const widgetCodeSelector = state => state.widgetCode\n\nexport default function* sagas() {\n yield all([\n takeEvery(actions.FETCH_WIDGET_CONFIG, fetchWidgetConfig),\n takeLatest(actions.COPY_WIDGET_CODE, copyWidgetCode)\n ])\n}\n\nexport function* fetchWidgetConfig() {\n const {selection} = yield select(inputSelector)\n\n try {\n const widgetConfigKey = selectionUtil.getSingleKey(selection, 'Widget_config')\n const widgetConfig = yield call(rest.fetchEntity, 'Widget_config', widgetConfigKey, {paths: ['domain']})\n yield put(actions.setWidgetConfig(widgetConfig))\n } catch (err) {\n consoleLogger.logError('Failed to get selected Widget_config', err)\n yield put(\n notification.toaster({\n type: 'error',\n title: 'client.actions.widget-code-copy.toasterTitle',\n body: 'client.actions.widget-code-copy.fetchFailedMessage'\n })\n )\n }\n}\n\nexport function* copyWidgetCode() {\n const {widgetConfig} = yield select(widgetCodeSelector)\n try {\n const widgetCode = generateWidgetCode(widgetConfig)\n yield call(js.copyToClipboard, widgetCode)\n yield put(\n notification.toaster({\n type: 'success',\n title: 'client.actions.widget-code-copy.toasterTitle',\n body: 'client.actions.widget-code-copy.copiedMessage'\n })\n )\n } catch (err) {\n consoleLogger.logError('Failed to generate and copy widget code', err)\n yield put(\n notification.toaster({\n type: 'error',\n title: 'client.actions.widget-code-copy.toasterTitle',\n body: 'client.actions.widget-code-copy.copyFailedMessage'\n })\n )\n }\n}\n","import widgetCodeReducer, {sagas as widgetCodeSagas} from './widgetCode'\n\nexport default {\n widgetCode: widgetCodeReducer\n}\n\nexport const sagas = [widgetCodeSagas]\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport {appFactory, actionEmitter, externalEvents, notification} from 'tocco-app-extensions'\nimport {reducer as reducerUtil} from 'tocco-util'\n\nimport WidgetCodeCopy from './components/WidgetCodeCopyContainer'\nimport reducers, {sagas} from './modules/reducers'\n\nconst packageName = 'widget-code-copy'\n\nconst EXTERNAL_EVENTS = ['emitAction']\n\nconst initApp = (id, input, events, publicPath) => {\n const content = <WidgetCodeCopy />\n\n const store = appFactory.createStore(reducers, sagas, input, packageName)\n actionEmitter.addToStore(store, events.emitAction)\n notification.addToStore(store, false)\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 (__PACKAGE_NAME__ === packageName) {\n appFactory.registerAppInRegistry(packageName, initApp)\n\n if (__DEV__) {\n const input = require('./dev/input.json')\n\n if (!__NO_MOCK__) {\n const fetchMock = require('fetch-mock').default\n fetchMock.config.overwriteRoutes = false\n const setupFetchMocks = require('./dev/fetchMocks').default\n setupFetchMocks(packageName, fetchMock)\n fetchMock.spy()\n }\n\n const app = initApp(packageName, input)\n\n if (module.hot) {\n module.hot.accept('./modules/reducers', () => {\n const reducers = require('./modules/reducers').default\n reducerUtil.hotReloadReducers(app.store, reducers)\n })\n }\n\n appFactory.renderApp(app.component)\n }\n }\n})()\n\nconst WidgetCodeCopyApp = props => {\n const {component} = appFactory.useApp({initApp, props, packageName, externalEvents: EXTERNAL_EVENTS})\n return component\n}\n\nWidgetCodeCopyApp.propTypes = {\n selection: PropTypes.object.isRequired\n}\n\nexport default WidgetCodeCopyApp\n"],"sourceRoot":""}
|