Linting long lines

This commit is contained in:
Jarosław Sadziński 2023-01-03 17:45:14 +01:00
parent 654514c18d
commit f8795efff8
13 changed files with 56 additions and 27 deletions

View File

@ -395,7 +395,10 @@ export class ActionLog extends dispose.Disposable implements IDomComponent {
const newName = tableRename[1]; const newName = tableRename[1];
if (!newName) { if (!newName) {
// TODO - find a better way to send informative notifications. // TODO - find a better way to send informative notifications.
gristNotify(t("Table {{tableId}} was subsequently removed in action #{{actionNum}}", {tableId:tableId, actionNum: action.actionNum})); gristNotify(t(
"Table {{tableId}} was subsequently removed in action #{{actionNum}}",
{tableId:tableId, actionNum: action.actionNum}
));
return; return;
} }
tableId = newName; tableId = newName;
@ -416,7 +419,10 @@ export class ActionLog extends dispose.Disposable implements IDomComponent {
const newName = columnRename[1]; const newName = columnRename[1];
if (!newName) { if (!newName) {
// TODO - find a better way to send informative notifications. // TODO - find a better way to send informative notifications.
gristNotify(t("Column {{colId}} was subsequently removed in action #{{action.actionNum}}", {colId, actionNum: action.actionNum})); gristNotify(t(
"Column {{colId}} was subsequently removed in action #{{action.actionNum}}",
{colId, actionNum: action.actionNum}
));
return; return;
} }
colId = newName; colId = newName;

View File

@ -656,8 +656,9 @@ export class ChartConfig extends GrainJSDisposable {
), ),
dom.domComputed(this._optionsObj.prop('errorBars'), (value: ChartOptions["errorBars"]) => dom.domComputed(this._optionsObj.prop('errorBars'), (value: ChartOptions["errorBars"]) =>
value === 'symmetric' ? cssRowHelp(t("Each Y series is followed by a series for the length of error bars.")) : 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.")) : value === 'separate' ? cssRowHelp(t("Each Y series is followed by two series, for " +
null "top and bottom error bars."))
: null
), ),
]), ]),

View File

@ -160,7 +160,10 @@ export class DataTables extends Disposable {
function doRemove() { function doRemove() {
return docModel.docData.sendAction(['RemoveTable', r.tableId()]); return docModel.docData.sendAction(['RemoveTable', r.tableId()]);
} }
confirmModal(t("Delete {{formattedTableName}} data, and remove it from all pages?", {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) { private _tableRows(table: TableRec) {

View File

@ -149,7 +149,9 @@ export class DocumentUsage extends Disposable {
return dom.domComputed((use) => { return dom.domComputed((use) => {
const isAccessDenied = use(this._isAccessDenied); const isAccessDenied = use(this._isAccessDenied);
if (isAccessDenied === null) { return null; } if (isAccessDenied === null) { return null; }
if (isAccessDenied) { return buildMessage(t("Usage statistics are only available to users with full access to the document data.")); } 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 org = use(this._currentOrg);
const product = use(this._currentProduct); const product = use(this._currentProduct);

View File

@ -239,14 +239,24 @@ export class DocPageModelImpl extends Disposable implements DocPageModel {
t("Error accessing document"), t("Error accessing document"),
t("Reload"), t("Reload"),
async () => window.location.reload(true), async () => window.location.reload(true),
isDocOwner ? t("You can try reloading the document, or using recovery mode. Recovery mode opens the document to be fully accessible to owners, and inaccessible to others. It also disables formulas. [{{error}}]", {error: err.message}) : isDocOwner
isDenied ? t('Sorry, access to this document has been denied. [{{error}}]', {error: err.message}) : ? t("You can try reloading the document, or using recovery mode. " +
t("Document owners can attempt to recover the document. [{{error}}]", {error: err.message}), "Recovery mode opens the document to be fully accessible to " +
{ hideCancel: true, "owners, and inaccessible to others. It also disables " +
extraButtons: (isDocOwner && !isDenied) ? bigBasicButton(t("Enter recovery mode"), dom.on('click', async () => { "formulas. [{{error}}]", {error: err.message})
: isDenied
? t('Sorry, access to this document has been denied. [{{error}}]', {error: err.message})
: t("Document owners can attempt to recover the document. [{{error}}]", {error: err.message}),
{
hideCancel: true,
extraButtons: !(isDocOwner && !isDenied) ? null : bigBasicButton(
t("Enter recovery mode"),
dom.on('click', async () => {
await this._api.getDocAPI(this.currentDocId.get()!).recover(true); await this._api.getDocAPI(this.currentDocId.get()!).recover(true);
window.location.reload(true); window.location.reload(true);
}), testId('modal-recovery-mode')) : null, }),
testId('modal-recovery-mode')
)
}, },
); );
} }

View File

@ -113,7 +113,9 @@ export class AccountPage extends Disposable {
), ),
css.subHeader(t("Two-factor authentication")), css.subHeader(t("Two-factor authentication")),
css.description( css.description(
t("Two-factor authentication is an extra layer of security for your Grist account designed to ensure that you're the only person who can access your account, even if someone knows your password.") t("Two-factor authentication is an extra layer of security for your Grist account " +
"designed to ensure that you're the only person who can access your account, " +
"even if someone knows your password.")
), ),
dom.create(MFAConfig, user), dom.create(MFAConfig, user),
), ),

View File

@ -78,7 +78,8 @@ export class ApiKey extends Disposable {
dom.maybe((use) => !(use(this._apiKey) || this._anonymous), () => [ dom.maybe((use) => !(use(this._apiKey) || this._anonymous), () => [
basicButton(t("Create"), dom.on('click', () => this._onCreate()), testId('create'), basicButton(t("Create"), dom.on('click', () => this._onCreate()), testId('create'),
dom.boolAttr('disabled', this._loading)), dom.boolAttr('disabled', this._loading)),
description(t("By generating an API key, you will be able to make API calls for your own account."), testId('description')), description(t("By generating an API key, you will be able to " +
"make API calls for your own account."), testId('description')),
]), ]),
); );
} }
@ -112,7 +113,8 @@ export class ApiKey extends Disposable {
confirmModal( confirmModal(
t("Remove API Key"), t("Remove"), t("Remove API Key"), t("Remove"),
() => this._onDelete(), () => this._onDelete(),
t("You're about to delete an API key. This will cause all future requests using this API key to be rejected. Do you still want to delete?") t("You're about to delete an API key. This will cause all future requests " +
"using this API key to be rejected. Do you still want to delete?")
); );
} }
} }

