From a59132108fb1d831cbf99b767c55efbd31fceb2f Mon Sep 17 00:00:00 2001 From: Florent Date: Mon, 8 Jan 2024 17:26:30 +0100 Subject: [PATCH 1/3] Add createSite feature so user can disable site creation #813 (#814) Co-authored-by: Florent FAYOLLE --- README.md | 4 ++-- app/client/ui/SiteSwitcher.ts | 14 ++++++++------ app/common/gristUrls.ts | 1 + stubs/app/server/server.ts | 2 +- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7555708f..df01493d 100644 --- a/README.md +++ b/README.md @@ -236,7 +236,7 @@ GRIST_DEFAULT_LOCALE | Locale to use as fallback when Grist cannot honour the b GRIST_DOMAIN | in hosted Grist, Grist is served from subdomains of this domain. Defaults to "getgrist.com". GRIST_EXPERIMENTAL_PLUGINS | enables experimental plugins GRIST_ENABLE_REQUEST_FUNCTION | enables the REQUEST function. This function performs HTTP requests in a similar way to `requests.request`. This function presents a significant security risk, since it can let users call internal endpoints when Grist is available publicly. This function can also cause performance issues. Unset by default. -GRIST_HIDE_UI_ELEMENTS | comma-separated list of UI features to disable. Allowed names of parts: `helpCenter,billing,templates,multiSite,multiAccounts,sendToDrive,tutorials`. If a part also exists in GRIST_UI_FEATURES, it will still be disabled. +GRIST_HIDE_UI_ELEMENTS | comma-separated list of UI features to disable. Allowed names of parts: `helpCenter,billing,templates,createSite,multiSite,multiAccounts,sendToDrive,tutorials`. If a part also exists in GRIST_UI_FEATURES, it will still be disabled. GRIST_HOME_INCLUDE_STATIC | if set, home server also serves static resources GRIST_HOST | hostname to use when listening on a port. GRIST_HTTPS_PROXY | if set, use this proxy for webhook payload delivery. @@ -269,7 +269,7 @@ GRIST_TELEMETRY_LEVEL | the telemetry level. Can be set to: `off` (default), `li GRIST_THROTTLE_CPU | if set, CPU throttling is enabled GRIST_TRUST_PLUGINS | if set, plugins are expect to be served from the same host as the rest of the Grist app, rather than from a distinct host. Ordinarily, plugins are served from a distinct host so that the cookies used by the Grist app are not automatically available to them. Enable this only if you understand the security implications. GRIST_USER_ROOT | an extra path to look for plugins in - Grist will scan for plugins in `$GRIST_USER_ROOT/plugins`. -GRIST_UI_FEATURES | comma-separated list of UI features to enable. Allowed names of parts: `helpCenter,billing,templates,multiSite,multiAccounts,sendToDrive,tutorials`. If a part also exists in GRIST_HIDE_UI_ELEMENTS, it won't be enabled. +GRIST_UI_FEATURES | comma-separated list of UI features to enable. Allowed names of parts: `helpCenter,billing,templates,createSite,multiSite,multiAccounts,sendToDrive,tutorials`. If a part also exists in GRIST_HIDE_UI_ELEMENTS, it won't be enabled. GRIST_UNTRUSTED_PORT | if set, plugins will be served from the given port. This is an alternative to setting APP_UNTRUSTED_URL. GRIST_WIDGET_LIST_URL | a url pointing to a widget manifest, by default `https://github.com/gristlabs/grist-widget/releases/download/latest/manifest.json` is used COOKIE_MAX_AGE | session cookie max age, defaults to 90 days; can be set to "none" to make it a session cookie diff --git a/app/client/ui/SiteSwitcher.ts b/app/client/ui/SiteSwitcher.ts index 77054b55..519f977f 100644 --- a/app/client/ui/SiteSwitcher.ts +++ b/app/client/ui/SiteSwitcher.ts @@ -42,12 +42,14 @@ export function buildSiteSwitcher(appModel: AppModel) { testId('org'), ) ), - menuItem( - () => appModel.showNewSiteModal(), - menuIcon('Plus'), - t("Create new team site"), - testId('create-new-site'), - ), + dom.maybe(() => isFeatureEnabled("createSite"), () => [ + menuItem( + () => appModel.showNewSiteModal(), + menuIcon('Plus'), + t("Create new team site"), + testId('create-new-site'), + ) + ]), ]; } diff --git a/app/common/gristUrls.ts b/app/common/gristUrls.ts index eee562dd..c78e0e20 100644 --- a/app/common/gristUrls.ts +++ b/app/common/gristUrls.ts @@ -758,6 +758,7 @@ export const Features = StringUnion( "helpCenter", "billing", "templates", + "createSite", "multiSite", "multiAccounts", "sendToDrive", diff --git a/stubs/app/server/server.ts b/stubs/app/server/server.ts index 4f5aa2e2..3eac5567 100644 --- a/stubs/app/server/server.ts +++ b/stubs/app/server/server.ts @@ -31,7 +31,7 @@ if (!process.env.GRIST_SINGLE_ORG) { setDefaultEnv('GRIST_ORG_IN_PATH', 'true'); } -setDefaultEnv('GRIST_UI_FEATURES', 'helpCenter,billing,templates,multiSite,multiAccounts,sendToDrive'); +setDefaultEnv('GRIST_UI_FEATURES', 'helpCenter,billing,templates,multiSite,multiAccounts,sendToDrive,createSite'); setDefaultEnv('GRIST_WIDGET_LIST_URL', commonUrls.gristLabsWidgetRepository); import {updateDb} from 'app/server/lib/dbUtils'; import {main as mergedServerMain, parseServerTypes} from 'app/server/mergedServerMain'; From 66b0673a3a0e33a53e35359e206f0d3cd6c56095 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, 8 Jan 2024 19:24:07 +0000 Subject: [PATCH 2/3] Translated using Weblate (Russian) Currently translated at 99.6% (1020 of 1024 strings) Translation: Grist/client Translate-URL: https://hosted.weblate.org/projects/grist/client/ru/ --- static/locales/ru.client.json | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/static/locales/ru.client.json b/static/locales/ru.client.json index 4477fb59..b25d950e 100644 --- a/static/locales/ru.client.json +++ b/static/locales/ru.client.json @@ -319,7 +319,8 @@ "TOOLS": "ИНСТРУМЕНТЫ", "Tour of this Document": "Тур по этому документу", "Validate Data": "Проверка данных", - "Settings": "Настройки" + "Settings": "Настройки", + "API Console": "API-консоль" }, "TypeTransformation": { "Cancel": "Отмена", @@ -566,7 +567,13 @@ "Adding duplicates column": "Добавление столбца дубликатов", "Lookups": "Lookups", "Add formula column": "Добавить вычисляемый столбец", - "Add column with type": "Добавить столбец с типом" + "Add column with type": "Добавить столбец с типом", + "Add column": "Добавить столбец", + "Created at": "Создан в", + "Created by": "Создано", + "Detect duplicates in...": "Обнаружение дубликатов в...", + "Last updated at": "Последнее обновление", + "Last updated by": "Последнее обновление" }, "FilterBar": { "SearchColumns": "Столбцы поиска", @@ -675,7 +682,8 @@ "WIDGET TITLE": "ЗАГОЛОВОК ВИДЖЕТА", "You do not have edit access to this document": "У вас нет прав на редактирование этого документа", "Widget": "Виджет", - "Add referenced columns": "Добавить ссылочные столбцы" + "Add referenced columns": "Добавить ссылочные столбцы", + "Reset form": "Сброс формы" }, "PermissionsWidget": { "Allow All": "Разрешить все", @@ -1249,5 +1257,8 @@ "Delete card": "Удалить карточку", "Copy anchor link": "Скопировать якорную ссылку", "Insert card": "Вставить карточку" + }, + "HiddenQuestionConfig": { + "Hidden fields": "Скрытые поля" } } From 93a8ea3f305b702cb2e746ff49e37610664d37df Mon Sep 17 00:00:00 2001 From: Alexandru-Ionut Chiuta Date: Wed, 10 Jan 2024 18:33:09 +0000 Subject: [PATCH 3/3] Translated using Weblate (Romanian) Currently translated at 100.0% (1024 of 1024 strings) Translation: Grist/client Translate-URL: https://hosted.weblate.org/projects/grist/client/ro/ --- static/locales/ro.client.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/locales/ro.client.json b/static/locales/ro.client.json index dcdd839d..23a40406 100644 --- a/static/locales/ro.client.json +++ b/static/locales/ro.client.json @@ -783,7 +783,8 @@ "Code View": "Vizualizare cod", "Return to viewing as yourself": "Reveniți la vizualizarea ca dvs", "Raw Data": "Date neprelucrate", - "Document History": "Istoricul documentelor" + "Document History": "Istoricul documentelor", + "API Console": "Consola API" }, "menus": { "Reference List": "Referință multiplă",