Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions config-ui/src/config/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,22 @@ export const PATHS = {
CONNECTIONS: () => `${PATH_PREFIX}/connections`,
CONNECTION: (plugin: string, connectionId: ID) => `${PATH_PREFIX}/connections/${plugin}/${connectionId}`,
PROJECTS: () => `${PATH_PREFIX}/projects`,
PROJECT: (pname: string, tab?: 'configuration' | 'status' | 'settings') =>
`${PATH_PREFIX}/projects/${encodeName(pname)}${tab ? `?tab=${tab}` : ''}`,
PROJECT: (
pname: string,
{ tab, tabId }: { tab?: 'configuration' | 'status'; tabId?: 'blueprint' | 'webhook' | 'settings' } = {},
) => {
let params = '';

if (tab && tabId) {
params = `?tab=${tab}&tabId=${tabId}`;
} else if (tab) {
params = `?tab=${tab}`;
} else if (tabId) {
params = `?tabId=${tabId}`;
}

return `${PATH_PREFIX}/projects/${encodeName(pname)}${params}`;
},
PROJECT_CONNECTION: (pname: string, plugin: string, connectionId: ID) =>
`${PATH_PREFIX}/projects/${encodeName(pname)}/${plugin}-${connectionId}`,
BLUEPRINTS: () => `${PATH_PREFIX}/advanced/blueprints`,
Expand Down
2 changes: 1 addition & 1 deletion config-ui/src/routes/blueprint/connection-detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const BlueprintConnectionDetailPage = () => {

if (success) {
handleShowTips();
navigate(pname ? PATHS.PROJECT(pname, 'configuration') : PATHS.BLUEPRINT(blueprint.id, 'configuration'));
navigate(pname ? PATHS.PROJECT(pname, { tab: 'configuration' }) : PATHS.BLUEPRINT(blueprint.id, 'configuration'));
}
};

Expand Down
2 changes: 1 addition & 1 deletion config-ui/src/routes/project/detail/settings-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const SettingsPanel = ({ project, onRefresh }: Props) => {

if (success) {
onRefresh();
navigate(PATHS.PROJECT(name, 'settings'));
navigate(PATHS.PROJECT(name, { tabId: 'settings' }));
}
};

Expand Down
4 changes: 2 additions & 2 deletions config-ui/src/routes/project/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export const ProjectHomePage = () => {
dataIndex: 'name',
key: 'name',
render: (name: string) => (
<Link to={PATHS.PROJECT(name, 'configuration')} style={{ color: '#292b3f' }}>
<Link to={PATHS.PROJECT(name, { tab: 'configuration' })} style={{ color: '#292b3f' }}>
{name}
</Link>
),
Expand Down Expand Up @@ -192,7 +192,7 @@ export const ProjectHomePage = () => {
<Button
type="primary"
icon={<SettingOutlined />}
onClick={() => navigate(PATHS.PROJECT(name, 'configuration'))}
onClick={() => navigate(PATHS.PROJECT(name, { tab: 'configuration' }))}
/>
),
},
Expand Down