mirror of
				https://github.com/gristlabs/grist-core.git
				synced 2025-06-13 20:53:59 +00:00 
			
		
		
		
	(core) updates from grist-core
This commit is contained in:
		
						commit
						f490854324
					
				@ -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}*.
 | 
			
		||||
 | 
			
		||||
@ -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<number> {
 | 
			
		||||
    // 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),
 | 
			
		||||
      ],
 | 
			
		||||
    ];
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -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'))),
 | 
			
		||||
  ];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -615,7 +615,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 {
 | 
			
		||||
 | 
			
		||||
@ -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",
 | 
			
		||||
 | 
			
		||||
@ -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": "ОПИСАНИЕ"
 | 
			
		||||
 | 
			
		||||
@ -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] }), [
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user