strapi-plugin-bulk-updater 1.6.9 → 1.6.10

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.
Files changed (35) hide show
  1. package/dist/_chunks/{BulkUpdater-CKDhgvZ6.js → BulkUpdater-BY8IXT4R.js} +4 -3
  2. package/dist/_chunks/BulkUpdater-BY8IXT4R.js.map +1 -0
  3. package/dist/_chunks/{BulkUpdater-4E6M5K8J.mjs → BulkUpdater-DISkZC1Y.mjs} +4 -3
  4. package/dist/_chunks/BulkUpdater-DISkZC1Y.mjs.map +1 -0
  5. package/dist/_chunks/{ScopedQuotaSelectInput-BsBpmwun.js → ScopedQuotaSelectInput-BC2Ge-Iv.js} +9 -4
  6. package/dist/_chunks/ScopedQuotaSelectInput-BC2Ge-Iv.js.map +1 -0
  7. package/dist/_chunks/{ScopedQuotaSelectInput-YKdQgrPt.mjs → ScopedQuotaSelectInput-DPIIa3XO.mjs} +9 -4
  8. package/dist/_chunks/ScopedQuotaSelectInput-DPIIa3XO.mjs.map +1 -0
  9. package/dist/_chunks/{SettingsPage-BX9sCRmw.mjs → SettingsPage-D9vD1BKo.mjs} +2 -2
  10. package/dist/_chunks/{SettingsPage-BX9sCRmw.mjs.map → SettingsPage-D9vD1BKo.mjs.map} +1 -1
  11. package/dist/_chunks/{SettingsPage-Crh2syU4.js → SettingsPage-vH-eanBJ.js} +2 -2
  12. package/dist/_chunks/{SettingsPage-Crh2syU4.js.map → SettingsPage-vH-eanBJ.js.map} +1 -1
  13. package/dist/_chunks/{ValidationRulesTab-BqbENLpg.mjs → ValidationRulesTab-DdwR3lWq.mjs} +146 -80
  14. package/dist/_chunks/ValidationRulesTab-DdwR3lWq.mjs.map +1 -0
  15. package/dist/_chunks/{ValidationRulesTab-R1vlW2wY.js → ValidationRulesTab-r6S-ZFDp.js} +145 -79
  16. package/dist/_chunks/ValidationRulesTab-r6S-ZFDp.js.map +1 -0
  17. package/dist/_chunks/index-AXTojFac.mjs +229 -0
  18. package/dist/_chunks/index-AXTojFac.mjs.map +1 -0
  19. package/dist/_chunks/index-aoOgZpZE.js +230 -0
  20. package/dist/_chunks/index-aoOgZpZE.js.map +1 -0
  21. package/dist/admin/index.js +4 -196
  22. package/dist/admin/index.js.map +1 -1
  23. package/dist/admin/index.mjs +4 -194
  24. package/dist/admin/index.mjs.map +1 -1
  25. package/dist/server/index.js +80 -9
  26. package/dist/server/index.js.map +1 -1
  27. package/dist/server/index.mjs +80 -9
  28. package/dist/server/index.mjs.map +1 -1
  29. package/package.json +1 -1
  30. package/dist/_chunks/BulkUpdater-4E6M5K8J.mjs.map +0 -1
  31. package/dist/_chunks/BulkUpdater-CKDhgvZ6.js.map +0 -1
  32. package/dist/_chunks/ScopedQuotaSelectInput-BsBpmwun.js.map +0 -1
  33. package/dist/_chunks/ScopedQuotaSelectInput-YKdQgrPt.mjs.map +0 -1
  34. package/dist/_chunks/ValidationRulesTab-BqbENLpg.mjs.map +0 -1
  35. package/dist/_chunks/ValidationRulesTab-R1vlW2wY.js.map +0 -1
@@ -172,20 +172,25 @@ function ScopedQuotaSelectInput({
172
172
  map.set((it.value || "").toLowerCase().trim(), { ...it });
173
173
  });
174
174
  if (activeUiRule?.quotas) {
175
- for (const [k, max] of Object.entries(activeUiRule.quotas)) {
175
+ const quotaEntries = Array.isArray(activeUiRule.quotas) ? activeUiRule.quotas.map((item) => [
176
+ String(item?.key || item?.option || item?.name || item?.value || "").trim(),
177
+ typeof item?.maxAllowed === "number" ? item.maxAllowed : parseInt(String(item?.maxAllowed ?? item?.max ?? 1), 10) || 1
178
+ ]).filter(([k]) => Boolean(k)) : Object.entries(activeUiRule.quotas);
179
+ for (const [k, max] of quotaEntries) {
176
180
  const lowerK = k.toLowerCase().trim();
181
+ const maxVal = typeof max === "number" ? max : parseInt(String(max || 1), 10) || null;
177
182
  if (map.has(lowerK)) {
178
183
  const existing = map.get(lowerK);
179
184
  map.set(lowerK, {
180
185
  ...existing,
181
- maxAllowed: typeof max === "number" ? max : existing.maxAllowed
186
+ maxAllowed: typeof maxVal === "number" ? maxVal : existing.maxAllowed
182
187
  });
183
188
  } else {
184
189
  map.set(lowerK, {
185
190
  value: k,
186
191
  // preserve original casing from rule, e.g. "H1"
187
192
  label: k.toUpperCase(),
188
- maxAllowed: typeof max === "number" ? max : null
193
+ maxAllowed: typeof maxVal === "number" ? maxVal : null
189
194
  });
190
195
  }
191
196
  }
@@ -293,4 +298,4 @@ function ScopedQuotaSelectInput({
293
298
  ] });
294
299
  }
295
300
  exports.default = ScopedQuotaSelectInput;
