mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) Fix widget loading spinner title
Summary: The loading spinner would always display 'Building Table widget' when creating or changing a widget. This fixes the title to reflect the selected widget type. Test Plan: Updated existing browser tests to verify the loading spinner title includes the correct widget type. Reviewers: dsagal, paulfitz Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2863
This commit is contained in:
parent
3af6dd46ea
commit
f613b68a9e
@ -158,8 +158,9 @@ export function buildPageWidgetPicker(
|
|||||||
// calls onSave and closes the popup. Failure must be handled by the caller.
|
// calls onSave and closes the popup. Failure must be handled by the caller.
|
||||||
async function onSaveCB() {
|
async function onSaveCB() {
|
||||||
ctl.close();
|
ctl.close();
|
||||||
|
const type = value.type.get();
|
||||||
const savePromise = onSave({
|
const savePromise = onSave({
|
||||||
type: value.type.get(),
|
type,
|
||||||
table: value.table.get(),
|
table: value.table.get(),
|
||||||
summarize: value.summarize.get(),
|
summarize: value.summarize.get(),
|
||||||
columns: sortedAs(value.columns.get(), columns.get().map((col) => col.id.peek())),
|
columns: sortedAs(value.columns.get(), columns.get().map((col) => col.id.peek())),
|
||||||
@ -169,7 +170,7 @@ export function buildPageWidgetPicker(
|
|||||||
// If savePromise throws an error, before or after timeout, we let the error propagate as it
|
// If savePromise throws an error, before or after timeout, we let the error propagate as it
|
||||||
// should be handle by the caller.
|
// should be handle by the caller.
|
||||||
if (await isLongerThan(savePromise, DELAY_BEFORE_SPINNER_MS)) {
|
if (await isLongerThan(savePromise, DELAY_BEFORE_SPINNER_MS)) {
|
||||||
const label = getWidgetTypes(value.type.get()).label;
|
const label = getWidgetTypes(type).label;
|
||||||
await spinnerModal(`Building ${label} widget`, savePromise);
|
await spinnerModal(`Building ${label} widget`, savePromise);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -212,7 +212,10 @@ export async function spinnerModal<T>(
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
cssModalSpinner.cls(''),
|
cssModalSpinner.cls(''),
|
||||||
cssModalTitle(title),
|
cssModalTitle(
|
||||||
|
title,
|
||||||
|
testId('modal-spinner-title'),
|
||||||
|
),
|
||||||
cssSpinner(loadingSpinner()),
|
cssSpinner(loadingSpinner()),
|
||||||
testId('modal-spinner'),
|
testId('modal-spinner'),
|
||||||
];
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user