mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Admin Panel and InstallAdmin class to identify installation admins.
Summary: - Add InstallAdmin class to identify users who can manage Grist installation. This is overridable by different Grist flavors (e.g. different in SaaS). It generalizes previous logic used to decide who can control Activation settings (e.g. enable telemetry). - Implement a basic Admin Panel at /admin, and move items previously in the "Support Grist" page into the "Support Grist" section of the Admin Panel. - Replace "Support Grist" menu items with "Admin Panel" and show only to admins. - Add "Support Grist" links to Github sponsorship to user-account menu. - Add "Support Grist" button to top-bar, which - for admins, replaces the previous "Contribute" button and reopens the "Support Grist / opt-in to telemetry" nudge (unchanged) - for everyone else, links to Github sponsorship - in either case, user can dismiss it. Test Plan: Shuffled some test cases between Support Grist and the new Admin Panel, and added some new cases. Reviewers: jarek, paulfitz Reviewed By: jarek, paulfitz Differential Revision: https://phab.getgrist.com/D4194
This commit is contained in:
@@ -21,7 +21,6 @@ import {reportWarning} from 'app/client/models/errors';
|
||||
import {IAppError} from 'app/client/models/NotifyModel';
|
||||
import {GristLoadConfig} from 'app/common/gristUrls';
|
||||
import {timeFormat} from 'app/common/timeFormat';
|
||||
import {ActiveSessionInfo} from 'app/common/UserAPI';
|
||||
import * as version from 'app/common/version';
|
||||
import {dom} from 'grainjs';
|
||||
import identity = require('lodash/identity');
|
||||
@@ -249,7 +248,7 @@ function getBeaconUserObj(appModel: AppModel|null): IUserObj|null {
|
||||
if (!appModel) { return null; }
|
||||
|
||||
// ActiveSessionInfo["user"] includes optional helpScoutSignature too.
|
||||
const user = appModel.currentValidUser as ActiveSessionInfo["user"]|null;
|
||||
const user = appModel.currentValidUser;
|
||||
|
||||
// For anon user, don't attempt to identify anything. Even the "company" field (when anon on a
|
||||
// team doc) isn't useful, because the user may be external to the company.
|
||||
|
||||
4
app/client/lib/imports.d.ts
vendored
4
app/client/lib/imports.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
import * as AccountPageModule from 'app/client/ui/AccountPage';
|
||||
import * as ActivationPageModule from 'app/client/ui/ActivationPage';
|
||||
import * as BillingPageModule from 'app/client/ui/BillingPage';
|
||||
import * as SupportGristPageModule from 'app/client/ui/SupportGristPage';
|
||||
import * as AdminPanelModule from 'app/client/ui/AdminPanel';
|
||||
import * as GristDocModule from 'app/client/components/GristDoc';
|
||||
import * as ViewPane from 'app/client/components/ViewPane';
|
||||
import * as UserManagerModule from 'app/client/ui/UserManager';
|
||||
@@ -15,7 +15,7 @@ export type MomentTimezone = typeof momentTimezone;
|
||||
export function loadAccountPage(): Promise<typeof AccountPageModule>;
|
||||
export function loadActivationPage(): Promise<typeof ActivationPageModule>;
|
||||
export function loadBillingPage(): Promise<typeof BillingPageModule>;
|
||||
export function loadSupportGristPage(): Promise<typeof SupportGristPageModule>;
|
||||
export function loadAdminPanel(): Promise<typeof AdminPanelModule>;
|
||||
export function loadGristDoc(): Promise<typeof GristDocModule>;
|
||||
export function loadMomentTimezone(): Promise<MomentTimezone>;
|
||||
export function loadPlotly(): Promise<PlotlyType>;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
exports.loadAccountPage = () => import('app/client/ui/AccountPage' /* webpackChunkName: "AccountPage" */);
|
||||
exports.loadActivationPage = () => import('app/client/ui/ActivationPage' /* webpackChunkName: "ActivationPage" */);
|
||||
exports.loadBillingPage = () => import('app/client/ui/BillingPage' /* webpackChunkName: "BillingModule" */);
|
||||
exports.loadSupportGristPage = () => import('app/client/ui/SupportGristPage' /* webpackChunkName: "SupportGristPage" */);
|
||||
exports.loadAdminPanel = () => import('app/client/ui/AdminPanel' /* webpackChunkName: "AdminPanel" */);
|
||||
exports.loadGristDoc = () => import('app/client/components/GristDoc' /* webpackChunkName: "GristDoc" */);
|
||||
// When importing this way, the module is under the "default" member, not sure why (maybe
|
||||
// esbuild-loader's doing).
|
||||
|
||||
Reference in New Issue
Block a user