Skip to content

Commit 70ab8da

Browse files
author
FalkWolsky
committed
Adapt html title tag by helmet for Admin Area
1 parent 7d218d6 commit 70ab8da

File tree

13 files changed

+322
-293
lines changed

13 files changed

+322
-293
lines changed

client/packages/lowcoder/src/i18n/locales/de.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2436,6 +2436,7 @@ export const de: typeof en = {
24362436
"allApplications": "Alle Apps",
24372437
"allModules": "Alle Module",
24382438
"allFolders": "Alle Ordner",
2439+
"yourFolders" : "Deine Ordner",
24392440
"modules": "Module",
24402441
"module": "Modul",
24412442
"trash": "Papierkorb",

client/packages/lowcoder/src/i18n/locales/en.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2801,6 +2801,7 @@ export const en = {
28012801
"allApplications": "Your Apps",
28022802
"allModules": "Your Modules",
28032803
"allFolders": "All Folders",
2804+
"yourFolders" : "Your Folders",
28042805
"modules": "Modules",
28052806
"module": "Module",
28062807
"trash": "Trash",

client/packages/lowcoder/src/pages/ApplicationV2/FolderView.tsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { fetchFolderElements } from "../../redux/reduxActions/folderActions";
66
import { FolderMeta } from "../../constants/applicationConstants";
77
import { buildFolderUrl } from "../../constants/routesURL";
88
import { folderElementsSelector, foldersSelector } from "../../redux/selectors/folderSelector";
9+
import { Helmet } from "react-helmet";
10+
import { trans } from "i18n";
911

1012
function getBreadcrumbs(
1113
folder: FolderMeta,
@@ -48,5 +50,10 @@ export function FolderView() {
4850
dispatch(fetchFolderElements({ folderId: folderId }));
4951
}, [folderId]);
5052

51-
return <HomeLayout elements={elements[folderId]} mode={"folder"} breadcrumb={breadcrumbs} />;
53+
return (
54+
<>
55+
<Helmet>{<title>{trans("home.yourFolders")}</title>}</Helmet>
56+
<HomeLayout elements={elements[folderId]} mode={"folder"} breadcrumb={breadcrumbs} />
57+
</>
58+
);
5259
}

client/packages/lowcoder/src/pages/ApplicationV2/HomeView.tsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { useSelector } from "react-redux";
22
import { HomeLayout } from "./HomeLayout";
33
import { getUser } from "../../redux/selectors/usersSelectors";
44
import { folderElementsSelector } from "../../redux/selectors/folderSelector";
5+
import { Helmet } from "react-helmet";
6+
import { trans } from "i18n";
57

68
export function HomeView() {
79
const elements = useSelector(folderElementsSelector)[""];
@@ -11,5 +13,10 @@ export function HomeView() {
1113
return null;
1214
}
1315

14-
return <HomeLayout elements={elements} mode={"view"} />;
16+
return (
17+
<>
18+
<Helmet>{<title>{trans("productName")} {trans("home.home")}</title>}</Helmet>
19+
<HomeLayout elements={elements} mode={"view"} />
20+
</>
21+
);
1522
}

client/packages/lowcoder/src/pages/ApplicationV2/MarketplaceView.tsx

+10-7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { ApplicationMeta } from "@lowcoder-ee/constants/applicationConstants";
88
import { GenericApiResponse } from "@lowcoder-ee/api/apiResponses";
99
import { validateResponse } from "@lowcoder-ee/api/apiUtils";
1010
import { messageInstance } from "lowcoder-design/src/components/GlobalInstances";
11+
import { Helmet } from "react-helmet";
1112

1213
export function MarketplaceView() {
1314
const [ marketplaceApps, setMarketplaceApps ] = useState<Array<ApplicationMeta>>([]);
@@ -52,12 +53,14 @@ export function MarketplaceView() {
5253
}, []);
5354

5455
return (
55-
<HomeLayout
56-
elements={[]}
57-
localMarketplaceApps={localMarketplaceApps}
58-
globalMarketplaceApps={marketplaceApps}
59-
breadcrumb={[{ text: trans("home.marketplace"), path: MARKETPLACE_URL }]}
60-
mode={"marketplace"}
61-
/>
56+
<>
57+
<Helmet>{<title>{trans("home.marketplace")}</title>}</Helmet>
58+
<HomeLayout
59+
elements={[]}
60+
localMarketplaceApps={localMarketplaceApps}
61+
globalMarketplaceApps={marketplaceApps}
62+
breadcrumb={[{ text: trans("home.marketplace"), path: MARKETPLACE_URL }]}
63+
mode={"marketplace"} />
64+
</>
6265
);
6366
};

client/packages/lowcoder/src/pages/ApplicationV2/ModuleView.tsx

+8-5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { MODULE_APPLICATIONS_URL } from "../../constants/routesURL";
55
import { normalAppListSelector } from "../../redux/selectors/applicationSelector";
66
import { AppTypeEnum } from "../../constants/applicationConstants";
77
import { trans } from "../../i18n";
8+
import { Helmet } from "react-helmet";
89

