(core) updates from grist-core

This commit is contained in:
Paul Fitzpatrick
2022-02-21 13:44:13 -05:00
70 changed files with 91 additions and 91 deletions

View File

@@ -99,7 +99,7 @@ function makePermissionSet(bits: PermissionKey[], makeValue: (bit: PermissionKey
return pset;
}
// Helper for a tick (checkmark) icon, replacing it with an equialent space when not shown.
// Helper for a tick (checkmark) icon, replacing it with an equivalent space when not shown.
function tick(show: boolean) {
return show ? menuIcon('Tick') : cssMenuIconSpace();
}

View File

@@ -158,7 +158,7 @@ function BaseView(gristDoc, viewSectionModel, options) {
this._isLoading = ko.observable(true);
this._pendingCursorPos = this.viewSection.lastCursorPos;
// Initialize the cursor with the previous cursor position indicies, if they exist.
// Initialize the cursor with the previous cursor position indices, if they exist.
console.log("%s BaseView viewSection %s (%s) lastCursorPos %s", this._debugName, this.viewSection.getRowId(),
this.viewSection.table().tableId(), JSON.stringify(this.viewSection.lastCursorPos));
this.cursor = this.autoDispose(Cursor.create(null, this, this.viewSection.lastCursorPos));

View File

@@ -97,7 +97,7 @@ export class ColumnTransform extends Disposable {
}
/**
* Helper called by contructor to prepare the column transform.
* Helper called by constructor to prepare the column transform.
* @param {String} colType: A pure or complete type for the transformed column.
*/
public async prepare(optColType?: string) {
@@ -156,7 +156,7 @@ export class ColumnTransform extends Disposable {
}
/**
* Adds the tranform column and returns its colRef. May be overridden by derived classes to create
* Adds the transform column and returns its colRef. May be overridden by derived classes to create
* differently-prepared transform columns.
* @param {String} colType: A pure or complete type for the transformed column.
*/

View File

@@ -77,7 +77,7 @@ export class Drafts extends Disposable {
editor.setState(draft.state);
}
// We don't need the draft any more.
// If user presses escape one more time it will be crated
// If user presses escape one more time it will be created
// once again
storage.clear();
// Close the notification

View File

@@ -610,7 +610,7 @@ GridView.prototype.assignCursor = function(elem, elemType) {
};
/**
* Schedules cursor assignement to happen at end of tick. Calling `preventAssignCursor()` before
* Schedules cursor assignment to happen at end of tick. Calling `preventAssignCursor()` before
* prevents assignment to happen. This was added to prevent cursor assignment on a `context click`
* on a cell that is already selected.
*/

View File

@@ -351,7 +351,7 @@ export class Importer extends DisposableWithEvents {
destTableId,
destCols: transformFields.map<TransformColumn>((field) => ({
label: field.label(),
colId: destTableId ? field.colId() : null, // if inserting into new table, colId isnt defined
colId: destTableId ? field.colId() : null, // if inserting into new table, colId isn't defined
type: field.column().type(),
formula: field.column().formula()
})),

View File

@@ -215,7 +215,7 @@ RecordLayout.prototype.saveLayoutSpec = async function(layoutSpec) {
var addedPositions = [];
// Recursively process all layoutBoxes in the spec. Sets up bookkeeping arrays for
// exisiting fields and added fields for new/hidden cols from which the action bundle will
// existing fields and added fields for new/hidden cols from which the action bundle will
// be created.
function processBox(spec) {
// "empty" is a temporary placeholder used by LayoutEditor, and not a valid leaf.

View File

@@ -3,7 +3,7 @@
* of a plugin.
*
* A plugin's safeBrowser component is made of one main entry point (the javascript files declares
* in the manifest), html files and any ressources included by the html files (css, scripts, images
* in the manifest), html files and any resources included by the html files (css, scripts, images
* ...). The main script is the main entry point which uses the Grist API to render the views,
* communicate with them en dispose them.
*
@@ -18,13 +18,13 @@
*
* The grist API available to safeBrowser components is implemented in `app/plugin/PluginImpl.ts`.
*
* All the safeBrowser's component ressources, including the main script, the html files and any
* other ressources needed by the views, should be placed within one plugins' subfolder, and Grist
* All the safeBrowser's component resources, including the main script, the html files and any
* other resources needed by the views, should be placed within one plugins' subfolder, and Grist
* should serve only this folder. However, this is not yet implemented and is left as a TODO, as of
* now the whole plugin's folder is served.
*
*/
// Todo: plugin ressources should not be made available on the server by default, but only after
// Todo: plugin resources should not be made available on the server by default, but only after
// activation.
// tslint:disable:max-classes-per-file
@@ -131,7 +131,7 @@ export class SafeBrowser extends BaseComponent {
// it's ok to leave it for now: (1) fixing this would require (yet) another refactoring of
// SafeBrowser and (2) at this point it is not sure wether we want to keep `render()` in the
// future (we could as well directly register contribution using files directly in the
// manifest), and (3) plugins are only developped by us, we only have to remember that using
// manifest), and (3) plugins are only developed by us, we only have to remember that using
// `render()` is only supported from within the main process (which cover all our use cases so
// far).
}

View File

@@ -1,4 +1,4 @@
// TODO: add remaining Disposable methode
// TODO: add remaining Disposable method
export abstract class Disposable {
public static create<T extends new (...args: any[]) => any>(
this: T, ...args: ConstructorParameters<T>): InstanceType<T>;

View File

@@ -146,7 +146,7 @@ export async function uploadFiles(
}
/**
* Fetches ressource from a url and returns an UploadResult. Tries to fetch from the client and
* Fetches resource from a url and returns an UploadResult. Tries to fetch from the client and
* upload the file to the server. If unsuccessful, tries to fetch directly from the server. In both
* case, it guesses the name of the file based on the response's content-type and the url.
*/

View File

@@ -34,7 +34,7 @@ export class DocData extends BaseDocData {
/**
* Constructor for DocData.
* @param {Object} docComm: A map of server methods availble on this document.
* @param {Object} docComm: A map of server methods available on this document.
* @param {Object} metaTableData: A map from tableId to table data, presented as an action,
* equivalent to BulkAddRecord, i.e. ["TableData", tableId, rowIds, columnValues].
*/

View File

@@ -74,7 +74,7 @@ function getRecords(table: TreeTableData) {
return fixIndents(records);
}
// The fixIndents function returns a copy of records with the garantee the .indentation starts at 0
// The fixIndents function returns a copy of records with the guarantee the .indentation starts at 0
// and can only increase one step at a time (note that it is however permitted to decrease several
// level at a time). This is useful to build a model for the tree view.
export function fixIndents(records: TreeRecord[]) {

View File

@@ -20,7 +20,7 @@ export class UserError extends Error {
}
/**
* This error causes Notifer to show the message with an upgrade link.
* This error causes Notifier to show the message with an upgrade link.
*/
export class NeedUpgradeError extends Error {
public name: string = 'NeedUpgradeError';

View File

@@ -20,7 +20,7 @@ const testId = makeTestId('test-apikey-');
* ApiKey component shows an api key with controls to change it. Expects `options.apiKey` the api
* key and shows it if value is truthy along with a 'Delete' button that triggers the
* `options.onDelete` callback. When `options.apiKey` is falsy, hides it and show a 'Create' button
* that triggers the `options.onCreate` callback. It is the responsability of the caller to update
* that triggers the `options.onCreate` callback. It is the responsibility of the caller to update
* the `options.apiKey` to its new value.
*/
export class ApiKey extends Disposable {

View File

@@ -56,7 +56,7 @@ function createMainPage(appModel: AppModel, appObj: App) {
} else if (err && (err.status === 401 || err.status === 403)) {
// Generally give access denied error.
// The exception is for document pages, where we want to allow access to documents
// shared publically without being shared specifically with the current user.
// shared publicly without being shared specifically with the current user.
if (appModel.pageType.get() !== 'doc') {
return createForbiddenPage(appModel);
}

View File

@@ -207,7 +207,7 @@ export function columnFilterMenu(owner: IDisposableOwner, opts: IFilterMenuOptio
* On user clicks, if checkbox is checked, it does uncheck all the values, and if the
* `switchFilterType` is true it also converts the filter into an inclusion filter. But if the
* checkbox is unchecked, or in the Indeterminate state, it does check all the values, and if the
* `switchFilterType` is true it also converts the filter into an exlusion filter.
* `switchFilterType` is true it also converts the filter into an exclusion filter.
*/
function buildSummary(label: string|Computed<string>, values: Array<[CellValue, IFilterCount]>,
switchFilterType: boolean, model: ColumnFilterMenuModel) {

View File

@@ -53,7 +53,7 @@ export function openFilePicker(options: FileDialogOptions): Promise<File[]> {
/**
* Opens the file picker dialog. If files are selected, calls the provided callback.
* If no files are seleced, will call the callback with an empty list if possible, or more
* If no files are selected, will call the callback with an empty list if possible, or more
* typically not call it at all.
*/
export function open(options: FileDialogOptions, callback: FilesCB): void {

View File

@@ -194,7 +194,7 @@ export class MFAConfig extends Disposable {
return [
this._buildSecurityVerificationForm(ctl, {onSuccess: async (hadSecondStep) => {
/**
* If method was unspecified, but second step verification occured, we know that
* If method was unspecified, but second step verification occurred, we know that
* the client doesn't have up-to-date 2FA preferences. Close the modal, and force
* a refresh of UserMFAPreferences, which should cause the correct buttons to be
* rendered once preferences are loaded.

View File

@@ -90,7 +90,7 @@ function allowOtherOrgs(doc: Document, app: AppModel): boolean {
/**
* Ask user for the desination and new name, and make a copy of the doc using those.
* Ask user for the destination and new name, and make a copy of the doc using those.
*/
export async function makeCopy(doc: Document, app: AppModel, modalTitle: string): Promise<void> {
if (!app.currentValidUser) {

View File

@@ -75,7 +75,7 @@ function buildDomFromTable(pagesTable: MetaTableModel<PageRec>, activeDoc: Grist
}
// if user removes a primary view, let's confirm first, because this will remove the
// corresponsing table and also all pages that are using this table.
// corresponding table and also all pages that are using this table.
// TODO: once we have raw table view, removing page should remove just the view (not the
// table), but for now this is the only way to remove a table in the newui.
actions.onRemove = () => confirmModal(

View File

@@ -91,7 +91,7 @@ const testId = makeTestId('test-treeview-');
* item and by highlighting its parent. In order to ensure data consistency, the component prevents
* dropping an item within its own children. If the cursor leaves the component during a drag, all
* such visual artifact (handle, target and target's parent) are hidden, but if the cursor re-enter
* the componet without releasing the mouse, they will show again allowing user to resume dragging.
* the component without releasing the mouse, they will show again allowing user to resume dragging.
*/
// note to self: in the future the model will be updated by the server, which could cause conflicts
// if the user is dragging at the same time. It could be simpler to freeze the model and to differ
@@ -125,7 +125,7 @@ export class TreeViewComponent extends Disposable {
// While building dom we add listeners to the children of all tree nodes to watch for changes
// and call this._update. Hence, repeated calls to this._update is likely to add or remove
// listeners to the observable that triggered the udpate which is not supported by grainjs and
// listeners to the observable that triggered the update which is not supported by grainjs and
// could fail (possibly infinite loop). Debounce allows for several change to resolve to a
// single update.
this._update = debounce(this._update.bind(this), 0, {leading: false});
@@ -230,7 +230,7 @@ export class TreeViewComponent extends Disposable {
// Update this._childrenDom with the content of the new tree. Its rebuilds entirely the tree of
// items and reuses dom from the old content for each item that were already part of the old
// tree. Then takes care of disposing dom for thoses items that were removed from the old tree.
// tree. Then takes care of disposing dom for those items that were removed from the old tree.
private _update() {
this._childrenDom.set(this._buildChildren(this._model.get().children(), 0));

View File

@@ -423,7 +423,7 @@ function buildCheckbox(...args: IDomArgs<HTMLInputElement>) {
);
}
// helper to find checkboxes withing a draggable list. This assumes that checkboxes are the only
// helper to find checkboxes within a draggable list. This assumes that checkboxes are the only
// <input> element in draggableElement.
function findCheckboxes(draggableElement: Element): NodeListOf<HTMLInputElement> {
return draggableElement.querySelectorAll<HTMLInputElement>('input');

View File

@@ -1,5 +1,5 @@
/**
* CSS Variables. To use in your web appication, add `cssRootVars` to the class list for your app's
* CSS Variables. To use in your web application, add `cssRootVars` to the class list for your app's
* root node, typically `<body>`.
*
* The fonts used attempt to default to system fonts as described here:

View File

@@ -20,7 +20,7 @@ const cssWrapper = styled('div', `
`);
export const cssLabelText = styled(rawTextInput, `
/* Reset apperance */
/* Reset appearance */
-webkit-appearance: none;
-moz-appearance: none;
padding: 0;

View File

@@ -22,7 +22,7 @@ export interface IModalControl {
// Returns true if closed, false if closing was prevented.
closeAndWait(): Promise<boolean>;
// Prevents closing, if close has been called ans is pending. No-op otherwise.
// Prevents closing, if close has been called and is pending. No-op otherwise.
preventClose(): void;
// Wraps the passed-in function, so that closing is delayed while the function is running. If

View File

@@ -64,7 +64,7 @@ export function buildPageDom(name: Observable<string>, actions: PageActions, ...
dom.on('click', (ev) => { ev.stopPropagation(); ev.preventDefault(); })
),
// Note that we don't pass extra args when renaming is on, because they usually includes
// mouse event handlers interferring with input editor and yields wrong behavior on
// mouse event handlers interfering with input editor and yields wrong behavior on
// firefox.
) :
cssPageItem(

View File

@@ -35,7 +35,7 @@ BaseEditor.prototype.getCellValue = function() {
};
/**
* Used if an editor needs preform any actions before a save
* Used if an editor needs perform any actions before a save
*/
BaseEditor.prototype.prepForSave = function() {
// No-op by default.

View File

@@ -430,9 +430,9 @@ export function openFormulaEditor(options: {
editor.attach(refElem);
// When formula is empty enter formula-editing mode (highlight formula icons; click on a column inserts its ID).
// This function is used for primarily for switching between diffrent column behaviors, so we want to enter full
// This function is used for primarily for switching between different column behaviors, so we want to enter full
// edit mode right away.
// TODO: consider converting it to parameter, when this will be used in diffrent scenarios.
// TODO: consider converting it to parameter, when this will be used in different scenarios.
if (!column.formula()) {
field.editingFormula(true);
}

View File

@@ -91,7 +91,7 @@ export abstract class NewBaseEditor extends Disposable {
public abstract getCellValue(): CellValue;
/**
* Used if an editor needs preform any actions before a save
* Used if an editor needs perform any actions before a save
*/
public prepForSave(): void | Promise<void> {
// No-op by default.