(core) Add additional org items to AppHeader

Summary:
Adds links to manage team and go to billing account in
the org menu (opened by clicking the dropdown in the
top-left corner of Grist). Tweaks some wording of items
in both AppHeader and AccountWidget, and adds a link
to create a new team site to the Site Switcher in both
menus.

Also tweaks the UI of UserManager by adding
an animation when the manager is opened from the
doc access dialog.

Test Plan: Browser tests.

Reviewers: dsagal

Reviewed By: dsagal

Subscribers: dsagal

Differential Revision: https://phab.getgrist.com/D3121
This commit is contained in:
George Gevoian
2021-11-05 07:47:17 -07:00
parent 1178d35237
commit 59699bf446
8 changed files with 171 additions and 64 deletions

View File

@@ -5,7 +5,8 @@ import {ShareAnnotations, ShareAnnotator} from 'app/common/ShareAnnotator';
import {normalizeEmail} from 'app/common/emails';
import {GristLoadConfig} from 'app/common/gristUrls';
import * as roles from 'app/common/roles';
import {ANONYMOUS_USER_EMAIL, EVERYONE_EMAIL, PermissionData, PermissionDelta, UserAPI} from 'app/common/UserAPI';
import {ANONYMOUS_USER_EMAIL, EVERYONE_EMAIL, Organization, PermissionData, PermissionDelta,
UserAPI, Workspace} from 'app/common/UserAPI';
import {getRealAccess} from 'app/common/UserAPI';
import {computed, Computed, Disposable, obsArray, ObsArray, observable, Observable} from 'grainjs';
import some = require('lodash/some');
@@ -42,6 +43,8 @@ export interface UserManagerModel {
export type ResourceType = 'organization'|'workspace'|'document';
export type Resource = Organization|Workspace|Document;
export interface IEditableMember {
id: number; // Newly invited members do not have ids and are represented by -1
name: string;
@@ -116,8 +119,6 @@ export class UserManagerModelImpl extends Disposable implements UserManagerModel
public isOrg: boolean = this.resourceType === 'organization';
private _shareAnnotator?: ShareAnnotator;
// Checks if any members were added/removed/changed, if the max inherited role changed or if the
// anonymous access setting changed to enable the confirm button to write changes to the server.
public readonly isAnythingChanged: Computed<boolean> = this.autoDispose(computed<boolean>((use) => {
@@ -128,6 +129,8 @@ export class UserManagerModelImpl extends Disposable implements UserManagerModel
(this.publicMember ? isMemberChangedFn(this.publicMember) : false);
}));
private _shareAnnotator?: ShareAnnotator;
constructor(
public initData: PermissionData,
public resourceType: ResourceType,