2023-05-01 18:24:23 +00:00
|
|
|
import {getWelcomeHomeUrl, urlState} from 'app/client/models/gristUrlState';
|
2021-08-18 17:49:34 +00:00
|
|
|
import {getTheme} from 'app/client/ui/CustomThemes';
|
2020-10-02 15:10:00 +00:00
|
|
|
import {cssLeftPane} from 'app/client/ui/PagePanels';
|
2024-10-07 14:54:03 +00:00
|
|
|
import {colors, theme, vars} from 'app/client/ui2018/cssVars';
|
2020-10-02 15:10:00 +00:00
|
|
|
import * as version from 'app/common/version';
|
(core) make Grist easier to run with a single server
Summary:
This makes many small changes so that Grist is less fussy to run as a single instance behind a reverse proxy. Some users had difficulty with the self-connections Grist would make, due to internal network setup, and since these are unnecessary in any case in this scenario, they are now optimized away. Likewise some users had difficulties related to doc worker urls, which are now also optimized away. With these changes, users should be able to get a lot further on first try, at least far enough to open and edit documents.
The `GRIST_SINGLE_ORG` setting was proving a bit confusing, since it appeared to only work when set to `docs`. This diff
adds a check for whether the specified org exists, and if not, it creates it. This still depends on having a user email to make as the owner of the team, so there could be remaining difficulties there.
Test Plan: tested manually with nginx
Reviewers: jarek
Reviewed By: jarek
Differential Revision: https://phab.getgrist.com/D3299
2022-03-02 19:07:26 +00:00
|
|
|
import {menu, menuItem, menuItemLink, menuSubHeader} from 'app/client/ui2018/menus';
|
2023-07-26 22:31:02 +00:00
|
|
|
import {commonUrls} from 'app/common/gristUrls';
|
|
|
|
import {getOrgName, isTemplatesOrg, Organization} from 'app/common/UserAPI';
|
2021-08-18 17:49:34 +00:00
|
|
|
import {AppModel} from 'app/client/models/AppModel';
|
|
|
|
import {icon} from 'app/client/ui2018/icons';
|
2021-11-05 14:47:17 +00:00
|
|
|
import {DocPageModel} from 'app/client/models/DocPageModel';
|
|
|
|
import * as roles from 'app/common/roles';
|
2022-06-03 14:58:07 +00:00
|
|
|
import {manageTeamUsersApp} from 'app/client/ui/OpenUserManager';
|
(core) make Grist easier to run with a single server
Summary:
This makes many small changes so that Grist is less fussy to run as a single instance behind a reverse proxy. Some users had difficulty with the self-connections Grist would make, due to internal network setup, and since these are unnecessary in any case in this scenario, they are now optimized away. Likewise some users had difficulties related to doc worker urls, which are now also optimized away. With these changes, users should be able to get a lot further on first try, at least far enough to open and edit documents.
The `GRIST_SINGLE_ORG` setting was proving a bit confusing, since it appeared to only work when set to `docs`. This diff
adds a check for whether the specified org exists, and if not, it creates it. This still depends on having a user email to make as the owner of the team, so there could be remaining difficulties there.
Test Plan: tested manually with nginx
Reviewers: jarek
Reviewed By: jarek
Differential Revision: https://phab.getgrist.com/D3299
2022-03-02 19:07:26 +00:00
|
|
|
import {maybeAddSiteSwitcherSection} from 'app/client/ui/SiteSwitcher';
|
2023-07-26 22:31:02 +00:00
|
|
|
import {Computed, Disposable, dom, DomContents, styled} from 'grainjs';
|
2022-10-28 16:11:08 +00:00
|
|
|
import {makeT} from 'app/client/lib/localization';
|
2023-06-06 17:08:50 +00:00
|
|
|
import {getGristConfig} from 'app/common/urlUtils';
|
2024-10-07 14:54:03 +00:00
|
|
|
import {makeTestId} from 'app/client/lib/domUtils';
|
2024-10-11 13:37:53 +00:00
|
|
|
import {createUserImage, cssUserImage} from 'app/client/ui/UserImage';
|
2022-10-28 16:11:08 +00:00
|
|
|
|
|
|
|
const t = makeT('AppHeader');
|
2024-10-07 14:54:03 +00:00
|
|
|
const testId = makeTestId('test-dm-');
|
2021-08-18 17:49:34 +00:00
|
|
|
|
2022-06-03 14:58:07 +00:00
|
|
|
// Maps a name of a Product (from app/gen-server/entity/Product.ts) to a tag (pill) to show next
|
|
|
|
// to the org name.
|
|
|
|
const productPills: {[name: string]: string|null} = {
|
|
|
|
// TODO We don't label paid team plans with a tag yet, but we should label as "Pro" once we
|
|
|
|
// update our pricing pages to refer to paid team plans as Pro plans.
|
|
|
|
"professional": null, // Deprecated but used in development.
|
|
|
|
"team": null, // Used for the paid team plans.
|
|
|
|
"teamFree": "Free", // The new free team plan.
|
|
|
|
// Other plans are either personal, or grandfathered, or for testing.
|
|
|
|
};
|
2021-08-18 17:49:34 +00:00
|
|
|
|
2023-07-26 22:31:02 +00:00
|
|
|
interface AppLogoOrgNameAndLink {
|
|
|
|
name: string;
|
|
|
|
link: AppLogoLink;
|
|
|
|
org?: string;
|
|
|
|
href?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
type AppLogoLink = AppLogoOrgDomain | AppLogoHref;
|
|
|
|
|
|
|
|
interface AppLogoOrgDomain {
|
|
|
|
type: 'domain';
|
|
|
|
domain: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface AppLogoHref {
|
|
|
|
type: 'href';
|
|
|
|
href: string;
|
|
|
|
}
|
|
|
|
|
2021-08-18 17:49:34 +00:00
|
|
|
export class AppHeader extends Disposable {
|
2023-07-26 22:31:02 +00:00
|
|
|
private _currentOrg = this._appModel.currentOrg;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The name and link of the site shown next to the logo.
|
|
|
|
*
|
|
|
|
* The last visited site is used, if known. Otherwise, the current site is used.
|
|
|
|
*/
|
|
|
|
private _appLogoOrg = Computed.create<AppLogoOrgNameAndLink>(this, (use) => {
|
|
|
|
const availableOrgs = use(this._appModel.topAppModel.orgs);
|
|
|
|
const currentOrgName = (this._appModel.currentOrgName ||
|
|
|
|
(this._docPageModel && use(this._docPageModel.currentOrgName))) ?? '';
|
|
|
|
const lastVisitedOrgDomain = use(this._appModel.lastVisitedOrgDomain);
|
|
|
|
return this._getAppLogoOrgNameAndLink({availableOrgs, currentOrgName, lastVisitedOrgDomain});
|
|
|
|
});
|
|
|
|
|
|
|
|
private _appLogoOrgName = Computed.create(this, this._appLogoOrg, (_use, {name}) => name);
|
|
|
|
|
|
|
|
private _appLogoOrgLink = Computed.create(this, this._appLogoOrg, (_use, {link}) => link);
|
|
|
|
|
2024-10-07 14:54:03 +00:00
|
|
|
constructor(
|
|
|
|
private _appModel: AppModel,
|
|
|
|
private _docPageModel?: DocPageModel|null) {
|
2021-08-18 17:49:34 +00:00
|
|
|
super();
|
|
|
|
}
|
|
|
|
|
|
|
|
public buildDom() {
|
2024-10-07 14:54:03 +00:00
|
|
|
// Check if we have a custom image.
|
|
|
|
const customImage = this._appModel.currentOrg?.orgPrefs?.customLogoUrl;
|
|
|
|
|
|
|
|
const variant = () => [cssUserImage.cls('-border'), cssUserImage.cls('-square')];
|
|
|
|
|
|
|
|
// Personal avatar is shown only for logged in users.
|
|
|
|
const personalAvatar = () => !this._appModel.currentValidUser
|
|
|
|
? cssAppLogo.cls('-grist-logo')
|
|
|
|
: createUserImage(this._appModel.currentValidUser, 'medium', variant());
|
|
|
|
|
|
|
|
// Team avatar is shown only for team sites (even for anonymous users).
|
2024-10-11 13:37:53 +00:00
|
|
|
const teamAvatar = () => cssAppLogo.cls('-grist-logo');
|
2024-10-07 14:54:03 +00:00
|
|
|
|
|
|
|
// Depending on site the avatar is either personal or team.
|
|
|
|
const avatar = () => this._appModel.isPersonal
|
|
|
|
? personalAvatar()
|
|
|
|
: teamAvatar();
|
|
|
|
|
|
|
|
// Show the image if it's set, otherwise show the avatar.
|
|
|
|
const image = () => customImage
|
|
|
|
? dom.style('background-image', customImage ? `url(${customImage})` : '')
|
|
|
|
: avatar();
|
|
|
|
|
|
|
|
|
|
|
|
// Maybe we should show custom logo and make it wide (without site switcher).
|
2022-09-06 01:51:57 +00:00
|
|
|
const productFlavor = getTheme(this._appModel.topAppModel.productFlavor);
|
2024-10-07 14:54:03 +00:00
|
|
|
const content = () => productFlavor.wideLogo
|
|
|
|
? null
|
|
|
|
: image();
|
|
|
|
|
|
|
|
const title = `Version ${version.version}` +
|
|
|
|
((version.gitcommit as string) !== 'unknown' ? ` (${version.gitcommit})` : '');
|
2021-08-18 17:49:34 +00:00
|
|
|
|
|
|
|
return cssAppHeader(
|
2022-09-06 01:51:57 +00:00
|
|
|
cssAppHeader.cls('-widelogo', productFlavor.wideLogo || false),
|
2024-10-07 14:54:03 +00:00
|
|
|
cssAppHeaderBox(
|
|
|
|
dom.domComputed(this._appLogoOrgLink, orgLink => cssAppLogo(
|
|
|
|
// Show version when hovering over the application icon.
|
|
|
|
// Include gitcommit when known. Cast version.gitcommit since, depending
|
|
|
|
// on how Grist is compiled, tsc may believe it to be a constant and
|
|
|
|
// believe that testing it is unnecessary.
|
|
|
|
{title},
|
|
|
|
this._setHomePageUrl(orgLink),
|
|
|
|
content(),
|
|
|
|
testId('logo'),
|
|
|
|
)),
|
|
|
|
this._buildOrgLinkOrMenu(),
|
|
|
|
),
|
2023-07-26 22:31:02 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
private _buildOrgLinkOrMenu() {
|
2023-09-19 05:31:22 +00:00
|
|
|
const {currentValidUser, isTemplatesSite} = this._appModel;
|
|
|
|
const {deploymentType} = getGristConfig();
|
|
|
|
if (deploymentType === 'saas' && !currentValidUser && isTemplatesSite) {
|
|
|
|
// When signed out and on the templates site (in SaaS Grist), link to the templates page.
|
2023-07-26 22:31:02 +00:00
|
|
|
return cssOrgLink(
|
2024-10-07 14:54:03 +00:00
|
|
|
cssOrgName(dom.text(this._appLogoOrgName), testId('orgname')),
|
2023-07-26 22:31:02 +00:00
|
|
|
{href: commonUrls.templates},
|
2024-10-07 14:54:03 +00:00
|
|
|
testId('org'),
|
2023-07-26 22:31:02 +00:00
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return cssOrg(
|
2024-10-07 14:54:03 +00:00
|
|
|
cssOrgName(dom.text(this._appLogoOrgName), testId('orgname')),
|
2023-07-26 22:31:02 +00:00
|
|
|
productPill(this._currentOrg),
|
2024-10-07 14:54:03 +00:00
|
|
|
dom.maybe(this._appLogoOrgName, () => [
|
|
|
|
cssSpacer(),
|
|
|
|
cssDropdownIcon('Dropdown'),
|
|
|
|
]),
|
2021-11-05 14:47:17 +00:00
|
|
|
menu(() => [
|
2022-07-26 17:49:35 +00:00
|
|
|
menuSubHeader(
|
2023-07-26 22:31:02 +00:00
|
|
|
this._appModel.isPersonal
|
|
|
|
? t("Personal Site") + (this._appModel.isLegacySite ? ` (${t("Legacy")})` : '')
|
|
|
|
: t("Team Site"),
|
2022-07-26 17:49:35 +00:00
|
|
|
testId('orgmenu-title'),
|
|
|
|
),
|
2022-12-06 13:57:29 +00:00
|
|
|
menuItemLink(urlState().setLinkUrl({}), t("Home Page"), testId('orgmenu-home-page')),
|
2021-08-18 17:49:34 +00:00
|
|
|
|
2021-11-05 14:47:17 +00:00
|
|
|
// Show 'Organization Settings' when on a home page of a valid org.
|
2023-07-26 22:31:02 +00:00
|
|
|
(!this._docPageModel && this._currentOrg && !this._currentOrg.owner ?
|
2024-05-17 19:14:34 +00:00
|
|
|
menuItem(() => manageTeamUsersApp({app: this._appModel}),
|
2024-05-29 18:02:00 +00:00
|
|
|
t('Manage Team'), testId('orgmenu-manage-team'),
|
2023-07-26 22:31:02 +00:00
|
|
|
dom.cls('disabled', !roles.canEditAccess(this._currentOrg.access))) :
|
2021-11-05 14:47:17 +00:00
|
|
|
// Don't show on doc pages, or for personal orgs.
|
|
|
|
null),
|
|
|
|
|
2023-06-06 17:08:50 +00:00
|
|
|
this._maybeBuildBillingPageMenuItem(),
|
|
|
|
this._maybeBuildActivationPageMenuItem(),
|
2021-08-18 17:49:34 +00:00
|
|
|
|
(core) make Grist easier to run with a single server
Summary:
This makes many small changes so that Grist is less fussy to run as a single instance behind a reverse proxy. Some users had difficulty with the self-connections Grist would make, due to internal network setup, and since these are unnecessary in any case in this scenario, they are now optimized away. Likewise some users had difficulties related to doc worker urls, which are now also optimized away. With these changes, users should be able to get a lot further on first try, at least far enough to open and edit documents.
The `GRIST_SINGLE_ORG` setting was proving a bit confusing, since it appeared to only work when set to `docs`. This diff
adds a check for whether the specified org exists, and if not, it creates it. This still depends on having a user email to make as the owner of the team, so there could be remaining difficulties there.
Test Plan: tested manually with nginx
Reviewers: jarek
Reviewed By: jarek
Differential Revision: https://phab.getgrist.com/D3299
2022-03-02 19:07:26 +00:00
|
|
|
maybeAddSiteSwitcherSection(this._appModel),
|
2021-11-05 14:47:17 +00:00
|
|
|
], { placement: 'bottom-start' }),
|
2024-10-07 14:54:03 +00:00
|
|
|
testId('org'),
|
2023-07-26 22:31:02 +00:00
|
|
|
);
|
|
|
|
}
|
2021-08-18 17:49:34 +00:00
|
|
|
}
|
2023-05-01 18:24:23 +00:00
|
|
|
|
2023-07-26 22:31:02 +00:00
|
|
|
private _setHomePageUrl(link: AppLogoLink) {
|
|
|
|
if (link.type === 'href') {
|
|
|
|
return {href: link.href};
|
2023-05-01 18:24:23 +00:00
|
|
|
} else {
|
2023-07-26 22:31:02 +00:00
|
|
|
return urlState().setLinkUrl({org: link.domain});
|
2023-05-01 18:24:23 +00:00
|
|
|
}
|
|
|
|
}
|
2023-06-06 17:08:50 +00:00
|
|
|
|
|
|
|
private _maybeBuildBillingPageMenuItem() {
|
|
|
|
const {deploymentType} = getGristConfig();
|
|
|
|
if (deploymentType !== 'saas') { return null; }
|
|
|
|
|
|
|
|
const {currentOrg} = this._appModel;
|
|
|
|
const isBillingManager = this._appModel.isBillingManager() || this._appModel.isSupport();
|
|
|
|
return currentOrg && !currentOrg.owner ?
|
|
|
|
// For links, disabling with just a class is hard; easier to just not make it a link.
|
|
|
|
// TODO weasel menus should support disabling menuItemLink.
|
|
|
|
(isBillingManager
|
|
|
|
? menuItemLink(
|
|
|
|
urlState().setLinkUrl({billing: 'billing'}),
|
2024-05-29 18:02:00 +00:00
|
|
|
t('Billing Account'),
|
2023-06-06 17:08:50 +00:00
|
|
|
testId('orgmenu-billing'),
|
|
|
|
)
|
|
|
|
: menuItem(
|
|
|
|
() => null,
|
2024-05-29 18:02:00 +00:00
|
|
|
t('Billing Account'),
|
2023-06-06 17:08:50 +00:00
|
|
|
dom.cls('disabled', true),
|
|
|
|
testId('orgmenu-billing'),
|
|
|
|
)
|
|
|
|
) :
|
|
|
|
null;
|
|
|
|
}
|
|
|
|
|
|
|
|
private _maybeBuildActivationPageMenuItem() {
|
2024-03-23 17:11:06 +00:00
|
|
|
const {deploymentType} = getGristConfig();
|
|
|
|
if (deploymentType !== 'enterprise' || !this._appModel.isInstallAdmin()) {
|
2023-06-06 17:08:50 +00:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return menuItemLink('Activation', urlState().setLinkUrl({activation: 'activation'}));
|
|
|
|
}
|
2023-07-26 22:31:02 +00:00
|
|
|
|
|
|
|
private _getAppLogoOrgNameAndLink(params: {
|
|
|
|
availableOrgs: Organization[],
|
|
|
|
currentOrgName: string,
|
|
|
|
lastVisitedOrgDomain: string|null,
|
|
|
|
}): AppLogoOrgNameAndLink {
|
|
|
|
const {
|
|
|
|
currentValidUser,
|
|
|
|
isTemplatesSite,
|
|
|
|
} = this._appModel;
|
2023-09-19 05:31:22 +00:00
|
|
|
const {deploymentType} = getGristConfig();
|
|
|
|
if (deploymentType === 'saas' && !currentValidUser && isTemplatesSite) {
|
|
|
|
// When signed out and on the templates site (in SaaS Grist), link to the templates page.
|
2023-07-26 22:31:02 +00:00
|
|
|
return {
|
|
|
|
name: t('Grist Templates'),
|
|
|
|
link: {
|
|
|
|
type: 'href',
|
|
|
|
href: commonUrls.templates,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
const {availableOrgs, currentOrgName, lastVisitedOrgDomain} = params;
|
|
|
|
if (lastVisitedOrgDomain) {
|
|
|
|
const lastVisitedOrg = availableOrgs.find(({domain}) => domain === lastVisitedOrgDomain);
|
|
|
|
if (lastVisitedOrg) {
|
|
|
|
return {
|
|
|
|
name: getOrgName(lastVisitedOrg),
|
|
|
|
link: {
|
|
|
|
type: 'domain',
|
|
|
|
domain: lastVisitedOrgDomain,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
name: currentOrgName ?? '',
|
|
|
|
link: {
|
|
|
|
type: 'href',
|
|
|
|
href: getWelcomeHomeUrl(),
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
2020-10-02 15:10:00 +00:00
|
|
|
}
|
|
|
|
|
2022-06-03 14:58:07 +00:00
|
|
|
export function productPill(org: Organization|null, options: {large?: boolean} = {}): DomContents {
|
|
|
|
if (!org || isTemplatesOrg(org)) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
const product = org?.billingAccount?.product.name;
|
|
|
|
const pillTag = product && productPills[product];
|
|
|
|
if (!pillTag) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
return cssProductPill(cssProductPill.cls('-' + pillTag),
|
|
|
|
options.large ? cssProductPill.cls('-large') : null,
|
|
|
|
pillTag,
|
2024-10-07 14:54:03 +00:00
|
|
|
testId('product-pill'));
|
2022-06-03 14:58:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-10-07 14:54:03 +00:00
|
|
|
const cssAppHeader = styled('div._cssAppHeader', `
|
2020-10-02 15:10:00 +00:00
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
2022-09-06 01:51:57 +00:00
|
|
|
background-color: ${theme.leftPanelBg};
|
2024-10-07 14:54:03 +00:00
|
|
|
padding: 0px;
|
|
|
|
padding: 8px;
|
2024-10-11 13:37:53 +00:00
|
|
|
|
2024-10-07 14:54:03 +00:00
|
|
|
.${cssLeftPane.className}-open & {
|
|
|
|
padding: 8px 16px;
|
|
|
|
}
|
|
|
|
&-widelogo {
|
|
|
|
padding: 0px !important;
|
|
|
|
}
|
2020-10-02 15:10:00 +00:00
|
|
|
&, &:hover, &:focus {
|
|
|
|
text-decoration: none;
|
|
|
|
outline: none;
|
2022-09-06 01:51:57 +00:00
|
|
|
color: ${theme.text};
|
2020-10-02 15:10:00 +00:00
|
|
|
}
|
|
|
|
`);
|
|
|
|
|
2024-10-07 14:54:03 +00:00
|
|
|
const cssAppHeaderBox = styled('div._cssAppHeaderBox', `
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
overflow: hidden;
|
|
|
|
background-color: ${theme.appHeaderBg};
|
|
|
|
border-radius: 4px;
|
2024-10-11 13:37:53 +00:00
|
|
|
overflow: hidden;
|
|
|
|
&:hover{
|
|
|
|
--middle-border-color: ${theme.appHeaderBorderHover};
|
2024-10-07 14:54:03 +00:00
|
|
|
}
|
|
|
|
.${cssAppHeader.className}-widelogo & {
|
|
|
|
border: none !important;
|
|
|
|
overflow: visible;
|
|
|
|
}
|
|
|
|
`);
|
|
|
|
|
|
|
|
const cssAppLogo = styled('a._cssAppLogo', `
|
2020-10-02 15:10:00 +00:00
|
|
|
flex: none;
|
2024-10-07 14:54:03 +00:00
|
|
|
height: 100%;
|
|
|
|
aspect-ratio: 1 / 1;
|
|
|
|
text-decoration: none;
|
2020-10-02 15:10:00 +00:00
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-position: center;
|
2024-10-07 14:54:03 +00:00
|
|
|
background-color: inherit;
|
|
|
|
background-size: cover;
|
|
|
|
|
2024-10-11 13:37:53 +00:00
|
|
|
border: 1px solid ${theme.appHeaderBorder};
|
|
|
|
border-radius: 4px;
|
|
|
|
overflow: hidden;
|
|
|
|
border-right-color: var(--middle-border-color, ${theme.appHeaderBorder});
|
|
|
|
|
2024-10-07 14:54:03 +00:00
|
|
|
&-grist-logo {
|
|
|
|
background-image: var(--icon-GristLogo);
|
|
|
|
background-color: ${vars.logoBg};
|
|
|
|
background-size: ${vars.logoSize};
|
|
|
|
}
|
|
|
|
|
2020-10-02 15:10:00 +00:00
|
|
|
.${cssAppHeader.className}-widelogo & {
|
|
|
|
width: 100%;
|
|
|
|
background-size: contain;
|
|
|
|
background-origin: content-box;
|
|
|
|
padding: 8px;
|
2024-10-07 14:54:03 +00:00
|
|
|
border-right: none !important;
|
|
|
|
background-size: contain;
|
2024-10-11 13:37:53 +00:00
|
|
|
border: 0px !important;
|
2020-10-02 15:10:00 +00:00
|
|
|
}
|
|
|
|
.${cssLeftPane.className}-open .${cssAppHeader.className}-widelogo & {
|
|
|
|
background-image: var(--icon-GristWideLogo, var(--icon-GristLogo));
|
2024-10-07 14:54:03 +00:00
|
|
|
background-size: contain;
|
|
|
|
}
|
|
|
|
&:hover {
|
2024-10-11 13:37:53 +00:00
|
|
|
border-color: ${theme.appHeaderBorderHover};
|
2024-10-07 14:54:03 +00:00
|
|
|
text-decoration: none;
|
2020-10-02 15:10:00 +00:00
|
|
|
}
|
2024-10-11 13:37:53 +00:00
|
|
|
.${cssLeftPane.className}-open & {
|
|
|
|
border-top-right-radius: 0;
|
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
}
|
2024-10-07 14:54:03 +00:00
|
|
|
`);
|
|
|
|
|
|
|
|
const cssOrg = styled('div._cssOrg', `
|
2022-07-27 19:02:28 +00:00
|
|
|
display: none;
|
2021-08-18 17:49:34 +00:00
|
|
|
flex-grow: 1;
|
2024-10-07 14:54:03 +00:00
|
|
|
flex-basis: 0px;
|
|
|
|
overflow: hidden;
|
2021-08-18 17:49:34 +00:00
|
|
|
align-items: center;
|
|
|
|
cursor: pointer;
|
|
|
|
height: 100%;
|
2022-06-03 14:58:07 +00:00
|
|
|
font-weight: 500;
|
2024-10-11 13:37:53 +00:00
|
|
|
|
|
|
|
border: 1px solid ${theme.appHeaderBorder};
|
|
|
|
border-radius: 4px;
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
border-left: 0px;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
border-color: ${theme.appHeaderBorderHover};
|
|
|
|
}
|
2022-07-27 19:02:28 +00:00
|
|
|
.${cssLeftPane.className}-open & {
|
|
|
|
display: flex;
|
|
|
|
}
|
2021-08-18 17:49:34 +00:00
|
|
|
`);
|
|
|
|
|
2024-10-11 13:37:53 +00:00
|
|
|
const cssDropdownIcon = styled(icon, `
|
|
|
|
--icon-color: ${theme.text};
|
|
|
|
flex-shrink: 0;
|
|
|
|
margin-right: 8px;
|
|
|
|
`);
|
|
|
|
|
|
|
|
const cssSpacer = styled('div', `
|
|
|
|
display: none;
|
|
|
|
flex: 1;
|
|
|
|
display: block;
|
|
|
|
`);
|
|
|
|
|
2024-10-07 14:54:03 +00:00
|
|
|
const cssOrgLink = styled('a.cssOrgLink', `
|
2023-07-26 22:31:02 +00:00
|
|
|
display: none;
|
|
|
|
flex-grow: 1;
|
|
|
|
align-items: center;
|
2024-10-11 13:37:53 +00:00
|
|
|
max-width: calc(100% - 32px);
|
2023-07-26 22:31:02 +00:00
|
|
|
cursor: pointer;
|
|
|
|
height: 100%;
|
|
|
|
font-weight: 500;
|
|
|
|
color: ${theme.text};
|
|
|
|
user-select: none;
|
|
|
|
|
2024-10-11 13:37:53 +00:00
|
|
|
|
|
|
|
border: 1px solid ${theme.appHeaderBorder};
|
|
|
|
border-radius: 4px;
|
|
|
|
border-left-width: 0;
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
|
2023-07-26 22:31:02 +00:00
|
|
|
&, &:hover, &:focus {
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
|
2024-10-07 14:54:03 +00:00
|
|
|
.${cssLeftPane.className}-open & {
|
|
|
|
border-left: 1px solid ${theme.appHeaderBorder};
|
|
|
|
}
|
|
|
|
|
2023-07-26 22:31:02 +00:00
|
|
|
&:hover {
|
|
|
|
color: ${theme.text};
|
|
|
|
background-color: ${theme.hover};
|
|
|
|
}
|
|
|
|
|
|
|
|
.${cssLeftPane.className}-open & {
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
`);
|
|
|
|
|
2020-10-02 15:10:00 +00:00
|
|
|
const cssOrgName = styled('div', `
|
2021-08-18 17:49:34 +00:00
|
|
|
padding-left: 16px;
|
|
|
|
padding-right: 8px;
|
2020-10-02 15:10:00 +00:00
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
.${cssAppHeader.className}-widelogo & {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
`);
|
2022-06-03 14:58:07 +00:00
|
|
|
|
|
|
|
const cssProductPill = styled('div', `
|
|
|
|
border-radius: 4px;
|
|
|
|
font-size: ${vars.smallFontSize};
|
|
|
|
padding: 2px 4px;
|
|
|
|
display: inline;
|
|
|
|
vertical-align: middle;
|
|
|
|
|
|
|
|
&-Free {
|
|
|
|
background-color: ${colors.orange};
|
|
|
|
color: white;
|
|
|
|
}
|
|
|
|
&-Pro {
|
|
|
|
background-color: ${colors.lightGreen};
|
|
|
|
color: white;
|
|
|
|
}
|
|
|
|
&-large {
|
|
|
|
padding: 4px 8px;
|
|
|
|
margin-left: 16px;
|
|
|
|
font-size: ${vars.mediumFontSize};
|
|
|
|
}
|
|
|
|
`);
|