rename widget info

pull/946/head
CamilleLegeron 2 months ago
parent 2d538deb40
commit dc5afb68bc

@ -205,8 +205,8 @@ export function buildPageWidgetPicker(
// If savePromise throws an error, before or after timeout, we let the error propagate as it
// should be handle by the caller.
if (await isLongerThan(savePromise, DELAY_BEFORE_SPINNER_MS)) {
const widget = getWidgetTypes(type);
const label = getWidgetTypesLabelTranslation(widget);
const widgetInfo = getWidgetTypes(type);
const label = getWidgetTypesLabelTranslation(widgetInfo);
await spinnerModal(t("Building {{- label}} widget", { label }), savePromise);
}
}
@ -318,12 +318,12 @@ export class PageWidgetSelect extends Disposable {
cssPanel(
header(t("Select Widget")),
sectionTypes.map((value) => {
const widget = getWidgetTypes(value);
const tLabel = getWidgetTypesLabelTranslation(widget);
const widgetInfo = getWidgetTypes(value);
const tLabel = getWidgetTypesLabelTranslation(widgetInfo);
const disabled = computed(this._value.table, (use, tid) => this._isTypeDisabled(value, tid));
return cssEntry(
dom.autoDispose(disabled),
cssTypeIcon(widget.icon),
cssTypeIcon(widgetInfo.icon),
tLabel,
dom.on('click', () => !disabled.get() && this._selectType(value)),
cssEntry.cls('-selected', (use) => use(this._value.type) === value),

@ -220,9 +220,9 @@ export class RightPanel extends Disposable {
private _buildStandardHeader() {
return dom.maybe(this._pageWidgetType, (type) => {
const widget = widgetTypesMap.get(type) || {label: 'Table', icon: 'TypeTable'};
const widgetIcon = widget.icon || 'TypeTable';
const widgetLabel = getWidgetTypesLabelTranslation(widget);
const widgetInfo = widgetTypesMap.get(type) || {label: 'Table', icon: 'TypeTable'};
const widgetIcon = widgetInfo.icon || 'TypeTable';
const widgetLabel = getWidgetTypesLabelTranslation(widgetInfo);
const fieldInfo = getFieldType(type);
return [
cssTopBarItem(cssTopBarIcon(widgetIcon), widgetLabel,

@ -1509,4 +1509,4 @@
"Form": "Form",
"Table": "Table"
}
}
}

Loading…
Cancel
Save