From 053ef45d643add940ae52228bbaf98eadd1f1460 Mon Sep 17 00:00:00 2001 From: Louis Delbosc Date: Tue, 11 Apr 2023 09:31:46 +0200 Subject: [PATCH 1/5] Keep choices after apply formula (#474) --- app/client/components/ColumnTransform.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/client/components/ColumnTransform.ts b/app/client/components/ColumnTransform.ts index 018868d3..772dbc41 100644 --- a/app/client/components/ColumnTransform.ts +++ b/app/client/components/ColumnTransform.ts @@ -11,6 +11,7 @@ import {TableData} from 'app/client/models/TableData'; import {FieldBuilder} from 'app/client/widgets/FieldBuilder'; import {UserAction} from 'app/common/DocActions'; import {Disposable, Observable} from 'grainjs'; +import isPlainObject from 'lodash/isPlainObject'; import * as ko from 'knockout'; import noop = require('lodash/noop'); @@ -163,7 +164,10 @@ export class ColumnTransform extends Disposable { protected async addTransformColumn(colType: string): Promise { // Retrieve widget options on prepare (useful for type transforms) const newColInfo = await this._tableData.sendTableAction(['AddColumn', "gristHelper_Transform", { - type: colType, isFormula: true, formula: this.getIdentityFormula(), + type: colType, + isFormula: true, + formula: this.getIdentityFormula(), + ...(this.origWidgetOptions ? {widgetOptions: JSON.stringify(this.origWidgetOptions)} : {}), }]); return newColInfo.colRef; } @@ -219,6 +223,9 @@ export class ColumnTransform extends Disposable { * The user actions to send when actually executing the transform. */ protected executeActions(): UserAction[] { + const newWidgetOptions = isPlainObject(this.origWidgetOptions) ? + {...this.origWidgetOptions as object, ...this._fieldBuilder.options.peek()} : + this._fieldBuilder.options.peek(); return [ [ 'CopyFromColumn', @@ -229,7 +236,7 @@ export class ColumnTransform extends Disposable { // Those options are supposed to be set by prepTransformColInfo(TypeTransform) and // adjusted by client. // TODO: is this really needed? Aren't those options already in the data-engine? - JSON.stringify(this._fieldBuilder.options.peek()), + JSON.stringify(newWidgetOptions), ], ]; } From 3e7acd9263d78678852b0e18eeed045bc4e138eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D0=BC=D0=B8=D1=80=20=D0=92?= Date: Mon, 10 Apr 2023 15:45:23 +0000 Subject: [PATCH 2/5] Translated using Weblate (Russian) Currently translated at 99.4% (771 of 775 strings) Translation: Grist/client Translate-URL: https://hosted.weblate.org/projects/grist/client/ru/ --- static/locales/ru.client.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/static/locales/ru.client.json b/static/locales/ru.client.json index ba71e94a..bb024d46 100644 --- a/static/locales/ru.client.json +++ b/static/locales/ru.client.json @@ -460,7 +460,9 @@ "Welcome to {{orgName}}": "Добро пожаловать в {{orgName}}", "personal site": "личный сайт", "You have read-only access to this site. Currently there are no documents.": "Вы имеете доступ к этому сайту только для просмотра. В настоящее время документов нет.", - "{{signUp}} to save your work. ": "{{signUp}} сохранить свою работу. " + "{{signUp}} to save your work. ": "{{signUp}} сохранить свою работу. ", + "Welcome to Grist, {{- name}}!": "Добро пожаловать в Grist, {{- name}}!", + "Welcome to {{- orgName}}": "Добро пожаловать в {{- orgName}}" }, "HomeLeftPane": { "Import Document": "Импорт документа", @@ -470,12 +472,13 @@ "Access Details": "Детали доступа", "Create Empty Document": "Создать пустой документ", "Delete": "Удалить", - "Examples & Templates": "Примеры & Шаблоны", + "Examples & Templates": "Шаблоны", "Rename": "Переименовать", "Delete {{workspace}} and all included documents?": "Удалить {{workspace}} и все прилагаемые документы?", "Trash": "Корзина", "Workspaces": "Рабочие пространства", - "Workspace will be moved to Trash.": "Рабочее пространство будет перемещено в корзину." + "Workspace will be moved to Trash.": "Рабочее пространство будет перемещено в корзину.", + "Tutorial": "Руководство" }, "GridViewMenus": { "Add to sort": "Добавить в сортировку", @@ -961,7 +964,8 @@ "Add New": "Добавить новое", "Access rules give you the power to create nuanced rules to determine who can see or edit which parts of your document.": "Правила доступа дают вам возможность создавать детальные правила, определяющие, кто может просматривать или редактировать части вашего документа.", "Use the 𝚺 icon to create summary (or pivot) tables, for totals or subtotals.": "Используйте 𝚺 значок для создания сводных таблиц для итогов или промежуточных итогов.", - "relational": "реляционный" + "relational": "реляционный", + "Anchor Links": "Якорные ссылки" }, "DescriptionConfig": { "DESCRIPTION": "ОПИСАНИЕ" From 449265803b2b6cd2c508edc84a9c2d632000d8e7 Mon Sep 17 00:00:00 2001 From: jarek Date: Tue, 11 Apr 2023 07:19:30 +0000 Subject: [PATCH 3/5] Translated using Weblate (Polish) Currently translated at 98.1% (761 of 775 strings) Translation: Grist/client Translate-URL: https://hosted.weblate.org/projects/grist/client/pl/ --- static/locales/pl.client.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/locales/pl.client.json b/static/locales/pl.client.json index 6561e9c6..711dcb77 100644 --- a/static/locales/pl.client.json +++ b/static/locales/pl.client.json @@ -372,7 +372,7 @@ "Insert column to the {{to}}": "Wstaw kolumnę do {{to}}", "More sort options ...": "Pozostałe opcje sortowania…", "Rename column": "Zmień nazwę kolumny", - "Reset {{count}} columns_one": "Wyzerować kolumnę", + "Reset {{count}} columns_one": "Resetuj kolumnę", "Reset {{count}} columns_other": "Wyzeruj {{count}} kolumn", "Reset {{count}} entire columns_one": "Zresetuj całą kolumnę", "Reset {{count}} entire columns_other": "Resetowanie {{count}} całych kolumn", @@ -589,13 +589,13 @@ }, "TriggerFormulas": { "Apply on changes to:": "Zastosuj w przypadku zmian do:", - "Apply on record changes": "Zastosuj zmiany w rekordzie", + "Apply on record changes": "Uruchom przy zmianach", "Cancel": "Anuluj", "Any field": "Dowolne pole", "Close": "Zamknij", "OK": "OK", "Current field ": "Bieżące pole ", - "Apply to new records": "Zastosuj do nowych rekordów" + "Apply to new records": "Uruchom przy dodawaniu" }, "TypeTransformation": { "Apply": "Zastosuj", From 5959db9584ea33ddcb9b4725655dbb86af760fa3 Mon Sep 17 00:00:00 2001 From: jarek Date: Thu, 13 Apr 2023 20:42:41 +0200 Subject: [PATCH 4/5] Changing choice test for a buggy chrome version (#490) --- test/nbrowser/ChoiceList.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/nbrowser/ChoiceList.ts b/test/nbrowser/ChoiceList.ts index 901bcec5..2ecfd73e 100644 --- a/test/nbrowser/ChoiceList.ts +++ b/test/nbrowser/ChoiceList.ts @@ -831,24 +831,23 @@ describe('ChoiceList', function() { await gu.sendKeys(await gu.pasteKey()); await gu.sendKeys(await gu.pasteKey()); await gu.sendKeys(Key.ENTER); - await clickEntry('three'); - await gu.sendKeys(await gu.copyKey()); await clickEntry('two'); + await gu.sendKeys(await gu.copyKey()); await gu.sendKeys(Key.ARROW_RIGHT); await gu.sendKeys(await gu.pasteKey()); await gu.sendKeys(Key.ENTER); - assert.deepEqual(await getEditModeChoiceLabels(), ["foofoo", "three", "twothree"]); + assert.deepEqual(await getEditModeChoiceLabels(), ["foofoo", "three", "twotwo"]); await saveChoiceEntries(); assert.deepEqual(await gu.getVisibleGridCells({ rowNums: [1, 2, 3], cols: [columnName] }), [ "foofoo", "three", - "twothree", + "twotwo", ]); // Rename to bar, four and eight and do the change. await editChoiceEntries(); await renameEntry("foofoo", "bar"); - await renameEntry("twothree", "four"); + await renameEntry("twotwo", "four"); await renameEntry("three", "eight"); await saveChoiceEntries(); assert.deepEqual(await gu.getVisibleGridCells({ rowNums: [1, 2, 3], cols: [columnName] }), [ From bcb5916434b45e788b7c23ce48de2dc916d0371e Mon Sep 17 00:00:00 2001 From: Vinschni Date: Sat, 15 Apr 2023 22:22:56 +0200 Subject: [PATCH 5/5] make sendToDrive hidable (#493) Make "sendToDrive" button from share menu hidable. --- README.md | 2 +- app/client/ui/ShareMenu.ts | 6 +++--- app/common/gristUrls.ts | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2904b13d..60c49f98 100644 --- a/README.md +++ b/README.md @@ -260,7 +260,7 @@ GRIST_DEFAULT_PRODUCT | if set, this controls enabled features and limits of ne GRIST_DEFAULT_LOCALE | Locale to use as fallback when Grist cannot honour the browser locale. GRIST_DOMAIN | in hosted Grist, Grist is served from subdomains of this domain. Defaults to "getgrist.com". GRIST_EXPERIMENTAL_PLUGINS | enables experimental plugins -GRIST_HIDE_UI_ELEMENTS | comma-separated list of parts of the UI to hide. Allowed names of parts: `helpCenter,billing,templates,multiSite,multiAccounts` +GRIST_HIDE_UI_ELEMENTS | comma-separated list of parts of the UI to hide. Allowed names of parts: `helpCenter,billing,templates,multiSite,multiAccounts,sendToDrive` GRIST_HOME_INCLUDE_STATIC | if set, home server also serves static resources GRIST_HOST | hostname to use when listening on a port. GRIST_ID_PREFIX | for subdomains of form o-*, expect or produce o-${GRIST_ID_PREFIX}*. diff --git a/app/client/ui/ShareMenu.ts b/app/client/ui/ShareMenu.ts index bf253560..14ff2ea1 100644 --- a/app/client/ui/ShareMenu.ts +++ b/app/client/ui/ShareMenu.ts @@ -11,7 +11,7 @@ import {primaryButton} from 'app/client/ui2018/buttons'; import {mediaXSmall, testId, theme} from 'app/client/ui2018/cssVars'; import {icon} from 'app/client/ui2018/icons'; import {menu, menuAnnotate, menuDivider, menuIcon, menuItem, menuItemLink, menuText} from 'app/client/ui2018/menus'; -import {buildUrlId, parseUrlId} from 'app/common/gristUrls'; +import {buildUrlId, parseUrlId, shouldHideUiElement} from 'app/common/gristUrls'; import * as roles from 'app/common/roles'; import {Document} from 'app/common/UserAPI'; import {dom, DomContents, styled} from 'grainjs'; @@ -244,8 +244,8 @@ function menuExports(doc: Document, pageModel: DocPageModel) { href: pageModel.appModel.api.getDocAPI(doc.id).getDownloadXlsxUrl(), target: '_blank', download: '' }, menuIcon('Download'), t("Export XLSX"), testId('tb-share-option')), - menuItem(() => sendToDrive(doc, pageModel), - menuIcon('Download'), t("Send to Google Drive"), testId('tb-share-option')), + (shouldHideUiElement("sendToDrive") ? null : menuItem(() => sendToDrive(doc, pageModel), + menuIcon('Download'), t("Send to Google Drive"), testId('tb-share-option'))), ]; } diff --git a/app/common/gristUrls.ts b/app/common/gristUrls.ts index a954dbf5..4315f065 100644 --- a/app/common/gristUrls.ts +++ b/app/common/gristUrls.ts @@ -614,7 +614,8 @@ export interface GristLoadConfig { userLocale?: string; } -export const HideableUiElements = StringUnion("helpCenter", "billing", "templates", "multiSite", "multiAccounts"); +export const HideableUiElements = StringUnion("helpCenter", "billing", "templates", "multiSite", "multiAccounts", +"sendToDrive"); export type IHideableUiElement = typeof HideableUiElements.type; export function shouldHideUiElement(elem: IHideableUiElement): boolean {