Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 70ab8da

Browse files
author
FalkWolsky
committedMay 6, 2024
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 8 additions & 1 deletion
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

Lines changed: 8 additions & 1 deletion
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

Lines changed: 10 additions & 7 deletions
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

Lines changed: 8 additions & 5 deletions
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
}
Lines changed: 7 additions & 1 deletion
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

Lines changed: 6 additions & 3 deletions
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

Lines changed: 7 additions & 1 deletion
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

Lines changed: 17 additions & 21 deletions
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
};

‎client/packages/lowcoder/src/pages/datasource/datasourceList.tsx

Lines changed: 181 additions & 186 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { Table } from "../../components/Table";
1515
import { trans } from "../../i18n";
1616
import { DatasourcePermissionDialog } from "../../components/PermissionDialog/DatasourcePermissionDialog";
1717
import DataSourceIcon from "components/DataSourceIcon";
18+
import { Helmet } from "react-helmet";
1819

1920
const DatasourceWrapper = styled.div`
2021
display: flex;
@@ -107,203 +108,197 @@ export const DatasourceList = () => {
107108
const plugins = useSelector(getDataSourceTypesMap);
108109

109110
return (
110-
<DatasourceWrapper>
111-
<StepModal
112-
open={isCreateFormShow}
113-
onCancel={() => showCreateForm(false)}
114-
activeStepKey={"type"}
115-
destroyOnClose={true}
116-
width="888px"
117-
steps={[
118-
{
119-
key: "type",
120-
titleRender: () => <DataSourceModalTitle title={trans("home.selectDatasourceType")} />,
121-
bodyRender: () => (
122-
<PluginPanel
123-
onSelect={(typeInfo) => {
124-
history.push(buildDatasourceCreateUrl(typeInfo.id));
125-
showCreateForm(false);
126-
}}
127-
/>
128-
),
129-
footerRender: () => null,
130-
},
131-
]}
132-
/>
133-
134-
<HeaderWrapper>
135-
<Title>{trans("home.datasource")}</Title>
136-
<Search
137-
placeholder={trans("search")}
138-
value={searchValue}
139-
onChange={(e) => setSearchValue(e.target.value)}
140-
style={{ width: "192px", height: "32px", margin: "0 12px 0 0" }}
141-
/>
142-
<AddBtn buttonType={"primary"} onClick={() => showCreateForm(true)}>
143-
{trans("home.newDatasource")}
144-
</AddBtn>
145-
</HeaderWrapper>
146-
<BodyWrapper>
147-
<StyledTable
148-
rowClassName={(record: any) => (!record.edit ? "datasource-can-not-edit" : "")}
149-
tableLayout={"auto"}
150-
scroll={{ x: "100%" }}
151-
pagination={false}
152-
onRow={(record: any) => ({
153-
onClick: () => record.edit && history.push(buildDatasourceEditUrl(record.id)),
154-
})}
155-
columns={[
111+
<>
112+
<Helmet>{<title>{trans("home.datasource")}</title>}</Helmet>
113+
<DatasourceWrapper>
114+
<StepModal
115+
open={isCreateFormShow}
116+
onCancel={() => showCreateForm(false)}
117+
activeStepKey={"type"}
118+
destroyOnClose={true}
119+
width="888px"
120+
steps={[
156121
{
157-
title: trans("home.datasourceName"),
158-
dataIndex: "name",
159-
ellipsis: true,
160-
sorter: (a: any, b: any) => {
161-
if (a.name === b.name) {
162-
return 0;
163-
}
164-
return a.name > b.name ? 1 : -1;
165-
},
122+
key: "type",
123+
titleRender: () => <DataSourceModalTitle title={trans("home.selectDatasourceType")} />,
124+
bodyRender: () => (
125+
<PluginPanel
126+
onSelect={(typeInfo) => {
127+
history.push(buildDatasourceCreateUrl(typeInfo.id));
128+
showCreateForm(false);
129+
} } />
130+
),
131+
footerRender: () => null,
166132
},
167-
{
168-
title: trans("home.type"),
169-
dataIndex: "type",
170-
ellipsis: true,
171-
width: "192px",
172-
sorter: (a: any, b: any) => {
173-
if (a.type === b.type) {
174-
return 0;
175-
}
176-
return a.type > b.type ? 1 : -1;
133+
]} />
134+
135+
<HeaderWrapper>
136+
<Title>{trans("home.datasource")}</Title>
137+
<Search
138+
placeholder={trans("search")}
139+
value={searchValue}
140+
onChange={(e) => setSearchValue(e.target.value)}
141+
style={{ width: "192px", height: "32px", margin: "0 12px 0 0" }} />
142+
<AddBtn buttonType={"primary"} onClick={() => showCreateForm(true)}>
143+
{trans("home.newDatasource")}
144+
</AddBtn>
145+
</HeaderWrapper>
146+
<BodyWrapper>
147+
<StyledTable
148+
rowClassName={(record: any) => (!record.edit ? "datasource-can-not-edit" : "")}
149+
tableLayout={"auto"}
150+
scroll={{ x: "100%" }}
151+
pagination={false}
152+
onRow={(record: any) => ({
153+
onClick: () => record.edit && history.push(buildDatasourceEditUrl(record.id)),
154+
})}
155+
columns={[
156+
{
157+
title: trans("home.datasourceName"),
158+
dataIndex: "name",
159+
ellipsis: true,
160+
sorter: (a: any, b: any) => {
161+
if (a.name === b.name) {
162+
return 0;
163+
}
164+
return a.name > b.name ? 1 : -1;
165+
},
177166
},
178-
render: (text) => <SubColumnCell>{text}</SubColumnCell>,
179-
},
180-
{
181-
title: trans("home.databaseName"),
182-
dataIndex: "database",
183-
ellipsis: true,
184-
sorter: (a: any, b: any) => {
185-
if (a.database === b.database) {
186-
return 0;
187-
}
188-
return a.database > b.database ? 1 : -1;
167+
{
168+
title: trans("home.type"),
169+
dataIndex: "type",
170+
ellipsis: true,
171+
width: "192px",
172+
sorter: (a: any, b: any) => {
173+
if (a.type === b.type) {
174+
return 0;
175+
}
176+
return a.type > b.type ? 1 : -1;
177+
},
178+
render: (text) => <SubColumnCell>{text}</SubColumnCell>,
189179
},
190-
render: (text) => (
191-
<SubColumnCell>
192-
{isEmpty(text) ? <span style={{ color: "#8B8FA3" }}>--</span> : text}
193-
</SubColumnCell>
194-
),
195-
},
196-
{
197-
title: trans("home.creator"),
198-
dataIndex: "creator",
199-
ellipsis: true,
200-
width: "192px",
201-
sorter: (a: any, b: any) => {
202-
if (a.creator === b.creator) {
203-
return 0;
204-
}
205-
return a.type > b.type ? 1 : -1;
180+
{
181+
title: trans("home.databaseName"),
182+
dataIndex: "database",
183+
ellipsis: true,
184+
sorter: (a: any, b: any) => {
185+
if (a.database === b.database) {
186+
return 0;
187+
}
188+
return a.database > b.database ? 1 : -1;
189+
},
190+
render: (text) => (
191+
<SubColumnCell>
192+
{isEmpty(text) ? <span style={{ color: "#8B8FA3" }}>--</span> : text}
193+
</SubColumnCell>
194+
),
206195
},
207-
render: (text) => <SubColumnCell>{text}</SubColumnCell>,
208-
},
209-
{
210-
title: trans("home.createTime"),
211-
dataIndex: "createTime",
212-
ellipsis: true,
213-
width: "192px",
214-
sorter: (a: any, b: any) => {
215-
if (a.createTime === b.createTime) {
216-
return 0;
217-
}
218-
return a.createTime > b.createTime ? 1 : -1;
196+
{
197+
title: trans("home.creator"),
198+
dataIndex: "creator",
199+
ellipsis: true,
200+
width: "192px",
201+
sorter: (a: any, b: any) => {
202+
if (a.creator === b.creator) {
203+
return 0;
204+
}
205+
return a.type > b.type ? 1 : -1;
206+
},
207+
render: (text) => <SubColumnCell>{text}</SubColumnCell>,
219208
},
220-
render: (text) => (
221-
<SubColumnCell>
222-
{timestampToHumanReadable(text, 30 * 24 * 60 * 60 * 1000)}
223-
</SubColumnCell>
224-
),
225-
},
226-
{
227-
title: " ",
228-
dataIndex: "operation",
229-
width: "152px",
230-
render: (_, record: any) => (
231-
<>
232-
{record.edit && (
233-
<OperationWrapper>
234-
{
235-
<EditBtn
209+
{
210+
title: trans("home.createTime"),
211+
dataIndex: "createTime",
212+
ellipsis: true,
213+
width: "192px",
214+
sorter: (a: any, b: any) => {
215+
if (a.createTime === b.createTime) {
216+
return 0;
217+
}
218+
return a.createTime > b.createTime ? 1 : -1;
219+
},
220+
render: (text) => (
221+
<SubColumnCell>
222+
{timestampToHumanReadable(text, 30 * 24 * 60 * 60 * 1000)}
223+
</SubColumnCell>
224+
),
225+
},
226+
{
227+
title: " ",
228+
dataIndex: "operation",
229+
width: "152px",
230+
render: (_, record: any) => (
231+
<>
232+
{record.edit && (
233+
<OperationWrapper>
234+
{<EditBtn
236235
className={"home-datasource-edit-button"}
237236
buttonType={"primary"}
238237
onClick={() => history.push(buildDatasourceEditUrl(record.id))}
239238
>
240239
{trans("edit")}
241-
</EditBtn>
242-
}
243-
<EditPopover
244-
items={[
245-
{
246-
text: trans("accessControl"),
247-
onClick: () => setShareDatasourceId(record.id),
248-
},
249-
{
250-
text: trans("delete"),
251-
onClick: () => {
252-
dispatch(deleteDatasource({ datasourceId: record.id }));
240+
</EditBtn>}
241+
<EditPopover
242+
items={[
243+
{
244+
text: trans("accessControl"),
245+
onClick: () => setShareDatasourceId(record.id),
253246
},
254-
type: "delete",
255-
},
256-
]}
257-
>
258-
<PopoverIcon tabIndex={-1} />
259-
</EditPopover>
260-
</OperationWrapper>
261-
)}
262-
</>
263-
),
264-
},
265-
]}
266-
dataSource={datasource
267-
.filter((info) => {
268-
if (info.datasource.creationSource === 2) {
269-
return false;
270-
}
271-
if (!isEmpty(searchValue)) {
272-
return (
273-
info.datasource.name.toLowerCase().includes(searchValue.trim().toLowerCase()) ||
274-
info.datasource.type.toLowerCase().includes(searchValue.trim().toLowerCase())
275-
);
276-
}
277-
return true;
278-
})
279-
.map((info, i) => ({
280-
key: i,
281-
id: info.datasource.id,
282-
name: (
283-
<DatasourceName>
284-
<DataSourceIcon dataSourceType={info.datasource.type} />
285-
{info.datasource.name}
286-
</DatasourceName>
287-
),
288-
type: plugins[info.datasource.type]?.name,
289-
database:
290-
(info.datasource.datasourceConfig as any)?.database ??
291-
(info.datasource.datasourceConfig as any)?.serviceName,
292-
createTime: info.datasource.createTime,
293-
creator: info.creatorName,
294-
edit: info.edit,
295-
}))}
296-
/>
297-
</BodyWrapper>
298-
{shareDatasourceId && (
299-
<DatasourcePermissionDialog
300-
datasourceId={shareDatasourceId}
301-
visible={!!shareDatasourceId}
302-
onVisibleChange={(visible) => {
303-
!visible && setShareDatasourceId(undefined);
304-
}}
305-
/>
306-
)}
307-
</DatasourceWrapper>
247+
{
248+
text: trans("delete"),
249+
onClick: () => {
250+
dispatch(deleteDatasource({ datasourceId: record.id }));
251+
},
252+
type: "delete",
253+
},
254+
]}
255+
>
256+
<PopoverIcon tabIndex={-1} />
257+
</EditPopover>
258+
</OperationWrapper>
259+
)}
260+
</>
261+
),
262+
},
263+
]}
264+
dataSource={datasource
265+
.filter((info) => {
266+
if (info.datasource.creationSource === 2) {
267+
return false;
268+
}
269+
if (!isEmpty(searchValue)) {
270+
return (
271+
info.datasource.name.toLowerCase().includes(searchValue.trim().toLowerCase()) ||
272+
info.datasource.type.toLowerCase().includes(searchValue.trim().toLowerCase())
273+
);
274+
}
275+
return true;
276+
})
277+
.map((info, i) => ({
278+
key: i,
279+
id: info.datasource.id,
280+
name: (
281+
<DatasourceName>
282+
<DataSourceIcon dataSourceType={info.datasource.type} />
283+
{info.datasource.name}
284+
</DatasourceName>
285+
),
286+
type: plugins[info.datasource.type]?.name,
287+
database: (info.datasource.datasourceConfig as any)?.database ??
288+
(info.datasource.datasourceConfig as any)?.serviceName,
289+
createTime: info.datasource.createTime,
290+
creator: info.creatorName,
291+
edit: info.edit,
292+
}))} />
293+
</BodyWrapper>
294+
{shareDatasourceId && (
295+
<DatasourcePermissionDialog
296+
datasourceId={shareDatasourceId}
297+
visible={!!shareDatasourceId}
298+
onVisibleChange={(visible) => {
299+
!visible && setShareDatasourceId(undefined);
300+
} } />
301+
)}
302+
</DatasourceWrapper></>
308303
);
309304
};

‎client/packages/lowcoder/src/pages/queryLibrary/QueryLibraryEditor.tsx

Lines changed: 45 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import {
4545
import { importQueryLibrary } from "./importQueryLibrary";
4646
import { registryDataSourcePlugin } from "constants/queryConstants";
4747
import { messageInstance } from "lowcoder-design/src/components/GlobalInstances";
48+
import { Helmet } from "react-helmet";
4849

4950
const Wrapper = styled.div`
5051
display: flex;
@@ -177,61 +178,58 @@ export const QueryLibraryEditor = () => {
177178
};
178179

