@solidxai/core-ui 0.1.5-beta.1 → 0.1.5-beta.11
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/chatter/SolidChatter.d.ts.map +1 -1
- package/dist/components/core/chatter/SolidChatter.js +5 -2
- package/dist/components/core/chatter/SolidChatter.js.map +1 -1
- package/dist/components/core/chatter/SolidChatter.tsx +5 -2
- package/dist/components/core/chatter/SolidChatterAuditMessage.d.ts +5 -2
- package/dist/components/core/chatter/SolidChatterAuditMessage.d.ts.map +1 -1
- package/dist/components/core/chatter/SolidChatterAuditMessage.js +19 -1
- package/dist/components/core/chatter/SolidChatterAuditMessage.js.map +1 -1
- package/dist/components/core/chatter/SolidChatterAuditMessage.tsx +29 -5
- package/dist/components/core/chatter/SolidChatterDateDivider.d.ts.map +1 -1
- package/dist/components/core/chatter/SolidChatterDateDivider.js +4 -1
- package/dist/components/core/chatter/SolidChatterDateDivider.js.map +1 -1
- package/dist/components/core/chatter/SolidChatterDateDivider.tsx +5 -1
- package/dist/components/core/common/SolidCreateButton.js +3 -3
- package/dist/components/core/common/SolidCreateButton.js.map +1 -1
- package/dist/components/core/common/SolidCreateButton.tsx +3 -3
- package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.tsx +1 -0
- package/dist/components/core/dashboard/DashboardFilter.d.ts +13 -0
- package/dist/components/core/dashboard/DashboardFilter.d.ts.map +1 -0
- package/dist/components/core/dashboard/DashboardFilter.js +305 -0
- package/dist/components/core/dashboard/DashboardFilter.js.map +1 -0
- package/dist/components/core/dashboard/DashboardFilter.tsx +356 -0
- package/dist/components/core/dashboard/PrimeDataTableWrapper.d.ts +3 -0
- package/dist/components/core/dashboard/PrimeDataTableWrapper.d.ts.map +1 -0
- package/dist/components/core/dashboard/PrimeDataTableWrapper.js +21 -0
- package/dist/components/core/dashboard/PrimeDataTableWrapper.js.map +1 -0
- package/dist/components/core/dashboard/PrimeDataTableWrapper.tsx +40 -0
- package/dist/components/core/dashboard/SolidDashboard.d.ts +0 -1
- package/dist/components/core/dashboard/SolidDashboard.d.ts.map +1 -1
- package/dist/components/core/dashboard/SolidDashboard.js +51 -22
- package/dist/components/core/dashboard/SolidDashboard.js.map +1 -1
- package/dist/components/core/dashboard/SolidDashboard.module.css +6 -2
- package/dist/components/core/dashboard/SolidDashboard.tsx +133 -56
- package/dist/components/core/dashboard/SolidDashboardBody.d.ts +13 -1
- package/dist/components/core/dashboard/SolidDashboardBody.d.ts.map +1 -1
- package/dist/components/core/dashboard/SolidDashboardBody.js +134 -48
- package/dist/components/core/dashboard/SolidDashboardBody.js.map +1 -1
- package/dist/components/core/dashboard/SolidDashboardBody.tsx +143 -91
- package/dist/components/core/dashboard/SolidQuestionRenderer.d.ts.map +1 -1
- package/dist/components/core/dashboard/SolidQuestionRenderer.js +1 -1
- package/dist/components/core/dashboard/SolidQuestionRenderer.js.map +1 -1
- package/dist/components/core/dashboard/SolidQuestionRenderer.tsx +12 -10
- package/dist/components/core/dashboard/chart-renderers/ChartJsRenderer.d.ts.map +1 -1
- package/dist/components/core/dashboard/chart-renderers/ChartJsRenderer.js +29 -2
- package/dist/components/core/dashboard/chart-renderers/ChartJsRenderer.js.map +1 -1
- package/dist/components/core/dashboard/chart-renderers/ChartJsRenderer.tsx +33 -3
- package/dist/components/core/extension/solid-core/dashboard/dashboardFormViewChangeHandler.d.ts +10 -0
- package/dist/components/core/extension/solid-core/dashboard/dashboardFormViewChangeHandler.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/dashboard/dashboardFormViewChangeHandler.js +16 -0
- package/dist/components/core/extension/solid-core/dashboard/dashboardFormViewChangeHandler.js.map +1 -0
- package/dist/components/core/extension/solid-core/dashboard/dashboardFormViewChangeHandler.ts +19 -0
- package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionFieldChangeHandler.d.ts +8 -0
- package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionFieldChangeHandler.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionFieldChangeHandler.js +64 -0
- package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionFieldChangeHandler.js.map +1 -0
- package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionFieldChangeHandler.ts +30 -0
- package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionOnFormLoadHandler.d.ts +8 -0
- package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionOnFormLoadHandler.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionOnFormLoadHandler.js +62 -0
- package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionOnFormLoadHandler.js.map +1 -0
- package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionOnFormLoadHandler.ts +29 -0
- package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.js +2 -2
- package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.js.map +1 -1
- package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.tsx +2 -2
- package/dist/components/core/form/SolidFormView.js +1 -1
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/SolidFormView.tsx +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.js +22 -15
- package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.tsx +14 -2
- package/dist/components/core/kanban/SolidKanbanView.js +2 -2
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.tsx +2 -2
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +14 -11
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +8 -7
- package/dist/components/core/list/columns/SolidDateColumn.d.ts +2 -0
- package/dist/components/core/list/columns/SolidDateColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidDateColumn.js +9 -1
- package/dist/components/core/list/columns/SolidDateColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidDateColumn.tsx +13 -1
- package/dist/components/core/list/columns/SolidDatetimeColumn.js +1 -1
- package/dist/components/core/list/columns/SolidDatetimeColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidDatetimeColumn.tsx +1 -1
- package/dist/components/core/tree/SolidTreeView.d.ts.map +1 -1
- package/dist/components/core/tree/SolidTreeView.js +277 -43
- package/dist/components/core/tree/SolidTreeView.js.map +1 -1
- package/dist/components/core/tree/SolidTreeView.tsx +436 -4
- package/dist/constants/error-messages.d.ts +3 -0
- package/dist/constants/error-messages.d.ts.map +1 -1
- package/dist/constants/error-messages.js +3 -0
- package/dist/constants/error-messages.js.map +1 -1
- package/dist/constants/error-messages.ts +24 -20
- package/dist/helpers/registry.d.ts.map +1 -1
- package/dist/helpers/registry.js +10 -0
- package/dist/helpers/registry.js.map +1 -1
- package/dist/helpers/registry.ts +12 -0
- package/dist/helpers/routePaths.d.ts +1 -1
- package/dist/helpers/routePaths.d.ts.map +1 -1
- package/dist/helpers/routePaths.js +2 -2
- package/dist/helpers/routePaths.js.map +1 -1
- package/dist/helpers/routePaths.ts +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/index.ts +8 -0
- package/dist/redux/api/dashboardLayoutApi.d.ts +24 -0
- package/dist/redux/api/dashboardLayoutApi.d.ts.map +1 -0
- package/dist/redux/api/dashboardLayoutApi.js +34 -0
- package/dist/redux/api/dashboardLayoutApi.js.map +1 -0
- package/dist/redux/api/dashboardLayoutApi.ts +55 -0
- package/dist/redux/store/defaultStoreConfig.d.ts +4 -0
- package/dist/redux/store/defaultStoreConfig.d.ts.map +1 -1
- package/dist/redux/store/defaultStoreConfig.js +3 -2
- package/dist/redux/store/defaultStoreConfig.js.map +1 -1
- package/dist/redux/store/defaultStoreConfig.ts +4 -2
- package/dist/resources/globals.css +8 -0
- package/dist/routes/pages/admin/core/DashboardPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/DashboardPage.js +3 -7
- package/dist/routes/pages/admin/core/DashboardPage.js.map +1 -1
- package/dist/routes/pages/admin/core/DashboardPage.tsx +2 -5
- package/dist/routes/pages/admin/core/FormPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/FormPage.js +6 -1
- package/dist/routes/pages/admin/core/FormPage.js.map +1 -1
- package/dist/routes/pages/admin/core/FormPage.tsx +7 -1
- package/dist/routes/solidRoutes.js +1 -1
- package/dist/routes/solidRoutes.js.map +1 -1
- package/dist/routes/solidRoutes.tsx +1 -1
- package/package.json +13 -11
|
@@ -1,8 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
import { useEffect, useRef } from "react";
|
|
2
14
|
import "../../../../components/core/dashboard/chart-renderers/init-chartjs";
|
|
3
15
|
import { Bar, Line, Pie } from "react-chartjs-2";
|
|
4
16
|
export var ChartJsRenderer = function (_a) {
|
|
5
17
|
var options = _a.options, visualizationData = _a.visualizationData, visualizedAs = _a.visualizedAs;
|
|
6
|
-
|
|
18
|
+
var chartRef = useRef(null);
|
|
19
|
+
var containerRef = useRef(null);
|
|
20
|
+
useEffect(function () {
|
|
21
|
+
if (!containerRef.current)
|
|
22
|
+
return;
|
|
23
|
+
var observer = new ResizeObserver(function () {
|
|
24
|
+
if (chartRef.current) {
|
|
25
|
+
chartRef.current.resize(); // ✅ tell Chart.js to refit
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
observer.observe(containerRef.current);
|
|
29
|
+
return function () { return observer.disconnect(); };
|
|
30
|
+
}, []);
|
|
31
|
+
// Merge in responsive options
|
|
32
|
+
var mergedOptions = __assign(__assign({}, options), { responsive: true, maintainAspectRatio: false });
|
|
33
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { ref: containerRef, style: { position: "relative", width: "100%", height: "100%" }, children: [visualizedAs === 'bar' && _jsx(Bar, { ref: chartRef, options: mergedOptions, data: visualizationData }), visualizedAs === 'line' && _jsx(Line, { ref: chartRef, options: mergedOptions, data: visualizationData }), visualizedAs === 'pie' && _jsx(Pie, { ref: chartRef, options: mergedOptions, data: visualizationData })] }) }));
|
|
7
34
|
};
|
|
8
35
|
//# sourceMappingURL=ChartJsRenderer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartJsRenderer.js","sourceRoot":"","sources":["../../../../../src/components/core/dashboard/chart-renderers/ChartJsRenderer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChartJsRenderer.js","sourceRoot":"","sources":["../../../../../src/components/core/dashboard/chart-renderers/ChartJsRenderer.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,oEAAoE,CAAC;AAC5E,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAQjD,MAAM,CAAC,IAAM,eAAe,GAAG,UAAC,EAAkE;QAAhE,OAAO,aAAA,EAAE,iBAAiB,uBAAA,EAAE,YAAY,kBAAA;IAEtE,IAAM,QAAQ,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js\";\nimport { Bar, Line, Pie } from \"react-chartjs-2\";\nimport { ChartJSOrUndefined } from \"node_modules/react-chartjs-2/dist/types\";\n\ntype ChartJsRendererProps = {\n options: any;\n visualizationData: any;\n visualizedAs: 'bar' | 'line' | 'pie';\n};\nexport const ChartJsRenderer = ({ options, visualizationData, visualizedAs }: ChartJsRendererProps) => {\n\n const chartRef = useRef<ChartJSOrUndefined>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!containerRef.current) return;\n\n const observer = new ResizeObserver(() => {\n if (chartRef.current) {\n chartRef.current.resize(); // ✅ tell Chart.js to refit\n }\n });\n\n observer.observe(containerRef.current);\n return () => observer.disconnect();\n }, []);\n\n // Merge in responsive options\n const mergedOptions = {\n ...options,\n responsive: true,\n maintainAspectRatio: false, // ✅ allows chart to fill container height\n };\n\n\n return (\n <>\n <div ref={containerRef} style={{ position: \"relative\", width: \"100%\", height: \"100%\" }}>\n\n {visualizedAs === 'bar' && <Bar ref={chartRef as any} options={mergedOptions} data={visualizationData} />}\n {visualizedAs === 'line' && <Line ref={chartRef as any} options={mergedOptions} data={visualizationData} />}\n {visualizedAs === 'pie' && <Pie ref={chartRef as any} options={mergedOptions} data={visualizationData} />}\n </div>\n </>\n );\n}"]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
2
3
|
import "../../../../components/core/dashboard/chart-renderers/init-chartjs";
|
|
3
4
|
import { Bar, Line, Pie } from "react-chartjs-2";
|
|
5
|
+
import { ChartJSOrUndefined } from "node_modules/react-chartjs-2/dist/types";
|
|
4
6
|
|
|
5
7
|
type ChartJsRendererProps = {
|
|
6
8
|
options: any;
|
|
@@ -8,11 +10,39 @@ type ChartJsRendererProps = {
|
|
|
8
10
|
visualizedAs: 'bar' | 'line' | 'pie';
|
|
9
11
|
};
|
|
10
12
|
export const ChartJsRenderer = ({ options, visualizationData, visualizedAs }: ChartJsRendererProps) => {
|
|
13
|
+
|
|
14
|
+
const chartRef = useRef<ChartJSOrUndefined>(null);
|
|
15
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
16
|
+
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (!containerRef.current) return;
|
|
19
|
+
|
|
20
|
+
const observer = new ResizeObserver(() => {
|
|
21
|
+
if (chartRef.current) {
|
|
22
|
+
chartRef.current.resize(); // ✅ tell Chart.js to refit
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
observer.observe(containerRef.current);
|
|
27
|
+
return () => observer.disconnect();
|
|
28
|
+
}, []);
|
|
29
|
+
|
|
30
|
+
// Merge in responsive options
|
|
31
|
+
const mergedOptions = {
|
|
32
|
+
...options,
|
|
33
|
+
responsive: true,
|
|
34
|
+
maintainAspectRatio: false, // ✅ allows chart to fill container height
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
|
|
11
38
|
return (
|
|
12
39
|
<>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
40
|
+
<div ref={containerRef} style={{ position: "relative", width: "100%", height: "100%" }}>
|
|
41
|
+
|
|
42
|
+
{visualizedAs === 'bar' && <Bar ref={chartRef as any} options={mergedOptions} data={visualizationData} />}
|
|
43
|
+
{visualizedAs === 'line' && <Line ref={chartRef as any} options={mergedOptions} data={visualizationData} />}
|
|
44
|
+
{visualizedAs === 'pie' && <Pie ref={chartRef as any} options={mergedOptions} data={visualizationData} />}
|
|
45
|
+
</div>
|
|
16
46
|
</>
|
|
17
47
|
);
|
|
18
48
|
}
|
package/dist/components/core/extension/solid-core/dashboard/dashboardFormViewChangeHandler.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SolidUiEvent } from "../../../../../types";
|
|
2
|
+
declare const dashboardFormViewChangeHandler: (event: SolidUiEvent) => {
|
|
3
|
+
layoutChanged: boolean;
|
|
4
|
+
dataChanged: boolean;
|
|
5
|
+
newFormData: {
|
|
6
|
+
name: any;
|
|
7
|
+
};
|
|
8
|
+
} | undefined;
|
|
9
|
+
export default dashboardFormViewChangeHandler;
|
|
10
|
+
//# sourceMappingURL=dashboardFormViewChangeHandler.d.ts.map
|
package/dist/components/core/extension/solid-core/dashboard/dashboardFormViewChangeHandler.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboardFormViewChangeHandler.d.ts","sourceRoot":"","sources":["../../../../../../src/components/core/extension/solid-core/dashboard/dashboardFormViewChangeHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,QAAA,MAAM,8BAA8B,UAAW,YAAY;;;;;;aAc1D,CAAA;AACD,eAAe,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getSingularAndPlural } from "../../../../../helpers/helpers";
|
|
2
|
+
var dashboardFormViewChangeHandler = function (event) {
|
|
3
|
+
var modifiedField = event.modifiedField, modifiedFieldValue = event.modifiedFieldValue, formData = event.formData;
|
|
4
|
+
var toKebabCase = getSingularAndPlural(modifiedFieldValue).toKebabCase;
|
|
5
|
+
if (modifiedField === 'displayName') {
|
|
6
|
+
return {
|
|
7
|
+
layoutChanged: false,
|
|
8
|
+
dataChanged: true,
|
|
9
|
+
newFormData: {
|
|
10
|
+
name: toKebabCase
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
export default dashboardFormViewChangeHandler;
|
|
16
|
+
//# sourceMappingURL=dashboardFormViewChangeHandler.js.map
|
package/dist/components/core/extension/solid-core/dashboard/dashboardFormViewChangeHandler.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboardFormViewChangeHandler.js","sourceRoot":"","sources":["../../../../../../src/components/core/extension/solid-core/dashboard/dashboardFormViewChangeHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAGtE,IAAM,8BAA8B,GAAG,UAAC,KAAmB;IAE/C,IAAA,aAAa,GAAmC,KAAK,cAAxC,EAAE,kBAAkB,GAAe,KAAK,mBAApB,EAAE,QAAQ,GAAK,KAAK,SAAV,CAAW;IACtD,IAAA,WAAW,GAAK,oBAAoB,CAAC,kBAAkB,CAAC,YAA7C,CAA8C;IAEjE,IAAI,aAAa,KAAK,aAAa,EAAE;QACjC,OAAO;YACH,aAAa,EAAE,KAAK;YACpB,WAAW,EAAE,IAAI;YACjB,WAAW,EAAE;gBACT,IAAI,EAAE,WAAW;aACpB;SACJ,CAAA;KACJ;AACL,CAAC,CAAA;AACD,eAAe,8BAA8B,CAAC","sourcesContent":["import { getSingularAndPlural } from \"../../../../../helpers/helpers\";\nimport { SolidUiEvent } from \"../../../../../types\";\n\nconst dashboardFormViewChangeHandler = (event: SolidUiEvent) => {\n\n const { modifiedField, modifiedFieldValue, formData } = event;\n const { toKebabCase } = getSingularAndPlural(modifiedFieldValue);\n\n if (modifiedField === 'displayName') {\n return {\n layoutChanged: false,\n dataChanged: true,\n newFormData: {\n name: toKebabCase\n },\n }\n }\n}\nexport default dashboardFormViewChangeHandler;\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { getSingularAndPlural } from "../../../../../helpers/helpers";
|
|
2
|
+
import { SolidUiEvent } from "../../../../../types";
|
|
3
|
+
|
|
4
|
+
const dashboardFormViewChangeHandler = (event: SolidUiEvent) => {
|
|
5
|
+
|
|
6
|
+
const { modifiedField, modifiedFieldValue, formData } = event;
|
|
7
|
+
const { toKebabCase } = getSingularAndPlural(modifiedFieldValue);
|
|
8
|
+
|
|
9
|
+
if (modifiedField === 'displayName') {
|
|
10
|
+
return {
|
|
11
|
+
layoutChanged: false,
|
|
12
|
+
dataChanged: true,
|
|
13
|
+
newFormData: {
|
|
14
|
+
name: toKebabCase
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export default dashboardFormViewChangeHandler;
|
package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionFieldChangeHandler.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SolidUiEvent } from "../../../../../types";
|
|
2
|
+
declare const dashboardQuestionFieldChangeHandler: (event: SolidUiEvent) => Promise<{
|
|
3
|
+
layoutChanged: boolean;
|
|
4
|
+
dataChanged: boolean;
|
|
5
|
+
newLayout: import("../../../../../types").LayoutNode;
|
|
6
|
+
}>;
|
|
7
|
+
export default dashboardQuestionFieldChangeHandler;
|
|
8
|
+
//# sourceMappingURL=dashboardQuestionFieldChangeHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboardQuestionFieldChangeHandler.d.ts","sourceRoot":"","sources":["../../../../../../src/components/core/extension/solid-core/dashboard/dashboardQuestionFieldChangeHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,QAAA,MAAM,mCAAmC,UAAiB,YAAY;;;;EAuBrE,CAAA;AAGD,eAAe,mCAAmC,CAAC"}
|
package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionFieldChangeHandler.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { SolidViewLayoutManager } from "../../../../../components/core/common/SolidViewLayoutManager";
|
|
38
|
+
var dashboardQuestionFieldChangeHandler = function (event) { return __awaiter(void 0, void 0, void 0, function () {
|
|
39
|
+
var modifiedField, modifiedFieldValue, formViewLayout, layout, layoutManager;
|
|
40
|
+
return __generator(this, function (_a) {
|
|
41
|
+
modifiedField = event.modifiedField, modifiedFieldValue = event.modifiedFieldValue, formViewLayout = event.formViewLayout;
|
|
42
|
+
layout = formViewLayout;
|
|
43
|
+
layoutManager = new SolidViewLayoutManager(layout);
|
|
44
|
+
if (modifiedField === 'sourceType') {
|
|
45
|
+
if (modifiedFieldValue.value === 'sql') {
|
|
46
|
+
layoutManager.updateNodeAttributes('labelSql', { visible: true });
|
|
47
|
+
layoutManager.updateNodeAttributes('kpiSql', { visible: true });
|
|
48
|
+
layoutManager.updateNodeAttributes('providerName', { visible: false });
|
|
49
|
+
}
|
|
50
|
+
if (modifiedFieldValue.value === 'provider') {
|
|
51
|
+
layoutManager.updateNodeAttributes('labelSql', { visible: false });
|
|
52
|
+
layoutManager.updateNodeAttributes('kpiSql', { visible: false });
|
|
53
|
+
layoutManager.updateNodeAttributes('providerName', { visible: true });
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return [2 /*return*/, {
|
|
57
|
+
layoutChanged: true,
|
|
58
|
+
dataChanged: false,
|
|
59
|
+
newLayout: layoutManager.getLayout(),
|
|
60
|
+
}];
|
|
61
|
+
});
|
|
62
|
+
}); };
|
|
63
|
+
export default dashboardQuestionFieldChangeHandler;
|
|
64
|
+
//# sourceMappingURL=dashboardQuestionFieldChangeHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboardQuestionFieldChangeHandler.js","sourceRoot":"","sources":["../../../../../../src/components/core/extension/solid-core/dashboard/dashboardQuestionFieldChangeHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAC;AAEtG,IAAM,mCAAmC,GAAG,UAAO,KAAmB;;;QAC1D,aAAa,GAAyC,KAAK,cAA9C,EAAE,kBAAkB,GAAqB,KAAK,mBAA1B,EAAE,cAAc,GAAK,KAAK,eAAV,CAAW;QAE9D,MAAM,GAAG,cAAc,CAAC;QAExB,aAAa,GAAG,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAAC;QACzD,IAAI,aAAa,KAAK,YAAY,EAAE;YAChC,IAAI,kBAAkB,CAAC,KAAK,KAAK,KAAK,EAAE;gBACpC,aAAa,CAAC,oBAAoB,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;gBAClE,aAAa,CAAC,oBAAoB,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;gBAChE,aAAa,CAAC,oBAAoB,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;aAC1E;YACD,IAAI,kBAAkB,CAAC,KAAK,KAAK,UAAU,EAAE;gBACzC,aAAa,CAAC,oBAAoB,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;gBACnE,aAAa,CAAC,oBAAoB,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;gBACjE,aAAa,CAAC,oBAAoB,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;aACzE;SACJ;QACD,sBAAO;gBACH,aAAa,EAAE,IAAI;gBACnB,WAAW,EAAE,KAAK;gBAClB,SAAS,EAAE,aAAa,CAAC,SAAS,EAAE;aACvC,EAAA;;KACJ,CAAA;AAGD,eAAe,mCAAmC,CAAC","sourcesContent":["import { SolidUiEvent } from \"../../../../../types\";\nimport { SolidViewLayoutManager } from \"../../../../../components/core/common/SolidViewLayoutManager\";\n\nconst dashboardQuestionFieldChangeHandler = async (event: SolidUiEvent) => {\n const { modifiedField, modifiedFieldValue, formViewLayout } = event;\n\n const layout = formViewLayout;\n\n const layoutManager = new SolidViewLayoutManager(layout);\n if (modifiedField === 'sourceType') {\n if (modifiedFieldValue.value === 'sql') {\n layoutManager.updateNodeAttributes('labelSql', { visible: true });\n layoutManager.updateNodeAttributes('kpiSql', { visible: true });\n layoutManager.updateNodeAttributes('providerName', { visible: false });\n }\n if (modifiedFieldValue.value === 'provider') {\n layoutManager.updateNodeAttributes('labelSql', { visible: false });\n layoutManager.updateNodeAttributes('kpiSql', { visible: false });\n layoutManager.updateNodeAttributes('providerName', { visible: true });\n }\n }\n return {\n layoutChanged: true,\n dataChanged: false,\n newLayout: layoutManager.getLayout(),\n }\n}\n\n\nexport default dashboardQuestionFieldChangeHandler;\n"]}
|
package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionFieldChangeHandler.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SolidUiEvent } from "../../../../../types";
|
|
2
|
+
import { SolidViewLayoutManager } from "../../../../../components/core/common/SolidViewLayoutManager";
|
|
3
|
+
|
|
4
|
+
const dashboardQuestionFieldChangeHandler = async (event: SolidUiEvent) => {
|
|
5
|
+
const { modifiedField, modifiedFieldValue, formViewLayout } = event;
|
|
6
|
+
|
|
7
|
+
const layout = formViewLayout;
|
|
8
|
+
|
|
9
|
+
const layoutManager = new SolidViewLayoutManager(layout);
|
|
10
|
+
if (modifiedField === 'sourceType') {
|
|
11
|
+
if (modifiedFieldValue.value === 'sql') {
|
|
12
|
+
layoutManager.updateNodeAttributes('labelSql', { visible: true });
|
|
13
|
+
layoutManager.updateNodeAttributes('kpiSql', { visible: true });
|
|
14
|
+
layoutManager.updateNodeAttributes('providerName', { visible: false });
|
|
15
|
+
}
|
|
16
|
+
if (modifiedFieldValue.value === 'provider') {
|
|
17
|
+
layoutManager.updateNodeAttributes('labelSql', { visible: false });
|
|
18
|
+
layoutManager.updateNodeAttributes('kpiSql', { visible: false });
|
|
19
|
+
layoutManager.updateNodeAttributes('providerName', { visible: true });
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
layoutChanged: true,
|
|
24
|
+
dataChanged: false,
|
|
25
|
+
newLayout: layoutManager.getLayout(),
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
export default dashboardQuestionFieldChangeHandler;
|
package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionOnFormLoadHandler.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SolidUiEvent } from "../../../../../types";
|
|
2
|
+
declare const dashboardQuestionOnFormLoadHandler: (event: SolidUiEvent) => Promise<{
|
|
3
|
+
layoutChanged: boolean;
|
|
4
|
+
dataChanged: boolean;
|
|
5
|
+
newLayout: import("../../../../../types").LayoutNode;
|
|
6
|
+
}>;
|
|
7
|
+
export default dashboardQuestionOnFormLoadHandler;
|
|
8
|
+
//# sourceMappingURL=dashboardQuestionOnFormLoadHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboardQuestionOnFormLoadHandler.d.ts","sourceRoot":"","sources":["../../../../../../src/components/core/extension/solid-core/dashboard/dashboardQuestionOnFormLoadHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,QAAA,MAAM,kCAAkC,UAAiB,YAAY;;;;EAsBpE,CAAA;AAED,eAAe,kCAAkC,CAAC"}
|
package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionOnFormLoadHandler.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { SolidViewLayoutManager } from "../../../../../components/core/common/SolidViewLayoutManager";
|
|
38
|
+
var dashboardQuestionOnFormLoadHandler = function (event) { return __awaiter(void 0, void 0, void 0, function () {
|
|
39
|
+
var formData, formViewLayout, layout, layoutManager;
|
|
40
|
+
return __generator(this, function (_a) {
|
|
41
|
+
formData = event.formData, formViewLayout = event.formViewLayout;
|
|
42
|
+
layout = formViewLayout;
|
|
43
|
+
layoutManager = new SolidViewLayoutManager(layout);
|
|
44
|
+
if (formData.sourceType === 'sql') {
|
|
45
|
+
layoutManager.updateNodeAttributes('labelSql', { visible: true });
|
|
46
|
+
layoutManager.updateNodeAttributes('kpiSql', { visible: true });
|
|
47
|
+
layoutManager.updateNodeAttributes('providerName', { visible: false });
|
|
48
|
+
}
|
|
49
|
+
if (formData.sourceType === 'provider') {
|
|
50
|
+
layoutManager.updateNodeAttributes('labelSql', { visible: false });
|
|
51
|
+
layoutManager.updateNodeAttributes('kpiSql', { visible: false });
|
|
52
|
+
layoutManager.updateNodeAttributes('providerName', { visible: true });
|
|
53
|
+
}
|
|
54
|
+
return [2 /*return*/, {
|
|
55
|
+
layoutChanged: true,
|
|
56
|
+
dataChanged: false,
|
|
57
|
+
newLayout: layoutManager.getLayout(),
|
|
58
|
+
}];
|
|
59
|
+
});
|
|
60
|
+
}); };
|
|
61
|
+
export default dashboardQuestionOnFormLoadHandler;
|
|
62
|
+
//# sourceMappingURL=dashboardQuestionOnFormLoadHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboardQuestionOnFormLoadHandler.js","sourceRoot":"","sources":["../../../../../../src/components/core/extension/solid-core/dashboard/dashboardQuestionOnFormLoadHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAC;AAEtG,IAAM,kCAAkC,GAAG,UAAO,KAAmB;;;QACzD,QAAQ,GAAqB,KAAK,SAA1B,EAAE,cAAc,GAAK,KAAK,eAAV,CAAW;QAErC,MAAM,GAAG,cAAc,CAAC;QACxB,aAAa,GAAG,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAAC;QAEzD,IAAI,QAAQ,CAAC,UAAU,KAAK,KAAK,EAAE;YAC/B,aAAa,CAAC,oBAAoB,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;YAClE,aAAa,CAAC,oBAAoB,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;YAChE,aAAa,CAAC,oBAAoB,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;SAC1E;QACD,IAAI,QAAQ,CAAC,UAAU,KAAK,UAAU,EAAE;YACpC,aAAa,CAAC,oBAAoB,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;YACnE,aAAa,CAAC,oBAAoB,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;YACjE,aAAa,CAAC,oBAAoB,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;SACzE;QACD,sBAAO;gBACH,aAAa,EAAE,IAAI;gBACnB,WAAW,EAAE,KAAK;gBAClB,SAAS,EAAE,aAAa,CAAC,SAAS,EAAE;aACvC,EAAA;;KAEJ,CAAA;AAED,eAAe,kCAAkC,CAAC","sourcesContent":["\nimport { SolidUiEvent } from \"../../../../../types\";\nimport { SolidViewLayoutManager } from \"../../../../../components/core/common/SolidViewLayoutManager\";\n\nconst dashboardQuestionOnFormLoadHandler = async (event: SolidUiEvent) => {\n const { formData, formViewLayout } = event;\n\n const layout = formViewLayout;\n const layoutManager = new SolidViewLayoutManager(layout);\n\n if (formData.sourceType === 'sql') {\n layoutManager.updateNodeAttributes('labelSql', { visible: true });\n layoutManager.updateNodeAttributes('kpiSql', { visible: true });\n layoutManager.updateNodeAttributes('providerName', { visible: false });\n }\n if (formData.sourceType === 'provider') {\n layoutManager.updateNodeAttributes('labelSql', { visible: false });\n layoutManager.updateNodeAttributes('kpiSql', { visible: false });\n layoutManager.updateNodeAttributes('providerName', { visible: true });\n }\n return {\n layoutChanged: true,\n dataChanged: false,\n newLayout: layoutManager.getLayout(),\n }\n\n}\n\nexport default dashboardQuestionOnFormLoadHandler;\n"]}
|
package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionOnFormLoadHandler.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
import { SolidUiEvent } from "../../../../../types";
|
|
3
|
+
import { SolidViewLayoutManager } from "../../../../../components/core/common/SolidViewLayoutManager";
|
|
4
|
+
|
|
5
|
+
const dashboardQuestionOnFormLoadHandler = async (event: SolidUiEvent) => {
|
|
6
|
+
const { formData, formViewLayout } = event;
|
|
7
|
+
|
|
8
|
+
const layout = formViewLayout;
|
|
9
|
+
const layoutManager = new SolidViewLayoutManager(layout);
|
|
10
|
+
|
|
11
|
+
if (formData.sourceType === 'sql') {
|
|
12
|
+
layoutManager.updateNodeAttributes('labelSql', { visible: true });
|
|
13
|
+
layoutManager.updateNodeAttributes('kpiSql', { visible: true });
|
|
14
|
+
layoutManager.updateNodeAttributes('providerName', { visible: false });
|
|
15
|
+
}
|
|
16
|
+
if (formData.sourceType === 'provider') {
|
|
17
|
+
layoutManager.updateNodeAttributes('labelSql', { visible: false });
|
|
18
|
+
layoutManager.updateNodeAttributes('kpiSql', { visible: false });
|
|
19
|
+
layoutManager.updateNodeAttributes('providerName', { visible: true });
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
layoutChanged: true,
|
|
23
|
+
dataChanged: false,
|
|
24
|
+
newLayout: layoutManager.getLayout(),
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default dashboardQuestionOnFormLoadHandler;
|
package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.js
CHANGED
|
@@ -92,11 +92,11 @@ var DeleteModelRowAction = function (event) {
|
|
|
92
92
|
{ file: "".concat(kebabCase(event.rowData.singularName), ".repository.ts"), description: 'Custom repository encapsulating database operations for this model', intervention: 'Automatic' },
|
|
93
93
|
{ file: "".concat(kebabCase(event.rowData.singularName), ".service.ts"), description: 'Service layer containing business logic and interactions for this model', intervention: 'Automatic' },
|
|
94
94
|
{ file: "".concat(kebabCase(event.rowData.singularName), ".controller.ts"), description: 'Controller exposing API endpoints related to this model', intervention: 'Automatic' },
|
|
95
|
-
{ file: "".concat(kebabCase(event.rowData.singularName), ".module.ts"), description: 'Module declaration that wires together the controller, service, and repository. All references to the deleted model
|
|
95
|
+
{ file: "".concat(kebabCase(event.rowData.singularName), ".module.ts"), description: 'Module declaration that wires together the controller, service, and repository. All imports and references to the deleted model are removed automatically', intervention: 'Automatic' },
|
|
96
96
|
{ file: "".concat(kebabCase(event.rowData.singularName), "-metadata.json"), description: 'Remove references to this model in the model metadata, menu, action & view sections', intervention: 'Automatic' },
|
|
97
97
|
{ file: '-', description: 'Drop database table. Removes the database table from the DB, this is a very risky step. Best to review all relations to other models etc and then do this manually', intervention: 'Manual (X)', manual: true },
|
|
98
98
|
];
|
|
99
|
-
return (_jsxs("div", { className: "", children: [_jsx(Toast, { ref: toast }), _jsx("div", { className: "p-dialog-header secondary-border-bottom py-3", style: { background: 'var(--solid-light-grey)' }, children: _jsx("span", { className: "p-dialog-title", children: "Delete Model" }) }), _jsxs("div", { className: "px-4 pb-4 pt-3", children: [_jsxs("div", { children: [_jsx("p", { className: "form-field-label font-medium", children: "Deleting a model should be done carefully. The below files will be impacted as part of deleting a model:" }), _jsxs(DataTable, { value: rows, size: "small", children: [_jsx(Column, { field: "file", header: "File Name" }), _jsx(Column, { field: "description", header: "Description" }), _jsx(Column, { field: "intervention", header: "Intervention" })] }), _jsx("div", { className: "my-4", children: _jsxs("div", { className: "flex align-items-center", children: [_jsx(Checkbox, { inputId: "confirmation", name: "confirm", checked: isConfirmed, onChange: function () { return setIsConfirmed(!isConfirmed); } }), _jsx("label", { htmlFor: "confirmation", className: "ml-2 form-field-label", children: "I confirm that #
|
|
99
|
+
return (_jsxs("div", { className: "", children: [_jsx(Toast, { ref: toast }), _jsx("div", { className: "p-dialog-header secondary-border-bottom py-3", style: { background: 'var(--solid-light-grey)' }, children: _jsx("span", { className: "p-dialog-title", children: "Delete Model" }) }), _jsxs("div", { className: "px-4 pb-4 pt-3", children: [_jsxs("div", { children: [_jsx("p", { className: "form-field-label font-medium", children: "Deleting a model should be done carefully. The below files will be impacted as part of deleting a model:" }), _jsxs(DataTable, { value: rows, size: "small", children: [_jsx(Column, { field: "file", header: "File Name" }), _jsx(Column, { field: "description", header: "Description" }), _jsx(Column, { field: "intervention", header: "Intervention" })] }), _jsx("div", { className: "my-4", children: _jsxs("div", { className: "flex align-items-center", children: [_jsx(Checkbox, { inputId: "confirmation", name: "confirm", checked: isConfirmed, onChange: function () { return setIsConfirmed(!isConfirmed); } }), _jsx("label", { htmlFor: "confirmation", className: "ml-2 form-field-label", children: "I confirm that #9 (drop database table) will be done by me manually after the automatic steps above are applied." })] }) })] }), _jsxs("div", { className: "flex gap-3 justify-content-start", children: [_jsx(Button, { size: "small", label: "Apply", disabled: !isConfirmed, autoFocus: true, onClick: deleteModelHandler }), _jsx(Button, { size: "small", label: "Cancel", outlined: true, onClick: function () { return dispatch(closePopup()); } })] })] })] }));
|
|
100
100
|
};
|
|
101
101
|
export default DeleteModelRowAction;
|
|
102
102
|
//# sourceMappingURL=DeleteModelRowAction.js.map
|
package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteModelRowAction.js","sourceRoot":"","sources":["../../../../../../../src/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,SAAS,MAAM,qCAAqC,CAAC;AAG5D,IAAM,oBAAoB,GAAG,UAAC,KAA2C;IAC/D,IAAA,KAAgC,QAAQ,CAAC,KAAK,CAAC,EAA9C,WAAW,QAAA,EAAE,cAAc,QAAmB,CAAC;IACtD,IAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,IAAM,SAAS,GAAG,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACxD,IAAA,4BAA4B,GAAI,SAAS,6BAAb,CAAc;IAC3C,IAAA,KAED,4BAA4B,EAAE,EAF5B,uBAAuB,QAAA,EAClB,0BAA0B,gBACH,CAAA;IAEnC,IAAM,KAAK,GAAG,MAA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EACJ,MAAC,SAAS,IAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAC,OAAO,aAChC,KAAC,MAAM,IAAC,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,WAAW,GAAG,EAC1C,KAAC,MAAM,IAAC,KAAK,EAAC,aAAa,EAAC,MAAM,EAAC,aAAa,GAAG,EACnD,KAAC,MAAM,IAAC,KAAK,EAAC,cAAc,EAAC,MAAM,EAAC,cAAc,GAAG,IAC7C,EACZ,cAAK,SAAS,EAAC,MAAM,YACjB,eAAK,SAAS,EAAC,yBAAyB,aACpC,KAAC,QAAQ,IACL,OAAO,EAAC,cAAc,EACtB,IAAI,EAAC,SAAS,EACd,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,cAAM,OAAA,cAAc,CAAC,CAAC,WAAW,CAAC,EAA5B,CAA4B,GAAI,EACpD,gBAAO,OAAO,EAAC,cAAc,EAAC,SAAS,EAAC,uBAAuB,gHAEvD,IACN,GACJ,IACJ,EACN,eAAK,SAAS,EAAC,kCAAkC,aAC7C,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,OAAO,EAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,SAAS,QAAC,OAAO,EAAE,kBAAkB,GAAI,EACpG,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,QAAQ,EAAC,QAAQ,QAAC,OAAO,EAAE,cAAM,OAAA,QAAQ,CAAC,UAAU,EAAE,CAAC,EAAtB,CAAsB,GAAI,IACpF,IACJ,IACJ,CACT,CAAA;AACL,CAAC,CAAA;AAED,eAAe,oBAAoB,CAAC","sourcesContent":["\nimport { useGenerateCodeForModelMutation } from \"../../../../../../redux/api/modelApi\";\nimport { closePopup } from \"../../../../../../redux/features/popupSlice\";\nimport { SolidListRowdataDynamicFunctionProps } from \"../../../../../../types/solid-core\";\nimport { Button } from \"primereact/button\";\nimport { useRef, useState } from \"react\";\nimport { useDispatch } from \"react-redux\";\nimport { Toast } from 'primereact/toast';\nimport { DataTable } from \"primereact/datatable\";\nimport { Column } from \"primereact/column\";\nimport { Checkbox } from \"primereact/checkbox\";\nimport { kebabCase } from \"lodash\";\nimport { createSolidEntityApi } from \"../../../../../../redux/api/solidEntityApi\";\nimport { ERROR_MESSAGES } from \"../../../../../../constants/error-messages\";\nimport showToast from \"../../../../../../helpers/showToast\";\n\n\nconst DeleteModelRowAction = (event: SolidListRowdataDynamicFunctionProps) => {\n const [isConfirmed, setIsConfirmed] = useState(false);\n const dispatch = useDispatch();\n const entityApi = createSolidEntityApi(event.params.modelName);\n const {useDeleteSolidEntityMutation} = entityApi;\n const [deleteSolidSingleEntiry, { \n isError:isSolidEntitiesDeleteError , \n }] = useDeleteSolidEntityMutation()\n\n const toast = useRef<Toast>(null);\n\n const deleteModelHandler = async () => {\n try {\n const res: any = await deleteSolidSingleEntiry(event.rowData.id);\n \n // console.log('delete model res', res);\n if (res.error) {\n // handle backend or RTK error object\n const message =\n res.error?.data?.message ||\n res.error?.error ||\n ERROR_MESSAGES.ERROR_OCCURED;\n showToast(toast, 'error', ERROR_MESSAGES.DELETE_FAIELD, message);\n } else {\n showToast(toast, 'success', ERROR_MESSAGES.MODEL_DELETE, ERROR_MESSAGES.MODEL_DELETE_SUCCESSFULLY(event.rowData.singularName));\n dispatch(closePopup());\n }\n } catch (err: any) {\n console.error(\"catch error\", err);\n showToast(toast, 'error', ERROR_MESSAGES.ERROR, ERROR_MESSAGES.NETWORK_OR_SERVER_ERROR);\n }\n }\n\n const rows = [\n { file: `${kebabCase(event.rowData.singularName)}.entity.ts`, description: 'The TypeORM entity definition for this model. Deleting it removes the model’s schema mapping', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.create.dto.ts`, description: 'DTO defining the payload for creating a new record of this model', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.update.dto.ts`, description: 'DTO defining the payload for updating an existing record of this model', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.repository.ts`, description: 'Custom repository encapsulating database operations for this model', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.service.ts`, description: 'Service layer containing business logic and interactions for this model', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.controller.ts`, description: 'Controller exposing API endpoints related to this model', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.module.ts`, description: 'Module declaration that wires together the controller, service, and repository. All references to the deleted model must be removed here', intervention: 'Manual (X)', manual: true },\n { file: `${kebabCase(event.rowData.singularName)}-metadata.json`, description: 'Remove references to this model in the model metadata, menu, action & view sections', intervention: 'Automatic' },\n { file: '-', description: 'Drop database table. Removes the database table from the DB, this is a very risky step. Best to review all relations to other models etc and then do this manually', intervention: 'Manual (X)', manual: true },\n ];\n\n\n\n return (\n <div className=\"\">\n <Toast ref={toast} />\n <div className=\"p-dialog-header secondary-border-bottom py-3\" style={{ background: 'var(--solid-light-grey)' }}>\n <span className=\"p-dialog-title\">\n Delete Model\n </span>\n </div>\n <div className=\"px-4 pb-4 pt-3\">\n <div>\n <p className=\"form-field-label font-medium\">\n Deleting a model should be done carefully. The below files will be impacted as part of deleting a model:\n </p>\n <DataTable value={rows} size=\"small\">\n <Column field=\"file\" header=\"File Name\" />\n <Column field=\"description\" header=\"Description\" />\n <Column field=\"intervention\" header=\"Intervention\" />\n </DataTable>\n <div className=\"my-4\">\n <div className=\"flex align-items-center\">\n <Checkbox\n inputId=\"confirmation\"\n name=\"confirm\"\n checked={isConfirmed}\n onChange={() => setIsConfirmed(!isConfirmed)} />\n <label htmlFor=\"confirmation\" className=\"ml-2 form-field-label\">\n I confirm that #7 & #9 will be done by me manually after the automatic steps above are applied.\n </label>\n </div>\n </div>\n </div>\n <div className=\"flex gap-3 justify-content-start\">\n <Button size=\"small\" label=\"Apply\" disabled={!isConfirmed} autoFocus onClick={deleteModelHandler} />\n <Button size=\"small\" label=\"Cancel\" outlined onClick={() => dispatch(closePopup())} />\n </div>\n </div>\n </div>\n )\n}\n\nexport default DeleteModelRowAction;\n"]}
|
|
1
|
+
{"version":3,"file":"DeleteModelRowAction.js","sourceRoot":"","sources":["../../../../../../../src/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,SAAS,MAAM,qCAAqC,CAAC;AAG5D,IAAM,oBAAoB,GAAG,UAAC,KAA2C;IAC/D,IAAA,KAAgC,QAAQ,CAAC,KAAK,CAAC,EAA9C,WAAW,QAAA,EAAE,cAAc,QAAmB,CAAC;IACtD,IAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,IAAM,SAAS,GAAG,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACxD,IAAA,4BAA4B,GAAI,SAAS,6BAAb,CAAc;IAC3C,IAAA,KAED,4BAA4B,EAAE,EAF5B,uBAAuB,QAAA,EAClB,0BAA0B,gBACH,CAAA;IAEnC,IAAM,KAAK,GAAG,MA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,KAAK,EAAE,IAAI,EAAE,IAAI,EAAC,OAAO,aAChC,KAAC,MAAM,IAAC,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,WAAW,GAAG,EAC1C,KAAC,MAAM,IAAC,KAAK,EAAC,aAAa,EAAC,MAAM,EAAC,aAAa,GAAG,EACnD,KAAC,MAAM,IAAC,KAAK,EAAC,cAAc,EAAC,MAAM,EAAC,cAAc,GAAG,IAC7C,EACZ,cAAK,SAAS,EAAC,MAAM,YACjB,eAAK,SAAS,EAAC,yBAAyB,aACpC,KAAC,QAAQ,IACL,OAAO,EAAC,cAAc,EACtB,IAAI,EAAC,SAAS,EACd,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,cAAM,OAAA,cAAc,CAAC,CAAC,WAAW,CAAC,EAA5B,CAA4B,GAAI,EACpD,gBAAO,OAAO,EAAC,cAAc,EAAC,SAAS,EAAC,uBAAuB,iIAEvD,IACN,GACJ,IACJ,EACN,eAAK,SAAS,EAAC,kCAAkC,aAC7C,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,OAAO,EAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,SAAS,QAAC,OAAO,EAAE,kBAAkB,GAAI,EACpG,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,QAAQ,EAAC,QAAQ,QAAC,OAAO,EAAE,cAAM,OAAA,QAAQ,CAAC,UAAU,EAAE,CAAC,EAAtB,CAAsB,GAAI,IACpF,IACJ,IACJ,CACT,CAAA;AACL,CAAC,CAAA;AAED,eAAe,oBAAoB,CAAC","sourcesContent":["\nimport { useGenerateCodeForModelMutation } from \"../../../../../../redux/api/modelApi\";\nimport { closePopup } from \"../../../../../../redux/features/popupSlice\";\nimport { SolidListRowdataDynamicFunctionProps } from \"../../../../../../types/solid-core\";\nimport { Button } from \"primereact/button\";\nimport { useRef, useState } from \"react\";\nimport { useDispatch } from \"react-redux\";\nimport { Toast } from 'primereact/toast';\nimport { DataTable } from \"primereact/datatable\";\nimport { Column } from \"primereact/column\";\nimport { Checkbox } from \"primereact/checkbox\";\nimport { kebabCase } from \"lodash\";\nimport { createSolidEntityApi } from \"../../../../../../redux/api/solidEntityApi\";\nimport { ERROR_MESSAGES } from \"../../../../../../constants/error-messages\";\nimport showToast from \"../../../../../../helpers/showToast\";\n\n\nconst DeleteModelRowAction = (event: SolidListRowdataDynamicFunctionProps) => {\n const [isConfirmed, setIsConfirmed] = useState(false);\n const dispatch = useDispatch();\n const entityApi = createSolidEntityApi(event.params.modelName);\n const {useDeleteSolidEntityMutation} = entityApi;\n const [deleteSolidSingleEntiry, { \n isError:isSolidEntitiesDeleteError , \n }] = useDeleteSolidEntityMutation()\n\n const toast = useRef<Toast>(null);\n\n const deleteModelHandler = async () => {\n try {\n const res: any = await deleteSolidSingleEntiry(event.rowData.id);\n \n // console.log('delete model res', res);\n if (res.error) {\n // handle backend or RTK error object\n const message =\n res.error?.data?.message ||\n res.error?.error ||\n ERROR_MESSAGES.ERROR_OCCURED;\n showToast(toast, 'error', ERROR_MESSAGES.DELETE_FAIELD, message);\n } else {\n showToast(toast, 'success', ERROR_MESSAGES.MODEL_DELETE, ERROR_MESSAGES.MODEL_DELETE_SUCCESSFULLY(event.rowData.singularName));\n dispatch(closePopup());\n }\n } catch (err: any) {\n console.error(\"catch error\", err);\n showToast(toast, 'error', ERROR_MESSAGES.ERROR, ERROR_MESSAGES.NETWORK_OR_SERVER_ERROR);\n }\n }\n\n const rows = [\n { file: `${kebabCase(event.rowData.singularName)}.entity.ts`, description: 'The TypeORM entity definition for this model. Deleting it removes the model’s schema mapping', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.create.dto.ts`, description: 'DTO defining the payload for creating a new record of this model', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.update.dto.ts`, description: 'DTO defining the payload for updating an existing record of this model', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.repository.ts`, description: 'Custom repository encapsulating database operations for this model', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.service.ts`, description: 'Service layer containing business logic and interactions for this model', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.controller.ts`, description: 'Controller exposing API endpoints related to this model', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}.module.ts`, description: 'Module declaration that wires together the controller, service, and repository. All imports and references to the deleted model are removed automatically', intervention: 'Automatic' },\n { file: `${kebabCase(event.rowData.singularName)}-metadata.json`, description: 'Remove references to this model in the model metadata, menu, action & view sections', intervention: 'Automatic' },\n { file: '-', description: 'Drop database table. Removes the database table from the DB, this is a very risky step. Best to review all relations to other models etc and then do this manually', intervention: 'Manual (X)', manual: true },\n ];\n\n\n\n return (\n <div className=\"\">\n <Toast ref={toast} />\n <div className=\"p-dialog-header secondary-border-bottom py-3\" style={{ background: 'var(--solid-light-grey)' }}>\n <span className=\"p-dialog-title\">\n Delete Model\n </span>\n </div>\n <div className=\"px-4 pb-4 pt-3\">\n <div>\n <p className=\"form-field-label font-medium\">\n Deleting a model should be done carefully. The below files will be impacted as part of deleting a model:\n </p>\n <DataTable value={rows} size=\"small\">\n <Column field=\"file\" header=\"File Name\" />\n <Column field=\"description\" header=\"Description\" />\n <Column field=\"intervention\" header=\"Intervention\" />\n </DataTable>\n <div className=\"my-4\">\n <div className=\"flex align-items-center\">\n <Checkbox\n inputId=\"confirmation\"\n name=\"confirm\"\n checked={isConfirmed}\n onChange={() => setIsConfirmed(!isConfirmed)} />\n <label htmlFor=\"confirmation\" className=\"ml-2 form-field-label\">\n I confirm that #9 (drop database table) will be done by me manually after the automatic steps above are applied.\n </label>\n </div>\n </div>\n </div>\n <div className=\"flex gap-3 justify-content-start\">\n <Button size=\"small\" label=\"Apply\" disabled={!isConfirmed} autoFocus onClick={deleteModelHandler} />\n <Button size=\"small\" label=\"Cancel\" outlined onClick={() => dispatch(closePopup())} />\n </div>\n </div>\n </div>\n )\n}\n\nexport default DeleteModelRowAction;\n"]}
|
package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.tsx
CHANGED
|
@@ -55,7 +55,7 @@ const DeleteModelRowAction = (event: SolidListRowdataDynamicFunctionProps) => {
|
|
|
55
55
|
{ file: `${kebabCase(event.rowData.singularName)}.repository.ts`, description: 'Custom repository encapsulating database operations for this model', intervention: 'Automatic' },
|
|
56
56
|
{ file: `${kebabCase(event.rowData.singularName)}.service.ts`, description: 'Service layer containing business logic and interactions for this model', intervention: 'Automatic' },
|
|
57
57
|
{ file: `${kebabCase(event.rowData.singularName)}.controller.ts`, description: 'Controller exposing API endpoints related to this model', intervention: 'Automatic' },
|
|
58
|
-
{ file: `${kebabCase(event.rowData.singularName)}.module.ts`, description: 'Module declaration that wires together the controller, service, and repository. All references to the deleted model
|
|
58
|
+
{ file: `${kebabCase(event.rowData.singularName)}.module.ts`, description: 'Module declaration that wires together the controller, service, and repository. All imports and references to the deleted model are removed automatically', intervention: 'Automatic' },
|
|
59
59
|
{ file: `${kebabCase(event.rowData.singularName)}-metadata.json`, description: 'Remove references to this model in the model metadata, menu, action & view sections', intervention: 'Automatic' },
|
|
60
60
|
{ file: '-', description: 'Drop database table. Removes the database table from the DB, this is a very risky step. Best to review all relations to other models etc and then do this manually', intervention: 'Manual (X)', manual: true },
|
|
61
61
|
];
|
|
@@ -88,7 +88,7 @@ const DeleteModelRowAction = (event: SolidListRowdataDynamicFunctionProps) => {
|
|
|
88
88
|
checked={isConfirmed}
|
|
89
89
|
onChange={() => setIsConfirmed(!isConfirmed)} />
|
|
90
90
|
<label htmlFor="confirmation" className="ml-2 form-field-label">
|
|
91
|
-
I confirm that #
|
|
91
|
+
I confirm that #9 (drop database table) will be done by me manually after the automatic steps above are applied.
|
|
92
92
|
</label>
|
|
93
93
|
</div>
|
|
94
94
|
</div>
|
|
@@ -1481,7 +1481,7 @@ var SolidFormView = function (params) {
|
|
|
1481
1481
|
_jsx(Button, { icon: "pi pi-angle-double-right", size: "small", text: true, className: "chatter-collapse-btn", style: { width: 30, height: 30, aspectRatio: '1/1' }, onClick: function () { return setShowChatter(false); } }), isShowChatter === false ?
|
|
1482
1482
|
_jsxs("div", { className: "flex flex-column gap-2 justify-content-center p-2", children: [((_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) &&
|
|
1483
1483
|
_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" }), mcpUrl &&
|
|
1484
|
-
(_jsx("div", { className: "chatter-collapsed-content", onClick: function () { return handleChatterExpandClick_1('solidx-ai'); }, children: _jsxs("div", { className: "flex gap-2", children: [" ", _jsx(SolidXAIIcon, {}), " SolidX AI "] }) })), _jsx(Button, { icon: "pi pi-chevron-left", size: "small", className: "px-0", style: { width: 30 }, onClick: function () { return handleChatterExpandClick_1('
|
|
1484
|
+
(_jsx("div", { className: "chatter-collapsed-content", onClick: function () { return handleChatterExpandClick_1('solidx-ai'); }, children: _jsxs("div", { className: "flex gap-2", children: [" ", _jsx(SolidXAIIcon, {}), " SolidX AI "] }) })), _jsx(Button, { icon: "pi pi-chevron-left", size: "small", className: "px-0", style: { width: 30 }, onClick: function () { return handleChatterExpandClick_1('chatter'); } })] })
|
|
1485
1485
|
:
|
|
1486
1486
|
_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(Dialog, { visible: isDeleteDialogVisible, header: "Confirm Delete", className: "solid-confirm-dialog", modal: true, footer: function () { return (_jsxs("div", { className: "flex justify-content-center", children: [_jsx(Button, { label: "Yes", icon: "pi pi-check", className: 'small-button', severity: "danger", autoFocus: true, onClick: function () { return handleDeleteEntity_1(); } }), _jsx(Button, { label: "No", icon: "pi pi-times", className: 'small-button', onClick: onDeleteClose_1 })] })); }, onHide: function () { return setDeleteDialogVisible(false); }, children: _jsx("p", { children: "Are you sure you want to delete?" }) }), _jsx(Dialog, { visible: isLayoutDialogVisible, header: "Change Form Layout", modal: true, onHide: function () { return setLayoutDialogVisible(false); }, style: { width: '50vw' }, breakpoints: {
|
|
1487
1487
|
'960px': '80vw',
|