(core) Guessing column widget options when transforming from

Summary:
When converting changing the type of Any column, try to guess
the widgetOptions. Especially important for choice and choiceList types.

Test Plan: Existing

Reviewers: alexmojaki

Reviewed By: alexmojaki

Differential Revision: https://phab.getgrist.com/D4088
This commit is contained in:
Jarosław Sadziński
2023-10-30 11:40:28 +01:00
parent cc9a9ae8c5
commit c7ba31eb7d
4 changed files with 156 additions and 71 deletions

View File

@@ -12,6 +12,7 @@ import { stackWrapFunc, stackWrapOwnMethods, WebDriver } from 'mocha-webdriver';
import * as path from 'path';
import * as PluginApi from 'app/plugin/grist-plugin-api';
import {CommandName} from 'app/client/components/commandList';
import {csvDecodeRow} from 'app/common/csvFormat';
import { AccessLevel } from 'app/common/CustomWidget';
import { decodeUrl } from 'app/common/gristUrls';
@@ -3413,6 +3414,21 @@ class Clipboard implements IClipboard {
}
}
/**
* Runs a Grist command in the browser window.
*/
export async function sendCommand(name: CommandName) {
await driver.executeAsyncScript((name: any, done: any) => {
const result = (window as any).gristApp.allCommands[name].run();
if (result?.finally) {
result.finally(done);
} else {
done();
}
}, name);
await waitForServer();
}
} // end of namespace gristUtils