179180
return (
180-
<Wrapper>
181-
<LeftNav
182-
selectedQuery={isCreatePanelShow ? undefined : selectedQuery}
183-
queryList={Object.values(queryLibrary)}
184-
addQuery={() => showCreatePanel(true)}
185-
onSelect={(id) => {
186-
setSelectedQuery(id);
187-
showCreatePanel(false);
188-
}}
189-
readOnly={showHistory}
190-
/>
191-
<RightContent>
192-
{!selectedQuery || !comp?.children.query.children.id.getView() ? (
193-
EmptyQueryWithoutTab
194-
) : showHistory ? (
195-
<QueryLibraryHistoryView
196-
libraryQueryId={selectedQuery}
197-
compContainer={container}
198-
onClose={() => setShowHistory(false)}
199-
/>
200-
) : (
201-
comp.propertyView({
202-
onPublish: () => setPublishModalVisible(true),
203-
onHistoryShow: () => setShowHistory(true),
204-
})
205-
)}
181+
<>
182+
<Helmet>{<title>{trans("home.queryLibrary")}</title>}</Helmet>
183+
<Wrapper>
184+
<LeftNav
185+
selectedQuery={isCreatePanelShow ? undefined : selectedQuery}
186+
queryList={Object.values(queryLibrary)}
187+
addQuery={() => showCreatePanel(true)}
188+
onSelect={(id) => {
189+
setSelectedQuery(id);
190+
showCreatePanel(false);
191+
} }
192+
readOnly={showHistory} />
193+
<RightContent>
194+
{!selectedQuery || !comp?.children.query.children.id.getView() ? (
195+
EmptyQueryWithoutTab
196+
) : showHistory ? (
197+
<QueryLibraryHistoryView
198+
libraryQueryId={selectedQuery}
199+
compContainer={container}
200+
onClose={() => setShowHistory(false)} />
201+
) : (
202+
comp.propertyView({
203+
onPublish: () => setPublishModalVisible(true),
204+
onHistoryShow: () => setShowHistory(true),
205+
})
206+
)}
206207

207-
{isCreatePanelShow && (
208-
<ResCreatePanel
209-
recentlyUsed={recentlyUsed}
210-
datasource={datasource.filter((d) => d.creationSource !== 2)}
211-
onSelect={handleAdd}
212-
onClose={() => showCreatePanel(false)}
213-
placement={"queryLibrary"}
214-
onImport={(options) =>
215-
importQueryLibrary({
208+
{isCreatePanelShow && (
209+
<ResCreatePanel
210+
recentlyUsed={recentlyUsed}
211+
datasource={datasource.filter((d) => d.creationSource !== 2)}
212+
onSelect={handleAdd}
213+
onClose={() => showCreatePanel(false)}
214+
placement={"queryLibrary"}
215+
onImport={(options) => importQueryLibrary({
216216
dispatch: dispatch,
217217
options: options,
218218
orgId: orgId,
219219
onSuccess: (resp) => {
220220
setSelectedQuery(resp.data.data.id);
221221
showCreatePanel(false);
222222
},
223-
})
224-
}
225-
/>
226-
)}
227-
</RightContent>
228-
<PublishModal
229-
libraryQueryId={comp?.children.query.children.id.getView() || ""}
230-
visible={publishModalVisible}
231-
onClose={() => setPublishModalVisible(false)}
232-
latestVersion={Object.values(selectedRecords)?.[0]?.tag}
233-
/>
234-
</Wrapper>
223+
})} />
224+
)}
225+
</RightContent>
226+
<PublishModal
227+
libraryQueryId={comp?.children.query.children.id.getView() || ""}
228+
visible={publishModalVisible}
229+
onClose={() => setPublishModalVisible(false)}
230+
latestVersion={Object.values(selectedRecords)?.[0]?.tag} />
231+
</Wrapper>
232+
</>
235233
);
236234
};
237235