910
export function ModuleView() {
1011
const user = useSelector(getUser);
@@ -15,10 +16,12 @@ export function ModuleView() {
1516
}
1617

1718
return (
18-
<HomeLayout
19-
elements={allApplications.filter((a) => a.applicationType === AppTypeEnum.Module)}
20-
mode={"module"}
21-
breadcrumb={[{ text: trans("home.allModules"), path: MODULE_APPLICATIONS_URL }]}
22-
/>
19+
<>
20+
<Helmet>{<title>{trans("productName")} {trans("home.modules")}</title>}</Helmet>
21+
<HomeLayout
22+
elements={allApplications.filter((a) => a.applicationType === AppTypeEnum.Module)}
23+
mode={"module"}
24+
breadcrumb={[{ text: trans("home.allModules"), path: MODULE_APPLICATIONS_URL }]} />
25+
</>
2326
);
2427
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
import { Helmet } from "react-helmet";
12
import { NewsLayout } from "./NewsLayout";
3+
import { trans } from "i18n";
24

35
export function NewsView() {
46

5-
return <NewsLayout/>;
7+
return (
8+
<><Helmet>
9+
{<title>{trans("productName")} {trans("home.news")}</title>}
10+
</Helmet><NewsLayout /></>
11+
);
612

713
};

client/packages/lowcoder/src/pages/ApplicationV2/TrashView.tsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { TRASH_URL } from "../../constants/routesURL";
55
import { useEffect } from "react";
66
import { fetchApplicationRecycleList } from "../../redux/reduxActions/applicationActions";
77
import { trans } from "../../i18n";
8+
import { Helmet } from "react-helmet";
89

910
export function TrashView() {
1011
const dispatch = useDispatch();
@@ -15,10 +16,12 @@ export function TrashView() {
1516
}, [dispatch]);
1617

1718
return (
18-
<HomeLayout
19+
<>
20+
<Helmet>{<title>{trans("home.trash")}</title>}</Helmet>
21+
<HomeLayout
1922
elements={recycleList}
2023
breadcrumb={[{ text: trans("home.trash"), path: TRASH_URL }]}
21-
mode={"trash"}
22-
/>
24+
mode={"trash"} />
25+
</>
2326
);
2427
}

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { trans } from "../../i18n";
55
import { USER_PROFILE_URL } from "constants/routesURL";
66
import { useEffect } from "react";
77
import { fetchApiKeysAction } from "redux/reduxActions/userActions";
8+
import { Helmet } from "react-helmet";
89

910
export function UserProfileView() {
1011

@@ -22,6 +23,11 @@ export function UserProfileView() {
2223
}
2324

2425

25-
return <UserProfileLayout breadcrumb={[{ text: trans("home.profile"), path: USER_PROFILE_URL }]}/>;
26+
return (
27+
<>
28+
<Helmet>{<title>{trans("home.profile")}</title>}</Helmet>
29+
<UserProfileLayout breadcrumb={[{ text: trans("home.profile"), path: USER_PROFILE_URL }]} />
30+
</>
31+
);
2632

2733
};

client/packages/lowcoder/src/pages/datasource/datasourceEditPage.tsx

+17-21
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { DatasourceType } from "@lowcoder-ee/constants/queryConstants";
1313
import { getDatasourceTutorial } from "@lowcoder-ee/util/tutorialUtils";
1414
import { getDataSourceFormManifest } from "./getDataSourceFormManifest";
1515
import DataSourceIcon from "components/DataSourceIcon";
16+
import { Helmet } from "react-helmet";
1617

1718
const Wrapper = styled.div`
1819
display: flex;
@@ -190,7 +191,7 @@ export const DatasourceEditPage = () => {
190191
const DatasourceForm = formManifest?.form;
191192

192193
return (
193-
<Wrapper>
194+
<><Helmet>{<title>{trans("home.datasource")} | {finalDataSourceType}</title>}</Helmet><Wrapper>
194195
<ContentWrapper>
195196
<Header>
196197
<BackBtn onClick={() => history.push(DATASOURCE_URL)}>
@@ -223,8 +224,7 @@ export const DatasourceEditPage = () => {
223224
onFormReadyStatusChange={handleFormReadyStatusChange}
224225
dataSourceTypeInfo={dataSourceTypeInfo}
225226
datasource={datasourceInfo?.datasource!}
226-
size={"middle"}
227-
/>
227+
size={"middle"} />
228228
)}
229229

230230
{formManifest && (
@@ -233,14 +233,12 @@ export const DatasourceEditPage = () => {
233233
<TacoButton
234234
buttonType="link"
235235
loading={testLoading}
236-
onClick={() =>
237-
resolveTest(
238-
genRequest({
239-
datasourceId: datasourceId,
240-
datasourceType: datasourceType ?? datasourceInfo?.datasource.type,
241-
})
242-
)
243-
}
236+
onClick={() => resolveTest(
237+
genRequest({
238+
datasourceId: datasourceId,
239+
datasourceType: datasourceType ?? datasourceInfo?.datasource.type,
240+
})
241+
)}
244242
>
245243
{trans("query.testConnection")}
246244
</TacoButton>
@@ -250,16 +248,14 @@ export const DatasourceEditPage = () => {
250248
buttonType="primary"
251249
loading={createLoading}
252250
disabled={!isReady}
253-
onClick={() =>
254-
resolveCreate({
251+
onClick={() => resolveCreate({
252+
datasourceId: datasourceId,
253+
request: genRequest({
255254
datasourceId: datasourceId,
256-
request: genRequest({
257-
datasourceId: datasourceId,
258-
datasourceType: datasourceType ?? datasourceInfo?.datasource.type,
259-
}),
260-
afterCreate: () => history.push(DATASOURCE_URL),
261-
})
262-
}
255+
datasourceType: datasourceType ?? datasourceInfo?.datasource.type,
256+
}),
257+
afterCreate: () => history.push(DATASOURCE_URL),
258+
})}
263259
>
264260
{!createLoading && trans("query.save")}
265261
</TacoButton>
@@ -290,6 +286,6 @@ export const DatasourceEditPage = () => {
290286
)}
291287
</Body>
292288
</ContentWrapper>
293-
</Wrapper>
289+
</Wrapper></>
294290
);
295291
};

0 commit comments

Comments
 (0)