296
- //# sourceMappingURL=ScopedQuotaSelectInput-BsBpmwun.js.map
301
+ //# sourceMappingURL=ScopedQuotaSelectInput-BC2Ge-Iv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScopedQuotaSelectInput-BC2Ge-Iv.js","sources":["../../admin/src/components/ScopedQuotaSelectInput.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n Field,\n SingleSelect,\n SingleSelectOption,\n Box,\n Typography,\n} from '@strapi/design-system';\nimport { useForm } from '@strapi/admin/strapi-admin';\nimport { useFetchClient } from '@strapi/strapi/admin';\n\nexport interface QuotaItem {\n value: string;\n label: string;\n maxAllowed?: number | null; // e.g. 1 for H1, 3 for H2, null for unlimited\n}\n\nexport interface ScopedQuotaSelectProps {\n name: string;\n value?: string | null;\n onChange: (e: { target: { name: string; value: string } }) => void;\n attribute?: {\n type?: string;\n customField?: string;\n options?: {\n scope?: 'entry' | 'zone';\n disabledBehavior?: 'disable' | 'hide';\n items?: QuotaItem[];\n };\n };\n disabled?: boolean;\n required?: boolean;\n placeholder?: string;\n label?: React.ReactNode;\n hint?: React.ReactNode;\n}\n\n// Default fallback options if none configured on the attribute\nconst DEFAULT_HEADING_ITEMS: QuotaItem[] = [\n { value: 'h1', label: 'H1 - Main Page Title', maxAllowed: 1 },\n { value: 'h2', label: 'H2 - Primary Section Heading', maxAllowed: 3 },\n { value: 'h3', label: 'H3 - Sub-section Heading', maxAllowed: null },\n { value: 'h4', label: 'H4 - Component Title', maxAllowed: null },\n { value: 'h5', label: 'H5 - Card / Item Heading', maxAllowed: null },\n { value: 'h6', label: 'H6 - Minor Heading', maxAllowed: null },\n];\n\nfunction cleanKey(str: string): string {\n return (str || '').replace(/[-_]/g, '').toLowerCase().trim();\n}\n\nfunction matchesPath(normalizedPath: string, leafKey: string, targetField: string): boolean {\n if (!targetField) return false;\n const pClean = cleanKey(normalizedPath);\n const kClean = cleanKey(leafKey);\n const tClean = cleanKey(targetField);\n\n if (kClean === tClean || pClean === tClean) return true;\n\n const targetSegments = targetField\n .replace(/^api::/i, '')\n .split('.')\n .map(cleanKey)\n .filter(Boolean);\n\n const pathSegments = normalizedPath\n .split('.')\n .map(cleanKey)\n .filter(Boolean);\n\n if (targetSegments.length === 0 || pathSegments.length === 0) return false;\n\n if (targetSegments.length === 1) {\n const single = targetSegments[0];\n return kClean === single || pathSegments[pathSegments.length - 1] === single;\n }\n\n let isSuffix = true;\n for (let i = 0; i < targetSegments.length; i++) {\n const tSeg = targetSegments[targetSegments.length - 1 - i];\n const pSeg = pathSegments[pathSegments.length - 1 - i];\n if (tSeg !== '*' && tSeg !== pSeg) {\n isSuffix = false;\n break;\n }\n }\n if (isSuffix) return true;\n\n for (let startIdx = 1; startIdx < targetSegments.length; startIdx++) {\n const subTarget = targetSegments.slice(startIdx);\n if (subTarget.length > pathSegments.length) continue;\n let subSuffix = true;\n for (let i = 0; i < subTarget.length; i++) {\n const tSeg = subTarget[subTarget.length - 1 - i];\n const pSeg = pathSegments[pathSegments.length - 1 - i];\n if (tSeg !== '*' && tSeg !== pSeg) {\n subSuffix = false;\n break;\n }\n }\n if (subSuffix) return true;\n }\n\n let pIdx = 0;\n let matchesInOrder = true;\n let tStart = 0;\n if (targetSegments.length > 2 && targetSegments[0] !== pathSegments[0] && targetSegments[0] !== '*') {\n tStart = 1;\n }\n for (let tIdx = tStart; tIdx < targetSegments.length; tIdx++) {\n const tSeg = targetSegments[tIdx];\n if (tSeg === '*') continue;\n let found = false;\n while (pIdx < pathSegments.length) {\n if (pathSegments[pIdx] === tSeg) {\n found = true;\n pIdx++;\n break;\n }\n pIdx++;\n }\n if (!found) {\n matchesInOrder = false;\n break;\n }\n }\n\n return matchesInOrder;\n}\n\n/**\n * Recursively traverses the entire form data tree to count occurrences of target field values,\n * excluding the current input's exact field path.\n */\nfunction computeCrossComponentUsage(\n data: any,\n targetFieldRule: string,\n fieldLeafName: string,\n excludePath: string,\n includeRichTextHtml: boolean = false\n): Record<string, number> {\n const counts: Record<string, number> = {};\n\n function traverse(current: any, currentPath: string) {\n if (!current || typeof current !== 'object') return;\n\n for (const key of Object.keys(current)) {\n const val = current[key];\n const fullPath = currentPath ? `${currentPath}.${key}` : key;\n const normalizedPath = fullPath.replace(/\\.\\d+/g, '');\n\n const isTargetMatch = matchesPath(normalizedPath, key, targetFieldRule || fieldLeafName);\n\n if (isTargetMatch && fullPath !== excludePath && typeof val === 'string' && val.trim()) {\n const valNorm = val.toLowerCase().trim();\n counts[valNorm] = (counts[valNorm] || 0) + 1;\n }\n\n // If rule checks rich text HTML, scan strings with HTML or Markdown headings\n if (includeRichTextHtml && typeof val === 'string' && (val.includes('<h') || val.includes('#'))) {\n for (let level = 1; level <= 6; level++) {\n const tag = `h${level}`;\n const htmlMatches = val.match(new RegExp(`<${tag}\\\\b[^>]*>`, 'gi'));\n if (htmlMatches) {\n counts[tag] = (counts[tag] || 0) + htmlMatches.length;\n }\n const mdMatches = val.match(new RegExp(`(?:^|\\\\n)${'#'.repeat(level)}\\\\s+[^\\\\n]+`, 'g'));\n if (mdMatches) {\n counts[tag] = (counts[tag] || 0) + mdMatches.length;\n }\n }\n }\n\n if (typeof val === 'object' && val !== null) {\n traverse(val, fullPath);\n }\n }\n }\n\n traverse(data, '');\n return counts;\n}\n\nexport default function ScopedQuotaSelectInput({\n name,\n value,\n onChange,\n attribute,\n disabled = false,\n required = false,\n placeholder,\n label,\n hint,\n}: ScopedQuotaSelectProps) {\n const { get } = useFetchClient();\n\n // Subscribe to live Formik/Form values in Strapi v5 Admin Edit View\n const formValues = useForm('ScopedQuotaSelectInput', (state) => state.values) || {};\n\n // Extract the leaf property name (e.g., 'titleStyle' from 'blocks.0.titleStyle')\n const fieldLeafName = name.split('.').pop() || name;\n const normalizedFieldPath = name.replace(/\\.\\d+/g, '');\n\n // Active UI-configured rule state\n const [activeUiRule, setActiveUiRule] = React.useState<any>(null);\n\n React.useEffect(() => {\n let isMounted = true;\n get('/bulk-updater/validation-rules')\n .then((res: any) => {\n if (isMounted && res.data && res.data.success && Array.isArray(res.data.rules)) {\n const matching = res.data.rules.find((r: any) => {\n if (!r.enabled || !r.targetField) return false;\n return matchesPath(normalizedFieldPath, fieldLeafName, r.targetField);\n });\n\n if (matching) {\n setActiveUiRule(matching);\n }\n }\n })\n .catch(() => {\n // Fall back gracefully to schema options on network/auth failure\n });\n return () => {\n isMounted = false;\n };\n }, [fieldLeafName, normalizedFieldPath]);\n\n const optionsConfig = attribute?.options || {};\n\n // Dynamically merge items: include items from attribute options, UI rules, or default headings\n const items: QuotaItem[] = React.useMemo(() => {\n const rawItems: QuotaItem[] = optionsConfig.items && optionsConfig.items.length > 0\n ? optionsConfig.items\n : [];\n\n const map = new Map<string, QuotaItem>();\n rawItems.forEach((it) => {\n map.set((it.value || '').toLowerCase().trim(), { ...it });\n });\n\n if (activeUiRule?.quotas) {\n const quotaEntries: Array<[string, any]> = Array.isArray(activeUiRule.quotas)\n ? (activeUiRule.quotas as any[])\n .map((item: any) => [\n String(item?.key || item?.option || item?.name || item?.value || '').trim(),\n typeof item?.maxAllowed === 'number'\n ? item.maxAllowed\n : parseInt(String(item?.maxAllowed ?? item?.max ?? 1), 10) || 1,\n ])\n .filter(([k]) => Boolean(k))\n : Object.entries(activeUiRule.quotas);\n\n for (const [k, max] of quotaEntries) {\n const lowerK = k.toLowerCase().trim();\n const maxVal = typeof max === 'number' ? max : parseInt(String(max || 1), 10) || null;\n if (map.has(lowerK)) {\n const existing = map.get(lowerK)!;\n map.set(lowerK, {\n ...existing,\n maxAllowed: typeof maxVal === 'number' ? maxVal : existing.maxAllowed,\n });\n } else {\n // If option not in schema items, add it preserving the user-defined casing\n map.set(lowerK, {\n value: k, // preserve original casing from rule, e.g. \"H1\"\n label: k.toUpperCase(),\n maxAllowed: typeof maxVal === 'number' ? maxVal : null,\n });\n }\n }\n }\n\n if (map.size === 0) {\n DEFAULT_HEADING_ITEMS.forEach((it) => map.set(it.value.toLowerCase().trim(), { ...it }));\n }\n\n return Array.from(map.values());\n }, [optionsConfig.items, activeUiRule]);\n\n const disabledBehavior = activeUiRule?.exceededAction || optionsConfig.disabledBehavior || 'disable';\n\n // Compute other components' usage across the entire entry (and rich text HTML if rule enabled)\n const otherUsage = React.useMemo(() => {\n return computeCrossComponentUsage(\n formValues,\n activeUiRule?.targetField || fieldLeafName,\n fieldLeafName,\n name,\n Boolean(activeUiRule?.includeRichTextHtml)\n );\n }, [formValues, fieldLeafName, name, activeUiRule]);\n\n // Compute processed options: evaluate quotas and apply disable or hide rules\n const processedOptions = React.useMemo(() => {\n return items\n .map((item) => {\n const itemValLower = (item.value || '').toLowerCase().trim();\n const usedCount = otherUsage[itemValLower] || 0;\n const max = item.maxAllowed;\n\n // Quota is exhausted if other components have already reached maxAllowed\n const isQuotaReached = typeof max === 'number' && max > 0 && usedCount >= max;\n\n // Check if current field already holds this value (case-insensitively)\n const isCurrentValue = (value || '').toLowerCase().trim() === itemValLower;\n const isDisabled = isQuotaReached && !isCurrentValue;\n\n let quotaNotice = '';\n if (typeof max === 'number' && max > 0) {\n quotaNotice = `(${usedCount}/${max} used)`;\n }\n\n return {\n ...item,\n isDisabled,\n quotaNotice,\n isQuotaReached,\n };\n })\n .filter((item) => {\n if (disabledBehavior === 'hide' && item.isDisabled) {\n return false;\n }\n return true;\n });\n }, [items, otherUsage, value, disabledBehavior]);\n\n // Identify options whose quota has been exhausted by other components\n const exhaustedItems = React.useMemo(() => {\n return items.filter((i) => {\n const iValLower = (i.value || '').toLowerCase().trim();\n const isCurrentValue = (value || '').toLowerCase().trim() === iValLower;\n return (\n typeof i.maxAllowed === 'number' &&\n i.maxAllowed > 0 &&\n (otherUsage[iValLower] || 0) >= i.maxAllowed &&\n !isCurrentValue\n );\n });\n }, [items, otherUsage, value]);\n\n const handleChange = (selectedVal: string) => {\n if (onChange) {\n onChange({ target: { name, value: selectedVal } });\n }\n };\n\n const displayLabel = label || activeUiRule?.name || (fieldLeafName.charAt(0).toUpperCase() + fieldLeafName.slice(1));\n const displayPlaceholder = placeholder || `Select ${displayLabel}...`;\n const matchedItemValue = items.find((it) => (it.value || '').toLowerCase().trim() === (value || '').toLowerCase().trim())?.value || (value || '');\n\n return (\n <Field.Root name={name} required={required}>\n {displayLabel && <Field.Label>{displayLabel}</Field.Label>}\n <SingleSelect\n placeholder={displayPlaceholder}\n value={matchedItemValue}\n onChange={handleChange}\n disabled={disabled}\n >\n {processedOptions.map((opt) => (\n <SingleSelectOption\n key={opt.value}\n value={opt.value}\n disabled={opt.isDisabled}\n >\n {opt.label}{' '}\n {opt.quotaNotice && (\n <span style={{ opacity: 0.65, fontSize: '0.85em', marginLeft: 6 }}>\n [{opt.quotaNotice}]\n </span>\n )}\n </SingleSelectOption>\n ))}\n </SingleSelect>\n {hint && <Field.Hint>{hint}</Field.Hint>}\n\n {exhaustedItems.length > 0 && (\n <Box paddingTop={1}>\n {exhaustedItems.map((item) => (\n <Typography\n key={item.value}\n variant=\"pi\"\n textColor=\"neutral600\"\n style={{ display: 'block', marginTop: 2 }}\n >\n ℹ️ <strong>{item.label}</strong> quota reached (Max {item.maxAllowed} per entry).\n </Typography>\n ))}\n </Box>\n )}\n </Field.Root>\n );\n}\n"],"names":["useFetchClient","useForm","React","jsxs","Field","jsx","SingleSelect","SingleSelectOption","Box","Typography"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,MAAM,wBAAqC;AAAA,EACzC,EAAE,OAAO,MAAM,OAAO,wBA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,IAAC,UAAA,EAAQ,UAAA,KAAK,MAAA,CAAM;AAAA,UAAS;AAAA,UAAqB,KAAK;AAAA,UAAW;AAAA,QAAA;AAAA,MAAA;AAAA,MALhE,KAAK;AAAA,IAAA,CAOb,EAAA,CACH;AAAA,EAAA,GAEJ;AAEJ;;"}
@@ -152,20 +152,25 @@ function ScopedQuotaSelectInput({
152
152
  map.set((it.value || "").toLowerCase().trim(), { ...it });
153
153
  });
