Skip to content

Commit

Permalink
Merge pull request #904 from OpenSourceBrain/feature/887
Browse files Browse the repository at this point in the history
887 - Allow more permanent URL for workspaces page
  • Loading branch information
filippomc authored Feb 2, 2024
2 parents c40ce34 + d00bef7 commit 037c8d6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
14 changes: 11 additions & 3 deletions applications/osb-portal/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,27 @@ export const App = (props: AppProps) => {
}
/>
<Route
path="/workspace/:workspaceId"
path="/workspaces"
element={
<SidebarPageLayout>
<HomePage />
</SidebarPageLayout>
}
/>
<Route
path="/workspaces/:workspaceId"
element={
<SidebarPageLayout>
<WorkspacePage />
</SidebarPageLayout>
}
/>
<Route
path="/workspace/open/:workspaceId/:app"
path="/workspaces/open/:workspaceId/:app"
element={<ProtectedRoute><WorkspaceOpenPage /></ProtectedRoute>}
/>
<Route
path="/workspace/open/:workspaceId"
path="/workspaces/open/:workspaceId"
element={
<ProtectedRoute>
<WorkspaceOpenPage />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const OSBResourceItem = (props: {
(e: any | Event) => {
e.preventDefault();
navigate(
{pathname: `/workspace/open/${workspaceId}/${resource.type.application.code}`,
{pathname: `/workspaces/open/${workspaceId}/${resource.type.application.code}`,
search: `?resource=${encodeURIComponent(resource.name)}`},
)
};
Expand Down
2 changes: 1 addition & 1 deletion applications/osb-portal/src/pages/UserPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ export const UserPage = (props: any) => {
}

const openWorkspaceUrl = (workspaceId: number) => {
navigate(`/workspace/${workspaceId}`);
navigate(`/workspaces/${workspaceId}`);
};

const canEdit =
Expand Down
2 changes: 1 addition & 1 deletion applications/osb-portal/src/pages/WorkspacePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const WorkspacePage = (props: any) => {
};

const openWithApp = (selectedOption: OSBApplication) => {
navigate(`/workspace/open/${workspaceId}/${selectedOption.code}`);
navigate(`/workspaces/open/${workspaceId}/${selectedOption.code}`);
};

const canEdit = canEditWorkspace(props.user, workspace);
Expand Down
2 changes: 1 addition & 1 deletion applications/osb-portal/src/pages/WorkspacesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const WorkspacesPage = (props: WorkspacesPageProps) => {
searchFilterValues.text === "");

const openWorkspaceUrl = (workspaceId: number) => {
navigate(`/workspace/${workspaceId}`);
navigate(`/workspaces/${workspaceId}`);
};

const debouncedHandleSearchFilter = debounce((newTextFilter: string) => {
Expand Down

0 comments on commit 037c8d6

Please sign in to comment.