mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-20 01:02:22 +00:00
cd339ce7cb
Summary: Fixes misc. bugs with forms, updates Grist URLs on static form pages to link to the new forms marketing page, and adds a forms announcement popup that's shown next to the Add New button within a document. Test Plan: Browser tests. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D4185
31 lines
965 B
TypeScript
31 lines
965 B
TypeScript
import {fromKoSave} from 'app/client/lib/fromKoSave';
|
|
import {makeT} from 'app/client/lib/localization';
|
|
import {ViewFieldRec} from 'app/client/models/DocModel';
|
|
import {KoSaveableObservable} from 'app/client/models/modelUtil';
|
|
import {cssLabel, cssRow, cssSeparator} from 'app/client/ui/RightPanelStyles';
|
|
import {labeledSquareCheckbox} from 'app/client/ui2018/checkbox';
|
|
import {testId} from 'app/client/ui2018/cssVars';
|
|
import {Disposable} from 'grainjs';
|
|
|
|
const t = makeT('FormConfig');
|
|
|
|
export class FieldRulesConfig extends Disposable {
|
|
constructor(private _field: ViewFieldRec) {
|
|
super();
|
|
}
|
|
|
|
public buildDom() {
|
|
const requiredField: KoSaveableObservable<boolean> = this._field.widgetOptionsJson.prop('formRequired');
|
|
|
|
return [
|
|
cssSeparator(),
|
|
cssLabel(t('Field rules')),
|
|
cssRow(labeledSquareCheckbox(
|
|
fromKoSave(requiredField),
|
|
t('Required field'),
|
|
testId('field-required'),
|
|
)),
|
|
];
|
|
}
|
|
}
|