mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Polish forms
Summary: - Updates styling of form submitted page. - Tweaks styling of checkboxes, labels, and questions on form page. - Adds new form 404 page. - Adds checkbox to not show warning again when publishing or un-publishing a form. - Excludes formula, hidden, and attachment columns in submitted form data. - Adds placeholder text to form configuration inputs. - Improves dark mode styling in Form widget. - Updates default title and description of new forms. - Updates styling of Form widget buttons. - Fixes form success text input handling. Test Plan: Browser tests. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D4170
This commit is contained in:
@@ -48,6 +48,7 @@ const G = getBrowserGlobals('document', 'window');
|
||||
|
||||
// TopAppModel is the part of the app model that persists across org and user switches.
|
||||
export interface TopAppModel {
|
||||
options: TopAppModelOptions;
|
||||
api: UserAPI;
|
||||
isSingleOrg: boolean;
|
||||
productFlavor: ProductFlavor;
|
||||
@@ -147,6 +148,11 @@ export interface AppModel {
|
||||
switchUser(user: FullUser, org?: string): Promise<void>;
|
||||
}
|
||||
|
||||
export interface TopAppModelOptions {
|
||||
/** Defaults to true. */
|
||||
attachTheme?: boolean;
|
||||
}
|
||||
|
||||
export class TopAppModelImpl extends Disposable implements TopAppModel {
|
||||
public readonly isSingleOrg: boolean;
|
||||
public readonly productFlavor: ProductFlavor;
|
||||
@@ -167,6 +173,7 @@ export class TopAppModelImpl extends Disposable implements TopAppModel {
|
||||
constructor(
|
||||
window: {gristConfig?: GristLoadConfig},
|
||||
public readonly api: UserAPI = newUserAPIImpl(),
|
||||
public readonly options: TopAppModelOptions = {}
|
||||
) {
|
||||
super();
|
||||
setErrorNotifier(this.notifier);
|
||||
@@ -350,7 +357,7 @@ export class AppModelImpl extends Disposable implements AppModel {
|
||||
) {
|
||||
super();
|
||||
|
||||
this._setTheme();
|
||||
this._setUpTheme();
|
||||
this._recordSignUpIfIsNewUser();
|
||||
|
||||
const state = urlState().state.get();
|
||||
@@ -525,9 +532,14 @@ export class AppModelImpl extends Disposable implements AppModel {
|
||||
);
|
||||
}
|
||||
|
||||
private _setTheme() {
|
||||
// Custom CSS is incompatible with custom themes.
|
||||
if (getGristConfig().enableCustomCss) { return; }
|
||||
private _setUpTheme() {
|
||||
if (
|
||||
this.topAppModel.options.attachTheme === false ||
|
||||
// Custom CSS is incompatible with custom themes.
|
||||
getGristConfig().enableCustomCss
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
attachCssThemeVars(this.currentTheme.get());
|
||||
this.autoDispose(this.currentTheme.addListener((newTheme, oldTheme) => {
|
||||
|
||||
Reference in New Issue
Block a user