unifyedx-storybook-new 0.1.41 → 0.1.43
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.
|
@@ -624,6 +624,10 @@
|
|
|
624
624
|
height: calc(var(--spacing) * 12);
|
|
625
625
|
}
|
|
626
626
|
|
|
627
|
+
.h-64 {
|
|
628
|
+
height: calc(var(--spacing) * 64);
|
|
629
|
+
}
|
|
630
|
+
|
|
627
631
|
.h-\[72px\] {
|
|
628
632
|
height: 72px;
|
|
629
633
|
}
|
|
@@ -1351,18 +1355,10 @@
|
|
|
1351
1355
|
color: #1c274c;
|
|
1352
1356
|
}
|
|
1353
1357
|
|
|
1354
|
-
.text-\[\#6b7280\] {
|
|
1355
|
-
color: #6b7280;
|
|
1356
|
-
}
|
|
1357
|
-
|
|
1358
1358
|
.text-\[\#101112\] {
|
|
1359
1359
|
color: #101112;
|
|
1360
1360
|
}
|
|
1361
1361
|
|
|
1362
|
-
.text-\[\#252525\] {
|
|
1363
|
-
color: #252525;
|
|
1364
|
-
}
|
|
1365
|
-
|
|
1366
1362
|
.text-\[\#767676\] {
|
|
1367
1363
|
color: #767676;
|
|
1368
1364
|
}
|
|
@@ -1451,10 +1447,6 @@
|
|
|
1451
1447
|
opacity: .7;
|
|
1452
1448
|
}
|
|
1453
1449
|
|
|
1454
|
-
.opacity-90 {
|
|
1455
|
-
opacity: .9;
|
|
1456
|
-
}
|
|
1457
|
-
|
|
1458
1450
|
.opacity-100 {
|
|
1459
1451
|
opacity: 1;
|
|
1460
1452
|
}
|
|
@@ -1628,10 +1620,6 @@
|
|
|
1628
1620
|
}
|
|
1629
1621
|
}
|
|
1630
1622
|
|
|
1631
|
-
.hover\:text-\[\#1f6ed4\]:hover {
|
|
1632
|
-
color: #1f6ed4;
|
|
1633
|
-
}
|
|
1634
|
-
|
|
1635
1623
|
.hover\:text-blue-800:hover {
|
|
1636
1624
|
color: var(--color-blue-800);
|
|
1637
1625
|
}
|
|
@@ -75156,7 +75156,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75156
75156
|
}
|
|
75157
75157
|
}, [section.key, data, updateHandler]);
|
|
75158
75158
|
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("div", { style: { marginBottom: "20px" }, children: [
|
|
75159
|
-
/* @__PURE__ */
|
|
75159
|
+
/* @__PURE__ */ jsx(
|
|
75160
75160
|
"h2",
|
|
75161
75161
|
{
|
|
75162
75162
|
style: {
|
|
@@ -75164,11 +75164,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75164
75164
|
fontWeight: "bold",
|
|
75165
75165
|
marginBottom: "10px"
|
|
75166
75166
|
},
|
|
75167
|
-
children:
|
|
75168
|
-
section.title,
|
|
75169
|
-
" - ",
|
|
75170
|
-
section.type
|
|
75171
|
-
]
|
|
75167
|
+
children: section.title
|
|
75172
75168
|
}
|
|
75173
75169
|
),
|
|
75174
75170
|
/* @__PURE__ */ jsx("p", { style: { fontSize: "14px", marginBottom: "10px" }, children: section.description }),
|
|
@@ -75287,9 +75283,6 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75287
75283
|
onChange: (value) => {
|
|
75288
75284
|
const newData = { ...data, [field.key]: value };
|
|
75289
75285
|
setData(newData);
|
|
75290
|
-
if (updateHandler) {
|
|
75291
|
-
updateHandler(section.key, newData);
|
|
75292
|
-
}
|
|
75293
75286
|
},
|
|
75294
75287
|
options: field.options || [],
|
|
75295
75288
|
placeholder: field.placeholder || `Select ${field.label}`,
|
|
@@ -75393,7 +75386,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75393
75386
|
/* @__PURE__ */ jsx(
|
|
75394
75387
|
ToggleSwitch,
|
|
75395
75388
|
{
|
|
75396
|
-
checked:
|
|
75389
|
+
checked: typeof data[field.key] === "boolean" ? data[field.key] : field.default,
|
|
75397
75390
|
onChange: (isOn) => {
|
|
75398
75391
|
console.log("Toggle changed:", field.key, isOn);
|
|
75399
75392
|
const newData = { ...data, [field.key]: isOn };
|
|
@@ -76164,11 +76157,13 @@ function Mt(t){if(typeof document=="undefined")return;let o=document.head||docum
|
|
|
76164
76157
|
function DynamicConfig({
|
|
76165
76158
|
appid,
|
|
76166
76159
|
configdata = null,
|
|
76167
|
-
disableApi = false
|
|
76160
|
+
disableApi = false,
|
|
76161
|
+
onCancel
|
|
76168
76162
|
}) {
|
|
76169
76163
|
const [config, setConfig] = React__default.useState(configdata);
|
|
76170
76164
|
const [data, setData] = React__default.useState(null);
|
|
76171
76165
|
const [loading, setLoading] = useState(false);
|
|
76166
|
+
const [saving, setSaving] = useState(false);
|
|
76172
76167
|
const [validationErrors, setValidationErrors] = useState({});
|
|
76173
76168
|
const configEndPoint = `${gatewayBase()}/unifyedxappmodulemanagement/api/v1/appmanager/${appid}/configuration`;
|
|
76174
76169
|
const updateEndPoint = configEndPoint;
|
|
@@ -76407,7 +76402,7 @@ function DynamicConfig({
|
|
|
76407
76402
|
}
|
|
76408
76403
|
const saveData = async () => {
|
|
76409
76404
|
try {
|
|
76410
|
-
|
|
76405
|
+
setSaving(true);
|
|
76411
76406
|
const transformedPayload = {};
|
|
76412
76407
|
if (data) {
|
|
76413
76408
|
Object.keys(data).forEach((key) => {
|
|
@@ -76481,12 +76476,16 @@ function DynamicConfig({
|
|
|
76481
76476
|
draggable: true
|
|
76482
76477
|
});
|
|
76483
76478
|
} finally {
|
|
76484
|
-
|
|
76479
|
+
setSaving(false);
|
|
76485
76480
|
}
|
|
76486
76481
|
};
|
|
76487
76482
|
saveData();
|
|
76488
76483
|
};
|
|
76489
76484
|
const handleCancel = () => {
|
|
76485
|
+
if (onCancel) {
|
|
76486
|
+
onCancel();
|
|
76487
|
+
return;
|
|
76488
|
+
}
|
|
76490
76489
|
const hasUnsavedChanges = validationErrors && Object.keys(validationErrors).length > 0;
|
|
76491
76490
|
if (hasUnsavedChanges) {
|
|
76492
76491
|
const confirmed = window.confirm(
|
|
@@ -76530,8 +76529,9 @@ function DynamicConfig({
|
|
|
76530
76529
|
const configurationSections = configdata?.configuration || config?.configuration;
|
|
76531
76530
|
useEffect(() => {
|
|
76532
76531
|
if (disableApi && configdata) {
|
|
76533
|
-
|
|
76534
|
-
|
|
76532
|
+
if (!data || Object.keys(data).length === 0) {
|
|
76533
|
+
initializeEmptyData();
|
|
76534
|
+
}
|
|
76535
76535
|
} else if (disableApi && !configdata) {
|
|
76536
76536
|
initializeEmptyData();
|
|
76537
76537
|
}
|
|
@@ -76543,8 +76543,8 @@ function DynamicConfig({
|
|
|
76543
76543
|
className: "dynamic-config bg-white w-full h-[calc(100vh-350px)] overflow-y-auto",
|
|
76544
76544
|
style: { padding: "0px 20px 0px 0px" },
|
|
76545
76545
|
children: [
|
|
76546
|
-
loading && /* @__PURE__ */ jsx(Spinner, { size: "
|
|
76547
|
-
configurationSections?.map((section, index) => {
|
|
76546
|
+
loading && /* @__PURE__ */ jsx("div", { className: "flex justify-center items-center h-64", children: /* @__PURE__ */ jsx(Spinner, { size: "large" }) }),
|
|
76547
|
+
!loading && configurationSections?.map((section, index) => {
|
|
76548
76548
|
const C = getComponentForType(section.type);
|
|
76549
76549
|
if (C && C !== "UnknownType") {
|
|
76550
76550
|
return /* @__PURE__ */ jsx(
|
|
@@ -76562,14 +76562,14 @@ function DynamicConfig({
|
|
|
76562
76562
|
]
|
|
76563
76563
|
}
|
|
76564
76564
|
),
|
|
76565
|
-
/* @__PURE__ */ jsxs("div", { className: "w-full gap-5 bg-white flex justify-end py-3 px-7 rounded-t-md rounded-b-2xl border border-gray-300", style:
|
|
76565
|
+
/* @__PURE__ */ jsxs("div", { className: "w-full gap-5 bg-white flex justify-end py-3 px-7 rounded-t-md rounded-b-2xl border border-gray-300", style: { boxShadow: "0 -2px 10px 0 rgba(0, 0, 0, 0.20)", marginTop: "20px" }, children: [
|
|
76566
76566
|
/* @__PURE__ */ jsx(
|
|
76567
76567
|
UnifyedCoreButton,
|
|
76568
76568
|
{
|
|
76569
76569
|
category: "secondary",
|
|
76570
76570
|
onClick: handleCancel,
|
|
76571
76571
|
label: "Cancel",
|
|
76572
|
-
disabled:
|
|
76572
|
+
disabled: saving
|
|
76573
76573
|
}
|
|
76574
76574
|
),
|
|
76575
76575
|
/* @__PURE__ */ jsx(
|
|
@@ -76577,8 +76577,8 @@ function DynamicConfig({
|
|
|
76577
76577
|
{
|
|
76578
76578
|
category: "primary",
|
|
76579
76579
|
onClick: handleSave,
|
|
76580
|
-
disabled:
|
|
76581
|
-
label:
|
|
76580
|
+
disabled: saving,
|
|
76581
|
+
label: saving ? "Saving..." : "Apply",
|
|
76582
76582
|
type: "submit"
|
|
76583
76583
|
}
|
|
76584
76584
|
)
|
|
@@ -76620,6 +76620,7 @@ const FullConfigPage = ({
|
|
|
76620
76620
|
disableApi = false
|
|
76621
76621
|
}) => {
|
|
76622
76622
|
const [activeTab, setActiveTab] = useState(0);
|
|
76623
|
+
const [showCancelModal, setShowCancelModal] = useState(false);
|
|
76623
76624
|
const {
|
|
76624
76625
|
pageHeader = {},
|
|
76625
76626
|
appletHeader = {},
|
|
@@ -76631,8 +76632,26 @@ const FullConfigPage = ({
|
|
|
76631
76632
|
heading: "App Details",
|
|
76632
76633
|
subHeading: "View app details and customize configurations to align with institutional requirements.",
|
|
76633
76634
|
isLeftArrow: true,
|
|
76635
|
+
onBackClick: () => window.history.back(),
|
|
76634
76636
|
...pageHeader
|
|
76635
76637
|
};
|
|
76638
|
+
const breadcrumbItems = breadcrumb.map((item) => ({
|
|
76639
|
+
label: item.text,
|
|
76640
|
+
href: item.href || "#"
|
|
76641
|
+
}));
|
|
76642
|
+
const handleCancelRequest = useCallback(() => {
|
|
76643
|
+
console.log("handleCancelRequest called - showing modal");
|
|
76644
|
+
setShowCancelModal(true);
|
|
76645
|
+
}, []);
|
|
76646
|
+
const handleCancelConfirm = useCallback((result) => {
|
|
76647
|
+
setShowCancelModal(false);
|
|
76648
|
+
if (result.primary) {
|
|
76649
|
+
console.log("User confirmed cancel - navigating back");
|
|
76650
|
+
window.history.back();
|
|
76651
|
+
} else {
|
|
76652
|
+
console.log("User cancelled the cancel action - modal closed, data preserved");
|
|
76653
|
+
}
|
|
76654
|
+
}, []);
|
|
76636
76655
|
const defaultAppletHeader = {
|
|
76637
76656
|
heading: "Application",
|
|
76638
76657
|
subHeading: "Application configuration and details",
|
|
@@ -76660,7 +76679,7 @@ const FullConfigPage = ({
|
|
|
76660
76679
|
};
|
|
76661
76680
|
const tabs = [
|
|
76662
76681
|
{ label: "Overview", content: renderOverview(defaultOverview) },
|
|
76663
|
-
{ label: "Configuration", content: /* @__PURE__ */ jsx(DynamicConfig, { appid, configdata: { configuration }, disableApi }) }
|
|
76682
|
+
{ label: "Configuration", content: /* @__PURE__ */ jsx(DynamicConfig, { appid, configdata: { configuration }, disableApi, onCancel: handleCancelRequest }) }
|
|
76664
76683
|
];
|
|
76665
76684
|
function renderIcon(icon) {
|
|
76666
76685
|
if (!icon) {
|
|
@@ -76714,25 +76733,16 @@ const FullConfigPage = ({
|
|
|
76714
76733
|
] });
|
|
76715
76734
|
}
|
|
76716
76735
|
return /* @__PURE__ */ jsxs("div", { className: "full-config-page", children: [
|
|
76717
|
-
/* @__PURE__ */
|
|
76718
|
-
|
|
76719
|
-
|
|
76720
|
-
|
|
76721
|
-
|
|
76722
|
-
|
|
76723
|
-
|
|
76724
|
-
|
|
76725
|
-
|
|
76726
|
-
|
|
76727
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col min-w-0", children: [
|
|
76728
|
-
/* @__PURE__ */ jsx("h1", { className: "text-[18px] font-semibold leading-tight truncate m-0", children: defaultPageHeader.heading }),
|
|
76729
|
-
/* @__PURE__ */ jsx("p", { className: "text-[13px] font-normal text-[#6b7280] opacity-90 mt-1 truncate mb-0", children: defaultPageHeader.subHeading })
|
|
76730
|
-
] })
|
|
76731
|
-
] }),
|
|
76732
|
-
breadcrumb && breadcrumb.length > 0 && /* @__PURE__ */ jsx("nav", { className: "flex gap-2 items-center text-[13px] text-[#6b7280] mb-4", "aria-label": "Breadcrumb", children: breadcrumb.map((item, index) => /* @__PURE__ */ jsxs("span", { className: "flex items-center", children: [
|
|
76733
|
-
index > 0 && /* @__PURE__ */ jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", style: { margin: "0 2px" }, children: /* @__PURE__ */ jsx("path", { d: "M9 18L15 12L9 6", stroke: "#6b7280", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }),
|
|
76734
|
-
item.isCurrent ? /* @__PURE__ */ jsx("span", { className: "font-semibold text-[#252525]", children: item.text }) : /* @__PURE__ */ jsx("a", { href: item.href, className: "hover:text-[#1f6ed4] cursor-pointer", style: { textDecoration: "none" }, children: item.text })
|
|
76735
|
-
] }, index)) }),
|
|
76736
|
+
/* @__PURE__ */ jsx(
|
|
76737
|
+
PageHeader,
|
|
76738
|
+
{
|
|
76739
|
+
heading: defaultPageHeader.heading,
|
|
76740
|
+
subHeading: breadcrumbItems.length > 0 ? void 0 : defaultPageHeader.subHeading,
|
|
76741
|
+
breadcrumbItems,
|
|
76742
|
+
isLeftArrow: defaultPageHeader.isLeftArrow,
|
|
76743
|
+
onBackClick: defaultPageHeader.onBackClick
|
|
76744
|
+
}
|
|
76745
|
+
),
|
|
76736
76746
|
/* @__PURE__ */ jsxs("div", { className: "bg-[#ffffff] border border-[#eef2f6] rounded-[12px] px-6 py-5 flex gap-4 items-start mb-4 shadow-sm", children: [
|
|
76737
76747
|
/* @__PURE__ */ jsx("div", { className: "icon w-[72px] h-[72px] rounded-full flex items-center justify-center bg-[#F5F5F6] text-[#1C274C] font-bold text-[18px]", children: renderIcon(defaultAppletHeader.icon) }),
|
|
76738
76748
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col min-w-0", children: [
|
|
@@ -76759,7 +76769,19 @@ const FullConfigPage = ({
|
|
|
76759
76769
|
index
|
|
76760
76770
|
)) }) }),
|
|
76761
76771
|
/* @__PURE__ */ jsx("div", { className: "p-8 h-full overflow-y-auto", children: tabs[activeTab].content })
|
|
76762
|
-
] })
|
|
76772
|
+
] }),
|
|
76773
|
+
/* @__PURE__ */ jsx(
|
|
76774
|
+
Modal,
|
|
76775
|
+
{
|
|
76776
|
+
isOpen: showCancelModal,
|
|
76777
|
+
onClose: handleCancelConfirm,
|
|
76778
|
+
variant: "warning",
|
|
76779
|
+
title: "Are you sure you want to cancel?",
|
|
76780
|
+
primaryButtonText: "Proceed",
|
|
76781
|
+
secondaryButtonText: "Cancel",
|
|
76782
|
+
children: "Your unsaved changes will be lost if you proceed."
|
|
76783
|
+
}
|
|
76784
|
+
)
|
|
76763
76785
|
] });
|
|
76764
76786
|
};
|
|
76765
76787
|
|