Fix whitelabel initialization (#28148)
This commit is contained in:
committed by
GitHub
parent
ff2c972dcb
commit
46711effe9
@@ -27,7 +27,7 @@ export const Input = styled(NumericInput)`
|
||||
|
||||
:focus,
|
||||
:hover {
|
||||
border-color: ${() => color("brand")};
|
||||
border-color: ${color("brand")};
|
||||
}
|
||||
|
||||
transition: border 300ms ease-in-out;
|
||||
|
||||
1
enterprise/frontend/src/metabase-enterprise/overrides.js
Normal file
1
enterprise/frontend/src/metabase-enterprise/overrides.js
Normal file
@@ -0,0 +1 @@
|
||||
import "./whitelabel/overrides";
|
||||
@@ -0,0 +1,10 @@
|
||||
import { hasPremiumFeature } from "metabase-enterprise/settings";
|
||||
import {
|
||||
enabledApplicationNameReplacement,
|
||||
updateColors,
|
||||
} from "metabase-enterprise/whitelabel/lib/whitelabel";
|
||||
|
||||
if (hasPremiumFeature("whitelabel")) {
|
||||
updateColors();
|
||||
enabledApplicationNameReplacement();
|
||||
}
|
||||
@@ -6,6 +6,11 @@ import "classlist-polyfill";
|
||||
|
||||
import "number-to-locale-string";
|
||||
|
||||
// This is conditionally aliased in the webpack config.
|
||||
// If EE isn't enabled, it loads an empty file.
|
||||
// Should be imported before any other metabase import
|
||||
import "ee-overrides"; // eslint-disable-line import/no-unresolved, import/no-duplicates
|
||||
|
||||
// If enabled this monkeypatches `t` and `jt` to return blacked out
|
||||
// strings/elements to assist in finding untranslated strings.
|
||||
import "metabase/lib/i18n-debug";
|
||||
@@ -21,7 +26,7 @@ import "metabase/plugins/builtin";
|
||||
|
||||
// This is conditionally aliased in the webpack config.
|
||||
// If EE isn't enabled, it loads an empty file.
|
||||
import "ee-plugins"; // eslint-disable-line import/no-unresolved
|
||||
import "ee-plugins"; // eslint-disable-line import/no-unresolved, import/no-duplicates
|
||||
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
|
||||
@@ -8,7 +8,7 @@ export const TextLink = styled(Link)`
|
||||
color: ${color("text-dark")};
|
||||
|
||||
&:hover {
|
||||
color: ${() => color("brand")};
|
||||
color: ${color("brand")};
|
||||
}
|
||||
`;
|
||||
|
||||
|
||||
@@ -21,6 +21,6 @@ export const TextLink = styled(Link)`
|
||||
color: ${color("text-dark")};
|
||||
|
||||
&:hover {
|
||||
color: ${() => color("brand")};
|
||||
color: ${color("brand")};
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -30,7 +30,7 @@ export const LoadingSpinner = styled(_LoadingSpinner)`
|
||||
flex-grow: 1;
|
||||
align-self: center;
|
||||
justify-content: center;
|
||||
color: ${() => color("brand")};
|
||||
color: ${color("brand")};
|
||||
`;
|
||||
|
||||
LoadingSpinner.defaultProps = {
|
||||
|
||||
@@ -61,7 +61,7 @@ export const RelativeSizeIcon = styled(Icon)`
|
||||
`;
|
||||
|
||||
export const InvertedColorRelativeSizeIcon = styled(RelativeSizeIcon)`
|
||||
background-color: ${() => color("brand")};
|
||||
background-color: ${color("brand")};
|
||||
color: ${color("white")};
|
||||
border-radius: 0.3em;
|
||||
padding: 0.3em;
|
||||
@@ -87,7 +87,7 @@ export const LoadingSpinner = styled(_LoadingSpinner)`
|
||||
flex-grow: 1;
|
||||
align-self: center;
|
||||
justify-content: center;
|
||||
color: ${() => color("brand")};
|
||||
color: ${color("brand")};
|
||||
`;
|
||||
|
||||
export const Table = styled.table`
|
||||
|
||||
@@ -33,7 +33,7 @@ export const InfoIcon = styled(Icon)`
|
||||
color: ${color("bg-dark")};
|
||||
|
||||
&:hover {
|
||||
color: ${() => color("brand")};
|
||||
color: ${color("brand")};
|
||||
}
|
||||
`;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import { color } from "metabase/lib/colors";
|
||||
import Button from "metabase/core/components/Button";
|
||||
|
||||
export const WidgetButton = styled(Button)`
|
||||
color: ${() => color("brand")};
|
||||
color: ${color("brand")};
|
||||
padding: 0;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
|
||||
@@ -39,7 +39,7 @@ export const CheckBoxContainer = styled.span<CheckBoxContainerProps>`
|
||||
opacity: ${props => (props.disabled ? "0.4" : "")};
|
||||
|
||||
${CheckBoxInput}:focus + & {
|
||||
outline: 2px solid ${() => color("focus")};
|
||||
outline: 2px solid ${color("focus")};
|
||||
}
|
||||
|
||||
${CheckBoxInput}:focus:not(:focus-visible) + & {
|
||||
|
||||
@@ -43,7 +43,7 @@ export const InputButton = styled.span`
|
||||
user-select: none;
|
||||
|
||||
${InputField}:focus + & {
|
||||
outline: 2px solid ${() => color("focus")};
|
||||
outline: 2px solid ${color("focus")};
|
||||
}
|
||||
|
||||
${InputField}:not(:focus-visible) + & {
|
||||
|
||||
@@ -59,7 +59,7 @@ export const FieldInfoIcon = styled(Icon)`
|
||||
height: 0.75rem;
|
||||
|
||||
&:hover {
|
||||
color: ${() => color("brand")};
|
||||
color: ${color("brand")};
|
||||
}
|
||||
`;
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ export const RadioContainer = styled.div<RadioContainerProps>`
|
||||
}
|
||||
|
||||
${RadioInput}:focus + & {
|
||||
outline: 2px solid ${() => color("focus")};
|
||||
outline: 2px solid ${color("focus")};
|
||||
}
|
||||
|
||||
${RadioInput}:focus:not(:focus-visible) + & {
|
||||
|
||||
@@ -35,8 +35,8 @@ export const SelectButtonRoot = styled.button<SelectButtonRootProps>`
|
||||
color: ${getColor};
|
||||
|
||||
&:focus {
|
||||
border-color: ${() => color("brand")};
|
||||
outline: 2px solid ${() => color("focus")};
|
||||
border-color: ${color("brand")};
|
||||
outline: 2px solid ${color("focus")};
|
||||
}
|
||||
|
||||
&:not(:focus-visible) {
|
||||
|
||||
@@ -23,7 +23,7 @@ export const TextAreaRoot = styled.textarea<TextAreaRootProps>`
|
||||
|
||||
&:focus,
|
||||
&:hover {
|
||||
border-color: ${() => color("brand")};
|
||||
border-color: ${color("brand")};
|
||||
transition: border 300ms ease-in-out;
|
||||
}
|
||||
${css`
|
||||
|
||||
@@ -39,8 +39,8 @@ export const EngineCardRoot = styled.li<EngineCardRootProps>`
|
||||
outline: ${props => (props.isActive ? `2px solid ${color("focus")}` : "")};
|
||||
|
||||
&:hover {
|
||||
border-color: ${() => color("brand")};
|
||||
background-color: ${() => lighten("brand", 0.6)};
|
||||
border-color: ${color("brand")};
|
||||
background-color: ${lighten("brand", 0.6)};
|
||||
}
|
||||
`;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ export const Link = styled(ExternalLink)`
|
||||
align-items: center;
|
||||
color: ${color("text-white")};
|
||||
font-weight: bold;
|
||||
background-color: ${() => color("brand")};
|
||||
background-color: ${color("brand")};
|
||||
padding: 12px 18px;
|
||||
border-radius: 6px;
|
||||
|
||||
|
||||
@@ -65,6 +65,6 @@ export const CloseButton = styled.a`
|
||||
margin-left: auto;
|
||||
|
||||
&:hover {
|
||||
color: ${() => color("brand")};
|
||||
color: ${color("brand")};
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -67,7 +67,7 @@ export const Root = styled.div<{
|
||||
|
||||
&:hover {
|
||||
transition: border 0.3s;
|
||||
border-color: ${() => color("brand")};
|
||||
border-color: ${color("brand")};
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -24,12 +24,12 @@ export const ExpandButton = styled(Button)`
|
||||
border: 1px solid ${() => lighten("brand", 0.3)};
|
||||
padding: 0.125rem 0.25rem;
|
||||
border-radius: 0.25rem;
|
||||
color: ${() => color("brand")};
|
||||
color: ${color("brand")};
|
||||
margin-right: 0.5rem;
|
||||
margin-left: auto;
|
||||
|
||||
&:hover {
|
||||
color: ${() => color("text-white")};
|
||||
background-color: ${() => color("brand")};
|
||||
color: ${color("text-white")};
|
||||
background-color: ${color("brand")};
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -87,7 +87,7 @@ export const TableHeaderCellContent = styled.button<{
|
||||
}
|
||||
|
||||
&:hover {
|
||||
color: ${() => color("brand")};
|
||||
color: ${color("brand")};
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -113,7 +113,7 @@ export const PaginationButton = styled.button<{
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
color: ${() => color("brand")};
|
||||
color: ${color("brand")};
|
||||
}
|
||||
|
||||
${props =>
|
||||
|
||||
@@ -143,6 +143,10 @@ const config = (module.exports = {
|
||||
process.env.MB_EDITION === "ee"
|
||||
? ENTERPRISE_SRC_PATH + "/plugins"
|
||||
: SRC_PATH + "/lib/noop",
|
||||
"ee-overrides":
|
||||
process.env.MB_EDITION === "ee"
|
||||
? ENTERPRISE_SRC_PATH + "/overrides"
|
||||
: SRC_PATH + "/lib/noop",
|
||||
},
|
||||
},
|
||||
cache: useFilesystemCache
|
||||
|
||||
Reference in New Issue
Block a user