Skip to content

Commit 39dbe79

Browse files
author
FalkWolsky
committed
fix branding by ENV
1 parent 472bc6c commit 39dbe79

File tree

9 files changed

+15
-62
lines changed

9 files changed

+15
-62
lines changed

client/packages/lowcoder-cli/client.d.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ declare module "*.svg" {
88
React.SVGProps<SVGSVGElement> & { title?: string }
99
>;
1010

11-
const src: string;
12-
export default src;
11+
// const src: string;
12+
// export default src;
1313
}
1414

1515
declare module "*.md" {
@@ -31,10 +31,6 @@ declare var REACT_APP_LANGUAGES: string;
3131
declare var REACT_APP_COMMIT_ID: string;
3232
declare var REACT_APP_API_HOST: string;
3333
declare var LOWCODER_NODE_SERVICE_URL: string;
34-
declare var REACT_APP_LOWCODER_SHOW_BRAND: string;
35-
declare var REACT_APP_LOWCODER_CUSTOM_LOGO: string;
36-
declare var REACT_APP_LOWCODER_CUSTOM_LOGO_SQUARE: string;
37-
declare var REACT_APP_LOWCODER_CUSTOM_AUTH_WELCOME_TEXT: string;
3834
declare var REACT_APP_ENV: string;
3935
declare var REACT_APP_BUILD_ID: string;
4036
declare var REACT_APP_LOG_LEVEL: string;

client/packages/lowcoder-dev-utils/buildVars.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,6 @@ export const buildVars = [
1919
name: "REACT_APP_API_HOST",
2020
defaultValue: "",
2121
},
22-
{
23-
name: "REACT_APP_LOWCODER_SHOW_BRAND",
24-
defaultValue: 'false',
25-
},
26-
{
27-
name: "REACT_APP_LOWCODER_CUSTOM_LOGO",
28-
defaultValue: '',
29-
},
30-
{
31-
name: "REACT_APP_LOWCODER_CUSTOM_LOGO_SQUARE",
32-
defaultValue: '',
33-
},
34-
{
35-
name: "REACT_APP_LOWCODER_CUSTOM_AUTH_WELCOME_TEXT",
36-
defaultValue: '',
37-
},
3822
{
3923
name: "LOWCODER_NODE_SERVICE_URL",
4024
defaultValue: "",

client/packages/lowcoder/index.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,5 @@
9696
<div id="root"></div>
9797
<script type="module" src="/src/index.ts"></script>
9898
<!-- <%- browserCheckScript %> -->
99-
<script>
100-
window.lowcoder_show_brand = "<%= process.env.REACT_APP_LOWCODER_SHOW_BRAND %>";
101-
window.lowcoder_custom_auth_welcome_text = "<%= process.env.REACT_APP_LOWCODER_CUSTOM_AUTH_WELCOME_TEXT %>";
102-
window.lowcoder_custom_logo = "<%= process.env.REACT_APP_LOWCODER_CUSTOM_LOGO %>";
103-
window.lowcoder_custom_logo_square = "<%= process.env.REACT_APP_LOWCODER_CUSTOM_LOGO_SQUARE %>";
104-
</script>
10599
</body>
106100
</html>

client/packages/lowcoder/src/app-env.d.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ declare var REACT_APP_LANGUAGES: string;
3434
declare var REACT_APP_COMMIT_ID: string;
3535
declare var REACT_APP_API_HOST: string;
3636
declare var LOWCODER_NODE_SERVICE_URL: string;
37-
declare var REACT_APP_LOWCODER_SHOW_BRAND: string;
38-
declare var REACT_APP_LOWCODER_CUSTOM_LOGO: string;
39-
declare var REACT_APP_LOWCODER_CUSTOM_LOGO_SQUARE: string;
40-
declare var REACT_APP_LOWCODER_CUSTOM_AUTH_WELCOME_TEXT: string;
4137
declare var REACT_APP_ENV: string;
4238
declare var REACT_APP_BUILD_ID: string;
4339
declare var REACT_APP_LOG_LEVEL: string;

client/packages/lowcoder/src/components/PageSkeleton.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,13 @@ export default function PageSkeleton(props: IProps) {
7878
</SkeletonWrapper>
7979
);
8080

81+
// {/* headerStart={REACT_APP_LOWCODER_SHOW_BRAND === 'true' ? REACT_APP_LOWCODER_CUSTOM_LOGO !== "" ? <img src={REACT_APP_LOWCODER_CUSTOM_LOGO} alt="logo" /> :<StyledLogoWithName branding={true} /> : <StyledLogoHome branding={true} />} */}
82+
8183
return (
8284
<Layout>
8385
{!hideHeader && isHeaderReady && (
84-
<Header
85-
headerStart={
86-
REACT_APP_LOWCODER_SHOW_BRAND === 'true' ?
87-
REACT_APP_LOWCODER_CUSTOM_LOGO !== "" ? <img src={REACT_APP_LOWCODER_CUSTOM_LOGO} alt="logo" /> :<StyledLogoWithName branding={true} /> :
88-
<StyledLogoHome branding={true} />
89-
}
86+
<Header
87+
headerStart={<StyledLogoWithName branding={true} />}
9088
style={{ backgroundColor: brandingConfig?.headerColor, ...props.headStyle }}
9189
/>
9290
)}
@@ -95,5 +93,6 @@ export default function PageSkeleton(props: IProps) {
9593
<MainContent>{!hideContent && skeleton}</MainContent>
9694
</Layout>
9795
</Layout>
96+
9897
);
9998
}

client/packages/lowcoder/src/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ debug(`REACT_APP_LANGUAGES:, ${REACT_APP_LANGUAGES}`);
3434
debug(`REACT_APP_API_HOST:, ${REACT_APP_API_HOST}`);
3535
debug(`REACT_APP_ENV:, ${REACT_APP_ENV}`);
3636
debug(`REACT_APP_LOG_LEVEL:, ${REACT_APP_LOG_LEVEL}`);
37-
debug(`REACT_APP_LOWCODER_SHOW_BRAND:, ${REACT_APP_LOWCODER_SHOW_BRAND}`);
38-
debug(`REACT_APP_LOWCODER_CUSTOM_AUTH_WELCOME_TEXT:, ${REACT_APP_LOWCODER_CUSTOM_AUTH_WELCOME_TEXT}`);
39-
debug(`LOWCODER_CUSTOM_LOGO:, ${REACT_APP_LOWCODER_CUSTOM_LOGO}`);
40-
debug(`LOWCODER_CUSTOM_LOGO_SQUARE:, ${REACT_APP_LOWCODER_CUSTOM_LOGO_SQUARE}`);
4137

4238
try {
4339
bootstrap();

client/packages/lowcoder/src/pages/common/header.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,8 @@ export default function Header(props: HeaderProps) {
290290
const headerStart = (
291291
<>
292292
<StyledLink onClick={() => history.push(ALL_APPLICATIONS_URL)}>
293-
{REACT_APP_LOWCODER_SHOW_BRAND === 'true' ?
294-
REACT_APP_LOWCODER_CUSTOM_LOGO_SQUARE !== "" ? <img src={REACT_APP_LOWCODER_CUSTOM_LOGO_SQUARE } height={24} width={24} alt="logo" /> :<LogoIcon /> :
295-
<LogoHome />}
293+
{/* {REACT_APP_LOWCODER_SHOW_BRAND === 'true' ? REACT_APP_LOWCODER_CUSTOM_LOGO_SQUARE !== "" ? <img src={REACT_APP_LOWCODER_CUSTOM_LOGO_SQUARE } height={24} width={24} alt="logo" /> :<LogoIcon /> : <LogoHome />} */}
294+
<LogoHome />
296295
</StyledLink>
297296
{editName ? (
298297
<Wrapper>
@@ -434,9 +433,8 @@ export function AppHeader() {
434433
const brandingConfig = useSelector(getBrandingConfig);
435434
const headerStart = (
436435
<StyledLink onClick={() => history.push(ALL_APPLICATIONS_URL)}>
437-
{REACT_APP_LOWCODER_SHOW_BRAND === 'true' ?
438-
REACT_APP_LOWCODER_CUSTOM_LOGO !== "" ? <img src={REACT_APP_LOWCODER_CUSTOM_LOGO} height={28} alt="logo" /> :<LogoWithName branding={!user.orgDev} /> :
439-
<LogoHome />}
436+
{/* {REACT_APP_LOWCODER_SHOW_BRAND === 'true' ? REACT_APP_LOWCODER_CUSTOM_LOGO !== "" ? <img src={REACT_APP_LOWCODER_CUSTOM_LOGO} height={28} alt="logo" /> :<LogoWithName branding={!user.orgDev} /> : <LogoHome />} */}
437+
<LogoHome />
440438
</StyledLink>
441439
);
442440
const headerEnd = <HeaderProfile user={user} />;

client/packages/lowcoder/src/pages/userAuth/login.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,8 @@ function Login() {
131131
loginCardView = thirdPartyLoginView;
132132
}
133133

134-
const loginHeading = REACT_APP_LOWCODER_CUSTOM_AUTH_WELCOME_TEXT !== ""
135-
? REACT_APP_LOWCODER_CUSTOM_AUTH_WELCOME_TEXT
136-
: getLoginTitle(inviteInfo?.createUserName, systemConfig?.branding?.brandName)
137-
138-
const loginSubHeading = REACT_APP_LOWCODER_CUSTOM_AUTH_WELCOME_TEXT !== ""
139-
? trans("userAuth.poweredByLowcoder")
140-
: ''
134+
const loginHeading = getLoginTitle(inviteInfo?.createUserName, systemConfig?.branding?.brandName)
135+
const loginSubHeading = '' // REACT_APP_LOWCODER_CUSTOM_AUTH_WELCOME_TEXT !== "" ? trans("userAuth.poweredByLowcoder") : ''
141136

142137
return (
143138
<AuthContainer

client/packages/lowcoder/src/pages/userAuth/register.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,8 @@ function UserRegister() {
7171
return null;
7272
}
7373

74-
const registerHeading = REACT_APP_LOWCODER_CUSTOM_AUTH_WELCOME_TEXT !== ""
75-
? REACT_APP_LOWCODER_CUSTOM_AUTH_WELCOME_TEXT
76-
: trans("userAuth.register")
77-
78-
const registerSubHeading = REACT_APP_LOWCODER_CUSTOM_AUTH_WELCOME_TEXT !== ""
79-
? trans("userAuth.poweredByLowcoder")
80-
: ''
74+
const registerHeading = trans("userAuth.register") // REACT_APP_LOWCODER_CUSTOM_AUTH_WELCOME_TEXT !== "" ? REACT_APP_LOWCODER_CUSTOM_AUTH_WELCOME_TEXT : trans("userAuth.register")
75+
const registerSubHeading = '' // REACT_APP_LOWCODER_CUSTOM_AUTH_WELCOME_TEXT !== "" ? trans("userAuth.poweredByLowcoder") : ''
8176

8277
return (
8378
<AuthContainer

0 commit comments

Comments
 (0)