@@ -10,11 +10,7 @@ import {
10
10
DATASOURCE_URL ,
11
11
IMPORT_APP_FROM_TEMPLATE_URL ,
12
12
INVITE_LANDING_URL ,
13
- isAuthUnRequired ,
14
- ORG_AUTH_LOGIN_URL ,
15
- ORG_AUTH_REGISTER_URL ,
16
13
QUERY_LIBRARY_URL ,
17
- USER_AUTH_URL ,
18
14
ADMIN_APP_URL ,
19
15
} from "constants/routesURL" ;
20
16
import React from "react" ;
@@ -30,22 +26,17 @@ import { developEnv } from "util/envUtils";
30
26
import history from "util/history" ;
31
27
import LazyRoute from "components/LazyRoute" ;
32
28
import { getAntdLocale } from "i18n/antdLocale" ;
33
- import { ProductLoading } from "components/ProductLoading" ;
34
29
import { trans } from "i18n" ; // language
35
30
import { loadComps } from "comps" ;
36
31
import { initApp } from "util/commonUtils" ;
37
32
import { favicon } from "assets/images" ;
38
33
import { hasQueryParam } from "util/urlUtils" ;
39
34
import { isFetchUserFinished } from "redux/selectors/usersSelectors" ; // getCurrentUser,
40
35
import { getIsCommonSettingFetched } from "redux/selectors/commonSettingSelectors" ;
41
- import { SystemWarning } from "./components/SystemWarning" ;
42
- import { getBrandingConfig } from "./redux/selectors/configSelectors" ;
43
- import { buildMaterialPreviewURL } from "./util/materialUtils" ;
44
36
import GlobalInstances from 'components/GlobalInstances' ;
45
37
// import posthog from 'posthog-js'
46
38
import { fetchHomeData } from "./redux/reduxActions/applicationActions" ;
47
39
48
- const LazyUserAuthComp = React . lazy ( ( ) => import ( "pages/userAuth" ) ) ;
49
40
const LazyInviteLanding = React . lazy ( ( ) => import ( "pages/common/inviteLanding" ) ) ;
50
41
const LazyComponentDoc = React . lazy ( ( ) => import ( "pages/ComponentDoc" ) ) ;
51
42
const LazyComponentPlayground = React . lazy ( ( ) => import ( "pages/ComponentPlayground" ) ) ;
@@ -66,20 +57,12 @@ const Wrapper = (props: { children: React.ReactNode, language: string }) => (
66
57
) ;
67
58
68
59
type AppIndexProps = {
69
- isFetchUserFinished : boolean ;
70
- getIsCommonSettingFetched : boolean ;
71
60
currentOrgId ?: string ;
72
61
currentUserId : string ;
73
62
currentUserAnonymous : boolean ;
74
63
orgDev : boolean ;
75
64
defaultHomePage : string | null | undefined ;
76
- fetchHomeDataFinished : boolean ;
77
- fetchConfig : ( orgId ?: string ) => void ;
78
- fetchHomeData : ( currentUserAnonymous ?: boolean | undefined ) => void ;
79
65
getCurrentUser : ( ) => void ;
80
- favicon : string ;
81
- brandName : string ;
82
- uiLanguage : string ;
83
66
} ;
84
67
85
68
class AppIndex extends React . Component < AppIndexProps , any > {
@@ -91,15 +74,6 @@ class AppIndex extends React.Component<AppIndexProps, any> {
91
74
}
92
75
93
76
componentDidUpdate ( prevProps : AppIndexProps ) {
94
- if (
95
- prevProps . currentOrgId !== this . props . currentOrgId &&
96
- this . props . currentOrgId !== ''
97
- ) {
98
- this . props . fetchConfig ( this . props . currentOrgId ) ;
99
- if ( ! this . props . currentUserAnonymous ) {
100
- this . props . fetchHomeData ( this . props . currentUserAnonymous ) ;
101
- }
102
- }
103
77
}
104
78
render ( ) {
105
79
const isTemplate = hasQueryParam ( 'template' ) ;
@@ -113,29 +87,14 @@ class AppIndex extends React.Component<AppIndexProps, any> {
113
87
posthog.init('phc_lD36OXeppUehLgI33YFhioTpXqThZ5QqR8IWeKvXP7f', { api_host: 'https://eu.i.posthog.com', person_profiles: 'always' });
114
88
} */
115
89
116
- // make sure all users in this app have checked login info
117
- if ( ! this . props . isFetchUserFinished || ( this . props . currentUserId && ! this . props . fetchHomeDataFinished ) ) {
118
- const hideLoadingHeader = isTemplate || isAuthUnRequired ( pathname ) ;
119
- return < ProductLoading hideHeader = { hideLoadingHeader } /> ;
120
- }
121
- else {
122
- // if the user just logged in, we send the event to posthog
123
- if ( isLocalhost || isLowCoderDomain ) {
124
- if ( sessionStorage . getItem ( '_just_logged_in_' ) ) {
125
- // posthog.identify(this.props.currentUserId);
126
- sessionStorage . removeItem ( '_just_logged_in_' ) ;
127
- }
128
- }
129
- }
130
-
131
90
// persisting the language in local storage
132
- localStorage . setItem ( 'lowcoder_uiLanguage' , this . props . uiLanguage ) ;
91
+ localStorage . setItem ( 'lowcoder_uiLanguage' , "en_US" ) ;
133
92
134
93
return (
135
- < Wrapper language = { this . props . uiLanguage } >
94
+ < Wrapper language = "en_US" >
136
95
< Helmet >
137
- { < title > { this . props . brandName } </ title > }
138
- { < link rel = "icon" href = { this . props . favicon } /> }
96
+ { < title > Lowcoder </ title > }
97
+ { < link rel = "icon" href = "" /> }
139
98
< meta name = "description" content = { trans ( 'productDesc' ) } />
140
99
< meta
141
100
name = "keywords"
@@ -147,7 +106,7 @@ class AppIndex extends React.Component<AppIndexProps, any> {
147
106
< meta
148
107
key = "og:title"
149
108
property = "og:title"
150
- content = { this . props . brandName }
109
+ content = "Lowcoder"
151
110
/>
152
111
< meta
153
112
key = "og:description"
@@ -170,7 +129,7 @@ class AppIndex extends React.Component<AppIndexProps, any> {
170
129
< meta
171
130
key = "twitter:title"
172
131
name = "twitter:title"
173
- content = { this . props . brandName }
132
+ content = "Lowcoder"
174
133
/>
175
134
< meta
176
135
key = "twitter:description"
@@ -208,7 +167,7 @@ class AppIndex extends React.Component<AppIndexProps, any> {
208
167
< meta
209
168
key = "apple-mobile-web-app-title"
210
169
name = "apple-mobile-web-app-title"
211
- content = { this . props . brandName }
170
+ content = "Lowcoder"
212
171
/>
213
172
< link
214
173
key = "apple-touch-icon"
@@ -224,7 +183,7 @@ class AppIndex extends React.Component<AppIndexProps, any> {
224
183
< meta
225
184
key = "application-name"
226
185
name = "application-name"
227
- content = { this . props . brandName }
186
+ content = "Lowcoder"
228
187
/>
229
188
< meta
230
189
key = "msapplication-TileColor"
@@ -244,7 +203,7 @@ class AppIndex extends React.Component<AppIndexProps, any> {
244
203
< meta
245
204
key = "iframely:title"
246
205
property = "iframely:title"
247
- content = { this . props . brandName }
206
+ content = "Lowcoder"
248
207
/> ,
249
208
< meta
250
209
key = "iframely:description"
@@ -284,23 +243,13 @@ class AppIndex extends React.Component<AppIndexProps, any> {
284
243
> </ script > ,
285
244
] }
286
245
</ Helmet >
287
- < SystemWarning />
288
246
< Router history = { history } >
289
247
< Switch >
290
248
< LazyRoute
291
249
fallback = "layout"
292
250
path = { APP_EDITOR_URL }
293
251
component = { LazyAppEditor }
294
252
/>
295
- < LazyRoute path = { USER_AUTH_URL } component = { LazyUserAuthComp } />
296
- < LazyRoute
297
- path = { ORG_AUTH_LOGIN_URL }
298
- component = { LazyUserAuthComp }
299
- />
300
- < LazyRoute
301
- path = { ORG_AUTH_REGISTER_URL }
302
- component = { LazyUserAuthComp }
303
- />
304
253
< LazyRoute
305
254
path = { INVITE_LANDING_URL }
306
255
component = { LazyInviteLanding }
@@ -332,30 +281,19 @@ class AppIndex extends React.Component<AppIndexProps, any> {
332
281
}
333
282
334
283
const mapStateToProps = ( state : AppState ) => ( {
335
- isFetchUserFinished : isFetchUserFinished ( state ) ,
336
- getIsCommonSettingFetched : getIsCommonSettingFetched ( state ) ,
337
284
orgDev : state . ui . users . user . orgDev ,
338
285
currentUserId : state . ui . users . currentUser . id ,
339
286
currentUserAnonymous : state . ui . users . currentUser . name === "ANONYMOUS" ,
340
287
currentOrgId : state . ui . users . user . currentOrgId ,
341
288
defaultHomePage : state . ui . application . homeOrg ?. commonSettings . defaultHomePage ,
342
289
fetchHomeDataFinished : Boolean ( state . ui . application . homeOrg ?. commonSettings ) ,
343
- favicon : getBrandingConfig ( state ) ?. favicon
344
- ? buildMaterialPreviewURL ( getBrandingConfig ( state ) ?. favicon ! )
345
- : favicon ,
346
- brandName : getBrandingConfig ( state ) ?. brandName ?? trans ( "productName" ) ,
347
290
uiLanguage : state . ui . users . user . uiLanguage ,
348
291
} ) ;
349
292
350
293
const mapDispatchToProps = ( dispatch : any ) => ( {
351
294
getCurrentUser : ( ) => {
352
295
dispatch ( fetchUserAction ( ) ) ;
353
296
} ,
354
- fetchConfig : ( orgId ?: string ) => dispatch ( fetchConfigAction ( orgId ) ) ,
355
-
356
- fetchHomeData : ( currentUserAnonymous : boolean | undefined ) => {
357
- dispatch ( fetchHomeData ( { } ) ) ;
358
- }
359
297
} ) ;
360
298
361
299
const AppIndexWithProps = connect ( mapStateToProps , mapDispatchToProps ) ( AppIndex ) ;
0 commit comments