‎client/packages/lowcoder/src/pages/setting/settingHome.tsx

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { IdSourceHome } from "@lowcoder-ee/pages/setting/idSource";
2525
import { selectSystemConfig } from "redux/selectors/configSelectors";
2626
import { enableCustomBrand } from "util/featureFlagUtils";
2727
import FreeLimitTag from "pages/common/freeLimitTag";
28+
import { Helmet } from "react-helmet";
2829

2930
enum SettingPageEnum {
3031
UserGroups = "permission",
@@ -127,26 +128,28 @@ export function SettingHome() {
127128
];
128129

129130
return (
130-
<TwoColumnSettingPageContent>
131-
<SubSideBar title={trans("settings.title")}>
132-
<Menu
133-
style={{ border: "none" }}
134-
mode="inline"
135-
selectedKeys={[selectKey]}
136-
onClick={(value) => {
137-
history.push("/setting/" + value.key);
138-
}}
139-
items={items}
140-
/>
141-
</SubSideBar>
142-
{selectKey === SettingPageEnum.UserGroups && <PermissionSetting />}
143-
{selectKey === SettingPageEnum.Organization && <Organization />}
144-
{selectKey === SettingPageEnum.Theme && <ThemeHome />}
145-
{selectKey === SettingPageEnum.OAuthProvider && <IdSourceHome />}
146-
{selectKey === SettingPageEnum.Audit && <AuditSetting />}
147-
{selectKey === SettingPageEnum.Branding && <BrandingSetting />}
148-
{selectKey === SettingPageEnum.Advanced && <AdvancedSetting />}
149-
</TwoColumnSettingPageContent>
131+
<>
132+
<Helmet>{<title>{trans("productName")} {trans("settings.title")}</title>}</Helmet>
133+
<TwoColumnSettingPageContent>
134+
<SubSideBar title={trans("settings.title")}>
135+
<Menu
136+
style={{ border: "none" }}
137+
mode="inline"
138+
selectedKeys={[selectKey]}
139+
onClick={(value) => {
140+
history.push("/setting/" + value.key);
141+
} }
142+
items={items} />
143+
</SubSideBar>
144+
{selectKey === SettingPageEnum.UserGroups && <PermissionSetting />}
145+
{selectKey === SettingPageEnum.Organization && <Organization />}
146+
{selectKey === SettingPageEnum.Theme && <ThemeHome />}
147+
{selectKey === SettingPageEnum.OAuthProvider && <IdSourceHome />}
148+
{selectKey === SettingPageEnum.Audit && <AuditSetting />}
149+
{selectKey === SettingPageEnum.Branding && <BrandingSetting />}
150+
{selectKey === SettingPageEnum.Advanced && <AdvancedSetting />}
151+
</TwoColumnSettingPageContent>
152+
</>
150153
);
151154
}
152155

0 commit comments

Comments
 (0)
Please sign in to comment.