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

Skip to content

Commit 65a2861

Browse files
committed
Remove home and its dependencies.
1 parent 1617b86 commit 65a2861

31 files changed

+0
-4016
lines changed

viewer/packages/lowcoder/src/app.tsx

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
ORG_AUTH_REGISTER_URL,
2020
QUERY_LIBRARY_URL,
2121
SETTING_URL,
22-
TRASH_URL,
2322
USER_AUTH_URL,
2423
ADMIN_APP_URL,
2524
ORG_AUTH_FORGOT_PASSWORD_URL,
@@ -58,8 +57,6 @@ const LazyInviteLanding = React.lazy(() => import("pages/common/inviteLanding"))
5857
const LazyComponentDoc = React.lazy(() => import("pages/ComponentDoc"));
5958
const LazyComponentPlayground = React.lazy(() => import("pages/ComponentPlayground"));
6059
const LazyAppEditor = React.lazy(() => import("pages/editor/AppEditor"));
61-
const LazyAppFromTemplate = React.lazy(() => import("pages/ApplicationV2/AppFromTemplate"));
62-
const LazyApplicationHome = React.lazy(() => import("pages/ApplicationV2"));
6360
const LazyDebugComp = React.lazy(() => import("./debug"));
6461
const LazyDebugNewComp = React.lazy(() => import("./debugNew"));
6562

@@ -297,34 +294,11 @@ class AppIndex extends React.Component<AppIndexProps, any> {
297294
<SystemWarning />
298295
<Router history={history}>
299296
<Switch>
300-
<LazyRoute
301-
exact
302-
path={IMPORT_APP_FROM_TEMPLATE_URL}
303-
component={LazyAppFromTemplate}
304-
/>
305297
<LazyRoute
306298
fallback="layout"
307299
path={APP_EDITOR_URL}
308300
component={LazyAppEditor}
309301
/>
310-
<LazyRoute
311-
fallback="layout"
312-
path={[
313-
ORG_HOME_URL,
314-
ALL_APPLICATIONS_URL,
315-
DATASOURCE_CREATE_URL,
316-
DATASOURCE_EDIT_URL,
317-
DATASOURCE_URL,
318-
QUERY_LIBRARY_URL,
319-
FOLDERS_URL,
320-
FOLDER_URL,
321-
TRASH_URL,
322-
SETTING_URL,
323-
ADMIN_APP_URL
324-
]}
325-
// component={ApplicationListPage}
326-
component={LazyApplicationHome}
327-
/>
328302
<LazyRoute path={USER_AUTH_URL} component={LazyUserAuthComp} />
329303
<LazyRoute
330304
path={ORG_AUTH_LOGIN_URL}

viewer/packages/lowcoder/src/components/CreateAppButton.tsx

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { getNextEntityName } from "util/stringUtils";
1111
import { trans } from "i18n";
1212
import { normalAppListSelector } from "../redux/selectors/applicationSelector";
1313
import { HomeResInfo } from "util/homeResUtils";
14-
import { newAppPrefix } from "pages/ApplicationV2/useCreateHomeRes";
1514

1615
const CreateSpan = styled.span`
1716
margin: 0 8px;
@@ -28,78 +27,9 @@ interface SelectedState {
2827
isCreating: boolean;
2928
}
3029

31-
export function useCreateApp(type: AppTypeEnum, onSuccess?: (app: ApplicationDetail) => void) {
32-
const dispatch = useDispatch();
33-
const { currentUser, isCreating } = useSelector<AppState, SelectedState>((state) => ({
34-
currentUser: state.ui.users.user,
35-
isCreating: state.ui.application.loadingStatus.isApplicationCreating,
36-
}));
37-
const allApplications = useSelector(normalAppListSelector);
38-
const typeDisplayName = HomeResInfo[type].name;
39-
const handleCreate = useCallback(() => {
40-
if (isCreating) {
41-
return;
42-
}
43-
const applicationList = allApplications.filter((i) => !type || type === i.applicationType);
44-
const names = applicationList.map((i) => i.name);
45-
const nextNewApplicationName = getNextEntityName(
46-
newAppPrefix(currentUser.username, type),
47-
names
48-
);
49-
50-
let dsl = {};
51-
52-
if (type === AppTypeEnum.Module) {
53-
dsl = {
54-
ui: {
55-
compType: "module",
56-
comp: {},
57-
},
58-
};
59-
} else if (type === AppTypeEnum.NavLayout) {
60-
dsl = {
61-
ui: {
62-
compType: "nav",
63-
comp: {},
64-
},
65-
};
66-
}
67-
68-
dispatch(
69-
createApplication({
70-
applicationType: type || AppTypeEnum.Application,
71-
applicationName: nextNewApplicationName,
72-
orgId: currentUser.currentOrgId,
73-
dsl,
74-
onSuccess: onSuccess || _.noop,
75-
})
76-
);
77-
}, [
78-
allApplications,
79-
currentUser.currentOrgId,
80-
currentUser.username,
81-
dispatch,
82-
isCreating,
83-
onSuccess,
84-
type,
85-
]);
86-
87-
return [handleCreate, isCreating, typeDisplayName] as const;
88-
}
8930

9031
interface IProps {
9132
type: AppTypeEnum;
9233
onSuccess?: (app: ApplicationDetail) => void;
9334
}
9435

95-
export default function CreateAppButton(props: IProps) {
96-
const { type, onSuccess } = props;
97-
const [handleCreate, isCreating, typeDisplayName] = useCreateApp(type, onSuccess);
98-
return (
99-
<CreateSpan onClick={handleCreate}>
100-
{isCreating
101-
? trans("createAppButton.creating")
102-
: trans("createAppButton.created", { name: typeDisplayName })}
103-
</CreateSpan>
104-
);
105-
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export const QUERY_LIBRARY_URL = `/query-library`;
2828
export const FOLDER_URL_PREFIX = `/folder`;
2929
export const FOLDER_URL = `${FOLDER_URL_PREFIX}/:folderId`;
3030
export const FOLDERS_URL = `/folders`;
31-
export const TRASH_URL = `/trash`;
3231
export const IMPORT_APP_FROM_TEMPLATE_URL = `${ALL_APPLICATIONS_URL}/template-import/:templateId`;
3332
export const APP_EDITOR_URL = `${ALL_APPLICATIONS_URL}/:applicationId/:viewMode/:appPageId?`;
3433

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

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

0 commit comments

Comments
 (0)