Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6b005b1

Browse files
committed
Remove the news of route and its dependencies.
1 parent 398316d commit 6b005b1

File tree

4 files changed

+100
-156
lines changed

4 files changed

+100
-156
lines changed

viewer/packages/lowcoder/src/app.tsx

Lines changed: 89 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { default as App } from "antd/es/app";
22
import { default as ConfigProvider } from "antd/es/config-provider";
33
import {
4-
USER_PROFILE_URL,
5-
NEWS_URL,
64
ORG_HOME_URL,
75
ALL_APPLICATIONS_URL,
86
APP_EDITOR_URL,
@@ -122,7 +120,7 @@ class AppIndex extends React.Component<AppIndexProps, any> {
122120
// we check if we are on the public cloud
123121
const isLowCoderDomain = window.location.hostname === 'app.lowcoder.cloud';
124122
const isLocalhost = window.location.hostname === 'localhost';
125-
123+
126124
/* if (isLocalhost || isLowCoderDomain) {
127125
posthog.init('phc_lD36OXeppUehLgI33YFhioTpXqThZ5QqR8IWeKvXP7f', { api_host: 'https://eu.i.posthog.com', person_profiles: 'always' });
128126
} */
@@ -299,99 +297,97 @@ class AppIndex extends React.Component<AppIndexProps, any> {
299297
]}
300298
</Helmet>
301299
<SystemWarning />
302-
<Router history={history}>
303-
<Switch>
304-
<LazyRoute
305-
exact
306-
path={IMPORT_APP_FROM_TEMPLATE_URL}
307-
component={LazyAppFromTemplate}
308-
/>
309-
<LazyRoute
310-
fallback="layout"
311-
path={APP_EDITOR_URL}
312-
component={LazyAppEditor}
313-
/>
314-
<LazyRoute
315-
fallback="layout"
316-
path={[
317-
USER_PROFILE_URL,
318-
NEWS_URL,
319-
ORG_HOME_URL,
320-
ALL_APPLICATIONS_URL,
321-
DATASOURCE_CREATE_URL,
322-
DATASOURCE_EDIT_URL,
323-
DATASOURCE_URL,
324-
SUPPORT_URL,
325-
QUERY_LIBRARY_URL,
326-
FOLDERS_URL,
327-
FOLDER_URL,
328-
TRASH_URL,
329-
SETTING_URL,
330-
MARKETPLACE_URL,
331-
ADMIN_APP_URL
332-
]}
333-
// component={ApplicationListPage}
334-
component={LazyApplicationHome}
335-
/>
336-
<LazyRoute path={USER_AUTH_URL} component={LazyUserAuthComp} />
337-
<LazyRoute
338-
path={ORG_AUTH_LOGIN_URL}
339-
component={LazyUserAuthComp}
340-
/>
341-
<LazyRoute
342-
path={ORG_AUTH_REGISTER_URL}
343-
component={LazyUserAuthComp}
344-
/>
345-
<LazyRoute
346-
path={ORG_AUTH_FORGOT_PASSWORD_URL}
347-
component={LazyUserAuthComp}
348-
/>
349-
<LazyRoute
350-
path={ORG_AUTH_RESET_PASSWORD_URL}
351-
component={LazyUserAuthComp}
352-
/>
353-
<LazyRoute
354-
path={INVITE_LANDING_URL}
355-
component={LazyInviteLanding}
356-
/>
357-
<LazyRoute
358-
path={`${COMPONENT_DOC_URL}/:name`}
359-
component={LazyComponentDoc}
360-
/>
361-
<LazyRoute
362-
path={`/playground/:name/:dsl`}
363-
component={LazyComponentPlayground}
364-
/>
300+
<Router history={history}>
301+
<Switch>
302+
<LazyRoute
303+
exact
304+
path={IMPORT_APP_FROM_TEMPLATE_URL}
305+
component={LazyAppFromTemplate}
306+
/>
307+
<LazyRoute
308+
fallback="layout"
309+
path={APP_EDITOR_URL}
310+
component={LazyAppEditor}
311+
/>
312+
<LazyRoute
313+
fallback="layout"
314+
path={[
315+
ORG_HOME_URL,
316+
ALL_APPLICATIONS_URL,
317+
DATASOURCE_CREATE_URL,
318+
DATASOURCE_EDIT_URL,
319+
DATASOURCE_URL,
320+
SUPPORT_URL,
321+
QUERY_LIBRARY_URL,
322+
FOLDERS_URL,
323+
FOLDER_URL,
324+
TRASH_URL,
325+
SETTING_URL,
326+
MARKETPLACE_URL,
327+
ADMIN_APP_URL
328+
]}
329+
// component={ApplicationListPage}
330+
component={LazyApplicationHome}
331+
/>
332+
<LazyRoute path={USER_AUTH_URL} component={LazyUserAuthComp} />
333+
<LazyRoute
334+
path={ORG_AUTH_LOGIN_URL}
335+
component={LazyUserAuthComp}
336+
/>
337+
<LazyRoute
338+
path={ORG_AUTH_REGISTER_URL}
339+
component={LazyUserAuthComp}
340+
/>
341+
<LazyRoute
342+
path={ORG_AUTH_FORGOT_PASSWORD_URL}
343+
component={LazyUserAuthComp}
344+
/>
345+
<LazyRoute
346+
path={ORG_AUTH_RESET_PASSWORD_URL}
347+
component={LazyUserAuthComp}
348+
/>
349+
<LazyRoute
350+
path={INVITE_LANDING_URL}
351+
component={LazyInviteLanding}
352+
/>
353+
<LazyRoute
354+
path={`${COMPONENT_DOC_URL}/:name`}
355+
component={LazyComponentDoc}
356+
/>
357+
<LazyRoute
358+
path={`/playground/:name/:dsl`}
359+
component={LazyComponentPlayground}
360+
/>
365361

366-
{this.props.isFetchUserFinished && this.props.defaultHomePage? (
367-
!this.props.orgDev ? (
368-
<Redirect exact from={BASE_URL} to={APPLICATION_VIEW_URL(this.props.defaultHomePage || "", "view")}/>
369-
) : (
370-
<Redirect exact from={BASE_URL} to={ORG_HOME_URL} />
371-
)
362+
{this.props.isFetchUserFinished && this.props.defaultHomePage ? (
363+
!this.props.orgDev ? (
364+
<Redirect exact from={BASE_URL} to={APPLICATION_VIEW_URL(this.props.defaultHomePage || "", "view")} />
372365
) : (
373-
<Redirect exact from={BASE_URL} to={ALL_APPLICATIONS_URL} />
374-
)}
366+
<Redirect exact from={BASE_URL} to={ORG_HOME_URL} />
367+
)
368+
) : (
369+
<Redirect exact from={BASE_URL} to={ALL_APPLICATIONS_URL} />
370+
)}
375371

376-
<Redirect to={`${COMPONENT_DOC_URL}/input`} path="/components" />
372+
<Redirect to={`${COMPONENT_DOC_URL}/input`} path="/components" />
377373

378-
{developEnv() && (
379-
<>
380-
<LazyRoute
381-
path="/debug_comp/:name"
382-
component={LazyDebugComp}
383-
/>
384-
<LazyRoute
385-
exact
386-
path="/debug_comp"
387-
component={LazyDebugComp}
388-
/>
389-
<LazyRoute path="/debug_editor" component={LazyAppEditor} />
390-
<LazyRoute path="/debug_new" component={LazyDebugNewComp} />
391-
</>
392-
)}
393-
</Switch>
394-
</Router>
374+
{developEnv() && (
375+
<>
376+
<LazyRoute
377+
path="/debug_comp/:name"
378+
component={LazyDebugComp}
379+
/>
380+
<LazyRoute
381+
exact
382+
path="/debug_comp"
383+
component={LazyDebugComp}
384+
/>
385+
<LazyRoute path="/debug_editor" component={LazyAppEditor} />
386+
<LazyRoute path="/debug_new" component={LazyDebugNewComp} />
387+
</>
388+
)}
389+
</Switch>
390+
</Router>
395391
</Wrapper>
396392
);
397393
}
@@ -434,7 +430,7 @@ export function bootstrap() {
434430
const root = createRoot(container!);
435431
root.render(
436432
<Provider store={reduxStore}>
437-
<AppIndexWithProps />
433+
<AppIndexWithProps />
438434
</Provider>
439435
);
440436
}

