@configuratorware/configurator-admingui 1.28.4 → 1.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/App/Api.js +315 -0
- package/App/Config/app.js +96 -0
- package/App/Config/defaultConfig.js +122 -0
- package/App/Config/icons.js +27 -0
- package/App/Config/network.js +20 -0
- package/App/Data.js +473 -0
- package/App/Entity.js +88 -0
- package/App/ErrorBoundary.js +126 -0
- package/App/FeatureReducers.js +62 -0
- package/App/Frame.js +133 -0
- package/App/Listeners.js +56 -0
- package/App/Main.js +321 -0
- package/App/Reducers/Api/Actions.js +262 -0
- package/App/Reducers/Api/Helpers.js +108 -0
- package/App/Reducers/Api/Reducer.js +109 -0
- package/App/Reducers/Common/Form/Actions.js +17 -0
- package/App/Reducers/Common/Form/Reducer.js +63 -0
- package/App/Reducers/Common/Language/Actions.js +17 -0
- package/App/Reducers/Common/Language/Reducer.js +48 -0
- package/App/Reducers/Common/OrderList/Actions.js +96 -0
- package/App/Reducers/Common/OrderList/Listener.js +37 -0
- package/App/Reducers/Common/OrderList/Reducer.js +100 -0
- package/App/Reducers/Common/index.js +19 -0
- package/App/Reducers/Config/Actions.js +18 -0
- package/App/Reducers/Config/Reducer.js +35 -0
- package/App/Reducers/Entity/Actions.js +660 -0
- package/App/Reducers/Entity/Reducer.js +379 -0
- package/App/Reducers/Frame/Actions.js +42 -0
- package/App/Reducers/Frame/Reducer.js +120 -0
- package/App/Reducers/index.js +51 -0
- package/App/ReduxListener.js +52 -0
- package/App/ReduxPersistLoader.js +26 -0
- package/App/Routes.js +73 -0
- package/App/Selectors/Credentials/hasCredentialFor.js +11 -0
- package/App/Services/ElementRef.js +28 -0
- package/App/Services/WindowCommunication.js +73 -0
- package/App/Services/index.js +15 -0
- package/App/Store.js +94 -0
- package/App/Styles.scss +185 -0
- package/App/TestHelpers.js +131 -0
- package/App/ThemeProvider.js +74 -0
- package/App/Translations.js +147 -0
- package/App/Utils.js +41 -0
- package/App/customSetup.js +21 -0
- package/App/i18n.js +307 -0
- package/App/index.js +80 -0
- package/App/initServices.js +92 -0
- package/App/setup.js +22 -0
- package/AppContainer.js +30 -0
- package/Components/AddButton.js +28 -0
- package/Components/AppBar.js +85 -0
- package/Components/CallToActionField.js +171 -0
- package/Components/CopyPaste.js +108 -0
- package/Components/DefaultConnectedForm.js +109 -0
- package/Components/DefaultConnectedList.js +147 -0
- package/Components/DefaultConnectedScreen.js +59 -0
- package/Components/DefaultForm.js +99 -0
- package/Components/DefaultList.js +345 -0
- package/Components/DefaultScreen.js +203 -0
- package/Components/Error.js +30 -0
- package/Components/Form.js +383 -0
- package/Components/FormFragments/AutoComplete.js +308 -0
- package/Components/FormFragments/AutocompleteEntity.js +294 -0
- package/Components/FormFragments/Checkbox.js +34 -0
- package/Components/FormFragments/Chip.js +249 -0
- package/Components/FormFragments/DatePicker.js +26 -0
- package/Components/FormFragments/DateTimePicker.js +27 -0
- package/Components/FormFragments/DynSourceInput.js +210 -0
- package/Components/FormFragments/ErrorWrapper.js +21 -0
- package/Components/FormFragments/File.js +231 -0
- package/Components/FormFragments/HintText.js +31 -0
- package/Components/FormFragments/InlineAddButton.js +213 -0
- package/Components/FormFragments/InputArray.js +349 -0
- package/Components/FormFragments/InputGroup.js +62 -0
- package/Components/FormFragments/InputWithSource.js +68 -0
- package/Components/FormFragments/IntlInput.js +211 -0
- package/Components/FormFragments/Label.js +32 -0
- package/Components/FormFragments/MarkDown.js +163 -0
- package/Components/FormFragments/MonacoEditor.js +119 -0
- package/Components/FormFragments/NestedDataComponent.js +232 -0
- package/Components/FormFragments/ObjectToggle.js +87 -0
- package/Components/FormFragments/RadioGroup.js +42 -0
- package/Components/FormFragments/Select.js +60 -0
- package/Components/FormFragments/SetInput.js +164 -0
- package/Components/FormFragments/SimpleNestedData.js +99 -0
- package/Components/FormFragments/SimpleTable.js +285 -0
- package/Components/FormFragments/SimpleTextEditor.js +43 -0
- package/Components/FormFragments/Styles.scss +119 -0
- package/Components/FormFragments/Tabs.js +307 -0
- package/Components/FormFragments/Text.js +43 -0
- package/Components/FormFragments/TimePicker.js +27 -0
- package/Components/FormFragments/Toggle.js +94 -0
- package/Components/FormFragments/TwoSideSelect.js +249 -0
- package/Components/FormFragments/Value.js +48 -0
- package/Components/FormFragments/index.js +138 -0
- package/Components/FormFragments/styles.js +38 -0
- package/Components/FormHooks/useDataSchema.js +68 -0
- package/Components/GeneralFragments/Box.js +25 -0
- package/Components/GeneralFragments/ConfigurationEditor.js +200 -0
- package/Components/GeneralFragments/ConfiguratorOverlay.js +111 -0
- package/Components/GeneralFragments/Content.js +25 -0
- package/Components/GeneralFragments/Headline.js +32 -0
- package/Components/GeneralFragments/Image.js +94 -0
- package/Components/GeneralFragments/MiniPopup.js +202 -0
- package/Components/GeneralFragments/Styles.scss +8 -0
- package/Components/GeneralFragments/index.js +39 -0
- package/Components/InputHelpers.js +17 -0
- package/Components/Join.js +28 -0
- package/Components/LicenseInfo.js +136 -0
- package/Components/List.js +413 -0
- package/Components/ListColumnFilter.js +258 -0
- package/Components/LocaleSwitch.js +56 -0
- package/Components/LocalizedPriceTextField.js +83 -0
- package/Components/LocalizedPriceValue.js +38 -0
- package/Components/Menu.js +202 -0
- package/Components/ModalContainer.js +128 -0
- package/Components/OrderList.js +248 -0
- package/Components/OverlayContainer.js +34 -0
- package/Components/Pagination.js +175 -0
- package/Components/ProfileButton.js +65 -0
- package/Components/SearchBar.js +183 -0
- package/Components/SplitContainer.js +53 -0
- package/Components/Styles.scss +114 -0
- package/Components/TranslateComponent.js +231 -0
- package/Components/TranslationFinder.js +72 -0
- package/Components/Translations.js +89 -0
- package/Components/ValidatorCallbackProvider.js +102 -0
- package/Components/VersionBadge.js +44 -0
- package/Components/VersionUpdateChip.js +52 -0
- package/Components/withLoadAction.js +41 -0
- package/Components/withTranslationFinder.js +47 -0
- package/README.md +5 -6
- package/Screens/ApiKeys/Containers/Edit.js +162 -0
- package/Screens/ApiKeys/Containers/List.js +37 -0
- package/Screens/ApiKeys/Reducers/Actions.js +44 -0
- package/Screens/ApiKeys/Reducers/Reducer.js +61 -0
- package/Screens/ApiKeys/Screen.js +24 -0
- package/Screens/ApiKeys/Styles.scss +3 -0
- package/Screens/ApiKeys/Translations.js +24 -0
- package/Screens/ApiKeys/index.js +21 -0
- package/Screens/Assemblypointeditor/Components/AssemblypointTable.js +161 -0
- package/Screens/Assemblypointeditor/Components/Assemblypointeditor.js +813 -0
- package/Screens/Assemblypointeditor/Components/Styles.scss +58 -0
- package/Screens/Assemblypointeditor/Components/fabric.min.js +1 -0
- package/Screens/Assemblypointeditor/Containers/Edit.js +77 -0
- package/Screens/Assemblypointeditor/Containers/List.js +53 -0
- package/Screens/Assemblypointeditor/Reducers/Actions.js +72 -0
- package/Screens/Assemblypointeditor/Reducers/Reducer.js +157 -0
- package/Screens/Assemblypointeditor/Screen.js +52 -0
- package/Screens/Assemblypointeditor/Styles.scss +38 -0
- package/Screens/Assemblypointeditor/Translations.js +10 -0
- package/Screens/Assemblypointeditor/index.js +20 -0
- package/Screens/Attribute/Containers/Edit.js +46 -0
- package/Screens/Attribute/Containers/List.js +41 -0
- package/Screens/Attribute/Reducers/Actions.js +42 -0
- package/Screens/Attribute/Reducers/Reducer.js +44 -0
- package/Screens/Attribute/Screen.js +24 -0
- package/Screens/Attribute/Styles.scss +0 -0
- package/Screens/Attribute/Translations.js +22 -0
- package/Screens/Attribute/__tests/AttributeScreen.js +368 -0
- package/Screens/Attribute/index.js +20 -0
- package/Screens/AttributeValue/Containers/Edit.js +49 -0
- package/Screens/AttributeValue/Containers/List.js +48 -0
- package/Screens/AttributeValue/Reducers/Actions.js +21 -0
- package/Screens/AttributeValue/Reducers/Reducer.js +38 -0
- package/Screens/AttributeValue/Screen.js +34 -0
- package/Screens/AttributeValue/Styles.scss +0 -0
- package/Screens/AttributeValue/Translations.js +17 -0
- package/Screens/AttributeValue/__tests/AttributeValueScreen.js +346 -0
- package/Screens/AttributeValue/index.js +20 -0
- package/Screens/ChangePassword/Reducers/Actions.js +69 -0
- package/Screens/ChangePassword/Reducers/Reducer.js +39 -0
- package/Screens/ChangePassword/Screen.js +212 -0
- package/Screens/ChangePassword/Translations.js +22 -0
- package/Screens/ChangePassword/index.js +20 -0
- package/Screens/Channel/Containers/Edit.js +58 -0
- package/Screens/Channel/Containers/List.js +33 -0
- package/Screens/Channel/Reducers/Actions.js +19 -0
- package/Screens/Channel/Reducers/Reducer.js +59 -0
- package/Screens/Channel/Screen.js +28 -0
- package/Screens/Channel/Translations.js +18 -0
- package/Screens/Channel/__tests/ChannelScreen.js +363 -0
- package/Screens/Channel/index.js +20 -0
- package/Screens/Client/Components/ColorTextField.js +90 -0
- package/Screens/Client/Components/PdfMarkdownField.js +171 -0
- package/Screens/Client/Components/TextFields.js +163 -0
- package/Screens/Client/Containers/Edit.js +190 -0
- package/Screens/Client/Containers/List.js +44 -0
- package/Screens/Client/Reducers/Actions.js +118 -0
- package/Screens/Client/Reducers/Reducer.js +149 -0
- package/Screens/Client/Screen.js +34 -0
- package/Screens/Client/Styles.scss +3 -0
- package/Screens/Client/Translations.js +49 -0
- package/Screens/Client/index.js +20 -0
- package/Screens/ColorPalettes/Components/DefaultColorSwitch.js +126 -0
- package/Screens/ColorPalettes/Containers/Edit.js +156 -0
- package/Screens/ColorPalettes/Containers/List.js +57 -0
- package/Screens/ColorPalettes/Reducers/Actions.js +21 -0
- package/Screens/ColorPalettes/Reducers/Reducer.js +61 -0
- package/Screens/ColorPalettes/Screen.js +34 -0
- package/Screens/ColorPalettes/Styles.scss +0 -0
- package/Screens/ColorPalettes/Translations.js +24 -0
- package/Screens/ColorPalettes/index.js +20 -0
- package/Screens/ConfigurationTypeEditor/Containers/Edit.js +83 -0
- package/Screens/ConfigurationTypeEditor/Containers/List.js +64 -0
- package/Screens/ConfigurationTypeEditor/Reducers/Actions.js +137 -0
- package/Screens/ConfigurationTypeEditor/Reducers/Reducer.js +122 -0
- package/Screens/ConfigurationTypeEditor/Screen.js +150 -0
- package/Screens/ConfigurationTypeEditor/Styles.scss +0 -0
- package/Screens/ConfigurationTypeEditor/Translations.js +14 -0
- package/Screens/ConfigurationTypeEditor/index.js +3 -0
- package/Screens/ConfigurationVariants/Containers/Edit.js +127 -0
- package/Screens/ConfigurationVariants/Containers/List.js +33 -0
- package/Screens/ConfigurationVariants/Containers/Styles.scss +13 -0
- package/Screens/ConfigurationVariants/Reducers/Actions.js +25 -0
- package/Screens/ConfigurationVariants/Reducers/Reducer.js +66 -0
- package/Screens/ConfigurationVariants/Screen.js +28 -0
- package/Screens/ConfigurationVariants/Translations.js +31 -0
- package/Screens/ConfigurationVariants/index.js +20 -0
- package/Screens/ConfigurationWorkflowStatus/Containers/Edit.js +81 -0
- package/Screens/ConfigurationWorkflowStatus/Containers/List.js +259 -0
- package/Screens/ConfigurationWorkflowStatus/Reducers/Actions.js +119 -0
- package/Screens/ConfigurationWorkflowStatus/Reducers/Reducer.js +103 -0
- package/Screens/ConfigurationWorkflowStatus/Screen.js +100 -0
- package/Screens/ConfigurationWorkflowStatus/Styles.scss +0 -0
- package/Screens/ConfigurationWorkflowStatus/Translations.js +43 -0
- package/Screens/ConfigurationWorkflowStatus/index.js +22 -0
- package/Screens/ConfigurationWorkflowStatus/initServices.js +12 -0
- package/Screens/Creator/Components/BaseConfigurationEditor.js +241 -0
- package/Screens/Creator/Components/CheckData/ApiCalls.js +43 -0
- package/Screens/Creator/Components/CheckData/CheckData.js +332 -0
- package/Screens/Creator/Components/CheckData/Constants.js +58 -0
- package/Screens/Creator/Components/CheckData/Translations.js +34 -0
- package/Screens/Creator/Components/ComponentEditor.js +245 -0
- package/Screens/Creator/Components/ConfiguratorQuickView.js +102 -0
- package/Screens/Creator/Components/OptionPriceEditor.js +167 -0
- package/Screens/Creator/Components/OptionclassificationEditor.js +572 -0
- package/Screens/Creator/Components/Rules/Containers/Edit.js +276 -0
- package/Screens/Creator/Components/Rules/Containers/List.js +45 -0
- package/Screens/Creator/Components/Rules/Containers/RuleForms/AdditionalOption.js +88 -0
- package/Screens/Creator/Components/Rules/Containers/RuleForms/AttributeValueGroupAutoSwitch.js +88 -0
- package/Screens/Creator/Components/Rules/Containers/RuleForms/DefaultOption.js +84 -0
- package/Screens/Creator/Components/Rules/Containers/RuleForms/ItemAttributeMatch.js +84 -0
- package/Screens/Creator/Components/Rules/Containers/RuleForms/ItemAttributeMaxSum.js +76 -0
- package/Screens/Creator/Components/Rules/Containers/RuleForms/OptionClassificationMaxAmount.js +78 -0
- package/Screens/Creator/Components/Rules/Containers/RuleForms/OptionClassificationMinAmount.js +78 -0
- package/Screens/Creator/Components/Rules/Containers/RuleForms/OptionDependency.js +88 -0
- package/Screens/Creator/Components/Rules/Containers/RuleForms/OptionExclusion.js +88 -0
- package/Screens/Creator/Components/Rules/Containers/RuleForms/OptionMaxAmount.js +78 -0
- package/Screens/Creator/Components/Rules/Containers/RuleForms/RuleForm.js +240 -0
- package/Screens/Creator/Components/Rules/Containers/RuleForms/index.js +42 -0
- package/Screens/Creator/Components/Rules/Styles.scss +38 -0
- package/Screens/Creator/Components/Rules/Translations.js +178 -0
- package/Screens/Creator/Components/Rules/index.js +80 -0
- package/Screens/Creator/Components/ShowPreviewErrorDialog.js +59 -0
- package/Screens/Creator/Components/VisualizationAndMediaData/ApiCalls.js +43 -0
- package/Screens/Creator/Components/VisualizationAndMediaData/Components/ConfirmDelete.js +68 -0
- package/Screens/Creator/Components/VisualizationAndMediaData/Components/EditableText.js +144 -0
- package/Screens/Creator/Components/VisualizationAndMediaData/Components/Image.js +125 -0
- package/Screens/Creator/Components/VisualizationAndMediaData/Components/ImageEditTools.js +242 -0
- package/Screens/Creator/Components/VisualizationAndMediaData/Components/PathStructure.js +118 -0
- package/Screens/Creator/Components/VisualizationAndMediaData/Components/ViewEdit.js +102 -0
- package/Screens/Creator/Components/VisualizationAndMediaData/Translations.js +82 -0
- package/Screens/Creator/Components/VisualizationAndMediaData/VisualizationAndMediaData.js +1098 -0
- package/Screens/Creator/Components/VisualizationAndMediaData/dev.js +385 -0
- package/Screens/Creator/Components/VisualizationAndMediaData/devImages/component_1.png +0 -0
- package/Screens/Creator/Components/VisualizationAndMediaData/devImages/option_1.png +0 -0
- package/Screens/Creator/Components/VisualizationAndMediaData/devImages/option_3.png +0 -0
- package/Screens/Creator/Components/VisualizationAndMediaData/devImages/option_3_fullsize.jpg +0 -0
- package/Screens/Creator/Components/VisualizationAndMediaData/devImages/view_1.png +0 -0
- package/Screens/Creator/Components/VisualizationAndMediaData/devImages/view_1_option_1.png +0 -0
- package/Screens/Creator/Components/VisualizationAndMediaData/devImages/view_1_option_3.png +0 -0
- package/Screens/Creator/Components/VisualizationAndMediaData/devImages/view_2_option_1.png +0 -0
- package/Screens/Creator/Components/VisualizationAndMediaData/devImages/view_2_option_3.png +0 -0
- package/Screens/Creator/Components/VisualizationAndMediaData/index.js +15 -0
- package/Screens/Creator/Containers/Edit.js +525 -0
- package/Screens/Creator/Containers/List.js +48 -0
- package/Screens/Creator/Reducers/Actions.js +35 -0
- package/Screens/Creator/Reducers/ConfigurationActions.js +443 -0
- package/Screens/Creator/Reducers/ConfigurationReducer.js +338 -0
- package/Screens/Creator/Reducers/CreatorReducer.js +42 -0
- package/Screens/Creator/Reducers/Rules/Actions.js +134 -0
- package/Screens/Creator/Reducers/Rules/Reducer.js +290 -0
- package/Screens/Creator/Screen.js +30 -0
- package/Screens/Creator/Translations.js +136 -0
- package/Screens/Creator/index.js +25 -0
- package/Screens/CurrentClient/Containers/Edit.js +128 -0
- package/Screens/CurrentClient/Reducers/Actions.js +42 -0
- package/Screens/CurrentClient/Reducers/Reducer.js +95 -0
- package/Screens/CurrentClient/Screen.js +15 -0
- package/Screens/CurrentClient/Translations.js +10 -0
- package/Screens/CurrentClient/index.js +20 -0
- package/Screens/Dashboard/Screen.js +50 -0
- package/Screens/Dashboard/Styles.scss +3 -0
- package/Screens/Dashboard/Translations.js +14 -0
- package/Screens/DefaultClient/Containers/Edit.js +141 -0
- package/Screens/DefaultClient/Reducers/Actions.js +42 -0
- package/Screens/DefaultClient/Reducers/Reducer.js +108 -0
- package/Screens/DefaultClient/Screen.js +15 -0
- package/Screens/DefaultClient/Translations.js +10 -0
- package/Screens/DefaultClient/index.js +20 -0
- package/Screens/Demo/Screen.js +164 -0
- package/Screens/Demo/Styles.scss +3 -0
- package/Screens/Demo/index.js +15 -0
- package/Screens/DesignProductionMethods/Containers/Edit.js +292 -0
- package/Screens/DesignProductionMethods/Containers/List.js +53 -0
- package/Screens/DesignProductionMethods/Reducers/Actions.js +29 -0
- package/Screens/DesignProductionMethods/Reducers/DesignProductionMethodsReducer.js +160 -0
- package/Screens/DesignProductionMethods/Screen.js +30 -0
- package/Screens/DesignProductionMethods/Translations.js +74 -0
- package/Screens/DesignProductionMethods/index.js +20 -0
- package/Screens/DesignTemplateEditor/Containers/List.js +78 -0
- package/Screens/DesignTemplateEditor/Reducers/Actions.js +16 -0
- package/Screens/DesignTemplateEditor/Reducers/Reducer.js +22 -0
- package/Screens/DesignTemplateEditor/Screen.js +22 -0
- package/Screens/DesignTemplateEditor/Translations.js +16 -0
- package/Screens/DesignTemplateEditor/index.js +20 -0
- package/Screens/Designer/Components/ConfiguratorQuickView.js +102 -0
- package/Screens/Designer/Components/DesignDataTransfer.js +426 -0
- package/Screens/Designer/Components/TemplateDefaultList.js +423 -0
- package/Screens/Designer/Components/TemplateList.js +316 -0
- package/Screens/Designer/Containers/Edit.js +346 -0
- package/Screens/Designer/Containers/List.js +46 -0
- package/Screens/Designer/Containers/TemplateList.js +45 -0
- package/Screens/Designer/Reducers/Actions.js +41 -0
- package/Screens/Designer/Reducers/DesignerReducer.js +46 -0
- package/Screens/Designer/Screen.js +28 -0
- package/Screens/Designer/SubScreens/DesignAreas/Components/ColorPalettes.js +451 -0
- package/Screens/Designer/SubScreens/DesignAreas/Components/FormArray.js +260 -0
- package/Screens/Designer/SubScreens/DesignAreas/Components/MaskEditorField/InlineFileInput.js +72 -0
- package/Screens/Designer/SubScreens/DesignAreas/Components/MaskEditorField/MaskEditorCanvas.js +133 -0
- package/Screens/Designer/SubScreens/DesignAreas/Components/MaskEditorField/MaskEditorField.js +330 -0
- package/Screens/Designer/SubScreens/DesignAreas/Components/MaskEditorField/masks/circle.svg +4 -0
- package/Screens/Designer/SubScreens/DesignAreas/Components/MaskEditorField/withFileUpload.js +115 -0
- package/Screens/Designer/SubScreens/DesignAreas/Containers/ConnectedMaskEditorField.js +89 -0
- package/Screens/Designer/SubScreens/DesignAreas/Containers/Edit.js +174 -0
- package/Screens/Designer/SubScreens/DesignAreas/Containers/FormProductionMethods.js +1100 -0
- package/Screens/Designer/SubScreens/DesignAreas/Containers/List.js +50 -0
- package/Screens/Designer/SubScreens/DesignAreas/Reducers/Actions.js +106 -0
- package/Screens/Designer/SubScreens/DesignAreas/Reducers/Reducer.js +318 -0
- package/Screens/Designer/SubScreens/DesignAreas/Screen.js +34 -0
- package/Screens/Designer/SubScreens/DesignAreas/Styles.scss +0 -0
- package/Screens/Designer/SubScreens/DesignAreas/Translations.js +122 -0
- package/Screens/Designer/SubScreens/DesignAreas/Utils/getFreeFormUrl.js +18 -0
- package/Screens/Designer/SubScreens/DesignAreas/Utils/getMaskSrcByType.js +22 -0
- package/Screens/Designer/SubScreens/DesignAreas/Utils/maskTypes.js +12 -0
- package/Screens/Designer/SubScreens/DesignAreas/index.js +18 -0
- package/Screens/Designer/SubScreens/Designviews/Containers/Edit.js +216 -0
- package/Screens/Designer/SubScreens/Designviews/Containers/List.js +50 -0
- package/Screens/Designer/SubScreens/Designviews/Reducers/Actions.js +260 -0
- package/Screens/Designer/SubScreens/Designviews/Reducers/Reducer.js +167 -0
- package/Screens/Designer/SubScreens/Designviews/Screen.js +32 -0
- package/Screens/Designer/SubScreens/Designviews/Translations.js +16 -0
- package/Screens/Designer/SubScreens/Designviews/index.js +18 -0
- package/Screens/Designer/SubScreens/Visualization/ApiCalls.js +77 -0
- package/Screens/Designer/SubScreens/Visualization/Components/AdvancedShapeEditor.js +291 -0
- package/Screens/Designer/SubScreens/Visualization/Components/AreaEditor.js +305 -0
- package/Screens/Designer/SubScreens/Visualization/Components/EntryList.js +78 -0
- package/Screens/Designer/SubScreens/Visualization/Components/ExpansionContainer.js +138 -0
- package/Screens/Designer/SubScreens/Visualization/Components/Three2DEditor.js +802 -0
- package/Screens/Designer/SubScreens/Visualization/Components/VisualizationContainer.js +166 -0
- package/Screens/Designer/SubScreens/Visualization/Components/resources/logo.svg +120 -0
- package/Screens/Designer/SubScreens/Visualization/Components/resources/move.svg +1 -0
- package/Screens/Designer/SubScreens/Visualization/Components/resources/rotate-x.svg +1 -0
- package/Screens/Designer/SubScreens/Visualization/Components/resources/rotate-y.svg +1 -0
- package/Screens/Designer/SubScreens/Visualization/Components/resources/rotate-z.svg +1 -0
- package/Screens/Designer/SubScreens/Visualization/Components/resources/rotate.svg +1 -0
- package/Screens/Designer/SubScreens/Visualization/Components/resources/size.svg +1 -0
- package/Screens/Designer/SubScreens/Visualization/Containers/Edit/Constants.js +12 -0
- package/Screens/Designer/SubScreens/Visualization/Containers/Edit/DataLinks.js +160 -0
- package/Screens/Designer/SubScreens/Visualization/Containers/Edit/Edit.js +995 -0
- package/Screens/Designer/SubScreens/Visualization/Containers/Edit/VisualizationUtils.js +174 -0
- package/Screens/Designer/SubScreens/Visualization/Containers/Edit/calculateBoundingBoxSize.js +77 -0
- package/Screens/Designer/SubScreens/Visualization/Containers/List.js +192 -0
- package/Screens/Designer/SubScreens/Visualization/Screen.js +49 -0
- package/Screens/Designer/SubScreens/Visualization/Translations.js +80 -0
- package/Screens/Designer/SubScreens/Visualization/index.js +13 -0
- package/Screens/Designer/Translations.js +49 -0
- package/Screens/Designer/index.js +21 -0
- package/Screens/DesignerGlobalItemPrices/Containers/Edit.js +131 -0
- package/Screens/DesignerGlobalItemPrices/Containers/List.js +45 -0
- package/Screens/DesignerGlobalItemPrices/Reducers/Actions.js +32 -0
- package/Screens/DesignerGlobalItemPrices/Reducers/Reducer.js +94 -0
- package/Screens/DesignerGlobalItemPrices/Screen.js +32 -0
- package/Screens/DesignerGlobalItemPrices/Translations.js +24 -0
- package/Screens/DesignerGlobalItemPrices/index.js +21 -0
- package/Screens/Font/Containers/Edit.js +66 -0
- package/Screens/Font/Containers/List.js +63 -0
- package/Screens/Font/Reducers/Actions.js +101 -0
- package/Screens/Font/Reducers/Reducer.js +61 -0
- package/Screens/Font/Screen.js +34 -0
- package/Screens/Font/Styles.scss +0 -0
- package/Screens/Font/Translations.js +16 -0
- package/Screens/Font/index.js +20 -0
- package/Screens/Group/Containers/Edit.js +49 -0
- package/Screens/Group/Containers/List.js +39 -0
- package/Screens/Group/Reducers/Actions.js +24 -0
- package/Screens/Group/Reducers/Reducer.js +38 -0
- package/Screens/Group/Screen.js +34 -0
- package/Screens/Group/Styles.scss +0 -0
- package/Screens/Group/Translations.js +18 -0
- package/Screens/Group/index.js +21 -0
- package/Screens/GroupEntry/Containers/Edit.js +62 -0
- package/Screens/GroupEntry/Containers/List.js +39 -0
- package/Screens/GroupEntry/Reducers/Actions.js +24 -0
- package/Screens/GroupEntry/Reducers/Reducer.js +38 -0
- package/Screens/GroupEntry/Screen.js +34 -0
- package/Screens/GroupEntry/Styles.scss +0 -0
- package/Screens/GroupEntry/Translations.js +16 -0
- package/Screens/GroupEntry/index.js +21 -0
- package/Screens/ImageGallery/Containers/Edit.js +125 -0
- package/Screens/ImageGallery/Containers/List.js +297 -0
- package/Screens/ImageGallery/ImageTags/Actions.js +48 -0
- package/Screens/ImageGallery/ImageTags/Container/TagsEdit.js +38 -0
- package/Screens/ImageGallery/ImageTags/Editor.js +68 -0
- package/Screens/ImageGallery/ImageTags/Reducer.js +64 -0
- package/Screens/ImageGallery/ImageTags/TagsActions.js +42 -0
- package/Screens/ImageGallery/ImageTags/TagsEditorPopup.js +92 -0
- package/Screens/ImageGallery/Reducers/Actions.js +134 -0
- package/Screens/ImageGallery/Reducers/Reducer.js +69 -0
- package/Screens/ImageGallery/Screen.js +34 -0
- package/Screens/ImageGallery/Styles.scss +37 -0
- package/Screens/ImageGallery/Translations.js +41 -0
- package/Screens/ImageGallery/index.js +20 -0
- package/Screens/Inspirations/Containers/Edit.js +163 -0
- package/Screens/Inspirations/Containers/InspirationsSubscreen.js +34 -0
- package/Screens/Inspirations/Containers/ItemInspirationsList.js +48 -0
- package/Screens/Inspirations/Containers/List.js +48 -0
- package/Screens/Inspirations/Reducers/Actions.js +159 -0
- package/Screens/Inspirations/Reducers/ItemInspirationsActions.js +25 -0
- package/Screens/Inspirations/Reducers/Reducer.js +78 -0
- package/Screens/Inspirations/Screen.js +108 -0
- package/Screens/Inspirations/Translations.js +27 -0
- package/Screens/Inspirations/index.js +21 -0
- package/Screens/Item/ApiCalls.js +45 -0
- package/Screens/Item/Components/AttributeEditorPopup.js +117 -0
- package/Screens/Item/Components/ConfiguratorQuickView.js +115 -0
- package/Screens/Item/Components/ListItemStatusEditor.js +216 -0
- package/Screens/Item/Components/Styles.scss +327 -0
- package/Screens/Item/Components/Variants/VariantsAutocomplete.js +418 -0
- package/Screens/Item/Components/Variants/VariantsEditor.js +715 -0
- package/Screens/Item/Components/Variants/VariantsEditorDialog.js +210 -0
- package/Screens/Item/Components/Variants/VariantsEditorPopup.js +117 -0
- package/Screens/Item/Components/Variants/VariantsSelection.js +184 -0
- package/Screens/Item/Components/Variants/VariantsSortFilter.js +230 -0
- package/Screens/Item/Containers/Edit.js +600 -0
- package/Screens/Item/Containers/List.js +118 -0
- package/Screens/Item/Containers/Styles.scss +92 -0
- package/Screens/Item/DataStructures/Attributes/Actions.js +54 -0
- package/Screens/Item/DataStructures/Attributes/Editor.js +127 -0
- package/Screens/Item/DataStructures/Attributes/Reducer.js +37 -0
- package/Screens/Item/Reducers/Actions.js +97 -0
- package/Screens/Item/Reducers/ItemReducer.js +102 -0
- package/Screens/Item/Reducers/Variant/Actions.js +24 -0
- package/Screens/Item/Reducers/Variant/Reducer.js +118 -0
- package/Screens/Item/Screen.js +28 -0
- package/Screens/Item/Translations.js +136 -0
- package/Screens/Item/index.js +22 -0
- package/Screens/License/Reducers/Actions.js +60 -0
- package/Screens/License/Reducers/Reducer.js +47 -0
- package/Screens/License/Screen.js +128 -0
- package/Screens/License/Styles.scss +35 -0
- package/Screens/License/Translations.js +18 -0
- package/Screens/License/index.js +21 -0
- package/Screens/Login/Reducers/Actions.js +102 -0
- package/Screens/Login/Reducers/Listener.js +23 -0
- package/Screens/Login/Reducers/Reducer.js +96 -0
- package/Screens/Login/Screen.js +200 -0
- package/Screens/Login/Styles.scss +0 -0
- package/Screens/Login/Translations.js +10 -0
- package/Screens/Login/__tests/LoginScreen.js +242 -0
- package/Screens/Option/Containers/Edit.js +139 -0
- package/Screens/Option/Containers/List.js +66 -0
- package/Screens/Option/Reducers/Actions.js +25 -0
- package/Screens/Option/Reducers/Reducer.js +127 -0
- package/Screens/Option/Screen.js +28 -0
- package/Screens/Option/Translations.js +23 -0
- package/Screens/Option/index.js +20 -0
- package/Screens/OptionPools/Containers/Edit.js +105 -0
- package/Screens/OptionPools/Containers/List.js +33 -0
- package/Screens/OptionPools/Reducers/Actions.js +25 -0
- package/Screens/OptionPools/Reducers/Reducer.js +61 -0
- package/Screens/OptionPools/Screen.js +28 -0
- package/Screens/OptionPools/Translations.js +22 -0
- package/Screens/OptionPools/index.js +20 -0
- package/Screens/Optionclassification/Containers/Edit.js +92 -0
- package/Screens/Optionclassification/Containers/List.js +63 -0
- package/Screens/Optionclassification/Reducers/Actions.js +25 -0
- package/Screens/Optionclassification/Reducers/Reducer.js +64 -0
- package/Screens/Optionclassification/Screen.js +34 -0
- package/Screens/Optionclassification/Styles.scss +0 -0
- package/Screens/Optionclassification/Translations.js +20 -0
- package/Screens/Optionclassification/index.js +20 -0
- package/Screens/PriceTypes/Containers/Edit.js +124 -0
- package/Screens/PriceTypes/Containers/List.js +67 -0
- package/Screens/PriceTypes/Reducers/Actions.js +21 -0
- package/Screens/PriceTypes/Reducers/Reducer.js +83 -0
- package/Screens/PriceTypes/Screen.js +32 -0
- package/Screens/PriceTypes/Translations.js +36 -0
- package/Screens/PriceTypes/index.js +20 -0
- package/Screens/ProductionView/Components/ConfigurationDataSheet.js +199 -0
- package/Screens/ProductionView/Containers/Edit.js +61 -0
- package/Screens/ProductionView/Containers/List.js +124 -0
- package/Screens/ProductionView/Reducers/Actions.js +34 -0
- package/Screens/ProductionView/Reducers/Reducer.js +40 -0
- package/Screens/ProductionView/Screen.js +42 -0
- package/Screens/ProductionView/Styles.scss +59 -0
- package/Screens/ProductionView/Translations.js +26 -0
- package/Screens/ProductionView/index.js +20 -0
- package/Screens/ReceiveOfferRequests/Components/ConfigurationDataSheet.js +280 -0
- package/Screens/ReceiveOfferRequests/Containers/Edit.js +65 -0
- package/Screens/ReceiveOfferRequests/Containers/List.js +117 -0
- package/Screens/ReceiveOfferRequests/Reducers/Actions.js +41 -0
- package/Screens/ReceiveOfferRequests/Reducers/Reducer.js +44 -0
- package/Screens/ReceiveOfferRequests/Screen.js +42 -0
- package/Screens/ReceiveOfferRequests/index.js +21 -0
- package/Screens/Roles/Containers/Edit.js +56 -0
- package/Screens/Roles/Containers/List.js +39 -0
- package/Screens/Roles/Reducers/Actions.js +29 -0
- package/Screens/Roles/Reducers/Reducer.js +46 -0
- package/Screens/Roles/Screen.js +32 -0
- package/Screens/Roles/Translations.js +18 -0
- package/Screens/Roles/index.js +20 -0
- package/Screens/Savedconfigurations/Components/ConfigurationDataSheet.js +300 -0
- package/Screens/Savedconfigurations/Containers/Edit.js +65 -0
- package/Screens/Savedconfigurations/Containers/List.js +210 -0
- package/Screens/Savedconfigurations/Reducers/Actions.js +28 -0
- package/Screens/Savedconfigurations/Reducers/Reducer.js +37 -0
- package/Screens/Savedconfigurations/Screen.js +42 -0
- package/Screens/Savedconfigurations/Styles.scss +38 -0
- package/Screens/Savedconfigurations/Translations.js +63 -0
- package/Screens/Savedconfigurations/index.js +20 -0
- package/Screens/Setting/Containers/Edit.js +171 -0
- package/Screens/Setting/Reducers/Actions.js +69 -0
- package/Screens/Setting/Reducers/Reducer.js +48 -0
- package/Screens/Setting/Screen.js +22 -0
- package/Screens/Setting/Styles.scss +0 -0
- package/Screens/Setting/Translations.js +52 -0
- package/Screens/Setting/index.js +20 -0
- package/Screens/SoftwareUpdates/Reducers/Actions.js +23 -0
- package/Screens/SoftwareUpdates/Reducers/Reducer.js +48 -0
- package/Screens/SoftwareUpdates/Screen.js +103 -0
- package/Screens/SoftwareUpdates/Translations.js +24 -0
- package/Screens/SoftwareUpdates/index.js +21 -0
- package/Screens/Tag/Containers/Edit.js +34 -0
- package/Screens/Tag/Containers/List.js +43 -0
- package/Screens/Tag/Reducers/Actions.js +42 -0
- package/Screens/Tag/Reducers/Reducer.js +38 -0
- package/Screens/Tag/Screen.js +24 -0
- package/Screens/Tag/Styles.scss +0 -0
- package/Screens/Tag/Translations.js +18 -0
- package/Screens/Tag/index.js +20 -0
- package/Screens/TrackingCodes/Containers/Edit.js +60 -0
- package/Screens/TrackingCodes/Containers/List.js +42 -0
- package/Screens/TrackingCodes/Reducers/Actions.js +65 -0
- package/Screens/TrackingCodes/Reducers/Reducer.js +75 -0
- package/Screens/TrackingCodes/Screen.js +28 -0
- package/Screens/TrackingCodes/Translations.js +20 -0
- package/Screens/TrackingCodes/index.js +21 -0
- package/Screens/TranslationFileHandling/Containers/Edit.js +303 -0
- package/Screens/TranslationFileHandling/Containers/List.js +38 -0
- package/Screens/TranslationFileHandling/Reducers/Actions.js +21 -0
- package/Screens/TranslationFileHandling/Reducers/Reducer.js +55 -0
- package/Screens/TranslationFileHandling/Screen.js +32 -0
- package/Screens/TranslationFileHandling/Translations.js +24 -0
- package/Screens/TranslationFileHandling/index.js +21 -0
- package/Screens/User/Containers/Edit.js +58 -0
- package/Screens/User/Containers/List.js +42 -0
- package/Screens/User/Reducers/Actions.js +63 -0
- package/Screens/User/Reducers/Reducer.js +63 -0
- package/Screens/User/Screen.js +24 -0
- package/Screens/User/Styles.scss +3 -0
- package/Screens/User/Translations.js +22 -0
- package/Screens/User/__tests/UserScreen.js +406 -0
- package/Screens/User/index.js +20 -0
- package/Screens/index.js +228 -0
- package/UIComponents/AppBar.js +13 -0
- package/UIComponents/AutoComplete.js +311 -0
- package/UIComponents/Button.js +13 -0
- package/UIComponents/ButtonBase.js +13 -0
- package/UIComponents/Checkbox.js +13 -0
- package/UIComponents/Chip.js +13 -0
- package/UIComponents/ChipInput.js +300 -0
- package/UIComponents/CircularProgress.js +13 -0
- package/UIComponents/ClickAwayListener.js +13 -0
- package/UIComponents/Collapse.js +13 -0
- package/UIComponents/DatePicker.js +63 -0
- package/UIComponents/DateTimePicker.js +63 -0
- package/UIComponents/Dialog.js +75 -0
- package/UIComponents/Drawer.js +13 -0
- package/UIComponents/FlatButton.js +52 -0
- package/UIComponents/FloatingActionButton.js +23 -0
- package/UIComponents/FontIcon.js +13 -0
- package/UIComponents/FormControl.js +13 -0
- package/UIComponents/FormControlLabel.js +13 -0
- package/UIComponents/Grow.js +13 -0
- package/UIComponents/IconButton.js +13 -0
- package/UIComponents/IconMenu.js +204 -0
- package/UIComponents/InlineHelp/index.js +109 -0
- package/UIComponents/Input.js +13 -0
- package/UIComponents/InputAdornment.js +13 -0
- package/UIComponents/InputLabel.js +13 -0
- package/UIComponents/LinearProgress.js +13 -0
- package/UIComponents/Link.js +44 -0
- package/UIComponents/List.js +13 -0
- package/UIComponents/ListItem.js +13 -0
- package/UIComponents/ListItemIcon.js +13 -0
- package/UIComponents/ListItemText.js +13 -0
- package/UIComponents/Menu.js +13 -0
- package/UIComponents/MenuItem.js +13 -0
- package/UIComponents/MenuList.js +13 -0
- package/UIComponents/Pagination.js +170 -0
- package/UIComponents/Paper.js +13 -0
- package/UIComponents/Popper.js +13 -0
- package/UIComponents/RadioButton/RadioButton.js +13 -0
- package/UIComponents/RadioButton/RadioGroup.js +13 -0
- package/UIComponents/RadioButton/index.js +23 -0
- package/UIComponents/RaisedButton.js +49 -0
- package/UIComponents/SelectField.js +123 -0
- package/UIComponents/Snackbar.js +13 -0
- package/UIComponents/Table/Table.js +208 -0
- package/UIComponents/Table/TableBody.js +119 -0
- package/UIComponents/Table/TableCell.js +13 -0
- package/UIComponents/Table/TableFooter.js +13 -0
- package/UIComponents/Table/TableHead.js +108 -0
- package/UIComponents/Table/TableHeadColumn.js +13 -0
- package/UIComponents/Table/TableRow.js +74 -0
- package/UIComponents/Table/TableRowColumn.js +13 -0
- package/UIComponents/Table/index.js +63 -0
- package/UIComponents/TableSortLabel.js +13 -0
- package/UIComponents/Tabs/Tab.js +13 -0
- package/UIComponents/Tabs/Tabs.js +13 -0
- package/UIComponents/Tabs/index.js +23 -0
- package/UIComponents/TextField.js +13 -0
- package/UIComponents/TimePicker.js +67 -0
- package/UIComponents/Toggle.js +13 -0
- package/UIComponents/Toolbar.js +13 -0
- package/UIComponents/Tooltip.js +19 -0
- package/UIComponents/Typography.js +13 -0
- package/UIComponents/icons/AccountCircleIcon.js +13 -0
- package/UIComponents/icons/AddCircleOutlineIcon.js +13 -0
- package/UIComponents/icons/AddIcon.js +13 -0
- package/UIComponents/icons/ArrowBackIcon.js +13 -0
- package/UIComponents/icons/CheckmarkIcon.js +13 -0
- package/UIComponents/icons/CloseIcon.js +13 -0
- package/UIComponents/icons/DeleteForeverIcon.js +13 -0
- package/UIComponents/icons/DeleteIcon.js +13 -0
- package/UIComponents/icons/ErrorIcon.js +13 -0
- package/UIComponents/icons/ExpandLessIcon.js +13 -0
- package/UIComponents/icons/ExpandMoreIcon.js +13 -0
- package/UIComponents/icons/FolderIcon.js +13 -0
- package/UIComponents/icons/ForwardIcon.js +13 -0
- package/UIComponents/icons/InfoIcon.js +13 -0
- package/UIComponents/icons/InfoOutlineIcon.js +13 -0
- package/UIComponents/icons/LanguageIcon.js +13 -0
- package/UIComponents/icons/LaunchIcon.js +13 -0
- package/UIComponents/icons/MenuIcon.js +13 -0
- package/UIComponents/icons/PriceIcon.js +13 -0
- package/UIComponents/icons/ReorderIcon.js +13 -0
- package/UIComponents/icons/SearchIcon.js +13 -0
- package/UIComponents/icons/SettingsIcon.js +13 -0
- package/UIComponents/icons/SortIcon.js +13 -0
- package/UIComponents/icons/TranslateIcon.js +13 -0
- package/UIComponents/icons/UpdateIcon.js +13 -0
- package/UIComponents/icons/ViewListIcon.js +13 -0
- package/UIComponents/icons/ZoomResetIcon.js +13 -0
- package/Utils/Async/Deferred.js +139 -0
- package/Utils/Async/newestRequest.js +55 -0
- package/Utils/Decorators/Observable.js +112 -0
- package/Utils/Dev/RequestApiToken.js +44 -0
- package/Utils/Dev/withStateProps.js +43 -0
- package/Utils/Error/createError.js +34 -0
- package/Utils/Events/pointerEvent.js +114 -0
- package/Utils/FunDraw/createMask.js +126 -0
- package/Utils/FunDraw/funDraw.js +561 -0
- package/Utils/FunDraw/movableObject.js +207 -0
- package/Utils/Function/sendMessage.js +22 -0
- package/Utils/HOCs/AsyncProps.js +123 -0
- package/Utils/HOCs/LocalState.js +107 -0
- package/Utils/HOCs/RemappedProps.js +32 -0
- package/Utils/Request/lazyFetch.js +109 -0
- package/Utils/Request/pathParams.js +21 -0
- package/Utils/Test/provideStore.js +30 -0
- package/Utils/Test/wrapperSelectors.js +22 -0
- package/default.js +19 -0
- package/dev.js +61 -0
- package/index.js +18 -0
- package/package.json +40 -103
- package/scripts/getDefaultWebpackConfig.js +1 -1
- package/src/App/Main.js +1 -2
- package/src/App/Styles.scss +185 -185
- package/src/Components/FormFragments/File.js +4 -2
- package/src/Components/FormFragments/IntlInput.js +2 -5
- package/src/Components/Menu.js +9 -1
- package/src/Components/Styles.scss +113 -113
- package/src/Components/Translations.js +4 -2
- package/src/Screens/Assemblypointeditor/Components/Styles.scss +58 -58
- package/src/Screens/Assemblypointeditor/Styles.scss +37 -37
- package/src/Screens/Creator/Components/ComponentEditor.js +9 -5
- package/src/Screens/Creator/Components/VisualizationAndMediaData/Components/EditableText.js +1 -1
- package/src/Screens/Creator/Components/VisualizationAndMediaData/Components/Image.js +1 -1
- package/src/Screens/Creator/Components/VisualizationAndMediaData/Components/ImageEditTools.js +1 -1
- package/src/Screens/Creator/Components/VisualizationAndMediaData/Translations.js +3 -3
- package/src/Screens/Creator/Components/VisualizationAndMediaData/VisualizationAndMediaData.js +1 -1
- package/src/Screens/Dashboard/Styles.scss +2 -2
- package/src/Screens/Designer/Components/DesignDataTransfer.js +1 -1
- package/src/Screens/Designer/Components/TemplateDefaultList.js +1 -2
- package/src/Screens/Designer/SubScreens/Designviews/Containers/Edit.js +5 -9
- package/src/Screens/Designer/Translations.js +1 -1
- package/src/Screens/Inspirations/Containers/Edit.js +1 -1
- package/src/Screens/Inspirations/Screen.js +6 -0
- package/src/Screens/Item/Reducers/Actions.js +73 -73
- package/src/Screens/Item/Translations.js +4 -2
- package/src/UIComponents/Table/TableHead.js +1 -2
- package/src/dev.js +3 -3
- package/babel.config.js +0 -1
- package/public/favicon.ico +0 -0
- package/scripts/cpPath.js +0 -152
- package/scripts/updateLocalPackages.js +0 -68
|
@@ -0,0 +1,660 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.generateDeleteAction = exports.generateListActions = exports.generateDefaultActions = exports.SET_VALIDATED_DATA = exports.MOUNT_NEXT = exports.SET_DATA_SOURCE = exports.SET_VALIDATION_ERRORS = exports.ENTITY_WILL_UNMOUNT = exports.ENTITY_WILL_MOUNT = exports.MOUNT_ENTITY = exports.UNMOUNT_ENTITY = exports.SET_DATA = exports.HIDE_DETAILS = exports.SHOW_DETAILS = exports.cancelDeleteEntitiesDialog = exports.reportDeleteEntities = exports.dataIsModified = exports.initUnsavedEntity = exports.cancelUnsavedEntityDialog = exports.releaseUnsavedEntity = exports.reportUnsavedEntity = exports.CANCEL_DELETE_ENTITIES_DIALOG = exports.REPORT_DELETE_ENTITIES = exports.MODIFIED_UNSAVED_ENTITY = exports.INIT_UNSAVED_ENTITY = exports.CANCEL_UNSAVED_ENTITY_DIALOG = exports.RELEASE_UNSAVED_ENTITY = exports.REPORT_UNSAVED_ENTITY = void 0;
|
|
7
|
+
|
|
8
|
+
var _Helpers = require("../Api/Helpers");
|
|
9
|
+
|
|
10
|
+
var _Actions = require("../Api/Actions");
|
|
11
|
+
|
|
12
|
+
var _Data = require("../../Data");
|
|
13
|
+
|
|
14
|
+
var _Actions2 = require("../Frame/Actions");
|
|
15
|
+
|
|
16
|
+
var _i18n = require("../../i18n");
|
|
17
|
+
|
|
18
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
+
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
21
|
+
|
|
22
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
+
|
|
24
|
+
var REPORT_UNSAVED_ENTITY = 'REPORT_UNSAVED_ENTITY';
|
|
25
|
+
exports.REPORT_UNSAVED_ENTITY = REPORT_UNSAVED_ENTITY;
|
|
26
|
+
var RELEASE_UNSAVED_ENTITY = 'RELEASE_UNSAVED_ENTITY';
|
|
27
|
+
exports.RELEASE_UNSAVED_ENTITY = RELEASE_UNSAVED_ENTITY;
|
|
28
|
+
var CANCEL_UNSAVED_ENTITY_DIALOG = 'CANCEL_UNSAVED_ENTITY_DIALOG';
|
|
29
|
+
exports.CANCEL_UNSAVED_ENTITY_DIALOG = CANCEL_UNSAVED_ENTITY_DIALOG;
|
|
30
|
+
var INIT_UNSAVED_ENTITY = 'INIT_UNSAVED_ENTITY';
|
|
31
|
+
exports.INIT_UNSAVED_ENTITY = INIT_UNSAVED_ENTITY;
|
|
32
|
+
var MODIFIED_UNSAVED_ENTITY = 'MODIFIED_UNSAVED_ENTITY';
|
|
33
|
+
exports.MODIFIED_UNSAVED_ENTITY = MODIFIED_UNSAVED_ENTITY;
|
|
34
|
+
var REPORT_DELETE_ENTITIES = 'REPORT_DELETE_ENTITIES';
|
|
35
|
+
exports.REPORT_DELETE_ENTITIES = REPORT_DELETE_ENTITIES;
|
|
36
|
+
var CANCEL_DELETE_ENTITIES_DIALOG = 'CANCEL_DELETE_ENTITIES_DIALOG';
|
|
37
|
+
exports.CANCEL_DELETE_ENTITIES_DIALOG = CANCEL_DELETE_ENTITIES_DIALOG;
|
|
38
|
+
|
|
39
|
+
var reportUnsavedEntity = function reportUnsavedEntity(reducerName, entityState, saveAndHide, hide, cancel) {
|
|
40
|
+
return {
|
|
41
|
+
type: REPORT_UNSAVED_ENTITY,
|
|
42
|
+
reducerName: reducerName,
|
|
43
|
+
entityState: entityState,
|
|
44
|
+
saveAndHide: saveAndHide,
|
|
45
|
+
hide: hide,
|
|
46
|
+
cancel: cancel
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
exports.reportUnsavedEntity = reportUnsavedEntity;
|
|
51
|
+
|
|
52
|
+
var releaseUnsavedEntity = function releaseUnsavedEntity() {
|
|
53
|
+
return function (dispatch, getState) {
|
|
54
|
+
var state = getState();
|
|
55
|
+
var entity = state.entity;
|
|
56
|
+
var reducerName = entity.unsavedEntity.reducerName;
|
|
57
|
+
|
|
58
|
+
if (reducerName) {
|
|
59
|
+
if (state[reducerName].showDetails) {
|
|
60
|
+
dispatch({
|
|
61
|
+
type: HIDE_DETAILS,
|
|
62
|
+
key: state[reducerName].actionKey
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
dispatch({
|
|
68
|
+
type: RELEASE_UNSAVED_ENTITY
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
exports.releaseUnsavedEntity = releaseUnsavedEntity;
|
|
74
|
+
|
|
75
|
+
var cancelUnsavedEntityDialog = function cancelUnsavedEntityDialog() {
|
|
76
|
+
return {
|
|
77
|
+
type: CANCEL_UNSAVED_ENTITY_DIALOG
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
exports.cancelUnsavedEntityDialog = cancelUnsavedEntityDialog;
|
|
82
|
+
|
|
83
|
+
var initUnsavedEntity = function initUnsavedEntity(reducerName) {
|
|
84
|
+
return {
|
|
85
|
+
type: INIT_UNSAVED_ENTITY,
|
|
86
|
+
reducerName: reducerName
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
exports.initUnsavedEntity = initUnsavedEntity;
|
|
91
|
+
|
|
92
|
+
var dataIsModified = function dataIsModified(reducerName, entityState) {
|
|
93
|
+
return {
|
|
94
|
+
type: MODIFIED_UNSAVED_ENTITY,
|
|
95
|
+
reducerName: reducerName,
|
|
96
|
+
entityState: entityState
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
exports.dataIsModified = dataIsModified;
|
|
101
|
+
|
|
102
|
+
var reportDeleteEntities = function reportDeleteEntities(key, onDelete, cancel) {
|
|
103
|
+
return {
|
|
104
|
+
type: REPORT_DELETE_ENTITIES,
|
|
105
|
+
key: key,
|
|
106
|
+
onDelete: onDelete,
|
|
107
|
+
cancel: cancel
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
exports.reportDeleteEntities = reportDeleteEntities;
|
|
112
|
+
|
|
113
|
+
var cancelDeleteEntitiesDialog = function cancelDeleteEntitiesDialog() {
|
|
114
|
+
return {
|
|
115
|
+
type: CANCEL_DELETE_ENTITIES_DIALOG
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
/*** DEFAULT ENTITY ACTIONS***/
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
exports.cancelDeleteEntitiesDialog = cancelDeleteEntitiesDialog;
|
|
122
|
+
var SHOW_DETAILS = 'SHOW_DETAILS';
|
|
123
|
+
exports.SHOW_DETAILS = SHOW_DETAILS;
|
|
124
|
+
var HIDE_DETAILS = 'HIDE_DETAILS';
|
|
125
|
+
exports.HIDE_DETAILS = HIDE_DETAILS;
|
|
126
|
+
var SET_DATA = 'SET_DATA';
|
|
127
|
+
exports.SET_DATA = SET_DATA;
|
|
128
|
+
var UNMOUNT_ENTITY = 'UNMOUNT_ENTITY';
|
|
129
|
+
exports.UNMOUNT_ENTITY = UNMOUNT_ENTITY;
|
|
130
|
+
var MOUNT_ENTITY = 'MOUNT_ENTITY';
|
|
131
|
+
exports.MOUNT_ENTITY = MOUNT_ENTITY;
|
|
132
|
+
var ENTITY_WILL_MOUNT = 'ENTITY_WILL_MOUNT';
|
|
133
|
+
exports.ENTITY_WILL_MOUNT = ENTITY_WILL_MOUNT;
|
|
134
|
+
var ENTITY_WILL_UNMOUNT = 'ENTITY_WILL_UNMOUNT';
|
|
135
|
+
exports.ENTITY_WILL_UNMOUNT = ENTITY_WILL_UNMOUNT;
|
|
136
|
+
var SET_VALIDATION_ERRORS = 'SET_VALIDATION_ERRORS';
|
|
137
|
+
exports.SET_VALIDATION_ERRORS = SET_VALIDATION_ERRORS;
|
|
138
|
+
var SET_DATA_SOURCE = 'SET_DATA_SOURCE';
|
|
139
|
+
exports.SET_DATA_SOURCE = SET_DATA_SOURCE;
|
|
140
|
+
var MOUNT_NEXT = 'MOUNT_NEXT';
|
|
141
|
+
exports.MOUNT_NEXT = MOUNT_NEXT;
|
|
142
|
+
var SET_VALIDATED_DATA = 'SET_VALIDATED_DATA';
|
|
143
|
+
exports.SET_VALIDATED_DATA = SET_VALIDATED_DATA;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
*
|
|
147
|
+
* @param listKey
|
|
148
|
+
* @param dataKey
|
|
149
|
+
* @param reducerName
|
|
150
|
+
* @param url
|
|
151
|
+
* @returns {{listAction: (function(*): function(*=)), showDetails: (function(*=, *=): function(*, *)), hideDetails: (function(*=): function(*, *)), detailsAction: (function(*=): function(*=)), setFieldData: (function(*, *): function(*, *)), postData: (function(*): function(*=, *)), createEntity: (function(): function(*, *)), deleteEntities: (function(*=): function(*=)), triggerUnsavedEntity: (function(): function(*=, *)), invalidateList: (function(): function(*))}}
|
|
152
|
+
*/
|
|
153
|
+
var generateDefaultActions = function generateDefaultActions(listKey, dataKey, reducerName, url) {
|
|
154
|
+
var ctx = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
155
|
+
var lastListParams;
|
|
156
|
+
|
|
157
|
+
var listAction = function listAction(params) {
|
|
158
|
+
return function (dispatch) {
|
|
159
|
+
lastListParams = params;
|
|
160
|
+
return (0, _Helpers.dispatchFetchData)(dispatch)(listKey, params ? {
|
|
161
|
+
url: url,
|
|
162
|
+
params: params
|
|
163
|
+
} : url);
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
var refreshListAction = function refreshListAction() {
|
|
168
|
+
return function (dispatch) {
|
|
169
|
+
return dispatch(listAction(lastListParams));
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
var triggerUnsavedEntity = function triggerUnsavedEntity() {
|
|
174
|
+
var hideSilent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
175
|
+
return function (dispatch, getState) {
|
|
176
|
+
return new Promise(function (resolve) {
|
|
177
|
+
var state = getState();
|
|
178
|
+
|
|
179
|
+
if (state[reducerName].isModified) {
|
|
180
|
+
dispatch(reportUnsavedEntity(reducerName, state[reducerName], function () {
|
|
181
|
+
// saveAndHide callback
|
|
182
|
+
dispatch(postData(true)).then(function (apiAction) {
|
|
183
|
+
if (apiAction.type === _Actions.RECEIVE_DATA) {
|
|
184
|
+
dispatch(hideDetails(false, hideSilent)).then(function () {
|
|
185
|
+
dispatch(releaseUnsavedEntity());
|
|
186
|
+
resolve();
|
|
187
|
+
});
|
|
188
|
+
} else {
|
|
189
|
+
// there might be some validation problems
|
|
190
|
+
dispatch(cancelUnsavedEntityDialog());
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}, function () {
|
|
194
|
+
// hide callback
|
|
195
|
+
dispatch(hideDetails(false, hideSilent)).then(function () {
|
|
196
|
+
dispatch(releaseUnsavedEntity());
|
|
197
|
+
resolve();
|
|
198
|
+
});
|
|
199
|
+
}, function () {
|
|
200
|
+
// cancel callback
|
|
201
|
+
dispatch(cancelUnsavedEntityDialog());
|
|
202
|
+
}));
|
|
203
|
+
} else {
|
|
204
|
+
resolve();
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
var showDetails = function showDetails() {
|
|
211
|
+
var showDetails = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
212
|
+
var reportUnsaved = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
213
|
+
return function (dispatch, getState) {
|
|
214
|
+
var state = getState();
|
|
215
|
+
|
|
216
|
+
if (reportUnsaved && state[reducerName].isModified) {
|
|
217
|
+
dispatch(triggerUnsavedEntity());
|
|
218
|
+
} else {
|
|
219
|
+
dispatch({
|
|
220
|
+
type: SHOW_DETAILS,
|
|
221
|
+
key: dataKey,
|
|
222
|
+
showDetails: showDetails
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
var hideDetails = function hideDetails() {
|
|
229
|
+
var reportUnsaved = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
230
|
+
var silent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
231
|
+
return function (dispatch, getState) {
|
|
232
|
+
dispatch(mountNext(false));
|
|
233
|
+
dispatch((0, _Helpers.dismissRequest)(dataKey));
|
|
234
|
+
var state = getState();
|
|
235
|
+
var p = null;
|
|
236
|
+
|
|
237
|
+
if (reportUnsaved && state[reducerName].isModified) {
|
|
238
|
+
p = dispatch(triggerUnsavedEntity());
|
|
239
|
+
} else {
|
|
240
|
+
p = Promise.resolve();
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
return p.then(function () {
|
|
244
|
+
if (!silent) {
|
|
245
|
+
dispatch({
|
|
246
|
+
type: HIDE_DETAILS,
|
|
247
|
+
key: dataKey
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
dispatch(unmountEntity());
|
|
252
|
+
});
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
var unmountEntity = function unmountEntity() {
|
|
257
|
+
return function (dispatch, getState) {
|
|
258
|
+
var state = getState();
|
|
259
|
+
|
|
260
|
+
if (state[reducerName].isReady) {
|
|
261
|
+
dispatch({
|
|
262
|
+
type: ENTITY_WILL_UNMOUNT,
|
|
263
|
+
key: dataKey
|
|
264
|
+
});
|
|
265
|
+
dispatch({
|
|
266
|
+
type: UNMOUNT_ENTITY,
|
|
267
|
+
key: dataKey
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
var mountEntity = function mountEntity() {
|
|
274
|
+
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
275
|
+
var isSaved = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
276
|
+
return function (dispatch) {
|
|
277
|
+
dispatch({
|
|
278
|
+
type: ENTITY_WILL_MOUNT,
|
|
279
|
+
key: dataKey,
|
|
280
|
+
data: data
|
|
281
|
+
});
|
|
282
|
+
dispatch({
|
|
283
|
+
type: MOUNT_ENTITY,
|
|
284
|
+
key: dataKey,
|
|
285
|
+
data: data,
|
|
286
|
+
isSaved: isSaved
|
|
287
|
+
});
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
var mountNewEntity = function mountNewEntity() {
|
|
292
|
+
return {
|
|
293
|
+
type: MOUNT_ENTITY,
|
|
294
|
+
key: dataKey,
|
|
295
|
+
isNew: true
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
var createEntity = function createEntity() {
|
|
300
|
+
return function (dispatch) {
|
|
301
|
+
return dispatch(triggerUnsavedEntity()).then(function () {
|
|
302
|
+
dispatch(unmountEntity());
|
|
303
|
+
dispatch(initUnsavedEntity(reducerName));
|
|
304
|
+
dispatch(mountNewEntity());
|
|
305
|
+
dispatch(loadDependencies());
|
|
306
|
+
dispatch(showDetails());
|
|
307
|
+
});
|
|
308
|
+
};
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
var setValidationErrors = function setValidationErrors(errors) {
|
|
312
|
+
return {
|
|
313
|
+
type: SET_VALIDATION_ERRORS,
|
|
314
|
+
key: dataKey,
|
|
315
|
+
errors: errors
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
var apiStateHandler = function apiStateHandler(apiAction) {
|
|
320
|
+
var hideDetailsAfterSave = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
321
|
+
return function (dispatch, getState) {
|
|
322
|
+
switch (apiAction && apiAction.type) {
|
|
323
|
+
case _Actions.RECEIVE_DATA:
|
|
324
|
+
{
|
|
325
|
+
var state = getState();
|
|
326
|
+
var source = state.dataBySource[apiAction.key];
|
|
327
|
+
|
|
328
|
+
if (!source.data) {
|
|
329
|
+
// eslint-disable-next-line no-console
|
|
330
|
+
console.error('There is no entity data, entity will not be mounted!');
|
|
331
|
+
return false;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
if (!state[reducerName].mountNext) {
|
|
335
|
+
// eslint-disable-next-line no-console
|
|
336
|
+
console.warn('Mounting is interrupted by the user.');
|
|
337
|
+
return false;
|
|
338
|
+
} // the data should be mounted in every case
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
dispatch(mountEntity(source.data, source.isPosted));
|
|
342
|
+
|
|
343
|
+
if (source.isPosted) {
|
|
344
|
+
// data is saved
|
|
345
|
+
if (ctx.stayAfterSave || !hideDetailsAfterSave) {
|
|
346
|
+
// the data should be re-fetched in the original way to make sure it is correct
|
|
347
|
+
// (since the response for the post request can contain the previous version)
|
|
348
|
+
source.source && (0, _Helpers.dispatchFetchData)(dispatch)(dataKey, source.source).then(function (result) {
|
|
349
|
+
dispatch(apiStateHandler(result));
|
|
350
|
+
});
|
|
351
|
+
} else if (hideDetailsAfterSave) {
|
|
352
|
+
dispatch(releaseUnsavedEntity());
|
|
353
|
+
dispatch(hideDetails(false));
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
dispatch((0, _Actions2.showInfoMessage)((0, _i18n.t)('entity.saveOk')));
|
|
357
|
+
dispatch((0, _Helpers.invalidateSource)(listKey));
|
|
358
|
+
} else {// data is loaded by its id (not from a post request), so it can be mounted
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
return true;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
case _Actions.HANDLED_NETWORK_ERROR:
|
|
365
|
+
dispatch(setValidationErrors(apiAction.error.response.data.errors));
|
|
366
|
+
return false;
|
|
367
|
+
|
|
368
|
+
case _Actions.NETWORK_ERROR:
|
|
369
|
+
{
|
|
370
|
+
var _state = getState();
|
|
371
|
+
|
|
372
|
+
var _source = _state.dataBySource[apiAction.key];
|
|
373
|
+
|
|
374
|
+
if (_source.isPosted) {
|
|
375
|
+
// data is saved
|
|
376
|
+
dispatch((0, _Actions2.showErrorMessage)((0, _i18n.t)('entity.saveError'), apiAction.error));
|
|
377
|
+
} else {
|
|
378
|
+
dispatch((0, _Actions2.showErrorMessage)((0, _i18n.t)('entity.loadError'), apiAction.error));
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
return false;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
var loadDependencies = function loadDependencies() {
|
|
388
|
+
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
389
|
+
return function (dispatch, getState) {
|
|
390
|
+
var state = getState();
|
|
391
|
+
var config = state[reducerName].config;
|
|
392
|
+
var dependencies = config.dependencies;
|
|
393
|
+
|
|
394
|
+
if (params.filter) {
|
|
395
|
+
dependencies = dependencies.filter(params.filter);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
return Promise.all(dependencies.map(function (dep) {
|
|
399
|
+
var dataKey = dep.dataKey,
|
|
400
|
+
source = dep.source,
|
|
401
|
+
name = dep.name,
|
|
402
|
+
transform = dep.transform;
|
|
403
|
+
return (0, _Helpers.dispatchFetchData)(dispatch)(dataKey, source).then(function (apiAction) {
|
|
404
|
+
if (apiAction.type === _Actions.NETWORK_ERROR) {
|
|
405
|
+
throw new Error('Cannot load dependency: ' + dataKey);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
var state = getState();
|
|
409
|
+
var dataState = state.dataBySource[apiAction.key];
|
|
410
|
+
|
|
411
|
+
if (!dataState.data) {
|
|
412
|
+
// eslint-disable-next-line no-console
|
|
413
|
+
console.error('Cannot load data for dependency: ' + dataKey, apiAction, dataState);
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
var data = transform ? transform(dataState.data) : dataState.data;
|
|
418
|
+
dispatch(setDataSource(name, data));
|
|
419
|
+
});
|
|
420
|
+
}));
|
|
421
|
+
};
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
var setDataSource = function setDataSource(name, data) {
|
|
425
|
+
return {
|
|
426
|
+
type: SET_DATA_SOURCE,
|
|
427
|
+
key: dataKey,
|
|
428
|
+
name: name,
|
|
429
|
+
data: data
|
|
430
|
+
};
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
var detailsAction = function detailsAction(params) {
|
|
434
|
+
return function (dispatch) {
|
|
435
|
+
return dispatch(triggerUnsavedEntity()).then(function () {
|
|
436
|
+
dispatch(unmountEntity());
|
|
437
|
+
dispatch(initUnsavedEntity(reducerName));
|
|
438
|
+
dispatch((0, _Helpers.invalidateSource)(dataKey));
|
|
439
|
+
return dispatch(loadEntity(params));
|
|
440
|
+
});
|
|
441
|
+
};
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
var mountNext = function mountNext(mount) {
|
|
445
|
+
return {
|
|
446
|
+
type: MOUNT_NEXT,
|
|
447
|
+
key: dataKey,
|
|
448
|
+
mount: mount
|
|
449
|
+
};
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
var loadEntity = function loadEntity(params) {
|
|
453
|
+
return function (dispatch) {
|
|
454
|
+
var _showDetailsWhenLoade = _objectSpread({
|
|
455
|
+
showDetailsWhenLoaded: true
|
|
456
|
+
}, params),
|
|
457
|
+
showDetailsWhenLoaded = _showDetailsWhenLoade.showDetailsWhenLoaded;
|
|
458
|
+
|
|
459
|
+
dispatch(mountNext(true));
|
|
460
|
+
var detailsURL = ctx.getDetailsURL instanceof Function ? ctx.getDetailsURL(params, url) : url + '/' + params.id;
|
|
461
|
+
return Promise.all([(0, _Helpers.dispatchFetchData)(dispatch)(dataKey, detailsURL), dispatch(loadDependencies())]).then(function (results) {
|
|
462
|
+
var success = dispatch(apiStateHandler(results[0]));
|
|
463
|
+
|
|
464
|
+
if (success && results && results[0] && results[0].type !== _Actions.NETWORK_ERROR) {
|
|
465
|
+
showDetailsWhenLoaded && dispatch(showDetails(true));
|
|
466
|
+
} else if (!results || !results[0]) {
|
|
467
|
+
// eslint-disable-next-line no-console
|
|
468
|
+
console.error('There are no results, check the call stack!');
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
return results;
|
|
472
|
+
});
|
|
473
|
+
};
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
var setFieldData = function setFieldData(field, value) {
|
|
477
|
+
return function (dispatch, getState) {
|
|
478
|
+
var state = getState();
|
|
479
|
+
|
|
480
|
+
if (!state[reducerName].isModified) {
|
|
481
|
+
dispatch(dataIsModified(reducerName, state[reducerName]));
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
dispatch({
|
|
485
|
+
type: SET_DATA,
|
|
486
|
+
key: dataKey,
|
|
487
|
+
field: field,
|
|
488
|
+
value: value
|
|
489
|
+
});
|
|
490
|
+
};
|
|
491
|
+
};
|
|
492
|
+
|
|
493
|
+
var validateData = function validateData() {
|
|
494
|
+
return function (dispatch, getState) {
|
|
495
|
+
var state = getState();
|
|
496
|
+
var data = new _Data.DataValidator(state[reducerName].data, false);
|
|
497
|
+
|
|
498
|
+
if (data.validate()) {
|
|
499
|
+
return true;
|
|
500
|
+
} else {
|
|
501
|
+
dispatch({
|
|
502
|
+
type: SET_VALIDATED_DATA,
|
|
503
|
+
key: dataKey,
|
|
504
|
+
data: data.getValidatedData()
|
|
505
|
+
});
|
|
506
|
+
return false;
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
};
|
|
510
|
+
|
|
511
|
+
var postData = ctx.postData || function () {
|
|
512
|
+
var hideDetails = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
513
|
+
return function (dispatch, getState) {
|
|
514
|
+
if (!dispatch(validateData())) {
|
|
515
|
+
return new Promise(function () {});
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
dispatch(mountNext(true));
|
|
519
|
+
var state = getState();
|
|
520
|
+
var newData = state[reducerName].data;
|
|
521
|
+
var data = {};
|
|
522
|
+
|
|
523
|
+
for (var k in newData) {
|
|
524
|
+
data[k] = newData[k].value;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
var p = (0, _Helpers.dispatchPostData)(dispatch)(dataKey, url, data).then(function (action) {
|
|
528
|
+
if (action && action.type === _Actions.RECEIVE_DATA) {
|
|
529
|
+
// Mount the data from the post response immediately
|
|
530
|
+
var _state2 = getState();
|
|
531
|
+
|
|
532
|
+
var source = _state2.dataBySource[dataKey];
|
|
533
|
+
source.data && dispatch(mountEntity(source.data, source.isPosted));
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
return action;
|
|
537
|
+
});
|
|
538
|
+
|
|
539
|
+
if (ctx.beforeApiStateHandler) {
|
|
540
|
+
p = p.then(function (s) {
|
|
541
|
+
return dispatch(ctx.beforeApiStateHandler(s));
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
p.then(function (s) {
|
|
546
|
+
return dispatch(apiStateHandler(s, hideDetails));
|
|
547
|
+
});
|
|
548
|
+
return p;
|
|
549
|
+
};
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
var deleteEntities = function deleteEntities(ids) {
|
|
553
|
+
return function (dispatch) {
|
|
554
|
+
dispatch(reportDeleteEntities(listKey, function () {
|
|
555
|
+
// onDelete callback
|
|
556
|
+
(0, _Helpers.dispatchDeleteData)(dispatch)(listKey, url, ids).then(function () {
|
|
557
|
+
dispatch(hideDetails(false));
|
|
558
|
+
dispatch(releaseUnsavedEntity());
|
|
559
|
+
dispatch((0, _Helpers.invalidateSource)(listKey));
|
|
560
|
+
dispatch(cancelDeleteEntitiesDialog());
|
|
561
|
+
ctx.afterDelete && dispatch(ctx.afterDelete(ids));
|
|
562
|
+
});
|
|
563
|
+
}, function () {
|
|
564
|
+
// cancel callback
|
|
565
|
+
dispatch(cancelDeleteEntitiesDialog());
|
|
566
|
+
}));
|
|
567
|
+
};
|
|
568
|
+
};
|
|
569
|
+
|
|
570
|
+
var invalidateList = function invalidateList() {
|
|
571
|
+
return function (dispatch) {
|
|
572
|
+
dispatch(releaseUnsavedEntity());
|
|
573
|
+
dispatch((0, _Helpers.invalidateSource)(listKey));
|
|
574
|
+
};
|
|
575
|
+
};
|
|
576
|
+
|
|
577
|
+
var customAction = function customAction(type, data) {
|
|
578
|
+
return function (dispatch) {
|
|
579
|
+
if (ctx.customDispatchHandler) {
|
|
580
|
+
var _customAction = ctx.customDispatchHandler(type, data);
|
|
581
|
+
|
|
582
|
+
if (_customAction) {
|
|
583
|
+
dispatch(_customAction);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
return {
|
|
590
|
+
listAction: listAction,
|
|
591
|
+
refreshListAction: refreshListAction,
|
|
592
|
+
showDetails: showDetails,
|
|
593
|
+
hideDetails: hideDetails,
|
|
594
|
+
detailsAction: detailsAction,
|
|
595
|
+
setFieldData: setFieldData,
|
|
596
|
+
postData: postData,
|
|
597
|
+
createEntity: createEntity,
|
|
598
|
+
deleteEntities: deleteEntities,
|
|
599
|
+
triggerUnsavedEntity: triggerUnsavedEntity,
|
|
600
|
+
invalidateList: invalidateList,
|
|
601
|
+
customAction: customAction,
|
|
602
|
+
loadEntity: loadEntity
|
|
603
|
+
};
|
|
604
|
+
};
|
|
605
|
+
|
|
606
|
+
exports.generateDefaultActions = generateDefaultActions;
|
|
607
|
+
|
|
608
|
+
var generateListActions = function generateListActions(listKey, url) {
|
|
609
|
+
var lastListParams;
|
|
610
|
+
|
|
611
|
+
var listAction = function listAction(params) {
|
|
612
|
+
return function (dispatch) {
|
|
613
|
+
lastListParams = params;
|
|
614
|
+
return (0, _Helpers.dispatchFetchData)(dispatch)(listKey, params ? {
|
|
615
|
+
url: url,
|
|
616
|
+
params: params
|
|
617
|
+
} : url);
|
|
618
|
+
};
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
var invalidateList = function invalidateList() {
|
|
622
|
+
return function (dispatch) {
|
|
623
|
+
dispatch((0, _Helpers.invalidateSource)(listKey));
|
|
624
|
+
};
|
|
625
|
+
};
|
|
626
|
+
|
|
627
|
+
var refreshListAction = function refreshListAction() {
|
|
628
|
+
return function (dispatch) {
|
|
629
|
+
return dispatch(listAction(lastListParams));
|
|
630
|
+
};
|
|
631
|
+
};
|
|
632
|
+
|
|
633
|
+
return {
|
|
634
|
+
listAction: listAction,
|
|
635
|
+
invalidateList: invalidateList,
|
|
636
|
+
refreshListAction: refreshListAction
|
|
637
|
+
};
|
|
638
|
+
};
|
|
639
|
+
|
|
640
|
+
exports.generateListActions = generateListActions;
|
|
641
|
+
|
|
642
|
+
var generateDeleteAction = function generateDeleteAction(listKey, url) {
|
|
643
|
+
return function (ids) {
|
|
644
|
+
return function (dispatch) {
|
|
645
|
+
dispatch(reportDeleteEntities(listKey, function () {
|
|
646
|
+
// onDelete callback
|
|
647
|
+
(0, _Helpers.dispatchDeleteData)(dispatch)(listKey, url, ids).then(function () {
|
|
648
|
+
dispatch(releaseUnsavedEntity());
|
|
649
|
+
dispatch((0, _Helpers.invalidateSource)(listKey));
|
|
650
|
+
dispatch(cancelDeleteEntitiesDialog());
|
|
651
|
+
});
|
|
652
|
+
}, function () {
|
|
653
|
+
// cancel callback
|
|
654
|
+
dispatch(cancelDeleteEntitiesDialog());
|
|
655
|
+
}));
|
|
656
|
+
};
|
|
657
|
+
};
|
|
658
|
+
};
|
|
659
|
+
|
|
660
|
+
exports.generateDeleteAction = generateDeleteAction;
|