154
154
  if (activeUiRule?.quotas) {
155
- for (const [k, max] of Object.entries(activeUiRule.quotas)) {
155
+ const quotaEntries = Array.isArray(activeUiRule.quotas) ? activeUiRule.quotas.map((item) => [
156
+ String(item?.key || item?.option || item?.name || item?.value || "").trim(),
157
+ typeof item?.maxAllowed === "number" ? item.maxAllowed : parseInt(String(item?.maxAllowed ?? item?.max ?? 1), 10) || 1
158
+ ]).filter(([k]) => Boolean(k)) : Object.entries(activeUiRule.quotas);
159
+ for (const [k, max] of quotaEntries) {
156
160
  const lowerK = k.toLowerCase().trim();
161
+ const maxVal = typeof max === "number" ? max : parseInt(String(max || 1), 10) || null;
157
162
  if (map.has(lowerK)) {
158
163
  const existing = map.get(lowerK);
159
164
  map.set(lowerK, {
160
165
  ...existing,
161
- maxAllowed: typeof max === "number" ? max : existing.maxAllowed
166
+ maxAllowed: typeof maxVal === "number" ? maxVal : existing.maxAllowed
162
167
  });
163
168
  } else {
164
169
  map.set(lowerK, {
165
170
  value: k,
166
171
  // preserve original casing from rule, e.g. "H1"
167
172
  label: k.toUpperCase(),
168
- maxAllowed: typeof max === "number" ? max : null
173
+ maxAllowed: typeof maxVal === "number" ? maxVal : null
169
174
  });
170
175
  }
171
176
  }
@@ -275,4 +280,4 @@ function ScopedQuotaSelectInput({
275
280
  export {
276
281
  ScopedQuotaSelectInput as default
277
282
  };
278
- //# sourceMappingURL=ScopedQuotaSelectInput-YKdQgrPt.mjs.map
283
+ //# sourceMappingURL=ScopedQuotaSelectInput-DPIIa3XO.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScopedQuotaSelectInput-DPIIa3XO.mjs","sources":["../../admin/src/components/ScopedQuotaSelectInput.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n Field,\n SingleSelect,\n SingleSelectOption,\n Box,\n Typography,\n} from '@strapi/design-system';\nimport { useForm } from '@strapi/admin/strapi-admin';\nimport { useFetchClient } from '@strapi/strapi/admin';\n\nexport interface QuotaItem {\n value: string;\n label: string;\n maxAllowed?: number | null; // e.g. 1 for H1, 3 for H2, null for unlimited\n}\n\nexport interface ScopedQuotaSelectProps {\n name: string;\n value?: string | null;\n onChange: (e: { target: { name: string; value: string } }) => void;\n attribute?: {\n type?: string;\n customField?: string;\n options?: {\n scope?: 'entry' | 'zone';\n disabledBehavior?: 'disable' | 'hide';\n items?: QuotaItem[];\n };\n };\n disabled?: boolean;\n required?: boolean;\n placeholder?: string;\n label?: React.ReactNode;\n hint?: React.ReactNode;\n}\n\n// Default fallback options if none configured on the attribute\nconst DEFAULT_HEADING_ITEMS: QuotaItem[] = [\n { value: 'h1', label: 'H1 - Main Page Title', maxAllowed: 1 },\n { value: 'h2', label: 'H2 - Primary Section Heading', maxAllowed: 3 },\n { value: 'h3', label: 'H3 - Sub-section Heading', maxAllowed: null },\n { value: 'h4', label: 'H4 - Component Title', maxAllowed: null },\n { value: 'h5', label: 'H5 - Card / Item Heading', maxAllowed: null },\n { value: 'h6', label: 'H6 - Minor Heading', maxAllowed: null },\n];\n\nfunction cleanKey(str: string): string {\n return (str || '').replace(/[-_]/g, '').toLowerCase().trim();\n}\n\nfunction matchesPath(normalizedPath: string, leafKey: string, targetField: string): boolean {\n if (!targetField) return false;\n const pClean = cleanKey(normalizedPath);\n const kClean = cleanKey(leafKey);\n const tClean = cleanKey(targetField);\n\n if (kClean === tClean || pClean === tClean) return true;\n\n const targetSegments = targetField\n .replace(/^api::/i, '')\n .split('.')\n .map(cleanKey)\n .filter(Boolean);\n\n const pathSegments = normalizedPath\n .split('.')\n .map(cleanKey)\n .filter(Boolean);\n\n if (targetSegments.length === 0 || pathSegments.length === 0) return false;\n\n if (targetSegments.length === 1) {\n const single = targetSegments[0];\n return kClean === single || pathSegments[pathSegments.length - 1] === single;\n }\n\n let isSuffix = true;\n for (let i = 0; i < targetSegments.length; i++) {\n const tSeg = targetSegments[targetSegments.length - 1 - i];\n const pSeg = pathSegments[pathSegments.length - 1 - i];\n if (tSeg !== '*' && tSeg !== pSeg) {\n isSuffix = false;\n break;\n }\n }\n if (isSuffix) return true;\n\n for (let startIdx = 1; startIdx < targetSegments.length; startIdx++) {\n const subTarget = targetSegments.slice(startIdx);\n if (subTarget.length > pathSegments.length) continue;\n let subSuffix = true;\n for (let i = 0; i < subTarget.length; i++) {\n const tSeg = subTarget[subTarget.length - 1 - i];\n const pSeg = pathSegments[pathSegments.length - 1 - i];\n if (tSeg !== '*' && tSeg !== pSeg) {\n subSuffix = false;\n break;\n }\n }\n if (subSuffix) return true;\n }\n\n let pIdx = 0;\n let matchesInOrder = true;\n let tStart = 0;\n if (targetSegments.length > 2 && targetSegments[0] !== pathSegments[0] && targetSegments[0] !== '*') {\n tStart = 1;\n }\n for (let tIdx = tStart; tIdx < targetSegments.length; tIdx++) {\n const tSeg = targetSegments[tIdx];\n if (tSeg === '*') continue;\n let found = false;\n while (pIdx < pathSegments.length) {\n if (pathSegments[pIdx] === tSeg) {\n found = true;\n pIdx++;\n break;\n }\n pIdx++;\n }\n if (!found) {\n matchesInOrder = false;\n break;\n }\n }\n\n return matchesInOrder;\n}\n\n/**\n * Recursively traverses the entire form data tree to count occurrences of target field values,\n * excluding the current input's exact field path.\n */\nfunction computeCrossComponentUsage(\n data: any,\n targetFieldRule: string,\n fieldLeafName: string,\n excludePath: string,\n includeRichTextHtml: boolean = false\n): Record<string, number> {\n const counts: Record<string, number> = {};\n\n function traverse(current: any, currentPath: string) {\n if (!current || typeof current !== 'object') return;\n\n for (const key of Object.keys(current)) {\n const val = current[key];\n const fullPath = currentPath ? `${currentPath}.${key}` : key;\n const normalizedPath = fullPath.replace(/\\.\\d+/g, '');\n\n const isTargetMatch = matchesPath(normalizedPath, key, targetFieldRule || fieldLeafName);\n\n if (isTargetMatch && fullPath !== excludePath && typeof val === 'string' && val.trim()) {\n const valNorm = val.toLowerCase().trim();\n counts[valNorm] = (counts[valNorm] || 0) + 1;\n }\n\n // If rule checks rich text HTML, scan strings with HTML or Markdown headings\n if (includeRichTextHtml && typeof val === 'string' && (val.includes('<h') || val.includes('#'))) {\n for (let level = 1; level <= 6; level++) {\n const tag = `h${level}`;\n const htmlMatches = val.match(new RegExp(`<${tag}\\\\b[^>]*>`, 'gi'));\n if (htmlMatches) {\n counts[tag] = (counts[tag] || 0) + htmlMatches.length;\n }\n const mdMatches = val.match(new RegExp(`(?:^|\\\\n)${'#'.repeat(level)}\\\\s+[^\\\\n]+`, 'g'));\n if (mdMatches) {\n counts[tag] = (counts[tag] || 0) + mdMatches.length;\n }\n }\n }\n\n if (typeof val === 'object' && val !== null) {\n traverse(val, fullPath);\n }\n }\n }\n\n traverse(data, '');\n return counts;\n}\n\nexport default function ScopedQuotaSelectInput({\n name,\n value,\n onChange,\n attribute,\n disabled = false,\n required = false,\n placeholder,\n label,\n hint,\n}: ScopedQuotaSelectProps) {\n const { get } = useFetchClient();\n\n // Subscribe to live Formik/Form values in Strapi v5 Admin Edit View\n const formValues = useForm('ScopedQuotaSelectInput', (state) => state.values) || {};\n\n // Extract the leaf property name (e.g., 'titleStyle' from 'blocks.0.titleStyle')\n const fieldLeafName = name.split('.').pop() || name;\n const normalizedFieldPath = name.replace(/\\.\\d+/g, '');\n\n // Active UI-configured rule state\n const [activeUiRule, setActiveUiRule] = React.useState<any>(null);\n\n React.useEffect(() => {\n let isMounted = true;\n get('/bulk-updater/validation-rules')\n .then((res: any) => {\n if (isMounted && res.data && res.data.success && Array.isArray(res.data.rules)) {\n const matching = res.data.rules.find((r: any) => {\n if (!r.enabled || !r.targetField) return false;\n return matchesPath(normalizedFieldPath, fieldLeafName, r.targetField);\n });\n\n if (matching) {\n setActiveUiRule(matching);\n }\n }\n })\n .catch(() => {\n // Fall back gracefully to schema options on network/auth failure\n });\n return () => {\n isMounted = false;\n };\n }, [fieldLeafName, normalizedFieldPath]);\n\n const optionsConfig = attribute?.options || {};\n\n // Dynamically merge items: include items from attribute options, UI rules, or default headings\n const items: QuotaItem[] = React.useMemo(() => {\n const rawItems: QuotaItem[] = optionsConfig.items && optionsConfig.items.length > 0\n ? optionsConfig.items\n : [];\n\n const map = new Map<string, QuotaItem>();\n rawItems.forEach((it) => {\n map.set((it.value || '').toLowerCase().trim(), { ...it });\n });\n\n if (activeUiRule?.quotas) {\n const quotaEntries: Array<[string, any]> = Array.isArray(activeUiRule.quotas)\n ? (activeUiRule.quotas as any[])\n .map((item: any) => [\n String(item?.key || item?.option || item?.name || item?.value || '').trim(),\n typeof item?.maxAllowed === 'number'\n ? item.maxAllowed\n : parseInt(String(item?.maxAllowed ?? item?.max ?? 1), 10) || 1,\n ])\n .filter(([k]) => Boolean(k))\n : Object.entries(activeUiRule.quotas);\n\n for (const [k, max] of quotaEntries) {\n const lowerK = k.toLowerCase().trim();\n const maxVal = typeof max === 'number' ? max : parseInt(String(max || 1), 10) || null;\n if (map.has(lowerK)) {\n const existing = map.get(lowerK)!;\n map.set(lowerK, {\n ...existing,\n maxAllowed: typeof maxVal === 'number' ? maxVal : existing.maxAllowed,\n });\n } else {\n // If option not in schema items, add it preserving the user-defined casing\n map.set(lowerK, {\n value: k, // preserve original casing from rule, e.g. \"H1\"\n label: k.toUpperCase(),\n maxAllowed: typeof maxVal === 'number' ? maxVal : null,\n });\n }\n }\n }\n\n if (map.size === 0) {\n DEFAULT_HEADING_ITEMS.forEach((it) => map.set(it.value.toLowerCase().trim(), { ...it }));\n }\n\n return Array.from(map.values());\n }, [optionsConfig.items, activeUiRule]);\n\n const disabledBehavior = activeUiRule?.exceededAction || optionsConfig.disabledBehavior || 'disable';\n\n // Compute other components' usage across the entire entry (and rich text HTML if rule enabled)\n const otherUsage = React.useMemo(() => {\n return computeCrossComponentUsage(\n formValues,\n activeUiRule?.targetField || fieldLeafName,\n fieldLeafName,\n name,\n Boolean(activeUiRule?.includeRichTextHtml)\n );\n }, [formValues, fieldLeafName, name, activeUiRule]);\n\n // Compute processed options: evaluate quotas and apply disable or hide rules\n const processedOptions = React.useMemo(() => {\n return items\n .map((item) => {\n const itemValLower = (item.value || '').toLowerCase().trim();\n const usedCount = otherUsage[itemValLower] || 0;\n const max = item.maxAllowed;\n\n // Quota is exhausted if other components have already reached maxAllowed\n const isQuotaReached = typeof max === 'number' && max > 0 && usedCount >= max;\n\n // Check if current field already holds this value (case-insensitively)\n const isCurrentValue = (value || '').toLowerCase().trim() === itemValLower;\n const isDisabled = isQuotaReached && !isCurrentValue;\n\n let quotaNotice = '';\n if (typeof max === 'number' && max > 0) {\n quotaNotice = `(${usedCount}/${max} used)`;\n }\n\n return {\n ...item,\n isDisabled,\n quotaNotice,\n isQuotaReached,\n };\n })\n .filter((item) => {\n if (disabledBehavior === 'hide' && item.isDisabled) {\n return false;\n }\n return true;\n });\n }, [items, otherUsage, value, disabledBehavior]);\n\n // Identify options whose quota has been exhausted by other components\n const exhaustedItems = React.useMemo(() => {\n return items.filter((i) => {\n const iValLower = (i.value || '').toLowerCase().trim();\n const isCurrentValue = (value || '').toLowerCase().trim() === iValLower;\n return (\n typeof i.maxAllowed === 'number' &&\n i.maxAllowed > 0 &&\n (otherUsage[iValLower] || 0) >= i.maxAllowed &&\n !isCurrentValue\n );\n });\n }, [items, otherUsage, value]);\n\n const handleChange = (selectedVal: string) => {\n if (onChange) {\n onChange({ target: { name, value: selectedVal } });\n }\n };\n\n const displayLabel = label || activeUiRule?.name || (fieldLeafName.charAt(0).toUpperCase() + fieldLeafName.slice(1));\n const displayPlaceholder = placeholder || `Select ${displayLabel}...`;\n const matchedItemValue = items.find((it) => (it.value || '').toLowerCase().trim() === (value || '').toLowerCase().trim())?.value || (value || '');\n\n return (\n <Field.Root name={name} required={required}>\n {displayLabel && <Field.Label>{displayLabel}</Field.Label>}\n <SingleSelect\n placeholder={displayPlaceholder}\n value={matchedItemValue}\n onChange={handleChange}\n disabled={disabled}\n >\n {processedOptions.map((opt) => (\n <SingleSelectOption\n key={opt.value}\n value={opt.value}\n disabled={opt.isDisabled}\n >\n {opt.label}{' '}\n {opt.quotaNotice && (\n <span style={{ opacity: 0.65, fontSize: '0.85em', marginLeft: 6 }}>\n [{opt.quotaNotice}]\n </span>\n )}\n </SingleSelectOption>\n ))}\n </SingleSelect>\n {hint && <Field.Hint>{hint}</Field.Hint>}\n\n {exhaustedItems.length > 0 && (\n <Box paddingTop={1}>\n {exhaustedItems.map((item) => (\n <Typography\n key={item.value}\n variant=\"pi\"\n textColor=\"neutral600\"\n style={{ display: 'block', marginTop: 2 }}\n >\n ℹ️ <strong>{item.label}</strong> quota reached (Max {item.maxAllowed} per entry).\n </Typography>\n ))}\n </Box>\n )}\n </Field.Root>\n );\n}\n"],"names":[],"mappings":";;;;;AAsCA,MAAM,wBAAqC;AAAA,EACzC,EAAE,OAAO,MAAM,OAAO,wBAAwB,YAAY,EAAA;AAAA,EAC1D,EAAE,OAAO,MAAM,OAAO,gCAAgC,YAAY,EAAA;AAAA,EAClE,EAAE,OAAO,MAAM,OAAO,4BAA4B,YAAY,KAAA;AAAA,EAC9D,EAAE,OAAO,MAAM,OAAO,wBAAwB,YAAY,KAAA;AAAA,EAC1D,EAAE,OAAO,MAAM,OAAO,4BAA4B,YAAY,KAAA;AAAA,EAC9D,EAAE,OAAO,MAAM,OAAO,sBAAsB,YAAY,KAAA;AAC1D;AAEA,SAAS,SAAS,KAAqB;AACrC,UAAQ,OAAO,IAAI,QAAQ,SAAS,EAAE,EAAE,YAAA,EAAc,KAAA;AACxD;AAEA,SAAS,YAAY,gBAAwB,SAAiB,aAA8B;AAC1F,MAAI,CAAC,YAAa,QAAO;AACzB,QAAM,SAAS,SAAS,cAAc;AACtC,QAAM,SAAS,SAAS,OAAO;AAC/B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A,EAAK,OAAO,EAAE,SAAS,MAAM,UAAU,UAAU,YAAY,EAAA,GAAK,UAAA;AAAA,gBAAA;AAAA,gBAC/D,IAAI;AAAA,gBAAY;AAAA,cAAA,EAAA,CACpB;AAAA,YAAA;AAAA,UAAA;AAAA,UARG,IAAI;AAAA,QAAA,CAWZ;AAAA,MAAA;AAAA,IAAA;AAAA,IAEF,QAAQ,oBAAC,MAAM,MAAN,EAAY,UAAA,MAAK;AAAA,IAE1B,eAAe,SAAS,KACvB,oBAAC,KAAA,EAAI,YAAY,GACd,UAAA,eAAe,IAAI,CAAC,SACnB;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,SAAQ;AAAA,QACR,WAAU;AAAA,QACV,OAAO,EAAE,SAAS,SAAS,WAAW,EAAA;AAAA,QACvC,UAAA;AAAA,UAAA;AAAA,UACI,oBAAC,UAAA,EAAQ,UAAA,KAAK,MAAA,CAAM;AAAA,UAAS;AAAA,UAAqB,KAAK;AAAA,UAAW;AAAA,QAAA;AAAA,MAAA;AAAA,MALhE,KAAK;AAAA,IAAA,CAOb,EAAA,CACH;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Box, Alert, Flex, Typography, Badge } from "@strapi/design-system";
3
3
  import { Check } from "@strapi/icons";
4
- import { u as useBulkUpdaterRBAC, V as ValidationRulesTab } from "./ValidationRulesTab-BqbENLpg.mjs";
4
+ import { u as useBulkUpdaterRBAC, V as ValidationRulesTab } from "./ValidationRulesTab-DdwR3lWq.mjs";
5
5
  const ALL_FEATURES = [
6
6
  "Cross-collection batch attribute & relationship updates",
7
7
  "Interactive schema compatibility & target selection",
@@ -44,4 +44,4 @@ const SettingsPage = () => {
44
44
  export {
45
45
  SettingsPage as default
46
46
  };
47
- //# sourceMappingURL=SettingsPage-BX9sCRmw.mjs.map
47
+ //# sourceMappingURL=SettingsPage-D9vD1BKo.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"SettingsPage-BX9sCRmw.mjs","sources":["../../admin/src/pages/SettingsPage.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Box,\n Flex,\n Typography,\n Badge,\n Alert,\n} from '@strapi/design-system';\nimport { Check } from '@strapi/icons';\nimport ValidationRulesTab from './ValidationRulesTab';\nimport { useBulkUpdaterRBAC } from '../hooks/useBulkUpdaterRBAC';\n\nconst ALL_FEATURES = [\n 'Cross-collection batch attribute & relationship updates',\n 'Interactive schema compatibility & target selection',\n 'Full regex find & replace with live diff previews',\n 'Dynamic cross-component quota validation (UI-configurable)',\n 'Enterprise Maker-Checker 4-Eyes approval workflow',\n 'Server-enforced off-peak execution maintenance window',\n '3-Tier comprehensive audit logging with one-click reversible rollback',\n 'Zero-infra memory caching & pod-level ETag optimization',\n];\n\nconst SettingsPage: React.FC = () => {\n const permissions = useBulkUpdaterRBAC();\n\n if (!permissions.canSettingsView) {\n return (\n <Box padding={8} background=\"neutral100\">\n <Alert variant=\"warning\" title=\"Access Denied\">\n You do not have permission to view Bulk Attribute Updater Settings (action: plugin::bulk-updater.settings.view).\n </Alert>\n </Box>\n );\n }\n\n return (\n <Box padding={8} background=\"neutral100\">\n <Flex direction=\"column\" alignItems=\"flex-start\" gap={2} marginBottom={6}>\n <Flex justifyContent=\"space-between\" width=\"100%\">\n <Box>\n <Typography variant=\"alpha\" tag=\"h1\" fontWeight=\"bold\">\n Bulk Attribute Updater Settings\n </Typography>\n <Typography variant=\"omega\" textColor=\"neutral600\">\n Configure cross-component validation rules, manage quotas, and view active plugin capabilities.\n </Typography>\n </Box>\n </Flex>\n </Flex>\n\n {/* Plugin Status Card */}\n <Box padding={6} background=\"neutral0\" shadow=\"filterShadow\" hasRadius marginBottom={6}>\n <Flex justifyContent=\"space-between\" alignItems=\"center\" marginBottom={4}>\n <Box>\n <Typography variant=\"delta\" tag=\"h2\" fontWeight=\"semiBold\">\n Plugin Status\n </Typography>\n <Typography variant=\"pi\" textColor=\"neutral600\">\n All features are fully unlocked, active, and free under the MIT open-source license.\n </Typography>\n </Box>\n <Badge backgroundColor=\"success100\" textColor=\"success700\" size=\"M\">\n COMMUNITY & ENTERPRISE UNLOCKED\n </Badge>\n </Flex>\n\n {/* Features Checklist */}\n <Box marginTop={4}>\n <Typography variant=\"pi\" fontWeight=\"bold\" textColor=\"neutral700\" marginBottom={3}>\n Active Capabilities:\n </Typography>\n <Flex direction=\"column\" gap={2} alignItems=\"flex-start\" marginTop={2}>\n {ALL_FEATURES.map((feat, i) => (\n <Flex key={i} gap={2} alignItems=\"center\">\n <Check width=\"16px\" height=\"16px\" color=\"#328048\" />\n <Typography variant=\"omega\">{feat}</Typography>\n </Flex>\n ))}\n </Flex>\n </Box>\n </Box>\n\n {/* Validation Rules Section */}\n {permissions.canValidationView && (\n <Box marginTop={6}>\n <ValidationRulesTab />\n </Box>\n )}\n </Box>\n );\n};\n\nexport default SettingsPage;\n"],"names":[],"mappings":";;;;AAYA,MAAM,eAAe;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,eAAyB,MAAM;AACnC,QAAM,cAAc,mBAAA;AAEpB,MAAI,CAAC,YAAY,iBAAiB;AAChC,WACE,oBAAC,KAAA,EAAI,SAAS,GAAG,YAAW,cAC1B,UAAA,oBAAC,OAAA,EAAM,SAAQ,WAAU,OAAM,iBAAgB,8HAE/C,GACF;AAAA,EAAA;AAIJ,SACE,qBAAC,KAAA,EAAI,SAAS,GAAG,YAAW,cAC1B,UAAA;AAAA,IAAA,oBAAC,QAAK,WAAU,UAAS,YAAW,cAAa,KAAK,GAAG,cAAc,GACrE,UAAA,oBAAC,QAAK,gBAAe,iBAAgB,OAAM,QACzC,+BAAC,KAAA,EACC,UAAA;AAAA,MAAA,oBAAC,cAAW,SAAQ,SAAQ,KAAI,MAAK,YAAW,QAAO,UAAA,kCAAA,CAEvD;AAAA,0BACC,YAAA,EAAW,SAA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pages/SettingsPage.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Box,\n Flex,\n Typography,\n Badge,\n Alert,\n} from '@strapi/design-system';\nimport { Check } from '@strapi/icons';\nimport ValidationRulesTab from './ValidationRulesTab';\nimport { useBulkUpdaterRBAC } from '../hooks/useBulkUpdaterRBAC';\n\nconst ALL_FEATURES = [\n 'Cross-collection batch attribute & relationship updates',\n 'Interactive schema compatibility & target selection',\n 'Full regex find & replace with live diff previews',\n 'Dynamic cross-component quota validation (UI-configurable)',\n 'Enterprise Maker-Checker 4-Eyes approval workflow',\n 'Server-enforced off-peak execution maintenance window',\n '3-Tier comprehensive audit logging with one-click reversible rollback',\n 'Zero-infra memory caching & pod-level ETag optimization',\n];\n\nconst SettingsPage: React.FC = () => {\n const permissions = useBulkUpdaterRBAC();\n\n if (!permissions.canSettingsView) {\n return (\n <Box padding={8} background=\"neutral100\">\n <Alert variant=\"warning\" title=\"Access Denied\">\n You do not have permission to view Bulk Attribute Updater Settings (action: plugin::bulk-updater.settings.view).\n </Alert>\n </Box>\n );\n }\n\n return (\n <Box padding={8} background=\"neutral100\">\n <Flex direction=\"column\" alignItems=\"flex-start\" gap={2} marginBottom={6}>\n <Flex justifyContent=\"space-between\" width=\"100%\">\n <Box>\n <Typography variant=\"alpha\" tag=\"h1\" fontWeight=\"bold\">\n Bulk Attribute Updater Settings\n </Typography>\n <Typography variant=\"omega\" textColor=\"neutral600\">\n Configure cross-component validation rules, manage quotas, and view active plugin capabilities.\n </Typography>\n </Box>\n </Flex>\n </Flex>\n\n {/* Plugin Status Card */}\n <Box padding={6} background=\"neutral0\" shadow=\"filterShadow\" hasRadius marginBottom={6}>\n <Flex justifyContent=\"space-between\" alignItems=\"center\" marginBottom={4}>\n <Box>\n <Typography variant=\"delta\" tag=\"h2\" fontWeight=\"semiBold\">\n Plugin Status\n </Typography>\n <Typography variant=\"pi\" textColor=\"neutral600\">\n All features are fully unlocked, active, and free under the MIT open-source license.\n </Typography>\n </Box>\n <Badge backgroundColor=\"success100\" textColor=\"success700\" size=\"M\">\n COMMUNITY & ENTERPRISE UNLOCKED\n </Badge>\n </Flex>\n\n {/* Features Checklist */}\n <Box marginTop={4}>\n <Typography variant=\"pi\" fontWeight=\"bold\" textColor=\"neutral700\" marginBottom={3}>\n Active Capabilities:\n </Typography>\n <Flex direction=\"column\" gap={2} alignItems=\"flex-start\" marginTop={2}>\n {ALL_FEATURES.map((feat, i) => (\n <Flex key={i} gap={2} alignItems=\"center\">\n <Check width=\"16px\" height=\"16px\" color=\"#328048\" />\n <Typography variant=\"omega\">{feat}</Typography>\n </Flex>\n ))}\n </Flex>\n </Box>\n </Box>\n\n {/* Validation Rules Section */}\n {permissions.canValidationView && (\n <Box marginTop={6}>\n <ValidationRulesTab />\n </Box>\n )}\n </Box>\n );\n};\n\nexport default SettingsPage;\n"],"names":[],"mappings":";;;;AAYA,MAAM,eAAe;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,eAAyB,MAAM;AACnC,QAAM,cAAc,mBAAA;AAEpB,MAAI,CAAC,YAAY,iBAAiB;AAChC,WACE,oBAAC,KAAA,EAAI,SAAS,GAAG,YAAW,cAC1B,UAAA,oBAAC,OAAA,EAAM,SAAQ,WAAU,OAAM,iBAAgB,8HAE/C,GACF;AAAA,EAAA;AAIJ,SACE,qBAAC,KAAA,EAAI,SAAS,GAAG,YAAW,cAC1B,UAAA;AAAA,IAAA,oBAAC,QAAK,WAAU,UAAS,YAAW,cAAa,KAAK,GAAG,cAAc,GACrE,UAAA,oBAAC,QAAK,gBAAe,iBAAgB,OAAM,QACzC,+BAAC,KAAA,EACC,UAAA;AAAA,MAAA,oBAAC,cAAW,SAAQ,SAAQ,KAAI,MAAK,YAAW,QAAO,UAAA,kCAAA,CAEvD;AAAA,0BACC,YAAA,EAAW,SAAQ,SAAQ,WAAU,cAAa,UAAA,kGAAA,CAEnD;AAAA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= require("@strapi/design-system");
5
5
  const icons = require("@strapi/icons");
6
- const ValidationRulesTab = require("./ValidationRulesTab-R1vlW2wY.js");
6
+ const ValidationRulesTab = require("./ValidationRulesTab-r6S-ZFDp.js");
7
7
  const ALL_FEATURES = [
8
8
  "Cross-collection batch attribute & relationship updates",
9
9
  "Interactive schema compatibility & target selection",
@@ -44,4 +44,4 @@ const SettingsPage = () => {
44
44
  ] });
45
45
  };
46
46
  exports.default = SettingsPage;
47
- //# sourceMappingURL=SettingsPage-Crh2syU4.js.map
47
+ //# sourceMappingURL=SettingsPage-vH-eanBJ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SettingsPage-Crh2syU4.js","sources":["../../admin/src/pages/SettingsPage.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Box,\n Flex,\n Typography,\n Badge,\n Alert,\n} from '@strapi/design-system';\nimport { Check } from '@strapi/icons';\nimport ValidationRulesTab from './ValidationRulesTab';\nimport { useBulkUpdaterRBAC } from '../hooks/useBulkUpdaterRBAC';\n\nconst ALL_FEATURES = [\n 'Cross-collection batch attribute & relationship updates',\n 'Interactive schema compatibility & target selection',\n 'Full regex find & replace with live diff previews',\n 'Dynamic cross-component quota validation (UI-configurable)',\n 'Enterprise Maker-Checker 4-Eyes approval workflow',\n 'Server-enforced off-peak execution maintenance window',\n '3-Tier comprehensive audit logging with one-click reversible rollback',\n 'Zero-infra memory caching & pod-level ETag optimization',\n];\n\nconst SettingsPage: React.FC = () => {\n const permissions = useBulkUpdaterRBAC();\n\n if (!permissions.canSettingsView) {\n return (\n <Box padding={8} background=\"neutral100\">\n <Alert variant=\"warning\" title=\"Access Denied\">\n You do not have permission to view Bulk Attribute Updater Settings (action: plugin::bulk-updater.settings.view).\n </Alert>\n </Box>\n );\n }\n\n return (\n <Box padding={8} background=\"neutral100\">\n <Flex direction=\"column\" alignItems=\"flex-start\" gap={2} marginBottom={6}>\n <Flex justifyContent=\"space-between\" width=\"100%\">\n <Box>\n <Typography variant=\"alpha\" tag=\"h1\" fontWeight=\"bold\">\n Bulk Attribute Updater Settings\n </Typography>\n <Typography variant=\"omega\" textColor=\"neutral600\">\n Configure cross-component validation rules, manage quotas, and view active plugin capabilities.\n </Typography>\n </Box>\n </Flex>\n </Flex>\n\n {/* Plugin Status Card */}\n <Box padding={6} background=\"neutral0\" shadow=\"filterShadow\" hasRadius marginBottom={6}>\n <Flex justifyContent=\"space-between\" alignItems=\"center\" marginBottom={4}>\n <Box>\n <Typography variant=\"delta\" tag=\"h2\" fontWeight=\"semiBold\">\n Plugin Status\n </Typography>\n <Typography variant=\"pi\" textColor=\"neutral600\">\n All features are fully unlocked, active, and free under the MIT open-source license.\n </Typography>\n </Box>\n <Badge backgroundColor=\"success100\" textColor=\"success700\" size=\"M\">\n COMMUNITY & ENTERPRISE UNLOCKED\n </Badge>\n </Flex>\n\n {/* Features Checklist */}\n <Box marginTop={4}>\n <Typography variant=\"pi\" fontWeight=\"bold\" textColor=\"neutral700\" marginBottom={3}>\n Active Capabilities:\n </Typography>\n <Flex direction=\"column\" gap={2} alignItems=\"flex-start\" marginTop={2}>\n {ALL_FEATURES.map((feat, i) => (\n <Flex key={i} gap={2} alignItems=\"center\">\n <Check width=\"16px\" height=\"16px\" color=\"#328048\" />\n <Typography variant=\"omega\">{feat}</Typography>\n </Flex>\n ))}\n </Flex>\n </Box>\n </Box>\n\n {/* Validation Rules Section */}\n {permissions.canValidationView && (\n <Box marginTop={6}>\n <ValidationRulesTab />\n </Box>\n )}\n </Box>\n );\n};\n\nexport default SettingsPage;\n"],"names":["useBulkUpdaterRBAC","jsx","Box","Alert","jsxs","Flex","Typography","Badge","Check","ValidationRulesTab"],"mappings":";;;;;;AAYA,MAAM,eAAe;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,eAAyB,MAAM;AACnC,QAAM,cAAcA,mBAAAA,mBAAA;AAEpB,MAAI,CAAC,YA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I,WAAW,GACd,UAAA;AAAA,QAAAD,2BAAAA,IAACK,aAAAA,YAAA,EAAW,SAAQ,MAAK,YAAW,QAAO,WAAU,cAAa,cAAc,GAAG,UAAA,uBAAA,CAEnF;AAAA,QACAL,2BAAAA,IAACI,aAAAA,QAAK,WAAU,UAAS,KAAK,GAAG,YAAW,cAAa,WAAW,GACjE,uBAAa,IAAI,CAAC,MAAM,MACvBD,gCAACC,aAAAA,QAAa,KAAK,GAAG,YAAW,UAC/B,UAAA;AAAA,UAAAJ,+BAACO,MAAAA,SAAM,OAAM,QAAO,QAAO,QAAO,OAAM,WAAU;AAAA,UAClDP,2BAAAA,IAACK,aAAAA,YAAA,EAAW,SAAQ,SAAS,UAAA,KAAA,CAAK;AAAA,QAAA,EAAA,GAFzB,CAGX,CACD,EAAA,CACH;AAAA,MAAA,EAAA,CACF;AAAA,IAAA,GACF;AAAA,IAGC,YAAY,qBACXL,+BAACC,aAAAA,KAAA,EAAI,WAAW,GACd,UAAAD,2BAAAA,IAACQ,mBAAAA,sBAAmB,EAAA,CACtB;AAAA,EAAA,GAEJ;AAEJ;;"}
1
+ {"version":3,"file":"SettingsPage-vH-eanBJ.js","sources":["../../admin/src/pages/SettingsPage.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Box,\n Flex,\n Typography,\n Badge,\n Alert,\n} from '@strapi/design-system';\nimport { Check } from '@strapi/icons';\nimport ValidationRulesTab from './ValidationRulesTab';\nimport { useBulkUpdaterRBAC } from '../hooks/useBulkUpdaterRBAC';\n\nconst ALL_FEATURES = [\n 'Cross-collection batch attribute & relationship updates',\n 'Interactive schema compatibility & target selection',\n 'Full regex find & replace with live diff previews',\n 'Dynamic cross-component quota validation (UI-configurable)',\n 'Enterprise Maker-Checker 4-Eyes approval workflow',\n 'Server-enforced off-peak execution maintenance window',\n '3-Tier comprehensive audit logging with one-click reversible rollback',\n 'Zero-infra memory caching & pod-level ETag optimization',\n];\n\nconst SettingsPage: React.FC = () => {\n const permissions = useBulkUpdaterRBAC();\n\n if (!permissions.canSettingsView) {\n return (\n <Box padding={8} background=\"neutral100\">\n <Alert variant=\"warning\" title=\"Access Denied\">\n You do not have permission to view Bulk Attribute Updater Settings (action: plugin::bulk-updater.settings.view).\n </Alert>\n </Box>\n );\n }\n\n return (\n <Box padding={8} background=\"neutral100\">\n <Flex direction=\"column\" alignItems=\"flex-start\" gap={2} marginBottom={6}>\n <Flex justifyContent=\"space-between\" width=\"100%\">\n <Box>\n <Typography variant=\"alpha\" tag=\"h1\" fontWeight=\"bold\">\n Bulk Attribute Updater Settings\n </Typography>\n <Typography variant=\"omega\" textColor=\"neutral600\">\n Configure cross-component validation rules, manage quotas, and view active plugin capabilities.\n </Typography>\n </Box>\n </Flex>\n </Flex>\n\n {/* Plugin Status Card */}\n <Box padding={6} background=\"neutral0\" shadow=\"filterShadow\" hasRadius marginBottom={6}>\n <Flex justifyContent=\"space-between\" alignItems=\"center\" marginBottom={4}>\n <Box>\n <Typography variant=\"delta\" tag=\"h2\" fontWeight=\"semiBold\">\n Plugin Status\n </Typography>\n <Typography variant=\"pi\" textColor=\"neutral600\">\n All features are fully unlocked, active, and free under the MIT open-source license.\n </Typography>\n </Box>\n <Badge backgroundColor=\"success100\" textColor=\"success700\" size=\"M\">\n COMMUNITY & ENTERPRISE UNLOCKED\n </Badge>\n </Flex>\n\n {/* Features Checklist */}\n <Box marginTop={4}>\n <Typography variant=\"pi\" fontWeight=\"bold\" textColor=\"neutral700\" marginBottom={3}>\n Active Capabilities:\n </Typography>\n <Flex direction=\"column\" gap={2} alignItems=\"flex-start\" marginTop={2}>\n {ALL_FEATURES.map((feat, i) => (\n <Flex key={i} gap={2} alignItems=\"center\">\n <Check width=\"16px\" height=\"16px\" color=\"#328048\" />\n <Typography variant=\"omega\">{feat}</Typography>\n </Flex>\n ))}\n </Flex>\n </Box>\n </Box>\n\n {/* Validation Rules Section */}\n {permissions.canValidationView && (\n <Box marginTop={6}>\n <ValidationRulesTab />\n </Box>\n )}\n </Box>\n );\n};\n\nexport default SettingsPage;\n"],"names":["useBulkUpdaterRBAC","jsx","Box","Alert","jsxs","Flex","Typography","Badge","Check","ValidationRulesTab"],"mappings":";;;;;;AAYA,MAAM,eAAe;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,eAAyB,MAAM;AACnC,QAAM,cAAcA,mBAAAA,mBAAA;AAEpB,MAAI,CAAC,YAAY,iBAAiB;AAChC,WACEC,2BAAAA,IAACC,aAAAA,KAAA,EAAI,SAAS,GAAG,YAAW,cAC1B,UAAAD,2BAAAA,IAACE,aAAAA,OAAA,EAAM,SAAQ,WAAU,OAAM,iBAAgB,8HAE/C,GACF;AAAA,EAAA;AAIJ,SACEC,2BAAAA,KAACF,aAAAA,KAAA,EAAI,SAAS,GAAG,YAAW,cAC1B,UAAA;AAAA,IAAAD,2BAAAA,IAACI,aAAAA,QAAK,WAAU,UAAS,YAAW,cAAa,KAAK,GAAG,cAAc,GACrE,UAAAJ,2BAAAA,IAACI,qBAAK,gBAAe,iBAAgB,OAAM,QACzC,0CAACH,kBAAA,EACC,UAAA;AAAA,MAAAD,2BAAAA,IAACK,aAAAA,cAAW,SAAQ,SAAQ,KAAI,MAAK,YAAW,QAAO,UAAA,kCAAA,CAEvD;AAAA,qCACCA,aAAAA,YAAA,EAAW,SAAQ,SAAQ,WAAU,cAAa,UAAA,kGAAA,CAEnD;AAAA,IAAA,EAAA,CACF,GACF,GACF;AAAA,IAGAF,2BAAAA,KAACF,aAAAA,KAAA,EAAI,SAAS,GAAG,YAAW,YAAW,QAAO,gBAAe,WAAS,MAAC,cAAc,GACnF,UAAA;AAAA,MAAAE,gCAACC,aAAAA,QAAK,gBAAe,iBAAgB,YAAW,UAAS,cAAc,GACrE,UAAA;AAAA,QAAAD,gCAACF,aAAAA,KAAA,EACC,UAAA;AAAA,UAAAD,2BAAAA,IAACK,aAAAA,cAAW,SAAQ,SAAQ,KAAI,MAAK,YAAW,YAAW,UAAA,gBAAA,CAE3D;AAAA,yCACCA,aAAAA,YAAA,EAAW,SAAQ,MAAK,WAAU,cAAa,UAAA,uFAAA,CAEhD;AAAA,QAAA,GACF;AAAA,QACAL,2BAAAA,IAACM,aAAAA,SAAM,iBAAgB,cAAa,WAAU,cAAa,MAAK,KAAI,UAAA,kCAAA,CAEpE;AAAA,MAAA,GACF;AAAA,MAGAH,2BAAAA,KAACF,aAAAA,KAAA,EAAI,WAAW,GACd,UAAA;AAAA,QAAAD,2BAAAA,IAACK,aAAAA,YAAA,EAAW,SAAQ,MAAK,YAAW,QAAO,WAAU,cAAa,cAAc,GAAG,UAAA,uBAAA,CAEnF;AAAA,QACAL,2BAAAA,IAACI,aAAAA,QAAK,WAAU,UAAS,KAAK,GAAG,YAAW,cAAa,WAAW,GACjE,uBAAa,IAAI,CAAC,MAAM,MACvBD,gCAACC,aAAAA,QAAa,KAAK,GAAG,YAAW,UAC/B,UAAA;AAAA,UAAAJ,+BAACO,MAAAA,SAAM,OAAM,QAAO,QAAO,QAAO,OAAM,WAAU;AAAA,UAClDP,2BAAAA,IAACK,aAAAA,YAAA,EAAW,SAAQ,SAAS,UAAA,KAAA,CAAK;AAAA,QAAA,EAAA,GAFzB,CAGX,CACD,EAAA,CACH;AAAA,MAAA,EAAA,CACF;AAAA,IAAA,GACF;AAAA,IAGC,YAAY,qBACXL,+BAACC,aAAAA,KAAA,EAAI,WAAW,GACd,UAAAD,2BAAAA,IAACQ,mBAAAA,sBAAmB,EAAA,CACtB;AAAA,EAAA,GAEJ;AAEJ;;"}
@@ -1,69 +1,90 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { useMemo, useState, useEffect } from "react";
3
- import { useRBAC, useFetchClient, useNotification } from "@strapi/strapi/admin";
3
+ import { useAuth, useFetchClient, useNotification } from "@strapi/strapi/admin";
4
4
  import { Box, Alert, Flex, Typography, Button, Table, Thead, Tr, Th, Tbody, Td, Badge, TextInput, SingleSelect, SingleSelectOption, Checkbox, Textarea } from "@strapi/design-system";
5
5
  import { ArrowClockwise, Plus, Search, Trash, Check, Download } from "@strapi/icons";
6
+ import { P as PERMISSIONS } from "./index-AXTojFac.mjs";
6
7
  function isAbortError(err) {
7
8
  if (!err) return false;
8
9
  return err.name === "AbortError" || err.name === "CanceledError" || err.code === "ERR_CANCELED" || typeof err.message === "string" && (err.message.includes("aborted") || err.message.includes("canceled") || err.message.includes("cancelled"));
9
10
  }
10
- const PLUGIN_ID = "bulk-updater";
11
- const PERMISSIONS = {
12
- // General
13
- read: `plugin::${PLUGIN_ID}.read`,
14
- // Workspace
15
- workspaceView: `plugin::${PLUGIN_ID}.workspace.view`,
16
- workspaceExecute: `plugin::${PLUGIN_ID}.workspace.execute`,
17
- workspacePublish: `plugin::${PLUGIN_ID}.workspace.publish`,
18
- // CSV Management
19
- csvExport: `plugin::${PLUGIN_ID}.csv.export`,
20
- csvImport: `plugin::${PLUGIN_ID}.csv.import`,
21
- // Audit Trail
22
- auditView: `plugin::${PLUGIN_ID}.audit.view`,
23
- auditDetails: `plugin::${PLUGIN_ID}.audit.details`,
24
- auditRollback: `plugin::${PLUGIN_ID}.audit.rollback`,
25
- // Approvals (Maker-Checker)
26
- approvalView: `plugin::${PLUGIN_ID}.approval.view`,
27
- approvalApprove: `plugin::${PLUGIN_ID}.approval.approve`,
28
- approvalReject: `plugin::${PLUGIN_ID}.approval.reject`,
29
- // Validation Rules
30
- validationView: `plugin::${PLUGIN_ID}.validation.view`,
31
- validationManage: `plugin::${PLUGIN_ID}.validation.manage`,
32
- // Settings
33
- settingsView: `plugin::${PLUGIN_ID}.settings.view`,
34
- settingsManage: `plugin::${PLUGIN_ID}.settings.manage`
35
- };
36
- const BULK_UPDATER_PERMISSIONS_LAYOUT = {
37
- canRead: [{ action: PERMISSIONS.read, subject: null }],
38
- canWorkspaceView: [{ action: PERMISSIONS.workspaceView, subject: null }],
39
- canWorkspaceExecute: [{ action: PERMISSIONS.workspaceExecute, subject: null }],
40
- canWorkspacePublish: [{ action: PERMISSIONS.workspacePublish, subject: null }],
41
- canCsvExport: [{ action: PERMISSIONS.csvExport, subject: null }],
42
- canCsvImport: [{ action: PERMISSIONS.csvImport, subject: null }],
43
- canAuditView: [{ action: PERMISSIONS.auditView, subject: null }],
44
- canAuditDetails: [{ action: PERMISSIONS.auditDetails, subject: null }],
45
- canAuditRollback: [{ action: PERMISSIONS.auditRollback, subject: null }],
46
- canApprovalView: [{ action: PERMISSIONS.approvalView, subject: null }],
47
- canApprovalApprove: [{ action: PERMISSIONS.approvalApprove, subject: null }],
48
- canApprovalReject: [{ action: PERMISSIONS.approvalReject, subject: null }],
49
- canValidationView: [{ action: PERMISSIONS.validationView, subject: null }],
50
- canValidationManage: [{ action: PERMISSIONS.validationManage, subject: null }],
51
- canSettingsView: [{ action: PERMISSIONS.settingsView, subject: null }],
52
- canSettingsManage: [{ action: PERMISSIONS.settingsManage, subject: null }]
53
- };
54
11
  function useBulkUpdaterRBAC() {
55
- let rbacResult = null;
12
+ let user = null;
13
+ let userPermissions = [];
14
+ let isLoadingAuth = false;
56
15
  try {
57
- if (typeof useRBAC === "function") {
58
- rbacResult = useRBAC(BULK_UPDATER_PERMISSIONS_LAYOUT);
16
+ if (typeof useAuth === "function") {
17
+ user = useAuth("useBulkUpdaterRBAC", (state) => state.user);
18
+ userPermissions = useAuth("useBulkUpdaterRBAC", (state) => state.permissions) || [];
19
+ isLoadingAuth = Boolean(useAuth("useBulkUpdaterRBAC", (state) => state.isLoading));
59
20
  }
60
21
  } catch {
61
- rbacResult = null;
22
+ user = null;
23
+ userPermissions = [];
24
+ isLoadingAuth = false;
62
25
  }
63
26
  return useMemo(() => {
64
- if (!rbacResult) {
27
+ const isSuperAdmin = Boolean(
28
+ user?.isSuperAdmin === true || Array.isArray(user?.roles) && user.roles.some((r) => r?.code === "strapi-super-admin" || r?.name === "Super Admin")
29
+ );
30
+ if (isSuperAdmin) {
31
+ return {
32
+ isLoading: false,
33
+ isSuperAdmin: true,
34
+ canRead: true,
35
+ canWorkspaceView: true,
36
+ canWorkspaceExecute: true,
37
+ canWorkspacePublish: true,
38
+ canCsvExport: true,
39
+ canCsvImport: true,
40
+ canAuditView: true,
41
+ canAuditDetails: true,
42
+ canAuditRollback: true,
43
+ canApprovalView: true,
44
+ canApprovalApprove: true,
45
+ canApprovalReject: true,
46
+ canValidationView: true,
47
+ canValidationManage: true,
48
+ canSettingsView: true,
49
+ canSettingsManage: true
50
+ };
51
+ }
52
+ if (isLoadingAuth) {
53
+ return {
54
+ isLoading: true,
55
+ isSuperAdmin: false,
56
+ canRead: false,
57
+ canWorkspaceView: false,
58
+ canWorkspaceExecute: false,
59
+ canWorkspacePublish: false,
60
+ canCsvExport: false,
61
+ canCsvImport: false,
62
+ canAuditView: false,
63
+ canAuditDetails: false,
64
+ canAuditRollback: false,
65
+ canApprovalView: false,
66
+ canApprovalApprove: false,
67
+ canApprovalReject: false,
68
+ canValidationView: false,
69
+ canValidationManage: false,
70
+ canSettingsView: false,
71
+ canSettingsManage: false
72
+ };
73
+ }
74
+ const grantedActions = /* @__PURE__ */ new Set();
75
+ if (Array.isArray(userPermissions)) {
76
+ for (const perm of userPermissions) {
77
+ if (typeof perm === "string") {
78
+ grantedActions.add(perm);
79
+ } else if (perm && typeof perm.action === "string") {
80
+ grantedActions.add(perm.action);
81
+ }
82
+ }
83
+ }
84
+ if (!user && grantedActions.size === 0) {
65
85
  return {
66
86
  isLoading: false,
87
+ isSuperAdmin: false,
67
88
  canRead: true,
68
89
  canWorkspaceView: true,
69
90
  canWorkspaceExecute: true,
@@ -82,28 +103,76 @@ function useBulkUpdaterRBAC() {
82
103
  canSettingsManage: true
83
104
  };
84
105
  }
85
- const { isLoading = false, allowedActions = {} } = rbacResult;
106
+ const hasWildcard = grantedActions.has("*");
107
+ const has = (action) => hasWildcard || grantedActions.has(action);
108
+ const canWorkspaceView = has(PERMISSIONS.workspaceView);
109
+ const canWorkspaceExecute = has(PERMISSIONS.workspaceExecute);
110
+ const canWorkspacePublish = has(PERMISSIONS.workspacePublish);
111
+ const canCsvExport = has(PERMISSIONS.csvExport);
112
+ const canCsvImport = has(PERMISSIONS.csvImport);
113
+ const canAuditView = has(PERMISSIONS.auditView);
114
+ const canAuditDetails = has(PERMISSIONS.auditDetails);
115
+ const canAuditRollback = has(PERMISSIONS.auditRollback);
116
+ const canApprovalView = has(PERMISSIONS.approvalView);
117
+ const canApprovalApprove = has(PERMISSIONS.approvalApprove);
118
+ const canApprovalReject = has(PERMISSIONS.approvalReject);
119
+ const canValidationView = has(PERMISSIONS.validationView);
120
+ const canValidationManage = has(PERMISSIONS.validationManage);
121
+ const canSettingsView = has(PERMISSIONS.settingsView);
122
+ const canSettingsManage = has(PERMISSIONS.settingsManage);
123
+ const canRead = has(PERMISSIONS.read) || has(PERMISSIONS.access) || canWorkspaceView || canCsvExport || canCsvImport || canAuditView || canApprovalView || canValidationView || canSettingsView;
86
124
  return {
87
- isLoading,
88
- canRead: Boolean(allowedActions.canRead),
89
- canWorkspaceView: Boolean(allowedActions.canWorkspaceView),
90
- canWorkspaceExecute: Boolean(allowedActions.canWorkspaceExecute),
91
- canWorkspacePublish: Boolean(allowedActions.canWorkspacePublish),
92
- canCsvExport: Boolean(allowedActions.canCsvExport),
93
- canCsvImport: Boolean(allowedActions.canCsvImport),
94
- canAuditView: Boolean(allowedActions.canAuditView),
95
- canAuditDetails: Boolean(allowedActions.canAuditDetails),
96
- canAuditRollback: Boolean(allowedActions.canAuditRollback),
97
- canApprovalView: Boolean(allowedActions.canApprovalView),
98
- canApprovalApprove: Boolean(allowedActions.canApprovalApprove),
99
- canApprovalReject: Boolean(allowedActions.canApprovalReject),
100
- canValidationView: Boolean(allowedActions.canValidationView),
101
- canValidationManage: Boolean(allowedActions.canValidationManage),
102
- canSettingsView: Boolean(allowedActions.canSettingsView),
103
- canSettingsManage: Boolean(allowedActions.canSettingsManage)
125
+ isLoading: false,
126
+ isSuperAdmin: false,
127
+ canRead,
128
+ canWorkspaceView,
129
+ canWorkspaceExecute,
130
+ canWorkspacePublish,
131
+ canCsvExport,
132
+ canCsvImport,
133
+ canAuditView,
134
+ canAuditDetails,
135
+ canAuditRollback,
136
+ canApprovalView,
137
+ canApprovalApprove,
138
+ canApprovalReject,
139
+ canValidationView,
140
+ canValidationManage,
141
+ canSettingsView,
142
+ canSettingsManage
104
143
  };
105
- }, [rbacResult]);
144
+ }, [user, userPermissions, isLoadingAuth]);
106
145
  }
146
+ const getQuotaBadges = (quotas) => {
147
+ if (!quotas) return [];
148
+ if (Array.isArray(quotas)) {
149
+ return quotas.map((item) => {
150
+ if (item && typeof item === "object") {
151
+ return {
152
+ key: String(item.key || item.option || item.name || item.value || "").trim(),
153
+ maxAllowed: typeof item.maxAllowed === "number" ? item.maxAllowed : parseInt(String(item.maxAllowed ?? item.max ?? 1), 10) || 1
154
+ };
155
+ }
156
+ return { key: String(item).trim(), maxAllowed: 1 };
157
+ }).filter((q) => Boolean(q.key));
158
+ }
159
+ if (typeof quotas === "object") {
160
+ return Object.entries(quotas).map(([k, v]) => {
161
+ if (v && typeof v === "object" && ("key" in v || "maxAllowed" in v)) {
162
+ const item = v;
163
+ return {
164
+ key: String(item.key || item.option || item.name || k).trim(),
165
+ maxAllowed: typeof item.maxAllowed === "number" ? item.maxAllowed : parseInt(String(item.maxAllowed ?? 1), 10) || 1
166
+ };
167
+ }
168
+ return {
169
+ key: String(k).trim(),
170
+ maxAllowed: typeof v === "number" ? v : parseInt(String(v || 1), 10) || 1
171
+ };
172
+ }).filter((q) => Boolean(q.key));
173
+ }
174
+ return [];
175
+ };
107
176
  function ValidationRulesTab() {
108
177
  const { get, post, del } = useFetchClient();
109
178
  const { toggleNotification } = useNotification();
@@ -215,10 +284,7 @@ function ValidationRulesTab() {
215
284
  setFormField(rule.targetField);
216
285
  setFormAction(rule.exceededAction || "disable");
217
286
  setFormIncludeRichText(rule.includeRichTextHtml ?? true);
218
- const quotaPairs = Object.entries(rule.quotas || {}).map(([k, v]) => ({
219
- key: k,
220
- maxAllowed: v
221
- }));
287
+ const quotaPairs = getQuotaBadges(rule.quotas);
222
288
  setFormQuotas(quotaPairs.length > 0 ? quotaPairs : [{ key: "h1", maxAllowed: 1 }]);
223
289
  setModalOpen(true);
224
290
  };
@@ -389,7 +455,7 @@ function ValidationRulesTab() {
389
455
  /* @__PURE__ */ jsx(Th, { style: { textAlign: "right" }, children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", children: "ACTIONS" }) })
390
456
  ] }) }),
391
457
  /* @__PURE__ */ jsx(Tbody, { children: rules.map((rule) => {
392
- const quotaKeys = Object.entries(rule.quotas || {});
458
+ const quotaBadges = getQuotaBadges(rule.quotas);
393
459
  const isGlobal = !rule.collectionUid || rule.collectionUid === "*";
394
460
  const collectionName = !isGlobal ? availableCollections.find((c) => c.uid === rule.collectionUid)?.displayName || rule.collectionUid : "All Collections (Global)";
395
461
  return /* @__PURE__ */ jsxs(Tr, { children: [
@@ -408,11 +474,11 @@ function ValidationRulesTab() {
408
474
  children: collectionName
409
475
  }
410
476
  ) }),
411
- /* @__PURE__ */ jsx(Td, { style: { minWidth: 180 }, children: /* @__PURE__ */ jsx(Flex, { gap: 1, wrap: "wrap", children: quotaKeys.map(([optVal, maxVal]) => /* @__PURE__ */ jsxs(Badge, { backgroundColor: "neutral100", textColor: "primary700", children: [
412
- /* @__PURE__ */ jsx("strong", { children: optVal.toUpperCase() }),
477
+ /* @__PURE__ */ jsx(Td, { style: { minWidth: 180 }, children: /* @__PURE__ */ jsx(Flex, { gap: 1, wrap: "wrap", children: quotaBadges.map((q, qIdx) => /* @__PURE__ */ jsxs(Badge, { backgroundColor: "neutral100", textColor: "primary700", children: [
478
+ /* @__PURE__ */ jsx("strong", { children: q.key.toUpperCase() }),
413
479
  ": max ",
414
- maxVal
415
- ] }, optVal)) }) }),
480
+ q.maxAllowed
481
+ ] }, `${q.key}-${qIdx}`)) }) }),
416
482
  /* @__PURE__ */ jsx(Td, { style: { minWidth: 140 }, children: rule.includeRichTextHtml ? /* @__PURE__ */ jsx(Badge, { backgroundColor: "success100", textColor: "success700", children: "HTML & Rich Text Active" }) : /* @__PURE__ */ jsx(Badge, { backgroundColor: "neutral150", textColor: "neutral600", children: "Structured Only" }) }),
417
483
  /* @__PURE__ */ jsx(Td, { style: { minWidth: 110 }, children: /* @__PURE__ */ jsx(
418
484
  Badge,
@@ -726,7 +792,7 @@ function ValidationRulesTab() {
726
792
  /* @__PURE__ */ jsxs(Typography, { variant: "pi", textColor: "neutral500", children: [
727
793
  " ",
728
794
  "(Allowed max: ",
729
- v.maxAllowed,
795
+ typeof v.maxAllowed === "object" ? JSON.stringify(v.maxAllowed) : String(v.maxAllowed),
730
796
  ")"
731
797
  ] })
732
798
  ] }),
@@ -797,4 +863,4 @@ export {
797
863
  isAbortError as i,
798
864
  useBulkUpdaterRBAC as u
799
865
  };
800
- //# sourceMappingURL=ValidationRulesTab-BqbENLpg.mjs.map
866
+ //# sourceMappingURL=ValidationRulesTab-DdwR3lWq.mjs.map