Skip to content

Commit 2c21181

Browse files
committed
Add deploy credential param in the deployment endpoint
1 parent 767da72 commit 2c21181

File tree

6 files changed

+33
-6
lines changed

6 files changed

+33
-6
lines changed

client/packages/lowcoder/src/pages/setting/environments/config/apps.config.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ export const appsConfig: DeployableItemConfig = {
3939
label: 'Public To Marketplace',
4040
type: 'checkbox',
4141
defaultValue: false
42+
},
43+
{
44+
name: 'deployCredential',
45+
label: 'Overwrite Credentials',
46+
type: 'checkbox',
47+
defaultValue: false
4248
}
4349
],
4450
prepareParams: (item: App, values: any, sourceEnv: Environment, targetEnv: Environment) => {
@@ -51,6 +57,7 @@ export const appsConfig: DeployableItemConfig = {
5157
publicToAll: values.publicToAll,
5258
publicToMarketplace: values.publicToMarketplace,
5359
applicationGid: item.applicationGid,
60+
deployCredential: values.deployCredential ?? false
5461
};
5562
},
5663
execute: (params: any) => deployApp(params)

client/packages/lowcoder/src/pages/setting/environments/config/data-sources.config.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ export const dataSourcesConfig: DeployableItemConfig = {
1616
label: 'Update Dependencies If Needed',
1717
type: 'checkbox',
1818
defaultValue: false
19+
},
20+
{
21+
name: 'deployCredential',
22+
label: 'Overwrite Credentials',
23+
type: 'checkbox',
24+
defaultValue: false
1925
}
2026
],
2127
prepareParams: (item: DataSource, values: any, sourceEnv: Environment, targetEnv: Environment) => {
@@ -24,7 +30,8 @@ export const dataSourcesConfig: DeployableItemConfig = {
2430
targetEnvId: targetEnv.environmentId,
2531
datasourceId: item.id,
2632
updateDependenciesIfNeeded: values.updateDependenciesIfNeeded,
27-
datasourceGid: item.gid
33+
datasourceGid: item.gid,
34+
deployCredential: values.deployCredential ?? false
2835
};
2936
},
3037
execute: (params: any) => deployDataSource(params)

client/packages/lowcoder/src/pages/setting/environments/config/workspace.config.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@ export const workspaceConfig: DeployableItemConfig = {
1212
// Deploy configuration
1313
deploy: {
1414
singularLabel: 'Workspace',
15-
fields: [],
15+
fields: [
16+
{
17+
name: 'deployCredential',
18+
label: 'Overwrite Credentials',
19+
type: 'checkbox',
20+
defaultValue: false
21+
}
22+
],
1623
prepareParams: (item: Workspace, values: any, sourceEnv: Environment, targetEnv: Environment) => {
1724
if (!item.gid) {
1825
console.error('Missing workspace.gid when deploying workspace:', item);
@@ -22,7 +29,8 @@ export const workspaceConfig: DeployableItemConfig = {
2229
return {
2330
envId: sourceEnv.environmentId,
2431
targetEnvId: targetEnv.environmentId,
25-
workspaceId: item.gid
32+
workspaceId: item.gid,
33+
deployCredential: values.deployCredential ?? false
2634
};
2735
},
2836
execute: (params: any) => deployWorkspace(params)

client/packages/lowcoder/src/pages/setting/environments/services/apps.service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export interface DeployAppParams {
2323
publishOnTarget?: boolean;
2424
publicToAll?: boolean;
2525
publicToMarketplace?: boolean;
26+
deployCredential: boolean;
2627
}
2728

2829

@@ -119,7 +120,8 @@ export const deployApp = async (params: DeployAppParams): Promise<boolean> => {
119120
updateDependenciesIfNeeded: params.updateDependenciesIfNeeded ?? false,
120121
publishOnTarget: params.publishOnTarget ?? false,
121122
publicToAll: params.publicToAll ?? false,
122-
publicToMarketplace: params.publicToMarketplace ?? false
123+
publicToMarketplace: params.publicToMarketplace ?? false,
124+
deployCredential: params.deployCredential
123125
}
124126
}
125127
);

client/packages/lowcoder/src/pages/setting/environments/services/datasources.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export interface DeployDataSourceParams {
2222
datasourceId: string;
2323
datasourceGid: string;
2424
updateDependenciesIfNeeded?: boolean;
25-
25+
deployCredential: boolean;
2626
}
2727
// Get data sources for a workspace - using your correct implementation
2828
export async function getWorkspaceDataSources(
@@ -159,6 +159,7 @@ export async function deployDataSource(params: DeployDataSourceParams): Promise<
159159
targetEnvId: params.targetEnvId,
160160
datasourceId: params.datasourceId,
161161
updateDependenciesIfNeeded: params.updateDependenciesIfNeeded ?? false,
162+
deployCredential: params.deployCredential
162163
}
163164
});
164165
if (response.status === 200) {

client/packages/lowcoder/src/pages/setting/environments/services/workspace.service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,16 @@ export async function deployWorkspace(params: {
8484
envId: string;
8585
targetEnvId: string;
8686
workspaceId: string;
87+
deployCredential: boolean; // Mandatory parameter
8788
}): Promise<boolean> {
8889
try {
8990
// Use the new endpoint format with only essential parameters
9091
const response = await axios.post('/api/plugins/enterprise/org/deploy', null, {
9192
params: {
9293
orgGid: params.workspaceId, // Using workspaceId as orgGid
9394
envId: params.envId,
94-
targetEnvId: params.targetEnvId
95+
targetEnvId: params.targetEnvId,
96+
deployCredential: params.deployCredential
9597
}
9698
});
9799

0 commit comments

Comments
 (0)