@solidxai/core-ui 0.1.14-beta.3 → 0.1.14-beta.4
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/dist/components/core/card/CardGrid.d.ts +1 -1
- package/dist/components/core/card/CardGrid.d.ts.map +1 -1
- package/dist/components/core/card/CardGrid.js +2 -2
- package/dist/components/core/card/CardGrid.js.map +1 -1
- package/dist/components/core/card/CardGrid.tsx +2 -0
- package/dist/components/core/card/CardItem.d.ts +1 -0
- package/dist/components/core/card/CardItem.d.ts.map +1 -1
- package/dist/components/core/card/CardItem.js +2 -2
- package/dist/components/core/card/CardItem.js.map +1 -1
- package/dist/components/core/card/CardItem.tsx +3 -1
- package/dist/components/core/card/SolidCardView.d.ts.map +1 -1
- package/dist/components/core/card/SolidCardView.js +45 -36
- package/dist/components/core/card/SolidCardView.js.map +1 -1
- package/dist/components/core/card/SolidCardView.tsx +11 -0
- package/dist/components/core/common/SolidAccountSettings/SolidAccountSettings.d.ts.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidAccountSettings.js +27 -7
- package/dist/components/core/common/SolidAccountSettings/SolidAccountSettings.js.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidAccountSettings.tsx +19 -4
- package/dist/components/core/common/SolidAccountSettings/SolidVersionInfo.d.ts.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidVersionInfo.js +14 -11
- package/dist/components/core/common/SolidAccountSettings/SolidVersionInfo.js.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidVersionInfo.tsx +5 -1
- package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.js +167 -93
- package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.tsx +172 -42
- package/dist/components/core/extension/solid-core/media/card/MediaCardWidget.d.ts.map +1 -1
- package/dist/components/core/extension/solid-core/media/card/MediaCardWidget.js +2 -13
- package/dist/components/core/extension/solid-core/media/card/MediaCardWidget.js.map +1 -1
- package/dist/components/core/extension/solid-core/media/card/MediaCardWidget.tsx +2 -10
- package/dist/components/core/extension/solid-core/media/fileSize/MediaFileSizeWidget.d.ts +5 -0
- package/dist/components/core/extension/solid-core/media/fileSize/MediaFileSizeWidget.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/media/fileSize/MediaFileSizeWidget.js +34 -0
- package/dist/components/core/extension/solid-core/media/fileSize/MediaFileSizeWidget.js.map +1 -0
- package/dist/components/core/extension/solid-core/media/fileSize/MediaFileSizeWidget.tsx +47 -0
- package/dist/components/core/form/SolidDraftPublishWorkflow.d.ts +32 -0
- package/dist/components/core/form/SolidDraftPublishWorkflow.d.ts.map +1 -0
- package/dist/components/core/form/SolidDraftPublishWorkflow.js +228 -0
- package/dist/components/core/form/SolidDraftPublishWorkflow.js.map +1 -0
- package/dist/components/core/form/SolidDraftPublishWorkflow.tsx +234 -0
- package/dist/components/core/form/SolidFormActionHeader.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormActionHeader.js +41 -23
- package/dist/components/core/form/SolidFormActionHeader.js.map +1 -1
- package/dist/components/core/form/SolidFormActionHeader.tsx +52 -30
- package/dist/components/core/form/SolidFormView.d.ts +1 -0
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +108 -129
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/SolidFormView.tsx +72 -90
- package/dist/components/core/form/SolidVersionHistory.d.ts +12 -0
- package/dist/components/core/form/SolidVersionHistory.d.ts.map +1 -0
- package/dist/components/core/form/SolidVersionHistory.js +125 -0
- package/dist/components/core/form/SolidVersionHistory.js.map +1 -0
- package/dist/components/core/form/SolidVersionHistory.tsx +159 -0
- package/dist/components/core/form/fields/SolidDateField.d.ts +1 -2
- package/dist/components/core/form/fields/SolidDateField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDateField.js +0 -7
- package/dist/components/core/form/fields/SolidDateField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDateField.tsx +1 -13
- package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.js +17 -7
- package/dist/components/core/form/fields/SolidMediaMultipleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.tsx +10 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.js +28 -11
- package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.tsx +17 -2
- package/dist/components/core/kanban/KanbanBoard.d.ts +1 -1
- package/dist/components/core/kanban/KanbanBoard.d.ts.map +1 -1
- package/dist/components/core/kanban/KanbanBoard.js +2 -2
- package/dist/components/core/kanban/KanbanBoard.js.map +1 -1
- package/dist/components/core/kanban/KanbanBoard.tsx +2 -1
- package/dist/components/core/kanban/KanbanCard.d.ts +1 -0
- package/dist/components/core/kanban/KanbanCard.d.ts.map +1 -1
- package/dist/components/core/kanban/KanbanCard.js +2 -2
- package/dist/components/core/kanban/KanbanCard.js.map +1 -1
- package/dist/components/core/kanban/KanbanCard.tsx +3 -2
- package/dist/components/core/kanban/KanbanColumn.d.ts +2 -1
- package/dist/components/core/kanban/KanbanColumn.d.ts.map +1 -1
- package/dist/components/core/kanban/KanbanColumn.js +2 -2
- package/dist/components/core/kanban/KanbanColumn.js.map +1 -1
- package/dist/components/core/kanban/KanbanColumn.tsx +3 -2
- package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.js +57 -43
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.tsx +17 -2
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +141 -88
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +80 -13
- package/dist/components/core/list/columns/PublishStatusColumnDefaults.d.ts +3 -0
- package/dist/components/core/list/columns/PublishStatusColumnDefaults.d.ts.map +1 -0
- package/dist/components/core/list/columns/PublishStatusColumnDefaults.js +23 -0
- package/dist/components/core/list/columns/PublishStatusColumnDefaults.js.map +1 -0
- package/dist/components/core/list/columns/PublishStatusColumnDefaults.ts +26 -0
- package/dist/components/core/list/columns/SolidBooleanColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.js +3 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.tsx +2 -1
- package/dist/components/core/list/columns/SolidDateColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidDateColumn.js +3 -1
- package/dist/components/core/list/columns/SolidDateColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidDateColumn.tsx +2 -1
- package/dist/components/core/list/columns/SolidDatetimeColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidDatetimeColumn.js +3 -1
- package/dist/components/core/list/columns/SolidDatetimeColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidDatetimeColumn.tsx +2 -1
- package/dist/components/core/list/widgets/PublishedStatusListViewWidget.d.ts +3 -0
- package/dist/components/core/list/widgets/PublishedStatusListViewWidget.d.ts.map +1 -0
- package/dist/components/core/list/widgets/PublishedStatusListViewWidget.js +12 -0
- package/dist/components/core/list/widgets/PublishedStatusListViewWidget.js.map +1 -0
- package/dist/components/core/list/widgets/PublishedStatusListViewWidget.module.css +37 -0
- package/dist/components/core/list/widgets/PublishedStatusListViewWidget.tsx +22 -0
- package/dist/components/core/locales/SolidChatterLocaleTabView.d.ts +1 -0
- package/dist/components/core/locales/SolidChatterLocaleTabView.d.ts.map +1 -1
- package/dist/components/core/locales/SolidChatterLocaleTabView.js +2 -2
- package/dist/components/core/locales/SolidChatterLocaleTabView.js.map +1 -1
- package/dist/components/core/locales/SolidChatterLocaleTabView.tsx +3 -0
- package/dist/components/core/locales/SolidLocale.d.ts +2 -1
- package/dist/components/core/locales/SolidLocale.d.ts.map +1 -1
- package/dist/components/core/locales/SolidLocale.js +83 -11
- package/dist/components/core/locales/SolidLocale.js.map +1 -1
- package/dist/components/core/locales/SolidLocale.tsx +141 -52
- package/dist/components/core/locales/solid-locale.css +153 -44
- package/dist/components/core/tree/SolidTreeView.d.ts.map +1 -1
- package/dist/components/core/tree/SolidTreeView.js +29 -20
- package/dist/components/core/tree/SolidTreeView.js.map +1 -1
- package/dist/components/core/tree/SolidTreeView.tsx +37 -23
- package/dist/components/layout/AppSidebar.d.ts.map +1 -1
- package/dist/components/layout/AppSidebar.js +9 -0
- package/dist/components/layout/AppSidebar.js.map +1 -1
- package/dist/components/layout/AppSidebar.tsx +14 -0
- package/dist/helpers/registry.d.ts.map +1 -1
- package/dist/helpers/registry.js +5 -1
- package/dist/helpers/registry.js.map +1 -1
- package/dist/helpers/registry.ts +5 -1
- package/dist/helpers/settingsPayload.d.ts +3 -0
- package/dist/helpers/settingsPayload.d.ts.map +1 -1
- package/dist/helpers/settingsPayload.js +9 -0
- package/dist/helpers/settingsPayload.js.map +1 -1
- package/dist/helpers/settingsPayload.ts +13 -0
- package/dist/hooks/useSession.d.ts.map +1 -1
- package/dist/hooks/useSession.js +12 -6
- package/dist/hooks/useSession.js.map +1 -1
- package/dist/hooks/useSession.ts +8 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.ts +2 -1
- package/dist/redux/store/solidEntityApiPool.js +1 -1
- package/dist/redux/store/solidEntityApiPool.js.map +1 -1
- package/dist/redux/store/solidEntityApiPool.ts +1 -1
- package/dist/resources/globals.css +131 -11
- package/dist/resources/solid-custom.css +167 -0
- package/dist/resources/solid-tailwind-generated.css +1 -1
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js +4 -0
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js.map +1 -1
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.tsx +4 -0
- package/dist/routes/pages/admin/core/MediaUploadPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/MediaUploadPage.js +102 -40
- package/dist/routes/pages/admin/core/MediaUploadPage.js.map +1 -1
- package/dist/routes/pages/admin/core/MediaUploadPage.tsx +152 -61
- package/dist/types/index.d.ts +4 -2
- package/dist/types/solid-core.d.ts +17 -0
- package/package.json +1 -1
|
@@ -87,6 +87,8 @@ import { ERROR_MESSAGES } from "../../../constants/error-messages";
|
|
|
87
87
|
import { useLazyGetMcpUrlQuery, useLazyGetSolidSettingsQuery } from "../../../redux/api/solidSettingsApi";
|
|
88
88
|
import { getSettingsMap } from "../../../helpers/settingsPayload";
|
|
89
89
|
import { SolidFormFooter } from "./SolidFormFooter";
|
|
90
|
+
import { SolidVersionHistory, getWorkflowStatusLabel } from "./SolidVersionHistory";
|
|
91
|
+
import { appendVersionHistoryPage, SolidWorkflowStatusPill, SolidWorkflowConfirmDialog, useDraftPublishWorkflow } from "./SolidDraftPublishWorkflow";
|
|
90
92
|
import { normalizeSolidFormActionPath } from "../../../helpers/routePaths";
|
|
91
93
|
import { showToast } from "../../../redux/features/toastSlice";
|
|
92
94
|
import { closePopup, openPopup } from "../../../redux/features/popupSlice";
|
|
@@ -397,7 +399,7 @@ var SolidPageTab = function (_a) {
|
|
|
397
399
|
return _jsx(_Fragment, { children: children });
|
|
398
400
|
};
|
|
399
401
|
var SolidNotebook = function (_a) {
|
|
400
|
-
var children = _a.children, activeTab = _a.activeTab, embeded = _a.embeded, requestedTab = _a.requestedTab, requestedTabVersion = _a.requestedTabVersion;
|
|
402
|
+
var children = _a.children, activeTab = _a.activeTab, embeded = _a.embeded, requestedTab = _a.requestedTab, requestedTabVersion = _a.requestedTabVersion, workflowStatusLabel = _a.workflowStatusLabel;
|
|
401
403
|
var childrenArray = React.Children.toArray(children).filter(function (child) { return !!child; });
|
|
402
404
|
var router = useRouter();
|
|
403
405
|
var pathname = usePathname();
|
|
@@ -438,10 +440,10 @@ var SolidNotebook = function (_a) {
|
|
|
438
440
|
}
|
|
439
441
|
}
|
|
440
442
|
};
|
|
441
|
-
return (_jsxs("div", { className: "solid-notebook w-full", children: [
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
443
|
+
return (_jsxs("div", { className: "solid-notebook w-full", children: [_jsxs("div", { className: "solid-notebook-tablist", role: "tablist", children: [childrenArray.map(function (child, index) {
|
|
444
|
+
var _a, _b;
|
|
445
|
+
return (_jsx("button", { type: "button", role: "tab", "aria-selected": index === activeIndex, onClick: function () { return handleTabChange(index); }, className: "solid-notebook-tab-trigger".concat(index === activeIndex ? ' active' : '').concat(((_a = child.props) === null || _a === void 0 ? void 0 : _a.hasError) ? ' error' : ''), children: (_b = child.props) === null || _b === void 0 ? void 0 : _b.label }, index));
|
|
446
|
+
}), _jsx(SolidWorkflowStatusPill, { label: workflowStatusLabel })] }), _jsx("div", { className: "solid-notebook-content", role: "tabpanel", children: childrenArray[activeIndex] })] }));
|
|
445
447
|
};
|
|
446
448
|
var SolidDynamicWidget = function (_a) {
|
|
447
449
|
var widgetName = _a.widgetName, formik = _a.formik, field = _a.field, solidFormViewMetaData = _a.solidFormViewMetaData, solidFormViewData = _a.solidFormViewData;
|
|
@@ -532,49 +534,46 @@ var SolidPage = function (_a) {
|
|
|
532
534
|
// });
|
|
533
535
|
// };
|
|
534
536
|
var SolidFormView = function (params) {
|
|
535
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
536
|
-
var
|
|
537
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
|
|
538
|
+
var _3 = useSession(), session = _3.data, status = _3.status;
|
|
537
539
|
var user = session === null || session === void 0 ? void 0 : session.user;
|
|
538
540
|
var pathname = usePathname();
|
|
539
541
|
var router = useRouter();
|
|
540
542
|
var dispatch = useDispatch();
|
|
541
543
|
var searchParams = useSearchParams();
|
|
542
|
-
var
|
|
543
|
-
var
|
|
544
|
-
var
|
|
545
|
-
var
|
|
546
|
-
var
|
|
547
|
-
var
|
|
548
|
-
var
|
|
549
|
-
var
|
|
550
|
-
var
|
|
551
|
-
var
|
|
552
|
-
var
|
|
553
|
-
var
|
|
554
|
-
var
|
|
555
|
-
var
|
|
556
|
-
var
|
|
557
|
-
var _15 = useState(false), isResizingChatterLocale = _15[0], setIsResizingChatterLocale = _15[1];
|
|
558
|
-
var _16 = useState(false), isSubmitting = _16[0], setIsSubmitting = _16[1];
|
|
559
|
-
var _17 = useState(false), isMobileViewport = _17[0], setIsMobileViewport = _17[1];
|
|
544
|
+
var _4 = useState(false), redirectToList = _4[0], setRedirectToList = _4[1];
|
|
545
|
+
var _5 = useState('en'), selectedLocale = _5[0], setSelectedLocale = _5[1];
|
|
546
|
+
var _6 = useState(null), defaultEntityLocaleId = _6[0], setDefaultEntityLocaleId = _6[1];
|
|
547
|
+
var _7 = useState(false), isDeleteDialogVisible = _7[0], setDeleteDialogVisible = _7[1];
|
|
548
|
+
var _8 = useState(false), isLayoutDialogVisible = _8[0], setLayoutDialogVisible = _8[1];
|
|
549
|
+
var _9 = useState([]), actionsAllowed = _9[0], setActionsAllowed = _9[1];
|
|
550
|
+
var _10 = useState(params.embeded === true ? "edit" : "view"), viewMode = _10[0], setViewMode = _10[1];
|
|
551
|
+
var _11 = useState(false), createMode = _11[0], setCreateMode = _11[1];
|
|
552
|
+
var _12 = useState(false), openLightbox = _12[0], setOpenLightbox = _12[1];
|
|
553
|
+
var _13 = useState([]), lightboxUrls = _13[0], setLightboxUrls = _13[1];
|
|
554
|
+
var _14 = useState(false), isShowChatter = _14[0], setShowChatter = _14[1];
|
|
555
|
+
var _15 = useState(360), chatterLocaleWidth = _15[0], setChatterLocaleWidth = _15[1];
|
|
556
|
+
var _16 = useState(false), isResizingChatterLocale = _16[0], setIsResizingChatterLocale = _16[1];
|
|
557
|
+
var _17 = useState(false), isSubmitting = _17[0], setIsSubmitting = _17[1];
|
|
558
|
+
var _18 = useState(false), isMobileViewport = _18[0], setIsMobileViewport = _18[1];
|
|
560
559
|
var solidFormWrapperRef = useRef(null);
|
|
561
560
|
var embeddedRelationSubmitActionRef = useRef("close");
|
|
562
561
|
var formikRef = useRef(null);
|
|
563
562
|
var tabFieldsRef = useRef([]);
|
|
564
|
-
var
|
|
565
|
-
var
|
|
566
|
-
var
|
|
567
|
-
var
|
|
563
|
+
var _19 = useState(null), requestedTab = _19[0], setRequestedTab = _19[1];
|
|
564
|
+
var _20 = useState(0), requestedTabVersion = _20[0], setRequestedTabVersion = _20[1];
|
|
565
|
+
var _21 = useState(""), solidWorkflowFieldValue = _21[0], setSolidWorkflowFieldValue = _21[1];
|
|
566
|
+
var _22 = useState(1), defaultTabViewOptionIndex = _22[0], setDefaultTabViewOptionIndex = _22[1];
|
|
568
567
|
var errorFields = [];
|
|
569
568
|
var triggerCheckIfPermissionExists = useLazyCheckIfPermissionExistsQuery()[0];
|
|
570
|
-
var
|
|
569
|
+
var _23 = useState(null), mcpUrl = _23[0], setMcpUrl = _23[1];
|
|
571
570
|
var getMcpUrl = useLazyGetMcpUrlQuery()[0];
|
|
572
571
|
// when rendering the form view we will optionally get action params...
|
|
573
572
|
// these we can bubble up in the event that is being raised onFormLayoutLoad, onFormDataLoad & onFormLoad
|
|
574
573
|
var actionName = searchParams.get('actionName');
|
|
575
574
|
var actionType = searchParams.get('actionType');
|
|
576
575
|
var actionContext = searchParams.get('actionContext');
|
|
577
|
-
var
|
|
576
|
+
var _24 = useLazyGetSolidSettingsQuery(), trigger = _24[0], solidSettingsData = _24[1].data;
|
|
578
577
|
var solidSettingsMap = useMemo(function () { return getSettingsMap(solidSettingsData); }, [solidSettingsData]);
|
|
579
578
|
useEffect(function () {
|
|
580
579
|
trigger(""); // Fetch settings on mount
|
|
@@ -735,24 +734,28 @@ var SolidFormView = function (params) {
|
|
|
735
734
|
// }
|
|
736
735
|
// }y
|
|
737
736
|
var entityApi = createSolidEntityApi(params.modelName);
|
|
738
|
-
var useCreateSolidEntityMutation = entityApi.useCreateSolidEntityMutation, useDeleteSolidEntityMutation = entityApi.useDeleteSolidEntityMutation, useGetSolidEntityByIdQuery = entityApi.useGetSolidEntityByIdQuery, useUpdateSolidEntityMutation = entityApi.useUpdateSolidEntityMutation, usePatchUpdateSolidEntityMutation = entityApi.usePatchUpdateSolidEntityMutation
|
|
739
|
-
var
|
|
740
|
-
var
|
|
741
|
-
var
|
|
742
|
-
var
|
|
743
|
-
var
|
|
744
|
-
|
|
737
|
+
var useCreateSolidEntityMutation = entityApi.useCreateSolidEntityMutation, useDeleteSolidEntityMutation = entityApi.useDeleteSolidEntityMutation, useGetSolidEntityByIdQuery = entityApi.useGetSolidEntityByIdQuery, useUpdateSolidEntityMutation = entityApi.useUpdateSolidEntityMutation, usePatchUpdateSolidEntityMutation = entityApi.usePatchUpdateSolidEntityMutation;
|
|
738
|
+
var _25 = useCreateSolidEntityMutation(), createEntity = _25[0], _26 = _25[1], isEntityCreateSuccess = _26.isSuccess, isEntityCreateError = _26.isError, entityCreateError = _26.error;
|
|
739
|
+
var _27 = useUpdateSolidEntityMutation(), updateEntity = _27[0], _28 = _27[1], isEntityUpdateSuceess = _28.isSuccess, isEntityUpdateError = _28.isError, entityUpdateError = _28.error;
|
|
740
|
+
var _29 = useDeleteSolidEntityMutation(), deleteEntity = _29[0], _30 = _29[1], isEntityDeleteSuceess = _30.isSuccess, isEntityDeleteError = _30.isError, entityDeleteError = _30.error;
|
|
741
|
+
var _31 = usePatchUpdateSolidEntityMutation(), patchEntity = _31[0], _32 = _31[1], isEntityPatchSuceess = _32.isSuccess, isEntityPatchError = _32.isError, entityPatchError = _32.error;
|
|
742
|
+
var _33 = useDraftPublishWorkflow({
|
|
743
|
+
entityApi: entityApi,
|
|
744
|
+
id: params.id,
|
|
745
|
+
onWorkflowChange: function () { return refetchSolidFormViewData(); },
|
|
746
|
+
onEmbeddedFormSave: params.onEmbeddedFormSave,
|
|
747
|
+
}), published = _33.published, setPublished = _33.setPublished, confirmVisible = _33.confirmVisible, workflowConfirmAction = _33.workflowConfirmAction, handleDraftPublishWorkFlow = _33.handleDraftPublishWorkFlow, handleConfirmAccept = _33.handleConfirmAccept, handleConfirmReject = _33.handleConfirmReject, isEntityPublishedSuccess = _33.isEntityPublishedSuccess, isEntityUnpublishedSuccess = _33.isEntityUnpublishedSuccess;
|
|
745
748
|
// - - - - - - - - - - - -- - - - - - - - - - - - METADATA here
|
|
746
749
|
// Get the form view layout & metadata first.
|
|
747
750
|
var formViewMetaDataQs = qs.stringify(__assign(__assign({}, params), { viewType: 'form', defaultEntityLocaleId: defaultEntityLocaleId }), {
|
|
748
751
|
encodeValuesOnly: true,
|
|
749
752
|
});
|
|
750
|
-
var
|
|
751
|
-
var
|
|
752
|
-
var
|
|
753
|
+
var _34 = useState({}), formViewMetaData = _34[0], setFormViewMetaData = _34[1];
|
|
754
|
+
var _35 = useState(null), formViewLayout = _35[0], setFormViewLayout = _35[1];
|
|
755
|
+
var _36 = useGetSolidViewLayoutQuery(formViewMetaDataQs), solidFormViewMetaData = _36.data, solidFormViewMetaDataIsLoading = _36.isLoading;
|
|
753
756
|
var triggerGetSolidViewLayout = useLazyGetSolidViewLayoutQuery()[0];
|
|
754
757
|
var entityDisplayName = ((_c = (_b = (_a = solidFormViewMetaData === null || solidFormViewMetaData === void 0 ? void 0 : solidFormViewMetaData.data) === null || _a === void 0 ? void 0 : _a.solidView) === null || _b === void 0 ? void 0 : _b.model) === null || _c === void 0 ? void 0 : _c.displayName) || params.modelName;
|
|
755
|
-
var
|
|
758
|
+
var _37 = useState(true), refreshChatterMessage = _37[0], setRefreshChatterMessage = _37[1];
|
|
756
759
|
useEffect(function () {
|
|
757
760
|
var _a;
|
|
758
761
|
if (isEntityCreateSuccess == true ||
|
|
@@ -831,39 +834,25 @@ var SolidFormView = function (params) {
|
|
|
831
834
|
else if (isEntityPatchError) {
|
|
832
835
|
handleError(entityPatchError);
|
|
833
836
|
}
|
|
834
|
-
else if (isEntityPublishedError) {
|
|
835
|
-
handleError(entityPublishedError);
|
|
836
|
-
}
|
|
837
|
-
else if (isEntityUnpublishedError) {
|
|
838
|
-
handleError(entityUnpublishedError);
|
|
839
|
-
}
|
|
840
837
|
}, [
|
|
841
838
|
isEntityCreateError,
|
|
842
839
|
isEntityDeleteError,
|
|
843
840
|
isEntityUpdateError,
|
|
844
841
|
isEntityPatchError,
|
|
845
|
-
isEntityPublishedError,
|
|
846
|
-
isEntityUnpublishedError
|
|
847
842
|
]);
|
|
848
|
-
var confirmDialogWithPromise = function () {
|
|
849
|
-
return new Promise(function (resolve) {
|
|
850
|
-
confirmResolveRef.current = resolve;
|
|
851
|
-
setConfirmVisible(true);
|
|
852
|
-
});
|
|
853
|
-
};
|
|
854
843
|
var onFormikSubmit = function (values) { return __awaiter(void 0, void 0, void 0, function () {
|
|
855
|
-
var solidView, solidFieldsMetadata, layoutFieldsObj, formData_1, solidWorkflowField, workflowFieldMetadata, workflowFieldContext, workflowSolidField, result, baseFormPath, queryParams, saveParentRelationField, nextViewMode, result, err_1;
|
|
856
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l
|
|
857
|
-
return __generator(this, function (
|
|
858
|
-
switch (
|
|
844
|
+
var solidView, solidFieldsMetadata, layoutFieldsObj, formData_1, solidWorkflowField, workflowFieldMetadata, workflowFieldContext, workflowSolidField, result, baseFormPath, queryParams, saveParentRelationField, nextViewMode, result, nextId, queryParams, updatedPath, err_1;
|
|
845
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
846
|
+
return __generator(this, function (_m) {
|
|
847
|
+
switch (_m.label) {
|
|
859
848
|
case 0:
|
|
860
849
|
solidView = solidFormViewMetaData.data.solidView;
|
|
861
850
|
solidFieldsMetadata = solidFormViewMetaData.data.solidFieldsMetadata;
|
|
862
851
|
layoutFieldsObj = getLayoutFieldsAsObject([formViewLayout]);
|
|
863
852
|
setIsSubmitting(true);
|
|
864
|
-
|
|
853
|
+
_m.label = 1;
|
|
865
854
|
case 1:
|
|
866
|
-
|
|
855
|
+
_m.trys.push([1, 7, 8, 9]);
|
|
867
856
|
formData_1 = new FormData();
|
|
868
857
|
// Iterate through the keys in the values object
|
|
869
858
|
Object.entries(values).forEach(function (_a) {
|
|
@@ -911,11 +900,6 @@ var SolidFormView = function (params) {
|
|
|
911
900
|
formData_1.append('defaultEntityLocaleId', defaultEntityLocaleId.toString());
|
|
912
901
|
}
|
|
913
902
|
}
|
|
914
|
-
if ((_k = (_j = (_h = solidFormViewMetaData === null || solidFormViewMetaData === void 0 ? void 0 : solidFormViewMetaData.data) === null || _h === void 0 ? void 0 : _h.solidView) === null || _j === void 0 ? void 0 : _j.model) === null || _k === void 0 ? void 0 : _k.draftPublishWorkflow) {
|
|
915
|
-
if (published) {
|
|
916
|
-
formData_1.append('publishedAt', published);
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
903
|
if (!(params.inlineCreateAutoSave === true)) return [3 /*break*/, 2];
|
|
920
904
|
params.customCreateHandler(formData_1);
|
|
921
905
|
return [3 /*break*/, 6];
|
|
@@ -923,7 +907,7 @@ var SolidFormView = function (params) {
|
|
|
923
907
|
if (!(params.id === 'new')) return [3 /*break*/, 4];
|
|
924
908
|
return [4 /*yield*/, createEntity(formData_1).unwrap()];
|
|
925
909
|
case 3:
|
|
926
|
-
result =
|
|
910
|
+
result = _m.sent();
|
|
927
911
|
dispatch(showToast({ severity: "success", summary: ERROR_MESSAGES.FORM_SAVED, detail: ERROR_MESSAGES.FORM_SAVED_SUCCESSFULLY }));
|
|
928
912
|
// if (!params.embeded && result?.data?.id) {
|
|
929
913
|
// const newPathname = pathname.replace(/new$/, result.data.id);
|
|
@@ -936,30 +920,40 @@ var SolidFormView = function (params) {
|
|
|
936
920
|
if (!params.embeded) {
|
|
937
921
|
baseFormPath = normalizeSolidFormActionPath(pathname, "form");
|
|
938
922
|
queryParams = new URLSearchParams(searchParams.toString());
|
|
939
|
-
saveParentRelationField = ((
|
|
923
|
+
saveParentRelationField = ((_j = (_h = formikRef.current) === null || _h === void 0 ? void 0 : _h.status) === null || _j === void 0 ? void 0 : _j.saveParentRelationField) || window.sessionStorage.getItem("solidSaveParentRelationField");
|
|
940
924
|
nextViewMode = saveParentRelationField ? "edit" : "view";
|
|
941
925
|
queryParams.set("viewMode", nextViewMode);
|
|
942
926
|
if (saveParentRelationField) {
|
|
943
927
|
queryParams.set("childEntity", saveParentRelationField);
|
|
944
928
|
}
|
|
945
|
-
router.replace("".concat(baseFormPath, "/").concat((
|
|
929
|
+
router.replace("".concat(baseFormPath, "/").concat((_k = result === null || result === void 0 ? void 0 : result.data) === null || _k === void 0 ? void 0 : _k.id, "?").concat(queryParams.toString()));
|
|
946
930
|
setViewMode(nextViewMode);
|
|
947
931
|
}
|
|
948
932
|
return [2 /*return*/, result];
|
|
949
933
|
case 4: return [4 /*yield*/, updateEntity({ id: +params.id, data: formData_1 }).unwrap()];
|
|
950
934
|
case 5:
|
|
951
|
-
result =
|
|
935
|
+
result = _m.sent();
|
|
952
936
|
// const result = await updateEntity({ id: +params.id, data: formData }).unwrap();
|
|
953
937
|
if (!params.embeded) {
|
|
954
938
|
dispatch(showToast({ severity: "success", summary: ERROR_MESSAGES.FORM_UPDATE, detail: ERROR_MESSAGES.FORM_UPDATE_SUCCESSFULLY }));
|
|
955
939
|
if ((result === null || result === void 0 ? void 0 : result.statusCode) === 200) {
|
|
956
|
-
|
|
940
|
+
nextId = (_l = result === null || result === void 0 ? void 0 : result.data) === null || _l === void 0 ? void 0 : _l.id;
|
|
941
|
+
if (nextId && String(nextId) !== String(params.id)) {
|
|
942
|
+
queryParams = new URLSearchParams(searchParams.toString());
|
|
943
|
+
queryParams.set("viewMode", "view");
|
|
944
|
+
updatedPath = pathname.replace(/\/form\/[^/]+/, "/form/".concat(nextId));
|
|
945
|
+
router.replace("".concat(updatedPath, "?").concat(queryParams.toString()));
|
|
946
|
+
setViewMode("view");
|
|
947
|
+
}
|
|
948
|
+
else {
|
|
949
|
+
updateViewMode("view");
|
|
950
|
+
}
|
|
957
951
|
}
|
|
958
952
|
}
|
|
959
953
|
return [2 /*return*/, result];
|
|
960
954
|
case 6: return [3 /*break*/, 9];
|
|
961
955
|
case 7:
|
|
962
|
-
err_1 =
|
|
956
|
+
err_1 = _m.sent();
|
|
963
957
|
console.error(ERROR_MESSAGES.ENTITY_FAILED, err_1);
|
|
964
958
|
return [3 /*break*/, 9];
|
|
965
959
|
case 8:
|
|
@@ -1017,17 +1011,17 @@ var SolidFormView = function (params) {
|
|
|
1017
1011
|
var formViewDataQs = qs.stringify({ populate: toPopulate, populateMedia: toPopulateMedia }, {
|
|
1018
1012
|
encodeValuesOnly: true,
|
|
1019
1013
|
});
|
|
1020
|
-
var
|
|
1021
|
-
var
|
|
1014
|
+
var _38 = useState({}), initialEntityData = _38[0], setInitialEntityData = _38[1];
|
|
1015
|
+
var _39 = useGetSolidEntityByIdQuery({ id: params.id, qs: formViewDataQs }, {
|
|
1022
1016
|
skip: params.id === 'new'
|
|
1023
|
-
}), solidFormViewData =
|
|
1017
|
+
}), solidFormViewData = _39.data, solidFormViewDataIsLoading = _39.isLoading, refetchSolidFormViewData = _39.refetch;
|
|
1024
1018
|
useEffect(function () {
|
|
1025
1019
|
if (params.id !== 'new') {
|
|
1026
1020
|
refetchSolidFormViewData();
|
|
1027
1021
|
}
|
|
1028
1022
|
}, [formViewDataQs]);
|
|
1029
1023
|
useEffect(function () {
|
|
1030
|
-
var _a, _b, _c;
|
|
1024
|
+
var _a, _b, _c, _d;
|
|
1031
1025
|
if (solidFormViewMetaData) {
|
|
1032
1026
|
if (params.customLayout) {
|
|
1033
1027
|
setFormViewLayout(params.customLayout);
|
|
@@ -1035,10 +1029,14 @@ var SolidFormView = function (params) {
|
|
|
1035
1029
|
else {
|
|
1036
1030
|
setFormViewLayout((_b = (_a = solidFormViewMetaData === null || solidFormViewMetaData === void 0 ? void 0 : solidFormViewMetaData.data) === null || _a === void 0 ? void 0 : _a.solidView) === null || _b === void 0 ? void 0 : _b.layout);
|
|
1037
1031
|
}
|
|
1038
|
-
setPublished((_c = solidFormViewData === null || solidFormViewData === void 0 ? void 0 : solidFormViewData.data) === null || _c === void 0 ? void 0 : _c.publishedAt);
|
|
1032
|
+
setPublished(((_c = solidFormViewData === null || solidFormViewData === void 0 ? void 0 : solidFormViewData.data) === null || _c === void 0 ? void 0 : _c.isPublished) ? (_d = solidFormViewData === null || solidFormViewData === void 0 ? void 0 : solidFormViewData.data) === null || _d === void 0 ? void 0 : _d.publishedAt : null);
|
|
1039
1033
|
setFormViewMetaData(solidFormViewMetaData);
|
|
1040
1034
|
}
|
|
1041
|
-
}, [solidFormViewMetaData]);
|
|
1035
|
+
}, [solidFormViewMetaData, solidFormViewData]);
|
|
1036
|
+
var isDraftPublishWorkflowEnabled = ((_j = (_h = (_g = solidFormViewMetaData === null || solidFormViewMetaData === void 0 ? void 0 : solidFormViewMetaData.data) === null || _g === void 0 ? void 0 : _g.solidView) === null || _h === void 0 ? void 0 : _h.model) === null || _j === void 0 ? void 0 : _j.draftPublishWorkflow) === true;
|
|
1037
|
+
var currentWorkflowStatusLabel = isDraftPublishWorkflowEnabled && params.id !== 'new'
|
|
1038
|
+
? getWorkflowStatusLabel(solidFormViewData === null || solidFormViewData === void 0 ? void 0 : solidFormViewData.data)
|
|
1039
|
+
: null;
|
|
1042
1040
|
// useEffect(() => {
|
|
1043
1041
|
// const handleOnFormLayoutLoadEvent = async () => {
|
|
1044
1042
|
// if (solidFormViewMetaData) {
|
|
@@ -1331,7 +1329,7 @@ var SolidFormView = function (params) {
|
|
|
1331
1329
|
}
|
|
1332
1330
|
var solidField = fieldFactory(fieldMetadata === null || fieldMetadata === void 0 ? void 0 : fieldMetadata.type, fieldContext);
|
|
1333
1331
|
if (!(fieldMetadata === null || fieldMetadata === void 0 ? void 0 : fieldMetadata.type)) {
|
|
1334
|
-
var errorMessage = ((
|
|
1332
|
+
var errorMessage = ((_k = formLayoutField === null || formLayoutField === void 0 ? void 0 : formLayoutField.attrs) === null || _k === void 0 ? void 0 : _k.label) ? (_l = formLayoutField === null || formLayoutField === void 0 ? void 0 : formLayoutField.attrs) === null || _l === void 0 ? void 0 : _l.label : formLayoutField.attrs.name;
|
|
1335
1333
|
if (!errorFields.includes(errorMessage)) {
|
|
1336
1334
|
// errorFields.push(errorMessage);
|
|
1337
1335
|
}
|
|
@@ -1441,7 +1439,7 @@ var SolidFormView = function (params) {
|
|
|
1441
1439
|
}); };
|
|
1442
1440
|
// Now render the form dynamically...
|
|
1443
1441
|
var renderFormElementDynamically_1 = function (element, recursiveFVMD, path) {
|
|
1444
|
-
var _a, _b, _c;
|
|
1442
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1445
1443
|
if (path === void 0) { path = "root"; }
|
|
1446
1444
|
var type = element.type, attrs = element.attrs, body = element.body, children = element.children;
|
|
1447
1445
|
var normalizedAttrs = normalizeLayoutAttrs(attrs);
|
|
@@ -1506,13 +1504,19 @@ var SolidFormView = function (params) {
|
|
|
1506
1504
|
var fieldMetadata = recursiveFVMD.data.solidFieldsMetadata[normalizedAttrs.name];
|
|
1507
1505
|
// Read only permission if there is no update permission on model and router doesnt contains new
|
|
1508
1506
|
var readOnlyPermission = !actionsAllowed.includes("".concat(permissionExpression(params.modelName, 'update'))) && params.id !== "new";
|
|
1509
|
-
|
|
1507
|
+
var readOnlyArchivedVersion = ((_f = (_e = (_d = solidFormViewMetaData === null || solidFormViewMetaData === void 0 ? void 0 : solidFormViewMetaData.data) === null || _d === void 0 ? void 0 : _d.solidView) === null || _e === void 0 ? void 0 : _e.model) === null || _f === void 0 ? void 0 : _f.draftPublishWorkflow) === true
|
|
1508
|
+
&& ((_g = solidFormViewData === null || solidFormViewData === void 0 ? void 0 : solidFormViewData.data) === null || _g === void 0 ? void 0 : _g.isLatest) === false
|
|
1509
|
+
&& params.id !== "new";
|
|
1510
|
+
return _jsx(SolidField, { field: normalizedElement, formik: formik, fieldMetadata: fieldMetadata, initialEntityData: solidFormViewData ? solidFormViewData.data : {}, solidFormViewMetaData: recursiveFVMD, modelName: params.modelName, readOnly: readOnlyPermission || readOnlyArchivedVersion, viewMode: viewMode, onChange: formFieldOnXXX_1, onBlur: formFieldOnXXX_1, setLightboxUrls: setLightboxUrls, setOpenLightbox: setOpenLightbox, parentFieldName: params.parentFieldName, parentData: params.parentData, onEmbeddedFormSave: function () { return setRefreshChatterMessage(true); } }, normalizedAttrs.name);
|
|
1510
1511
|
}
|
|
1511
1512
|
break;
|
|
1512
1513
|
case "notebook":
|
|
1513
1514
|
if (visible === true) {
|
|
1514
1515
|
tabFieldsRef.current = [];
|
|
1515
|
-
|
|
1516
|
+
var workflowStatusLabel = ((_k = (_j = (_h = recursiveFVMD === null || recursiveFVMD === void 0 ? void 0 : recursiveFVMD.data) === null || _h === void 0 ? void 0 : _h.solidView) === null || _j === void 0 ? void 0 : _j.model) === null || _k === void 0 ? void 0 : _k.draftPublishWorkflow) === true
|
|
1517
|
+
? currentWorkflowStatusLabel
|
|
1518
|
+
: null;
|
|
1519
|
+
return _jsx(SolidNotebook, { activeTab: searchParams.get("activeTab") || "", embeded: params.embeded, requestedTab: requestedTab, requestedTabVersion: requestedTabVersion, workflowStatusLabel: workflowStatusLabel, children: children.map(function (element, index) { return renderFormElementDynamically_1(element, recursiveFVMD, "".concat(path, ".").concat(index)); }) }, key);
|
|
1516
1520
|
}
|
|
1517
1521
|
break;
|
|
1518
1522
|
case "page":
|
|
@@ -1533,11 +1537,20 @@ var SolidFormView = function (params) {
|
|
|
1533
1537
|
}
|
|
1534
1538
|
}
|
|
1535
1539
|
break;
|
|
1540
|
+
case "versionHistory":
|
|
1541
|
+
if (visible === true) {
|
|
1542
|
+
return (_jsx(SolidVersionHistory, { params: params, currentRecord: solidFormViewData === null || solidFormViewData === void 0 ? void 0 : solidFormViewData.data, onRefresh: function () {
|
|
1543
|
+
refetchSolidFormViewData();
|
|
1544
|
+
setRefreshChatterMessage(true);
|
|
1545
|
+
} }, key));
|
|
1546
|
+
}
|
|
1547
|
+
break;
|
|
1536
1548
|
default:
|
|
1537
1549
|
return null;
|
|
1538
1550
|
}
|
|
1539
1551
|
};
|
|
1540
1552
|
var renderFormDynamically = function (recursiveFVMD, formViewLayout) {
|
|
1553
|
+
var _a, _b;
|
|
1541
1554
|
if (!recursiveFVMD) {
|
|
1542
1555
|
return;
|
|
1543
1556
|
}
|
|
@@ -1549,7 +1562,12 @@ var SolidFormView = function (params) {
|
|
|
1549
1562
|
if (!solidView || !solidFieldsMetadata) {
|
|
1550
1563
|
return;
|
|
1551
1564
|
}
|
|
1552
|
-
var
|
|
1565
|
+
var shouldShowVersionHistory = Boolean(((_b = (_a = recursiveFVMD.data.solidView) === null || _a === void 0 ? void 0 : _a.model) === null || _b === void 0 ? void 0 : _b.draftPublishWorkflow)
|
|
1566
|
+
&& params.id !== 'new'
|
|
1567
|
+
&& params.embeded !== true
|
|
1568
|
+
&& !params.hideVersionHistory);
|
|
1569
|
+
var layoutToRender = shouldShowVersionHistory ? appendVersionHistoryPage(formViewLayout) : formViewLayout;
|
|
1570
|
+
var updatedLayout = [layoutToRender];
|
|
1553
1571
|
var dynamicForm = updatedLayout.map(function (element, index) { return renderFormElementDynamically_1(element, recursiveFVMD, "root-".concat(index)); });
|
|
1554
1572
|
return dynamicForm;
|
|
1555
1573
|
};
|
|
@@ -1569,7 +1587,7 @@ var SolidFormView = function (params) {
|
|
|
1569
1587
|
var onDeleteClose = function () {
|
|
1570
1588
|
setDeleteDialogVisible(false);
|
|
1571
1589
|
};
|
|
1572
|
-
var dynamicHeader = (
|
|
1590
|
+
var dynamicHeader = (_m = solidView_1.layout) === null || _m === void 0 ? void 0 : _m.header;
|
|
1573
1591
|
var DynamicHeaderComponent = null;
|
|
1574
1592
|
if (dynamicHeader) {
|
|
1575
1593
|
DynamicHeaderComponent = getExtensionComponent(dynamicHeader);
|
|
@@ -1597,8 +1615,8 @@ var SolidFormView = function (params) {
|
|
|
1597
1615
|
setDefaultTabViewOptionIndex(2);
|
|
1598
1616
|
}
|
|
1599
1617
|
};
|
|
1600
|
-
var showChatterInfo = Boolean(((
|
|
1601
|
-
|| ((
|
|
1618
|
+
var showChatterInfo = Boolean(((_q = (_p = (_o = solidFormViewMetaData === null || solidFormViewMetaData === void 0 ? void 0 : solidFormViewMetaData.data) === null || _o === void 0 ? void 0 : _o.solidView) === null || _p === void 0 ? void 0 : _p.model) === null || _q === void 0 ? void 0 : _q.draftPublishWorkflow)
|
|
1619
|
+
|| ((_t = (_s = (_r = solidFormViewMetaData === null || solidFormViewMetaData === void 0 ? void 0 : solidFormViewMetaData.data) === null || _r === void 0 ? void 0 : _r.solidView) === null || _s === void 0 ? void 0 : _s.model) === null || _t === void 0 ? void 0 : _t.internationalisation));
|
|
1602
1620
|
//en 4 null
|
|
1603
1621
|
var handleLocaleChangeRedirect = function (locale, defaultEntityLocaleId, viewMode) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1604
1622
|
var newViewMode, defaultApplicableLocales, matchingLocale, resolvedDefaultEntityLocaleId, freshQuery, freshResponse, freshApplicableLocales, _a, basePath, entityPart, updatedPath, queryParams;
|
|
@@ -1653,45 +1671,6 @@ var SolidFormView = function (params) {
|
|
|
1653
1671
|
}
|
|
1654
1672
|
});
|
|
1655
1673
|
}); };
|
|
1656
|
-
var handleConfirmAccept = function () {
|
|
1657
|
-
var _a;
|
|
1658
|
-
(_a = confirmResolveRef.current) === null || _a === void 0 ? void 0 : _a.call(confirmResolveRef, true);
|
|
1659
|
-
setConfirmVisible(false);
|
|
1660
|
-
};
|
|
1661
|
-
var handleConfirmReject = function () {
|
|
1662
|
-
var _a;
|
|
1663
|
-
(_a = confirmResolveRef.current) === null || _a === void 0 ? void 0 : _a.call(confirmResolveRef, false);
|
|
1664
|
-
setConfirmVisible(false);
|
|
1665
|
-
};
|
|
1666
|
-
var handleDraftPublishWorkFlow = function (type) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1667
|
-
var userChoice, result;
|
|
1668
|
-
var _a;
|
|
1669
|
-
return __generator(this, function (_b) {
|
|
1670
|
-
switch (_b.label) {
|
|
1671
|
-
case 0: return [4 /*yield*/, confirmDialogWithPromise()];
|
|
1672
|
-
case 1:
|
|
1673
|
-
userChoice = _b.sent();
|
|
1674
|
-
if (!userChoice)
|
|
1675
|
-
return [2 /*return*/];
|
|
1676
|
-
if (!(type === "publish")) return [3 /*break*/, 3];
|
|
1677
|
-
return [4 /*yield*/, publishSolidEntity(params.id).unwrap()];
|
|
1678
|
-
case 2:
|
|
1679
|
-
result = _b.sent();
|
|
1680
|
-
dispatch(showToast({ severity: "success", summary: ERROR_MESSAGES.SAVED, detail: ERROR_MESSAGES.MARK_PUBLISH }));
|
|
1681
|
-
return [3 /*break*/, 5];
|
|
1682
|
-
case 3: return [4 /*yield*/, unpublishSolidEntity(params.id).unwrap()];
|
|
1683
|
-
case 4:
|
|
1684
|
-
result = _b.sent();
|
|
1685
|
-
dispatch(showToast({ severity: "success", summary: ERROR_MESSAGES.SAVED, detail: ERROR_MESSAGES.MARK_UNPUBLISH }));
|
|
1686
|
-
_b.label = 5;
|
|
1687
|
-
case 5:
|
|
1688
|
-
console.log("publish/unpublish result", result);
|
|
1689
|
-
// Set updated publish value from API response
|
|
1690
|
-
setPublished((_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.publishedAt);
|
|
1691
|
-
return [2 /*return*/];
|
|
1692
|
-
}
|
|
1693
|
-
});
|
|
1694
|
-
}); };
|
|
1695
1674
|
var lightboxSlides = lightboxUrls
|
|
1696
1675
|
.map(function (item) {
|
|
1697
1676
|
var src = (item === null || item === void 0 ? void 0 : item.src) || (item === null || item === void 0 ? void 0 : item.downloadUrl) || "";
|
|
@@ -1706,11 +1685,11 @@ var SolidFormView = function (params) {
|
|
|
1706
1685
|
return slide;
|
|
1707
1686
|
})
|
|
1708
1687
|
.filter(function (slide) { return !!slide; });
|
|
1709
|
-
return (_jsxs("div", { className: "solid-form-wrapper", ref: solidFormWrapperRef, children: [_jsxs("div", { className: "solid-form-section", children: [_jsxs("form", { style: { width: '100%' }, onSubmit: formik.handleSubmit, children: [_jsx(FormikSubmitWatcher, { formik: formik, tabFieldsRef: tabFieldsRef, embeded: params.embeded, searchParams: searchParams, setRequestedTab: setRequestedTab, setRequestedTabVersion: setRequestedTabVersion }), _jsx(SolidFormActionHeader, { formik: formik, formData: solidFormViewData === null || solidFormViewData === void 0 ? void 0 : solidFormViewData.data, params: params, actionsAllowed: actionsAllowed, formViewLayout: formViewLayout, solidView: solidView_1, solidFormViewMetaData: solidFormViewMetaData, initialEntityData: solidFormViewData ? solidFormViewData.data : {}, setDeleteDialogVisible: setDeleteDialogVisible, setLayoutDialogVisible: setLayoutDialogVisible, setRedirectToList: setRedirectToList, viewMode: viewMode, setViewMode: setViewMode, solidWorkflowFieldValue: solidWorkflowFieldValue, setSolidWorkflowFieldValue: setSolidWorkflowFieldValue, draftEnabled: (
|
|
1688
|
+
return (_jsxs("div", { className: "solid-form-wrapper", ref: solidFormWrapperRef, children: [_jsxs("div", { className: "solid-form-section", children: [_jsxs("form", { style: { width: '100%' }, onSubmit: formik.handleSubmit, children: [_jsx(FormikSubmitWatcher, { formik: formik, tabFieldsRef: tabFieldsRef, embeded: params.embeded, searchParams: searchParams, setRequestedTab: setRequestedTab, setRequestedTabVersion: setRequestedTabVersion }), _jsx(SolidFormActionHeader, { formik: formik, formData: solidFormViewData === null || solidFormViewData === void 0 ? void 0 : solidFormViewData.data, params: params, actionsAllowed: actionsAllowed, formViewLayout: formViewLayout, solidView: solidView_1, solidFormViewMetaData: solidFormViewMetaData, initialEntityData: solidFormViewData ? solidFormViewData.data : {}, setDeleteDialogVisible: setDeleteDialogVisible, setLayoutDialogVisible: setLayoutDialogVisible, setRedirectToList: setRedirectToList, viewMode: viewMode, setViewMode: setViewMode, solidWorkflowFieldValue: solidWorkflowFieldValue, setSolidWorkflowFieldValue: setSolidWorkflowFieldValue, draftEnabled: (_w = (_v = (_u = solidFormViewMetaData === null || solidFormViewMetaData === void 0 ? void 0 : solidFormViewMetaData.data) === null || _u === void 0 ? void 0 : _u.solidView) === null || _v === void 0 ? void 0 : _v.model) === null || _w === void 0 ? void 0 : _w.draftPublishWorkflow, publish: published, internationalisationEnabled: (_z = (_y = (_x = solidFormViewMetaData === null || solidFormViewMetaData === void 0 ? void 0 : solidFormViewMetaData.data) === null || _x === void 0 ? void 0 : _x.solidView) === null || _y === void 0 ? void 0 : _y.model) === null || _z === void 0 ? void 0 : _z.internationalisation, handleDraftPublishWorkFlow: handleDraftPublishWorkFlow, onStepperUpdate: function () { return setRefreshChatterMessage(true); }, isSubmitting: isSubmitting, setEmbeddedRelationSubmitAction: function (action) {
|
|
1710
1689
|
embeddedRelationSubmitActionRef.current = action;
|
|
1711
1690
|
},
|
|
1712
1691
|
// headerRequestStatusLabel={isSubmitting ? "Saving..." : null}
|
|
1713
|
-
showMobileOpenChatter: isMobileViewport && !isShowChatter && params.embeded !== true, onMobileOpenChatter: function () { return setShowChatter(true); } }), _jsxs("div", { className: "px-3 py-3 md:p-4 solid-form-content md:pt-1 ".concat(createMode ? 'solid-create-mode-form-content' : 'solid-edit-mode-form-content', " ").concat(params.embeded === true ? 'h-auto' : ''), children: [DynamicHeaderComponent && _jsx(DynamicHeaderComponent, {}), params.id === 'new' && DynamicFormComponentNew ? (_jsx(DynamicFormComponentNew, { params: params })) : params.id !== 'new' && DynamicFormComponentEdit ? (_jsx(DynamicFormComponentEdit, { params: params })) : (renderFormDynamically(formViewMetaData, formViewLayout))] })] }), _jsx(SolidFormFooter, { params: params, internationalisationEnabled: (
|
|
1692
|
+
showMobileOpenChatter: isMobileViewport && !isShowChatter && params.embeded !== true, onMobileOpenChatter: function () { return setShowChatter(true); } }), _jsxs("div", { className: "px-3 py-3 md:p-4 solid-form-content md:pt-1 ".concat(createMode ? 'solid-create-mode-form-content' : 'solid-edit-mode-form-content', " ").concat(params.embeded === true ? 'h-auto' : ''), children: [DynamicHeaderComponent && _jsx(DynamicHeaderComponent, {}), params.id === 'new' && DynamicFormComponentNew ? (_jsx(DynamicFormComponentNew, { params: params })) : params.id !== 'new' && DynamicFormComponentEdit ? (_jsx(DynamicFormComponentEdit, { params: params })) : (renderFormDynamically(formViewMetaData, formViewLayout))] })] }), _jsx(SolidFormFooter, { params: params, internationalisationEnabled: (_2 = (_1 = (_0 = solidFormViewMetaData === null || solidFormViewMetaData === void 0 ? void 0 : solidFormViewMetaData.data) === null || _0 === void 0 ? void 0 : _0.solidView) === null || _1 === void 0 ? void 0 : _1.model) === null || _2 === void 0 ? void 0 : _2.internationalisation })] }), params.embeded !== true &&
|
|
1714
1693
|
_jsxs("div", { className: "chatter-section ".concat(isShowChatter === false ? 'collapsed' : 'open'), style: { width: chatterLocaleWidth }, children: [isShowChatter && (_jsx("div", { style: {
|
|
1715
1694
|
width: 5,
|
|
1716
1695
|
cursor: 'col-resize',
|
|
@@ -1724,7 +1703,7 @@ var SolidFormView = function (params) {
|
|
|
1724
1703
|
_jsxs("div", { className: "flex flex-col gap-2 justify-center p-1", children: [showChatterInfo &&
|
|
1725
1704
|
_jsx("div", { className: "chatter-collapsed-content", onClick: function () { return handleChatterExpandClick_1('info'); }, children: "Info" }), _jsx("div", { className: "chatter-collapsed-content", onClick: function () { return handleChatterExpandClick_1('chatter'); }, children: "Audit Trail" }), _jsx(SolidButton, { icon: "si si-chevron-left", size: "sm", className: "px-0", style: { width: 30 }, onClick: function () { return handleChatterExpandClick_1('chatter'); } })] })
|
|
1726
1705
|
:
|
|
1727
|
-
_jsx(SolidChatterLocaleTabView, { createMode: createMode, setSelectedLocale: setSelectedLocale, selectedLocale: selectedLocale, solidFormViewMetaData: solidFormViewMetaData, id: params.id, refreshChatterMessage: refreshChatterMessage, setRefreshChatterMessage: setRefreshChatterMessage, activeTab: defaultTabViewOptionIndex, viewMode: viewMode, defaultEntityLocaleId: defaultEntityLocaleId, handleLocaleChangeRedirect: handleLocaleChangeRedirect, solidFormViewData: solidFormViewData, published: published, actionsAllowed: actionsAllowed, mcpUrl: mcpUrl })] }), _jsx(SolidConfirmDialog, { open: isDeleteDialogVisible, onCancel: onDeleteClose, onConfirm: function () { return handleDeleteEntity_1(); }, className: "solid-shadcn-confirm-dialog solid-delete-confirm-dialog", headerClassName: "solid-shadcn-dialog-head", bodyClassName: "solid-shadcn-dialog-body", footerClassName: "solid-shadcn-dialog-actions", separatorClassName: "solid-shadcn-dialog-sep", showSeparator: true, title: "Delete ".concat(entityDisplayName), message: _jsx("p", { className: "solid-shadcn-dialog-text", children: "Are you sure you want to delete this ".concat(entityDisplayName, "?") }), confirmLabel: "Delete", cancelLabel: "Cancel" }), _jsxs(SolidDialog, { open: isLayoutDialogVisible, onOpenChange: setLayoutDialogVisible, className: "solid-form-layout-dialog", children: [_jsxs(SolidDialogHeader, { className: "solid-shadcn-dialog-head", children: [_jsx(SolidDialogTitle, { children: "Change Form Layout" }), _jsx(SolidDialogClose, {})] }), _jsx(SolidDialogSeparator, {}), _jsx(SolidDialogBody, { className: "p-4 pt-0 lg:p-6", children: _jsx(SolidFormUserViewLayout, { solidFormViewMetaData: solidFormViewMetaData, setLayoutDialogVisible: setLayoutDialogVisible }) })] }), openLightbox && (_jsx(SolidLightbox, { open: openLightbox, slides: lightboxSlides, onClose: function () { return setOpenLightbox(false); } })), _jsx(
|
|
1706
|
+
_jsx(SolidChatterLocaleTabView, { createMode: createMode, setSelectedLocale: setSelectedLocale, selectedLocale: selectedLocale, solidFormViewMetaData: solidFormViewMetaData, id: params.id, refreshChatterMessage: refreshChatterMessage, setRefreshChatterMessage: setRefreshChatterMessage, activeTab: defaultTabViewOptionIndex, viewMode: viewMode, defaultEntityLocaleId: defaultEntityLocaleId, handleLocaleChangeRedirect: handleLocaleChangeRedirect, solidFormViewData: solidFormViewData, published: published, workflowStatusLabel: currentWorkflowStatusLabel, actionsAllowed: actionsAllowed, mcpUrl: mcpUrl })] }), _jsx(SolidConfirmDialog, { open: isDeleteDialogVisible, onCancel: onDeleteClose, onConfirm: function () { return handleDeleteEntity_1(); }, className: "solid-shadcn-confirm-dialog solid-delete-confirm-dialog", headerClassName: "solid-shadcn-dialog-head", bodyClassName: "solid-shadcn-dialog-body", footerClassName: "solid-shadcn-dialog-actions", separatorClassName: "solid-shadcn-dialog-sep", showSeparator: true, title: "Delete ".concat(entityDisplayName), message: _jsx("p", { className: "solid-shadcn-dialog-text", children: "Are you sure you want to delete this ".concat(entityDisplayName, "?") }), confirmLabel: "Delete", cancelLabel: "Cancel" }), _jsxs(SolidDialog, { open: isLayoutDialogVisible, onOpenChange: setLayoutDialogVisible, className: "solid-form-layout-dialog", children: [_jsxs(SolidDialogHeader, { className: "solid-shadcn-dialog-head", children: [_jsx(SolidDialogTitle, { children: "Change Form Layout" }), _jsx(SolidDialogClose, {})] }), _jsx(SolidDialogSeparator, {}), _jsx(SolidDialogBody, { className: "p-4 pt-0 lg:p-6", children: _jsx(SolidFormUserViewLayout, { solidFormViewMetaData: solidFormViewMetaData, setLayoutDialogVisible: setLayoutDialogVisible }) })] }), openLightbox && (_jsx(SolidLightbox, { open: openLightbox, slides: lightboxSlides, onClose: function () { return setOpenLightbox(false); } })), _jsx(SolidWorkflowConfirmDialog, { open: confirmVisible, workflowConfirmAction: workflowConfirmAction, onConfirm: handleConfirmAccept, onCancel: handleConfirmReject })] }));
|
|
1728
1707
|
}
|
|
1729
1708
|
};
|
|
1730
1709
|
export default SolidFormView;
|