- fixed dynamic tags aggregation #6342;

This commit is contained in:
Vitalii Kiiko
2026-04-02 10:17:49 +02:00
parent 0b432c6cdf
commit 2804dd897a
2 changed files with 11 additions and 3 deletions

View File

@@ -95,12 +95,13 @@ const BandoEditFormStep3 = forwardRef(function () {
const getFormsCallback = (resp) => {
if (resp.status === 'SUCCESS') {
const EXCLUDED_TYPES = new Set(['fileupload', 'fileselect', 'table', 'criteria_table', 'spreadsheet']);
console.log('resp.data', resp.data)
const raw = (resp.data ?? []).flatMap(form =>
(form.content ?? [])
.filter(f => !EXCLUDED_TYPES.has(f.name))
.map(f => ({
id: f.id,
label: f.label,
label: f.settings?.find(s => s.name === 'label')?.value ?? f.label,
placeholder: f.settings?.find(s => s.name === 'placeholder')?.value ?? ''
}))
);
@@ -109,6 +110,7 @@ const BandoEditFormStep3 = forwardRef(function () {
if (!byLabel.has(f.label)) byLabel.set(f.label, { label: f.label, ids: [], placeholder: f.placeholder });
byLabel.get(f.label).ids.push(f.id);
});
console.log('byLabel', Array.from(byLabel.values()))
storeSet('callFormFields', Array.from(byLabel.values()));
}
}

View File

@@ -162,10 +162,16 @@ const ElementSettingSpreadsheet = ({ value, name, setDataFn }) => {
}, []); // refs are stable
// Keep formFieldsRef in sync with store value
// Keep formFieldsRef in sync with store value; rebuild Univer (and its context menu)
// once fields arrive, because the menu is constructed at init time from formFieldsRef.current.
useEffect(() => {
console.log('callFormFields', callFormFields)
formFieldsRef.current = callFormFields;
}, [callFormFields]);
if (callFormFields.length > 0 && univerAPIRef.current) {
const currentWorkbook = univerAPIRef.current.getActiveWorkbook()?.save() ?? null;
initializeUniver(currentWorkbook);
}
}, [callFormFields, initializeUniver]);
// Initialize Univer on mount
useEffect(() => {