Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite4c0ba2

Browse files
committed
Made fix to support /datasource/NEW. Also fixed the datasource url for datasource configuration
1 parentad664c8 commite4c0ba2

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

‎app/client/src/ce/RouteBuilder.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export const workspaceDatasourcesURL = (workspaceId: string): string =>
203203
exportconstworkspaceDatasourceEditorURL=(
204204
workspaceId:string,
205205
datasourceId:string,
206-
):string=>`/workspace/${workspaceId}/datasources/${datasourceId}`;
206+
):string=>`/workspace/${workspaceId}/datasource/${datasourceId}`;
207207

208208
exportconstappLibrariesURL=():string=>
209209
urlBuilder.build({

‎app/client/src/ce/entities/URLRedirect/URLAssembly.ts‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -338,16 +338,16 @@ export class URLBuilder {
338338

339339
constentityId=this.resolveEntityId(builderParams);
340340

341-
// Handle workspace-specific suffix modification
342-
letmodifiedSuffix=suffix;
341+
// Handle workspace-specific URL generation
342+
letbasePath=this.generateBasePath(entityId,mode);
343+
letsuffixPath=suffix ?`/${suffix}` :"";
343344

344345
if(this.isWorkspaceContext()&&suffix?.startsWith("datasource/")){
345-
// For workspace context, remove the 'datasource/' prefix from suffix
346-
modifiedSuffix=suffix.replace("datasource/","");
346+
// For workspace datasource URLs, use singular /datasource path
347+
basePath=`/workspace/${entityId}/datasource`;
348+
suffixPath=`/${suffix.replace("datasource/","")}`;
347349
}
348350

349-
constbasePath=this.generateBasePath(entityId,mode);
350-
351351
constqueryParamsToPersist=fetchQueryParamsToPersist(
352352
persistExistingParams,
353353
);
@@ -362,8 +362,6 @@ export class URLBuilder {
362362

363363
constqueryString=getQueryStringfromObject(modifiedQueryParams);
364364

365-
constsuffixPath=modifiedSuffix ?`/${modifiedSuffix}` :"";
366-
367365
consthashPath=hash ?`#${hash}` :"";
368366

369367
// hash fragment should be at the end of the href

‎app/client/src/pages/workspace/WorkspaceDatasourcesPage.tsx‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,21 +119,19 @@ export const WorkspaceDatasourcesPage = (
119119
{/* Create new datasource - use the exact same component */}
120120
<SentryRoute
121121
exact
122-
path="/workspace/:workspaceId/datasources/new"
122+
path="/workspace/:workspaceId/datasources/NEW"
123123
render={()=><WorkspaceCreateNewDatasourceTab/>}
124124
/>
125125
{/* Edit existing datasource - use workspace-specific editor */}
126126
<SentryRoute
127127
exact
128-
path="/workspace/:workspaceId/datasources/:datasourceId"
128+
path="/workspace/:workspaceId/datasource/:datasourceId"
129129
render={()=><WorkspaceDatasourceEditor/>}
130130
/>
131131
{/* Default list view - show "Connect a datasource" page by default */}
132132
<SentryRoute
133133
path="/workspace/:workspaceId/datasources"
134-
render={()=>(
135-
<WorkspaceCreateNewDatasourceTabworkspaceId={workspaceId}/>
136-
)}
134+
render={()=><WorkspaceCreateNewDatasourceTab/>}
137135
/>
138136
</Switch>
139137
</MainPane>

‎app/client/src/pages/workspace/index.tsx‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ export function Workspace() {
2727
)}
2828
path={`${path}/:workspaceId/datasources`}
2929
/>
30+
<SentryRoute
31+
component={({
32+
match,
33+
}:{
34+
match:{params:{workspaceId:string}};
35+
})=>(
36+
<WorkspaceDatasourcesPageworkspaceId={match.params.workspaceId}/>
37+
)}
38+
path={`${path}/:workspaceId/datasource`}
39+
/>
3040
<SentryRoutecomponent={DefaultWorkspacePage}/>
3141
</Switch>
3242
</PageWrapper>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp