(core) updates from grist-core

This commit is contained in:
Paul Fitzpatrick
2023-01-03 12:50:50 -05:00
87 changed files with 2449 additions and 1933 deletions

View File

@@ -47,7 +47,7 @@ const state = {
DEFAULT: 'default'
};
const t = makeT('components.ActionLog');
const t = makeT('ActionLog');
export class ActionLog extends dispose.Disposable implements IDomComponent {
@@ -227,7 +227,7 @@ export class ActionLog extends dispose.Disposable implements IDomComponent {
}
private _buildLogDom() {
this._loadActionSummaries().catch((error) => gristNotify(t("ActionLogFailed")));
this._loadActionSummaries().catch((error) => gristNotify(t("Action Log failed to load")));
return dom('div.action_log',
dom('div.preference_item',
koForm.checkbox(this._showAllTables,
@@ -395,7 +395,7 @@ export class ActionLog extends dispose.Disposable implements IDomComponent {
const newName = tableRename[1];
if (!newName) {
// TODO - find a better way to send informative notifications.
gristNotify(t('TableRemovedInAction', {tableId:tableId, actionNum: action.actionNum}));
gristNotify(t("Table {{tableId}} was subsequently removed in action #{{actionNum}}", {tableId:tableId, actionNum: action.actionNum}));
return;
}
tableId = newName;
@@ -406,7 +406,7 @@ export class ActionLog extends dispose.Disposable implements IDomComponent {
// Check is this row was removed - if so there's no reason to go on.
if (td.removeRows.indexOf(rowId) >= 0) {
// TODO - find a better way to send informative notifications.
gristNotify(t("RowRemovedInAction", {actionNum}));
gristNotify(t("This row was subsequently removed in action {{action.actionNum}}", {actionNum}));
return;
}
@@ -416,7 +416,7 @@ export class ActionLog extends dispose.Disposable implements IDomComponent {
const newName = columnRename[1];
if (!newName) {
// TODO - find a better way to send informative notifications.
gristNotify(t("ColumnRemovedInAction", {colId, actionNum: action.actionNum}));
gristNotify(t("Column {{colId}} was subsequently removed in action #{{action.actionNum}}", {colId, actionNum: action.actionNum}));
return;
}
colId = newName;

View File

@@ -50,7 +50,7 @@ const DONUT_DEFAULT_TEXT_SIZE = 24;
const testId = makeTestId('test-chart-');
const t = makeT('components.ChartView');
const t = makeT('ChartView');
function isPieLike(chartType: string) {
return ['pie', 'donut'].includes(chartType);
@@ -655,8 +655,8 @@ export class ChartConfig extends GrainJSDisposable {
testId('error-bars'),
),
dom.domComputed(this._optionsObj.prop('errorBars'), (value: ChartOptions["errorBars"]) =>
value === 'symmetric' ? cssRowHelp(t('EachYFollowedByOne')) :
value === 'separate' ? cssRowHelp(t('EachYFollowedByTwo')) :
value === 'symmetric' ? cssRowHelp(t("Each Y series is followed by a series for the length of error bars.")) :
value === 'separate' ? cssRowHelp(t("Each Y series is followed by two series, for top and bottom error bars.")) :
null
),
]),
@@ -669,7 +669,7 @@ export class ChartConfig extends GrainJSDisposable {
select(this._groupDataColId, this._groupDataOptions),
testId('group-by-column'),
),
cssHintRow(t('CreateSeparateSeries')),
cssHintRow(t("Create separate series for each value of the selected column.")),
]),
// TODO: user should select x axis before widget reach page
@@ -677,7 +677,7 @@ export class ChartConfig extends GrainJSDisposable {
cssRow(
select(
this._xAxis, this._columnsOptions,
{ defaultLabel: t('PickColumn') }
{ defaultLabel: t("Pick a column") }
),
testId('x-axis'),
),
@@ -773,7 +773,7 @@ export class ChartConfig extends GrainJSDisposable {
private async _setGroupDataColumn(colId: string) {
const viewFields = this._section.viewFields.peek().peek();
await this._gristDoc.docData.bundleActions(t('SelectedNewGroupDataColumns'), async () => {
await this._gristDoc.docData.bundleActions(t("selected new group data columns"), async () => {
this._freezeXAxis.set(true);
this._freezeYAxis.set(true);
try {
@@ -872,7 +872,7 @@ export class ChartConfig extends GrainJSDisposable {
private async _setAggregation(val: boolean) {
try {
this._freezeXAxis.set(true);
await this._gristDoc.docData.bundleActions(t("ToggleChartAggregation"), async () => {
await this._gristDoc.docData.bundleActions(t("Toggle chart aggregation"), async () => {
if (val) {
await this._doAggregation();
} else {

View File

@@ -9,7 +9,7 @@ import {makeT} from 'app/client/lib/localization';
const hljs = require('highlight.js/lib/core');
hljs.registerLanguage('python', require('highlight.js/lib/languages/python'));
const t = makeT('components.CodeEditorPanel');
const t = makeT('CodeEditorPanel');
export class CodeEditorPanel extends DisposableWithEvents {
private _schema = Observable.create(this, '');
@@ -28,8 +28,8 @@ export class CodeEditorPanel extends DisposableWithEvents {
return dom('div.g-code-panel.clipboard',
{tabIndex: "-1"},
dom.maybe(this._denied, () => dom('div.g-code-panel-denied',
dom('h2', dom.text(t('AccessDenied'))),
dom('div', dom.text(t('CodeViewOnlyFullAccess'))),
dom('h2', dom.text(t("Access denied"))),
dom('div', dom.text(t("Code View is available only when you have full document access."))),
)),
dom.maybe(this._schema, (schema) => {
// The reason to scope and rebuild instead of using `kd.text(schema)` is because

View File

@@ -16,7 +16,7 @@ import {makeT} from 'app/client/lib/localization';
const testId = makeTestId('test-raw-data-');
const t = makeT('components.DataTables');
const t = makeT('DataTables');
export class DataTables extends Disposable {
private _tables: Observable<TableRec[]>;
@@ -45,7 +45,7 @@ export class DataTables extends Disposable {
cssTableList(
/*************** List section **********/
testId('list'),
cssHeader(t('RawDataTables')),
cssHeader(t("Raw Data Tables")),
cssList(
dom.forEach(this._tables, tableRec =>
cssItem(
@@ -65,11 +65,11 @@ export class DataTables extends Disposable {
testId('table-id'),
dom.text(tableRec.tableId),
),
{ title : t('ClickToCopy') },
{ title : t("Click to copy") },
dom.on('click', async (e, d) => {
e.stopImmediatePropagation();
e.preventDefault();
showTransientTooltip(d, t('TableIDCopied'), {
showTransientTooltip(d, t("Table ID copied to clipboard"), {
key: 'copy-table-id'
});
await copyToClipboard(tableRec.tableId.peek());
@@ -127,7 +127,7 @@ export class DataTables extends Disposable {
return [
menuItem(
() => this._duplicateTable(table),
t('DuplicateTable'),
t("Duplicate Table"),
testId('menu-duplicate-table'),
dom.cls('disabled', use =>
use(isReadonly) ||
@@ -144,7 +144,7 @@ export class DataTables extends Disposable {
use(docModel.visibleTables.getObservable()).length <= 1 && !use(table.isHidden)
))
),
dom.maybe(isReadonly, () => menuText(t("NoEditAccess"))),
dom.maybe(isReadonly, () => menuText(t("You do not have edit access to this document"))),
];
}
@@ -160,7 +160,7 @@ export class DataTables extends Disposable {
function doRemove() {
return docModel.docData.sendAction(['RemoveTable', r.tableId()]);
}
confirmModal(t("DeleteData", {formattedTableName : r.formattedTableName()}), 'Delete', doRemove);
confirmModal(t("Delete {{formattedTableName}} data, and remove it from all pages?", {formattedTableName : r.formattedTableName()}), 'Delete', doRemove);
}
private _tableRows(table: TableRec) {

View File

@@ -13,7 +13,7 @@ import {canUpgradeOrg} from 'app/common/roles';
import {Computed, Disposable, dom, DomContents, DomElementArg, makeTestId, styled} from 'grainjs';
import {makeT} from 'app/client/lib/localization';
const t = makeT('components.DocumentUsage');
const t = makeT('DocumentUsage');
const testId = makeTestId('test-doc-usage-');
@@ -60,7 +60,7 @@ export class DocumentUsage extends Disposable {
// Invalid row limits are currently treated as if they are undefined.
const maxValue = maxRows && maxRows > 0 ? maxRows : undefined;
return {
name: t('Rows'),
name: t("Rows"),
currentValue: typeof rowCount !== 'object' ? undefined : rowCount.total,
maximumValue: maxValue ?? DEFAULT_MAX_ROWS,
unit: 'rows',
@@ -75,7 +75,7 @@ export class DocumentUsage extends Disposable {
// Invalid data size limits are currently treated as if they are undefined.
const maxValue = maxSize && maxSize > 0 ? maxSize : undefined;
return {
name: t('DataSize'),
name: t("Data Size"),
currentValue: typeof dataSize !== 'number' ? undefined : dataSize,
maximumValue: maxValue ?? DEFAULT_MAX_DATA_SIZE,
unit: 'MB',
@@ -97,7 +97,7 @@ export class DocumentUsage extends Disposable {
// Invalid attachments size limits are currently treated as if they are undefined.
const maxValue = maxSize && maxSize > 0 ? maxSize : undefined;
return {
name: t('AttachmentsSize'),
name: t("Attachments Size"),
currentValue: typeof attachmentsSize !== 'number' ? undefined : attachmentsSize,
maximumValue: maxValue ?? DEFAULT_MAX_ATTACHMENTS_SIZE,
unit: 'GB',
@@ -135,7 +135,7 @@ export class DocumentUsage extends Disposable {
public buildDom() {
return dom('div',
cssHeader(t('Usage'), testId('heading')),
cssHeader(t("Usage"), testId('heading')),
dom.domComputed(this._areAllMetricsPending, (isLoading) => {
if (isLoading) { return cssSpinner(loadingSpinner(), testId('loading')); }
@@ -149,7 +149,7 @@ export class DocumentUsage extends Disposable {
return dom.domComputed((use) => {
const isAccessDenied = use(this._isAccessDenied);
if (isAccessDenied === null) { return null; }
if (isAccessDenied) { return buildMessage(t('UsageStatisticsOnlyFullAccess')); }
if (isAccessDenied) { return buildMessage(t("Usage statistics are only available to users with full access to the document data.")); }
const org = use(this._currentOrg);
const product = use(this._currentProduct);
@@ -237,12 +237,12 @@ export function buildUpgradeMessage(
variant: 'short' | 'long',
onUpgrade: () => void,
) {
if (!canUpgrade) { return t('LimitContactSiteOwner'); }
if (!canUpgrade) { return t("Contact the site owner to upgrade the plan to raise limits."); }
const upgradeLinkText = t('UpgradeLinkText')
const upgradeLinkText = t("start your 30-day free trial of the Pro plan.")
// TODO i18next
return [
variant === 'short' ? null : t('ForHigherLimits'),
variant === 'short' ? null : t("For higher limits, "),
buildUpgradeLink(
variant === 'short' ? capitalizeFirstWord(upgradeLinkText) : upgradeLinkText,
() => onUpgrade(),

View File

@@ -273,7 +273,7 @@ class NotificationAdapter extends Disposable implements Notification {
}
public showUndoDiscard() {
const notifier = this._doc.app.topAppModel.notifier;
const notification = notifier.createUserMessage(t("UndoDiscard"), {
const notification = notifier.createUserMessage(t("Undo discard"), {
message: () =>
discardNotification(
dom.on("click", () => {
@@ -421,7 +421,7 @@ const styledTooltip = styled('div', `
function cellTooltip(clb: () => any) {
return function (ctl: ITooltipControl) {
return styledTooltip(
cssLink(t('RestoreLastEdit'),
cssLink(t("Restore last edit"),
dom.on('mousedown', (ev) => { ev.preventDefault(); ctl.close(); clb(); }),
testId('draft-tooltip'),
),
@@ -440,7 +440,7 @@ const styledNotification = styled('div', `
`);
function discardNotification(...args: IDomArgs<TagElem<"div">>) {
return styledNotification(
t("UndoDiscard"),
t("Undo discard"),
testId("draft-notification"),
...args
);

View File

@@ -87,7 +87,7 @@ import * as ko from 'knockout';
import cloneDeepWith = require('lodash/cloneDeepWith');
import isEqual = require('lodash/isEqual');
const t = makeT('components.GristDoc');
const t = makeT('GristDoc');
const G = getBrowserGlobals('document', 'window');
@@ -314,7 +314,7 @@ export class GristDoc extends DisposableWithEvents {
const importSourceElems = ImportSourceElement.fromArray(this.docPluginManager.pluginsList);
const importMenuItems = [
{
label: t('ImportFromFile'),
label: t("Import from file"),
action: () => Importer.selectAndImport(this, importSourceElems, null, createPreview),
},
...importSourceElems.map(importSourceElem => ({
@@ -599,7 +599,7 @@ export class GristDoc extends DisposableWithEvents {
}
}
const res = await docData.bundleActions(
t("AddedNewLinkedSection", {viewName}),
t("Added new linked section to view {{viewName}}", {viewName}),
() => this.addWidgetToPageImpl(val, tableId ?? null)
);
@@ -680,7 +680,7 @@ export class GristDoc extends DisposableWithEvents {
}
return await this._viewLayout!.freezeUntil(docData.bundleActions(
t("SavedLinkedSectionIn", {title:section.title(), name: viewModel.name()}),
t("Saved linked section {{title}} in view {{name}}", {title:section.title(), name: viewModel.name()}),
async () => {
// if table changes or a table is made a summary table, let's replace the view section by a

View File

@@ -36,7 +36,7 @@ import {labeledSquareCheckbox} from 'app/client/ui2018/checkbox';
import {ACCESS_DENIED, AUTH_INTERRUPTED, canReadPrivateFiles, getGoogleCodeForReading} from 'app/client/ui/googleAuth';
import debounce = require('lodash/debounce');
const t = makeT('components.Importer');
const t = makeT('Importer');
// We expect a function for creating the preview GridView, to avoid the need to require the
@@ -631,7 +631,7 @@ export class Importer extends DisposableWithEvents {
cssMergeOptions(
cssMergeOptionsToggle(labeledSquareCheckbox(
updateExistingRecords,
t('UpdateExistingRecords'),
t("Update existing records"),
dom.autoDispose(updateRecordsListener),
testId('importer-update-existing-records')
)),
@@ -646,14 +646,14 @@ export class Importer extends DisposableWithEvents {
return [
cssMergeOptionsMessage(
t('MergeRowsThatMatch'),
t("Merge rows that match these fields:"),
testId('importer-merge-fields-message')
),
multiSelect(
mergeCols,
section.viewFields().peek().map(f => ({label: f.label(), value: f.colId()})) ?? [],
{
placeholder: t("SelectFieldsToMatch"),
placeholder: t("Select fields to match on"),
error: hasInvalidMergeCols
},
dom.autoDispose(mergeColsListener),

View File

@@ -7,7 +7,7 @@ import { PluginInstance } from 'app/common/PluginInstance';
import { RenderTarget } from 'app/plugin/RenderOptions';
import { Disposable, dom, DomContents, Observable, styled } from 'grainjs';
const t = makeT('components.PluginScreen');
const t = makeT('PluginScreen');
/**
* Rendering options for the PluginScreen modal.
@@ -55,7 +55,7 @@ export class PluginScreen extends Disposable {
public renderError(message: string) {
this.render([
this._buildModalTitle(),
cssModalBody(t('ImportFailed'), message, testId('importer-error')),
cssModalBody(t("Import failed: "), message, testId('importer-error')),
cssModalButtons(
bigBasicButton('Close',
dom.on('click', () => this.close()),

View File

@@ -41,7 +41,7 @@ var {menu} = require('../ui2018/menus');
var {testId} = require('app/client/ui2018/cssVars');
var {contextMenu} = require('app/client/ui/contextMenu');
const t = makeT('components.RecordLayout');
const t = makeT('RecordLayout');
/**
* Construct a RecordLayout.
@@ -263,7 +263,7 @@ RecordLayout.prototype.saveLayoutSpec = async function(layoutSpec) {
// Use separate copies of addColAction, since sendTableActions modified each in-place.
let addActions = gutil.arrayRepeat(addColNum, 0).map(() => addColAction.slice());
await docData.bundleActions(t('UpdatingRecordLayout'), () => {
await docData.bundleActions(t("Updating record layout."), () => {
return Promise.try(() => {
return addColNum > 0 ? docModel.dataTables[tableId].sendTableActions(addActions) : [];
})

View File

@@ -6,7 +6,7 @@ var {makeT} = require('app/client/lib/localization');
var commands = require('./commands');
var LayoutEditor = require('./LayoutEditor');
const t = makeT('components.RecordLayoutEditor');
const t = makeT('RecordLayoutEditor');
const {basicButton, cssButton, primaryButton} = require('app/client/ui2018/buttons');
const {icon} = require('app/client/ui2018/icons');
const {menu, menuDivider, menuItem} = require('app/client/ui2018/menus');
@@ -93,13 +93,13 @@ RecordLayoutEditor.prototype.buildEditorDom = function() {
};
return cssControls(
basicButton(t('AddField'), cssCollapseIcon('Collapse'),
basicButton(t('Add Field'), cssCollapseIcon('Collapse'),
menu((ctl) => [
menuItem(() => addNewField(), t('CreateNewField')),
menuItem(() => addNewField(), t('Create New Field')),
dom.maybe((use) => use(this._hiddenColumns).length > 0,
() => menuDivider()),
dom.forEach(this._hiddenColumns, (col) =>
menuItem(() => showField(col), t("ShowField", {label:col.label()}))
menuItem(() => showField(col), t("Show field {{- label}}", {label:col.label()}))
),
testId('edit-layout-add-menu'),
]),
@@ -113,7 +113,7 @@ RecordLayoutEditor.prototype.buildEditorDom = function() {
RecordLayoutEditor.prototype.buildFinishButtons = function() {
return [
primaryButton(t('SaveLayout'),
primaryButton(t('Save Layout'),
dom.on('click', () => commands.allCommands.accept.run()),
),
basicButton(t('Cancel'),

View File

@@ -14,7 +14,7 @@ import ko from 'knockout';
import {menu, menuItem} from 'popweasel';
import {makeT} from 'app/client/lib/localization';
const t = makeT('components.RefSelect');
const t = makeT('RefSelect');
interface Item {
label: string;
@@ -97,7 +97,7 @@ export class RefSelect extends Disposable {
testId('ref-select-item'),
)
),
cssAddLink(cssAddIcon('Plus'), t('AddColumn'),
cssAddLink(cssAddIcon('Plus'), t("Add Column"),
menu(() => [
...this._validCols.peek()
.filter((col) => !this._addedSet.peek().has(col.colId.peek()))
@@ -105,7 +105,7 @@ export class RefSelect extends Disposable {
menuItem(() => this._addFormulaField({ label: col.label(), value: col.colId() }),
col.label.peek())
),
cssEmptyMenuText(t("NoColumnsAdd")),
cssEmptyMenuText(t("No columns to add")),
testId('ref-select-menu'),
]),
testId('ref-select-add'),

View File

@@ -16,7 +16,7 @@ import ko from 'knockout';
import {Computed, Disposable, dom, makeTestId, Observable, styled, subscribe} from 'grainjs';
import {makeT} from 'app/client/lib/localization';
const t = makeT('components.SelectionSummary');
const t = makeT('SelectionSummary');
/**
* A beginning and end index for a range of columns or rows.
@@ -266,7 +266,7 @@ export class SelectionSummary extends Disposable {
async function doCopy(value: string, elem: Element) {
await copyToClipboard(value);
showTransientTooltip(elem, t('CopiedClipboard'), {key: 'copy-selection-summary'});
showTransientTooltip(elem, t("Copied to clipboard"), {key: 'copy-selection-summary'});
}
const cssSummary = styled('div', `

View File

@@ -20,7 +20,7 @@ import {UserAction} from 'app/common/DocActions';
import {Computed, dom, fromKo, Observable} from 'grainjs';
import {makeT} from 'app/client/lib/localization';
const t = makeT('components.TypeTransformation');
const t = makeT('TypeTransformation');
// To simplify diff (avoid rearranging methods to satisfy private/public order).
/* eslint-disable @typescript-eslint/member-ordering */
@@ -74,7 +74,7 @@ export class TypeTransform extends ColumnTransform {
return basicButton(dom.on('click', () => this.editor.writeObservable()),
t('Preview'), testId("type-transform-update"),
dom.cls('disabled', (use) => use(disableButtons) || use(this.formulaUpToDate)),
{ title: t('UpdateFormula') }
{ title: t('Update formula (Shift+Enter)') }
);
} else {
return basicButton(dom.on('click', () => { this._reviseTypeChange.set(true); }),

View File

@@ -7,7 +7,7 @@ var kf = require('../lib/koForm');
var AceEditor = require('./AceEditor');
var {makeT} = require('app/client/lib/localization');
const t = makeT('components.ValidationPanel');
const t = makeT('ValidationPanel');
/**
* Document level configuration settings.
@@ -33,7 +33,7 @@ dispose.makeDisposable(ValidationPanel);
ValidationPanel.prototype.onAddRule = function() {
this.validationsTable.sendTableAction(["AddRecord", null, {
tableRef: this.docTables.at(0).id(),
name: t("RuleLength", {length: this.validations.peekLength + 1}),
name: t("Rule {{length}}", {length: this.validations.peekLength + 1}),
formula: ""
}])
.then(function() {
@@ -86,7 +86,7 @@ ValidationPanel.prototype.buildDom = function() {
2, '',
1, kf.buttonGroup(
kf.button(() => editor.writeObservable(),
'Apply', { title: t('UpdateFormula')},
'Apply', { title: t("Update formula (Shift+Enter)")},
kd.toggleClass('disabled', editorUpToDate)
)
)

View File

@@ -19,7 +19,7 @@ const {makeT} = require('app/client/lib/localization');
const testId = makeTestId('test-vconfigtab-');
const t = makeT('components.ViewConfigTab');
const t = makeT('ViewConfigTab');
/**
* Helper class that combines one ViewSection's data for building dom.
@@ -124,9 +124,9 @@ ViewConfigTab.prototype._buildAdvancedSettingsDom = function() {
const table = sectionData.section.table();
const isCollapsed = ko.observable(true);
return [
kf.collapserLabel(isCollapsed, t('AdvancedSettings'), dom.testId('ViewConfig_advanced')),
kf.collapserLabel(isCollapsed, t("Advanced settings"), dom.testId('ViewConfig_advanced')),
kf.helpRow(kd.hide(isCollapsed),
t('BigTablesMayBeMarked'),
t("Big tables may be marked as \"on-demand\" to avoid loading them into the data engine."),
kd.style('text-align', 'left'),
kd.style('margin-top', '1.5rem')
),
@@ -135,7 +135,7 @@ ViewConfigTab.prototype._buildAdvancedSettingsDom = function() {
),
kf.row(kd.hide(isCollapsed),
kf.buttonGroup(kf.button(() => this._makeOnDemand(table),
kd.text(() => table.onDemand() ? t('UnmarkOnDemandButton') : t('MakeOnDemandButton')),
kd.text(() => table.onDemand() ? t("Unmark On-Demand") : t("Make On-Demand")),
dom.testId('ViewConfig_onDemandBtn')
))
),
@@ -152,9 +152,9 @@ ViewConfigTab.prototype._buildThemeDom = function() {
return cssRow(
dom.autoDispose(theme),
select(theme, [
{label: t('Form'), value: 'form' },
{label: t('Compact'), value: 'compact'},
{label: t('Blocks'), value: 'blocks' },
{label: t("Form"), value: 'form' },
{label: t("Compact"), value: 'compact'},
{label: t("Blocks"), value: 'blocks' },
]),
testId('detail-theme')
);
@@ -173,7 +173,7 @@ ViewConfigTab.prototype._buildLayoutDom = function() {
const layoutEditorObs = ko.computed(() => view && view.recordLayout && view.recordLayout.layoutEditor());
return cssRow({style: 'margin-top: 16px;'},
kd.maybe(layoutEditorObs, (editor) => editor.buildFinishButtons()),
primaryButton(t('EditCardLayout'),
primaryButton(t("Edit Card Layout"),
dom.autoDispose(layoutEditorObs),
dom.on('click', () => commands.allCommands.editLayout.run()),
grainjsDom.hide(layoutEditorObs),
@@ -222,8 +222,8 @@ ViewConfigTab.prototype._buildCustomTypeItems = function() {
// 3)
showObs: () => activeSection().customDef.mode() === "plugin",
buildDom: () => kd.scope(activeSection, ({customDef}) => dom('div',
kf.row(5, t("PluginColon"), 13, kf.text(customDef.pluginId, {}, {list: "list_plugin"}, dom.testId('ViewConfigTab_customView_pluginId'))),
kf.row(5, t("SectionColon"), 13, kf.text(customDef.sectionId, {}, {list: "list_section"}, dom.testId('ViewConfigTab_customView_sectionId'))),
kf.row(5, t("Plugin: "), 13, kf.text(customDef.pluginId, {}, {list: "list_plugin"}, dom.testId('ViewConfigTab_customView_pluginId'))),
kf.row(5, t("Section: "), 13, kf.text(customDef.sectionId, {}, {list: "list_section"}, dom.testId('ViewConfigTab_customView_sectionId'))),
// For both `customPlugin` and `selectedSection` it is possible for the value not to be in the
// list of options. Combining <datalist> and <input> allows both to freely edit the value with
// keyboard and to select it from a list. Although the content of the list seems to be

View File

@@ -15,7 +15,7 @@ import zip = require('lodash/zip');
import zipObject = require('lodash/zipObject');
import {makeT} from 'app/client/lib/localization';
const t = makeT('components.duplicatePage');
const t = makeT('duplicatePage');
// Duplicate page with pageId. Starts by prompting user for a new name.
export async function duplicatePage(gristDoc: GristDoc, pageId: number) {
@@ -30,7 +30,7 @@ export async function duplicatePage(gristDoc: GristDoc, pageId: number) {
cssLabel("Name"),
inputEl = cssInput({value: pageName + ' (copy)'}),
),
t("DoesNotCopyData"),
t("Note that this does not copy data, but creates another view of the same data."),
])
));
}
@@ -41,7 +41,7 @@ async function makeDuplicate(gristDoc: GristDoc, pageId: number, pageName: strin
const viewSections = sourceView.viewSections.peek().peek();
let viewRef = 0;
await gristDoc.docData.bundleActions(
t("DuplicatePageName", {pageName}),
t("Duplicate page {{pageName}}", {pageName}),
async () => {
// create new view and new sections
const results = await createNewViewSections(gristDoc.docData, viewSections);