-
-
-
- {open ? (
-
- ) : (
-
- )}
-
+ })}
+ classes={{
+ paper: clsx(classes.drawerPaper, {
+ [classes.drawerOpen]: open,
+ [classes.drawerClose]: !open,
+ }),
+ }}
+ >
+
+
+
+
+
+
+
+ {open ? (
+
+ ) : (
+
+ )}
+
+
-
-
+
-
-
- {children}
+
+
+ {children}
+
-
+ )
);
};
diff --git a/applications/osb-portal/src/components/workspace/drawer/WorkspaceInteractions.tsx b/applications/osb-portal/src/components/workspace/drawer/WorkspaceInteractions.tsx
index 360f7a8d..92ba3163 100644
--- a/applications/osb-portal/src/components/workspace/drawer/WorkspaceInteractions.tsx
+++ b/applications/osb-portal/src/components/workspace/drawer/WorkspaceInteractions.tsx
@@ -1,5 +1,5 @@
import * as React from "react";
-import { useHistory } from "react-router-dom";
+import { useNavigate } from "react-router-dom";
import makeStyles from "@mui/styles/makeStyles";
import { styled } from "@mui/styles";
@@ -105,10 +105,9 @@ interface WorkspaceProps {
deleteWorkspace: (wsId: number) => null;
user: UserInfo;
[propName: string]: any;
- openResource: (r: WorkspaceResource) => any;
refreshWorkspacePage?: () => void;
currentResource: WorkspaceResource;
- openResourceAction?: (resource: WorkspaceResource) => void;
+ hideTabs: Boolean;
}
const SidebarBox = styled(Box)(({ theme }) => ({
@@ -145,7 +144,7 @@ const SidebarIconButton = styled(IconButton)(({ theme }) => ({
}));
export default (props: WorkspaceProps | any) => {
- const { workspace, refreshWorkspace } = props;
+ const { workspace, refreshWorkspace, hideTabs } = props;
const classes = useStyles();
const [tabValue, setTabValue] = React.useState(0);
@@ -186,7 +185,7 @@ export default (props: WorkspaceProps | any) => {
{props.open ? (
- {
label="My Assets"
sx={{ pl: "0.75rem", pr: "0.75rem", fontSize: "0.75rem" }}
/>
-
+ }
@@ -258,9 +257,7 @@ export default (props: WorkspaceProps | any) => {
workspace={workspace}
currentResource={props.currentResource}
refreshWorkspace={handleWorkspaceRefresh}
- openResource={props.openResource}
user={props.user}
- openResourceAction={props.openResourceAction}
/>
diff --git a/applications/osb-portal/src/components/workspace/drawer/WorkspaceResourceBrowser.tsx b/applications/osb-portal/src/components/workspace/drawer/WorkspaceResourceBrowser.tsx
index b22391bc..df2ed439 100644
--- a/applications/osb-portal/src/components/workspace/drawer/WorkspaceResourceBrowser.tsx
+++ b/applications/osb-portal/src/components/workspace/drawer/WorkspaceResourceBrowser.tsx
@@ -1,4 +1,5 @@
import * as React from "react";
+import { useNavigate } from "react-router-dom";
//theme
import { styled } from "@mui/styles";
@@ -90,17 +91,15 @@ const OSBResourceItem = (props: {
resource: WorkspaceResource;
active: boolean;
refreshWorkspace: () => void;
- openResource: (r: WorkspaceResource) => any;
- lastOpenResourceId: number;
+ currentResourceId: number;
Icon: JSX.Element;
- openResourceAction?: (resource: WorkspaceResource) => void;
+ workspaceId: number;
}) => {
const {
resource,
active,
refreshWorkspace,
- openResource,
- openResourceAction,
+ workspaceId,
Icon,
} = props;
const canOpenFile: boolean =
@@ -108,6 +107,7 @@ const OSBResourceItem = (props: {
const [waiting, setWaiting] = React.useState(
resource.status === ResourceStatus.pending
);
+ let navigate = useNavigate();
React.useEffect(() => {
setWaiting(resource.status === ResourceStatus.pending);
@@ -127,13 +127,10 @@ const OSBResourceItem = (props: {
const handleOpenResource =
(e: any) => {
- openResource && openResource(resource);
- return workspaceResourceService
- .workspacesControllerWorkspaceResourceOpen(resource.id)
- .then(openResourceAction ? (() => openResourceAction(resource)) : refreshWorkspace)
- .catch(() => {
- console.error("Error opening resource, ResourceOpen function failed!");
- });
+ navigate(
+ {pathname: `/workspace/open/${workspaceId}/${resource.type.application.code}`,
+ search: `?resource=${resource.name}`},
+ )
};
return (
@@ -179,24 +176,24 @@ const OSBResourceItem = (props: {
interface WorkspaceProps {
workspace: Workspace;
refreshWorkspace: () => void;
- openResource?: (r: WorkspaceResource) => any;
currentResource: WorkspaceResource;
user: UserInfo;
- openResourceAction?: (resource: WorkspaceResource) => void;
}
const WorkspaceResourceBrowser = (props: WorkspaceProps) => {
- const { workspace, refreshWorkspace, openResource, currentResource, openResourceAction } = props;
+ const { workspace, refreshWorkspace, currentResource } = props;
- const lastOpenResourceId = currentResource?.id ?? -1;
+ const currentResourceId = currentResource?.id ?? -1;
+ if (!workspace.resources || workspace.resources.length === 0) {
+ return null;
+ }
+
const resources = workspace.resources.filter(
(resource) => resource.id !== undefined && resource.id !== -1
);
- if (!resources || resources.length === 0) {
- return null;
- }
+
const experimentalResources = resources.filter(
(resource) => resource.resourceType === ResourceType.E
@@ -244,12 +241,11 @@ const WorkspaceResourceBrowser = (props: WorkspaceProps) => {
))}
diff --git a/applications/osb-portal/src/index.ejs b/applications/osb-portal/src/index.ejs
index eadb32e0..96cc4aa4 100644
--- a/applications/osb-portal/src/index.ejs
+++ b/applications/osb-portal/src/index.ejs
@@ -9,7 +9,7 @@
-
+ loading...