mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Extending widget
Summary: - Adding new option 'strictType' to widget mapping - Refreshing mappings when widget options are changed Test Plan: Updated Reviewers: JakubSerafin Reviewed By: JakubSerafin Differential Revision: https://phab.getgrist.com/D4061
This commit is contained in:
5
test/fixtures/sites/config/index.html
vendored
5
test/fixtures/sites/config/index.html
vendored
@@ -39,5 +39,10 @@
|
||||
<button onclick="mappings()">mappings</button>
|
||||
<button onclick="configure()">configure</button>
|
||||
<button onclick="clearOptions()">clearOptions</button>
|
||||
<button onclick="clearLog()">clearLog</button>
|
||||
|
||||
|
||||
<div>meta columns:</div>
|
||||
<textarea id="log"></textarea>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
11
test/fixtures/sites/config/page.js
vendored
11
test/fixtures/sites/config/page.js
vendored
@@ -26,6 +26,12 @@ function setup() {
|
||||
document.getElementById('onRecords').innerHTML = JSON.stringify(data);
|
||||
document.getElementById('onRecordsMappings').innerHTML = JSON.stringify(mappings);
|
||||
});
|
||||
|
||||
grist.on('message', event => {
|
||||
const existing = document.getElementById('log').textContent || '';
|
||||
const newContent = `${existing}\n${JSON.stringify(event)}`.trim();
|
||||
document.getElementById('log').innerHTML = newContent;
|
||||
});
|
||||
}
|
||||
|
||||
async function run(handler) {
|
||||
@@ -67,6 +73,11 @@ async function configure() {
|
||||
return run((options) => grist.sectionApi.configure(...options));
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
async function clearLog() {
|
||||
return run(() => document.getElementById('log').textContent = '');
|
||||
}
|
||||
|
||||
window.onload = () => {
|
||||
setup();
|
||||
document.getElementById('ready').innerText = 'ready';
|
||||
|
||||
Reference in New Issue
Block a user