View File

@ -21,7 +21,8 @@ export async function startDocTour(docData: DocData, docComm: DocComm, onFinishC
const invalidDocTour: IOnBoardingMsg[] = [{ const invalidDocTour: IOnBoardingMsg[] = [{
title: t("No valid document tour"), title: t("No valid document tour"),
body: t("Cannot construct a document tour from the data in this document. Ensure there is a table named GristDocTour with columns Title, Body, Placement, and Location."), body: t("Cannot construct a document tour from the data in this document. " +
"Ensure there is a table named GristDocTour with columns Title, Body, Placement, and Location."),
selector: 'document', selector: 'document',
showHasModal: true, showHasModal: true,
}]; }];

View File

@ -83,10 +83,9 @@ class DuplicateTableModal extends Disposable {
), ),
cssWarning( cssWarning(
cssWarningIcon('Warning'), cssWarningIcon('Warning'),
dom('div', t("Instead of duplicating tables, it's usually better to segment data using linked views. {{link}}",
dom('div', {link: cssLink({href: commonUrls.helpLinkingWidgets, target: '_blank'}, 'Read More.')}
t("Instead of duplicating tables, it's usually better to segment data using linked views. {{link}}", {link: cssLink({href: commonUrls.helpLinkingWidgets, target: '_blank'}, 'Read More.')}) )),
), //TODO: i18next
), ),
cssField( cssField(
cssCheckbox( cssCheckbox(

View File

@ -36,7 +36,8 @@ export const buildExamples = (): IExampleInfo[] => [{
tutorialUrl: 'https://support.getgrist.com/investment-research/', tutorialUrl: 'https://support.getgrist.com/investment-research/',
welcomeCard: { welcomeCard: {
title: t("Welcome to the Investment Research template"), title: t("Welcome to the Investment Research template"),
text: t("Check out our related tutorial to learn how to create summary tables and charts, and to link charts dynamically."), text: t("Check out our related tutorial to learn how to create " +
"summary tables and charts, and to link charts dynamically."),
tutorialName: t("Tutorial: Analyze & Visualize"), tutorialName: t("Tutorial: Analyze & Visualize"),
}, },
}, { }, {

View File

@ -41,7 +41,8 @@ export async function replaceTrunkWithFork(user: FullUser|null, doc: Document, a
if (cmp.summary === 'left' || cmp.summary === 'both') { if (cmp.summary === 'left' || cmp.summary === 'both') {
titleText = t("Original Has Modifications"); titleText = t("Original Has Modifications");
buttonText = t("Overwrite"); buttonText = t("Overwrite");
warningText = `${warningText} ${t("Be careful, the original has changes not in this document. Those changes will be overwritten.")}`; warningText = `${warningText} ${t("Be careful, the original has changes " +
"not in this document. Those changes will be overwritten.")}`;
} else if (cmp.summary === 'unrelated') { } else if (cmp.summary === 'unrelated') {
titleText = t("Original Looks Unrelated"); titleText = t("Original Looks Unrelated");
buttonText = t("Overwrite"); buttonText = t("Overwrite");

View File

@ -35,7 +35,8 @@ export function createForbiddenPage(appModel: AppModel, message?: string) {
return pagePanelsError(appModel, t("Access denied{{suffix}}", {suffix: ''}), [ return pagePanelsError(appModel, t("Access denied{{suffix}}", {suffix: ''}), [
dom.domComputed(appModel.currentValidUser, user => user ? [ dom.domComputed(appModel.currentValidUser, user => user ? [
cssErrorText(message || t("You do not have access to this organization's documents.")), cssErrorText(message || t("You do not have access to this organization's documents.")),
cssErrorText(t("You are signed in as {{email}}. You can sign in with a different account, or ask an administrator for access.", {email: dom('b', user.email)})), // TODO: i18next cssErrorText(t("You are signed in as {{email}}. You can sign in with a different " +
"account, or ask an administrator for access.", {email: dom('b', user.email)})),
] : [ ] : [
// This page is not normally shown because a logged out user with no access will get // This page is not normally shown because a logged out user with no access will get
// redirected to log in. But it may be seen if a user logs out and returns to a cached // redirected to log in. But it may be seen if a user logs out and returns to a cached