Skip to content

Commit 0ffa425

Browse files
committed
fix: compile error
1 parent bd8c98b commit 0ffa425

File tree

5 files changed

+32
-12
lines changed

5 files changed

+32
-12
lines changed

client/packages/openblocks/src/assets/images/index.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches
2+
import { ReactComponent as CELogo } from "./logo.svg";
3+
import { ReactComponent as CELogoWithName } from "./logo-with-name.svg";
4+
5+
export { default as favicon } from "./favicon.ico";
6+
7+
export const Logo = (props: { branding?: boolean }) => {
8+
return <CELogo />;
9+
};
10+
export const LogoWithName = (props: { branding?: boolean }) => {
11+
return <CELogoWithName />;
12+
};

client/packages/openblocks/src/comps/controls/codeControl.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
AbstractComp,
77
changeDependName,
88
changeValueAction,
9+
CodeFunction,
910
CodeNode,
1011
CodeNodeOptions,
1112
CompAction,
@@ -18,7 +19,6 @@ import {
1819
transformWrapper,
1920
ValueAndMsg,
2021
withFunction,
21-
CodeFunction,
2222
} from "openblocks-core";
2323
import { EditorContext } from "comps/editorState";
2424
import { withDefault } from "comps/generators/simpleGenerators";
@@ -218,6 +218,9 @@ export function codeControl<
218218

219219
function toCardTitle(expectedType?: string, value?: unknown) {
220220
const type = expectedType ?? toType(value);
221+
if (type === "RegExp") {
222+
return type;
223+
}
221224
if (Array.isArray(value)) {
222225
return type + "(" + value.length + ")";
223226
}
@@ -257,8 +260,8 @@ function toRegExp(value: unknown): RegExp {
257260
if (valueType === "RegExp") {
258261
return value as RegExp;
259262
} else if (valueType === "string") {
260-
const regexStr = _.trimStart(_.trimEnd(value as string, "$"), "^");
261-
return new RegExp("^" + regexStr ?? ".*" + "$");
263+
const regexStr = _.trimStart(value as string, "^");
264+
return new RegExp("^" + (regexStr ?? ".*") + "$");
262265
}
263266
throw new TypeError(
264267
`must be a valid JavaScript regular expression without forward slashes around the pattern`

client/packages/openblocks/src/constants/configConstants.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@ interface FeatureFlag {
22
enableCustomBrand: boolean;
33
}
44

5+
export interface BrandingConfig {
6+
logo?: string;
7+
favicon?: string;
8+
brandName?: string;
9+
headerColor?: string;
10+
}
11+
512
export type ConfigBaseInfo = {
613
selfDomain: boolean;
714
cloudHosting: boolean;
815
workspaceMode: "SAAS" | "ENTERPRISE";
916
warning?: string;
1017
featureFlag: FeatureFlag;
18+
branding?: BrandingConfig;
1119
};
1220

1321
export type ConfigResponseData = {

client/packages/openblocks/src/pages/setting/settingHome.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { AdvancedSetting } from "./advanced/AdvancedSetting";
55
import { currentOrgAdmin } from "util/permissionUtils";
66
import { trans } from "i18n";
77
import AuditSetting from "@openblocks-ee/pages/setting/audit";
8-
import { isEE, isEnterpriseMode, isSelfDomain } from "util/envUtils";
8+
import { developEnv, isEE, isEnterpriseMode, isSelfDomain } from "util/envUtils";
99
import { TwoColumnSettingPageContent } from "./styled";
1010
import SubSideBar from "components/layout/SubSideBar";
1111
import { Menu } from "openblocks-design";
@@ -52,10 +52,11 @@ export function SettingHome() {
5252
key: SettingPageEnum.Theme,
5353
label: trans("settings.theme"),
5454
},
55-
...(isEE() &&
56-
currentOrgAdmin(user) &&
57-
enableCustomBrand(config) &&
58-
(isSelfDomain(config) || isEnterpriseMode(config))
55+
...(developEnv() ||
56+
(isEE() &&
57+
currentOrgAdmin(user) &&
58+
enableCustomBrand(config) &&
59+
(isSelfDomain(config) || isEnterpriseMode(config)))
5960
? [
6061
{
6162
key: SettingPageEnum.Branding,

0 commit comments

Comments
 (0)