(core) Update grainjs, fix some code affected by stronger types.

Summary: Also clean up dom-ownership in Charts using the new grainjs maybeOwned() method.

Test Plan: Should be no behaviour changes; existing tests should pass

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D3166
This commit is contained in:
Dmitry S
2021-12-05 00:14:38 -05:00
parent 7a6d726daa
commit e4314f9def
4 changed files with 26 additions and 30 deletions

View File

@@ -50,7 +50,7 @@ function createLoadedDocMenu(home: HomeModel) {
return css.docList(
dom.maybe(!home.app.currentFeatures.workspaces, () => [
css.docListHeader('This service is not available right now'),
dom.text('(The organization needs a paid plan)')
dom('span', '(The organization needs a paid plan)')
]),
// currentWS and showIntro observables change together. We capture both in one domComputed call.

View File

@@ -323,25 +323,23 @@ export class RightPanel extends Disposable {
vct._buildChartConfigDom(),
]),
dom.maybe((use) => use(this._pageWidgetType) === 'custom', () => [
cssLabel('CUSTOM'),
() => {
const parts = vct._buildCustomTypeItems() as any[];
return [
// If 'customViewPlugin' feature is on, show the toggle that allows switching to
// plugin mode. Note that the default mode for a new 'custom' view is 'url', so that's
// the only one that will be shown without the feature flag.
dom.maybe((use) => use(this._gristDoc.app.features).customViewPlugin,
() => dom('div', parts[0].buildDom())),
dom.maybe(use => use(activeSection.customDef.mode) === 'plugin',
() => dom('div', parts[2].buildDom())),
// In the default url mode, allow picking a url and granting/forbidding
// access to data.
dom.maybe(use => use(activeSection.customDef.mode) === 'url',
() => dom.create(CustomSectionConfig, activeSection, this._gristDoc.app.topAppModel.api)),
];
}
]),
dom.maybe((use) => use(this._pageWidgetType) === 'custom', () => {
const parts = vct._buildCustomTypeItems() as any[];
return [
cssLabel('CUSTOM'),
// If 'customViewPlugin' feature is on, show the toggle that allows switching to
// plugin mode. Note that the default mode for a new 'custom' view is 'url', so that's
// the only one that will be shown without the feature flag.
dom.maybe((use) => use(this._gristDoc.app.features).customViewPlugin,
() => dom('div', parts[0].buildDom())),
dom.maybe(use => use(activeSection.customDef.mode) === 'plugin',
() => dom('div', parts[2].buildDom())),
// In the default url mode, allow picking a url and granting/forbidding
// access to data.
dom.maybe(use => use(activeSection.customDef.mode) === 'url',
() => dom.create(CustomSectionConfig, activeSection, this._gristDoc.app.topAppModel.api)),
];
}),
dom.maybe((use) => use(this._pageWidgetType) !== 'chart', () => [
cssSeparator(),