viewer/packages/lowcoder/src/constants/routesURL.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import { DatasourceType } from "@lowcoder-ee/constants/queryConstants";
55

66
export const BASE_URL = "/";
77
export const USER_AUTH_URL = "/user/auth";
8-
export const USER_PROFILE_URL = "/user/profile";
9-
export const NEWS_URL = "/news";
108
export const ORG_HOME_URL = "/org/home";
119
export const COMPONENT_DOC_URL = "/components";
1210
export const SETTING_URL = "/setting";

viewer/packages/lowcoder/src/pages/ApplicationV2/UserProfileView.tsx

Lines changed: 0 additions & 33 deletions
This file was deleted.

viewer/packages/lowcoder/src/pages/ApplicationV2/index.tsx

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {
2-
USER_PROFILE_URL,
32
ALL_APPLICATIONS_URL,
43
DATASOURCE_URL,
54
// FOLDER_URL,
@@ -11,7 +10,6 @@ import {
1110
SETTING_URL,
1211
SUPPORT_URL,
1312
TRASH_URL,
14-
NEWS_URL,
1513
ORG_HOME_URL,
1614
} from "constants/routesURL";
1715
import { getUser, isFetchingUser } from "redux/selectors/usersSelectors";
@@ -45,7 +43,6 @@ import { QueryLibraryEditor } from "../queryLibrary/QueryLibraryEditor";
4543
import { ProductLoading } from "components/ProductLoading";
4644
import { Layout } from "../../components/layout/Layout";
4745
import { HomeView } from "./HomeView";
48-
import { UserProfileView } from "./UserProfileView";
4946
import { NewsView } from "./NewsView";
5047
import { OrgView } from "./OrgView";
5148
import styled, { css } from "styled-components";
@@ -213,34 +210,20 @@ export default function ApplicationHome() {
213210
sections={[
214211
{
215212
items: [
216-
{
217-
text: <TabLabel>{trans("home.profile")}</TabLabel>,
218-
routePath: USER_PROFILE_URL,
219-
routeComp: UserProfileView,
220-
icon: ({ selected, ...otherProps }) => selected ? <UserIcon {...otherProps} width={"24px"}/> : <UserIcon {...otherProps} width={"24px"}/>,
221-
},
222-
{
223-
text: <TabLabel>{trans("home.news")}</TabLabel>,
224-
routePath: NEWS_URL,
225-
routeComp: NewsView,
226-
icon: ({ selected, ...otherProps }) => selected ? <NewsIcon {...otherProps} width={"24px"}/> : <NewsIcon {...otherProps} width={"24px"}/>,
227-
visible: ({ user }) => user.orgDev,
228-
style: { color: "red" },
229-
},
230213
{
231214
text: <TabLabel>{trans("home.orgHome")}</TabLabel>,
232215
routePath: ORG_HOME_URL,
233216
routePathExact: false,
234217
routeComp: OrgView,
235-
icon: ({ selected, ...otherProps }) => selected ? <WorkspacesIcon {...otherProps} width={"24px"}/> : <WorkspacesIcon {...otherProps} width={"24px"}/>,
218+
icon: ({ selected, ...otherProps }) => selected ? <WorkspacesIcon {...otherProps} width={"24px"} /> : <WorkspacesIcon {...otherProps} width={"24px"} />,
236219
visible: ({ user }) => !user.orgDev,
237220
},
238221
{
239222
text: <TabLabel>{trans("home.marketplace")}</TabLabel>,
240223
routePath: MARKETPLACE_URL,
241224
routePathExact: false,
242225
routeComp: MarketplaceView,
243-
icon: ({ selected, ...otherProps }) => selected ? <MarketplaceIcon {...otherProps} width={"24px"}/> : <MarketplaceIcon {...otherProps} width={"24px"}/>,
226+
icon: ({ selected, ...otherProps }) => selected ? <MarketplaceIcon {...otherProps} width={"24px"} /> : <MarketplaceIcon {...otherProps} width={"24px"} />,
244227
},
245228
]
246229
},
@@ -251,33 +234,33 @@ export default function ApplicationHome() {
251234
text: <MoreFoldersWrapper>{trans("home.allFolders")}</MoreFoldersWrapper>,
252235
routePath: FOLDERS_URL,
253236
routeComp: RootFolderListView,
254-
icon: ({ selected, ...otherProps }) => selected ? <FolderIcon {...otherProps} width={"24px"}/> : <FolderIcon {...otherProps} width={"24px"}/>,
237+
icon: ({ selected, ...otherProps }) => selected ? <FolderIcon {...otherProps} width={"24px"} /> : <FolderIcon {...otherProps} width={"24px"} />,
255238
},
256239
{
257240
text: <TabLabel>{trans("home.allApplications")}</TabLabel>,
258241
routePath: ALL_APPLICATIONS_URL,
259242
routeComp: HomeView,
260-
icon: ({ selected, ...otherProps }) => selected ? <AppsIcon {...otherProps} width={"24px"}/> : <AppsIcon {...otherProps} width={"24px"}/>,
243+
icon: ({ selected, ...otherProps }) => selected ? <AppsIcon {...otherProps} width={"24px"} /> : <AppsIcon {...otherProps} width={"24px"} />,
261244
},
262245
],
263246
},
264-
247+
265248
{
266249
items: [
267-
250+
268251
{
269252
text: <TabLabel>{trans("home.queryLibrary")}</TabLabel>,
270253
routePath: QUERY_LIBRARY_URL,
271254
routeComp: QueryLibraryEditor,
272-
icon: ({ selected, ...otherProps }) => selected ? <HomeQueryLibraryIcon {...otherProps} width={"24px"}/> : <HomeQueryLibraryIcon {...otherProps} width={"24px"}/>,
255+
icon: ({ selected, ...otherProps }) => selected ? <HomeQueryLibraryIcon {...otherProps} width={"24px"} /> : <HomeQueryLibraryIcon {...otherProps} width={"24px"} />,
273256
visible: ({ user }) => user.orgDev,
274257
},
275258
{
276259
text: <TabLabel>{trans("home.datasource")}</TabLabel>,
277260
routePath: DATASOURCE_URL,
278261
routePathExact: false,
279262
routeComp: DatasourceHome,
280-
icon: ({ selected, ...otherProps }) => selected ? <HomeDataSourceIcon {...otherProps} width={"24px"}/> : <HomeDataSourceIcon {...otherProps} width={"24px"}/>,
263+
icon: ({ selected, ...otherProps }) => selected ? <HomeDataSourceIcon {...otherProps} width={"24px"} /> : <HomeDataSourceIcon {...otherProps} width={"24px"} />,
281264
visible: ({ user }) => user.orgDev,
282265
onSelected: (_, currentPath) => currentPath.split("/")[1] === "datasource",
283266
},
@@ -290,7 +273,7 @@ export default function ApplicationHome() {
290273
routePath: "/ee/6600ae8724a23f365ba2ed4c/admin",
291274
routePathExact: false,
292275
routeComp: AppEditor,
293-
icon: ({ selected, ...otherProps }) => selected ? ( <EnterpriseIcon {...otherProps} width={"24px"}/> ) : ( <EnterpriseIcon {...otherProps} width={"24px"}/> ),
276+
icon: ({ selected, ...otherProps }) => selected ? (<EnterpriseIcon {...otherProps} width={"24px"} />) : (<EnterpriseIcon {...otherProps} width={"24px"} />),
294277
visible: ({ user }) => user.orgDev,
295278
},
296279
],
@@ -315,7 +298,7 @@ export default function ApplicationHome() {
315298
routePath: SETTING_URL,
316299
routePathExact: false,
317300
routeComp: Setting,
318-
icon: ({ selected, ...otherProps }) => selected ? <HomeSettingIcon {...otherProps} width={"24px"}/> : <HomeSettingIcon {...otherProps} width={"24px"}/>,
301+
icon: ({ selected, ...otherProps }) => selected ? <HomeSettingIcon {...otherProps} width={"24px"} /> : <HomeSettingIcon {...otherProps} width={"24px"} />,
319302
visible: ({ user }) => user.orgDev,
320303
onSelected: (_, currentPath) => currentPath.split("/")[1] === "setting",
321304
}
@@ -328,7 +311,7 @@ export default function ApplicationHome() {
328311
text: <TabLabel>{trans("home.trash")}</TabLabel>,
329312
routePath: TRASH_URL,
330313
routeComp: TrashView,
331-
icon: ({ selected, ...otherProps }) => selected ? <RecyclerIcon {...otherProps} width={"24px"}/> : <RecyclerIcon {...otherProps} width={"24px"}/>,
314+
icon: ({ selected, ...otherProps }) => selected ? <RecyclerIcon {...otherProps} width={"24px"} /> : <RecyclerIcon {...otherProps} width={"24px"} />,
332315
visible: ({ user }) => user.orgDev,
333316
},
334317
],

0 commit comments

Comments
 (0)