Skip to content

Commit

Permalink
(core) Fix more tests: bundleSize and Embed
Browse files Browse the repository at this point in the history
Summary:
1. Unclear why Embed fails often. Locally, it fails for me every time, and
   this tweak makes it pass (while still keeping the test useful).
2. Reduced back main bundle's size by removing dependency of some common
   elements on the full AdminPanel. Updated expected size of errorPages
   bundle to the new reduced size.

Test Plan: No changes to functionality; relying on existing tests to verify that.

Reviewers: jordigh

Reviewed By: jordigh

Subscribers: georgegevoian, jordigh

Differential Revision: https://phab.getgrist.com/D4315
  • Loading branch information
dsagal committed Aug 9, 2024
1 parent 773588f commit 4ed90fa
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/client/ui/AccountWidget.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {AppModel} from 'app/client/models/AppModel';
import {DocPageModel} from 'app/client/models/DocPageModel';
import {getLoginOrSignupUrl, getLoginUrl, getLogoutUrl, getSignupUrl, urlState} from 'app/client/models/gristUrlState';
import {getAdminPanelName} from 'app/client/ui/AdminPanel';
import {getAdminPanelName} from 'app/client/ui/AdminPanelName';
import {manageTeamUsers} from 'app/client/ui/OpenUserManager';
import {createUserImage} from 'app/client/ui/UserImage';
import * as viewport from 'app/client/ui/viewport';
Expand Down
6 changes: 1 addition & 5 deletions app/client/ui/AdminPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,10 @@ import * as version from 'app/common/version';
import {Computed, Disposable, dom, IDisposable,
IDisposableOwner, MultiHolder, Observable, styled} from 'grainjs';
import {AdminSection, AdminSectionItem, HidableToggle} from 'app/client/ui/AdminPanelCss';
import {getAdminPanelName} from 'app/client/ui/AdminPanelName';

const t = makeT('AdminPanel');

// Translated "Admin Panel" name, made available to other modules.
export function getAdminPanelName() {
return t("Admin Panel");
}

export class AdminPanel extends Disposable {
private _supportGrist = SupportGristPage.create(this, this._appModel);
private _toggleEnterprise = ToggleEnterpriseWidget.create(this);
Expand Down
11 changes: 11 additions & 0 deletions app/client/ui/AdminPanelName.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Separated out into its own file because this is used in several modules, but we'd like to avoid
// pulling in the full AdminPanel into their bundle.

import {makeT} from 'app/client/lib/localization';

const t = makeT('AdminPanel');

// Translated "Admin Panel" name, made available to other modules.
export function getAdminPanelName() {
return t("Admin Panel");
}
2 changes: 1 addition & 1 deletion app/client/ui/HomeLeftPane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {reportError} from 'app/client/models/AppModel';
import {docUrl, urlState} from 'app/client/models/gristUrlState';
import {HomeModel} from 'app/client/models/HomeModel';
import {getWorkspaceInfo, workspaceName} from 'app/client/models/WorkspaceInfo';
import {getAdminPanelName} from 'app/client/ui/AdminPanel';
import {getAdminPanelName} from 'app/client/ui/AdminPanelName';
import {addNewButton, cssAddNewButton} from 'app/client/ui/AddNewButton';
import {docImport, importFromPlugin} from 'app/client/ui/HomeImports';
import {
Expand Down

0 comments on commit 4ed90fa

Please sign in to comment.