unifyedx-storybook-new 0.1.42 → 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
  }
@@ -75283,9 +75283,6 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
75283
75283
  onChange: (value) => {
75284
75284
  const newData = { ...data, [field.key]: value };
75285
75285
  setData(newData);
75286
- if (updateHandler) {
75287
- updateHandler(section.key, newData);
75288
- }
75289
75286
  },
75290
75287
  options: field.options || [],
75291
75288
  placeholder: field.placeholder || `Select ${field.label}`,
@@ -75389,7 +75386,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
75389
75386
  /* @__PURE__ */ jsx(
75390
75387
  ToggleSwitch,
75391
75388
  {
75392
- checked: Boolean(data[field.key] || field.default),
75389
+ checked: typeof data[field.key] === "boolean" ? data[field.key] : field.default,
75393
75390
  onChange: (isOn) => {
75394
75391
  console.log("Toggle changed:", field.key, isOn);
75395
75392
  const newData = { ...data, [field.key]: isOn };
@@ -76166,6 +76163,7 @@ function DynamicConfig({
76166
76163
  const [config, setConfig] = React__default.useState(configdata);
76167
76164
  const [data, setData] = React__default.useState(null);
76168
76165
  const [loading, setLoading] = useState(false);
76166
+ const [saving, setSaving] = useState(false);
76169
76167
  const [validationErrors, setValidationErrors] = useState({});
76170
76168
  const configEndPoint = `${gatewayBase()}/unifyedxappmodulemanagement/api/v1/appmanager/${appid}/configuration`;
76171
76169
  const updateEndPoint = configEndPoint;
@@ -76404,7 +76402,7 @@ function DynamicConfig({
76404
76402
  }
76405
76403
  const saveData = async () => {
76406
76404
  try {
76407
- setLoading(true);
76405
+ setSaving(true);
76408
76406
  const transformedPayload = {};
76409
76407
  if (data) {
76410
76408
  Object.keys(data).forEach((key) => {
@@ -76478,7 +76476,7 @@ function DynamicConfig({
76478
76476
  draggable: true
76479
76477
  });
76480
76478
  } finally {
76481
- setLoading(false);
76479
+ setSaving(false);
76482
76480
  }
76483
76481
  };
76484
76482
  saveData();
@@ -76531,8 +76529,9 @@ function DynamicConfig({
76531
76529
  const configurationSections = configdata?.configuration || config?.configuration;
76532
76530
  useEffect(() => {
76533
76531
  if (disableApi && configdata) {
76534
- const transformedData = transformApiResponse(configdata);
76535
- setData(transformedData);
76532
+ if (!data || Object.keys(data).length === 0) {
76533
+ initializeEmptyData();
76534
+ }
76536
76535
  } else if (disableApi && !configdata) {
76537
76536
  initializeEmptyData();
76538
76537
  }
@@ -76544,8 +76543,8 @@ function DynamicConfig({
76544
76543
  className: "dynamic-config bg-white w-full h-[calc(100vh-350px)] overflow-y-auto",
76545
76544
  style: { padding: "0px 20px 0px 0px" },
76546
76545
  children: [
76547
- loading && /* @__PURE__ */ jsx(Spinner, { size: "small" }),
76548
- 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) => {
76549
76548
  const C = getComponentForType(section.type);
76550
76549
  if (C && C !== "UnknownType") {
76551
76550
  return /* @__PURE__ */ jsx(
@@ -76570,7 +76569,7 @@ function DynamicConfig({
76570
76569
  category: "secondary",
76571
76570
  onClick: handleCancel,
76572
76571
  label: "Cancel",
76573
- disabled: loading
76572
+ disabled: saving
76574
76573
  }
76575
76574
  ),
76576
76575
  /* @__PURE__ */ jsx(
@@ -76578,8 +76577,8 @@ function DynamicConfig({
76578
76577
  {
76579
76578
  category: "primary",
76580
76579
  onClick: handleSave,
76581
- disabled: loading,
76582
- label: loading ? "Saving..." : "Apply",
76580
+ disabled: saving,
76581
+ label: saving ? "Saving..." : "Apply",
76583
76582
  type: "submit"
76584
76583
  }
76585
76584
  )
@@ -76640,15 +76639,19 @@ const FullConfigPage = ({
76640
76639
  label: item.text,
76641
76640
  href: item.href || "#"
76642
76641
  }));
76643
- const handleCancelRequest = () => {
76642
+ const handleCancelRequest = useCallback(() => {
76643
+ console.log("handleCancelRequest called - showing modal");
76644
76644
  setShowCancelModal(true);
76645
- };
76646
- const handleCancelConfirm = (result) => {
76645
+ }, []);
76646
+ const handleCancelConfirm = useCallback((result) => {
76647
76647
  setShowCancelModal(false);
76648
76648
  if (result.primary) {
76649
+ console.log("User confirmed cancel - navigating back");
76649
76650
  window.history.back();
76651
+ } else {
76652
+ console.log("User cancelled the cancel action - modal closed, data preserved");
76650
76653
  }
76651
- };
76654
+ }, []);
76652
76655
  const defaultAppletHeader = {
76653
76656
  heading: "Application",
76654
76657
  subHeading: "Application configuration and details",