Skip to content

Commit

Permalink
Notebook Spawner reachable when disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
pnaik1 committed Jul 12, 2023
1 parent 58d77f1 commit 4c898c7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
11 changes: 7 additions & 4 deletions frontend/src/pages/projects/screens/projects/EmptyProjects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
import { CubesIcon } from '@patternfly/react-icons';
import { useNavigate } from 'react-router-dom';
import { ODH_PRODUCT_NAME } from '~/utilities/const';
import { useAppContext } from '~/app/AppContext';
import LaunchJupyterButton from '~/pages/projects/screens/projects/LaunchJupyterButton';
import NewProjectButton from './NewProjectButton';

Expand All @@ -19,7 +20,7 @@ type EmptyProjectsProps = {

const EmptyProjects: React.FC<EmptyProjectsProps> = ({ allowCreate }) => {
const navigate = useNavigate();

const { dashboardConfig } = useAppContext();
return (
<EmptyState>
<EmptyStateIcon icon={CubesIcon} />
Expand All @@ -36,9 +37,11 @@ const EmptyProjects: React.FC<EmptyProjectsProps> = ({ allowCreate }) => {
<NewProjectButton
onProjectCreated={(projectName) => navigate(`/projects/${projectName}`)}
/>
<EmptyStateSecondaryActions>
<LaunchJupyterButton variant={ButtonVariant.link} />
</EmptyStateSecondaryActions>
{dashboardConfig.spec.notebookController?.enabled && (
<EmptyStateSecondaryActions>
<LaunchJupyterButton variant={ButtonVariant.link} />
</EmptyStateSecondaryActions>
)}
</>
) : (
<LaunchJupyterButton variant={ButtonVariant.primary} />
Expand Down
24 changes: 11 additions & 13 deletions frontend/src/pages/projects/screens/projects/ProjectListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import useTableColumnSort from '~/components/table/useTableColumnSort';
import SearchField, { SearchType } from '~/pages/projects/components/SearchField';
import { ProjectKind } from '~/k8sTypes';
import { getProjectDisplayName, getProjectOwner } from '~/pages/projects/utils';
import { useAppContext } from '~/app/AppContext';
import LaunchJupyterButton from '~/pages/projects/screens/projects/LaunchJupyterButton';
import { ProjectsContext } from '~/concepts/projects/ProjectsContext';
import NewProjectButton from './NewProjectButton';
Expand All @@ -19,6 +20,7 @@ type ProjectListViewProps = {
};

const ProjectListView: React.FC<ProjectListViewProps> = ({ allowCreate }) => {
const { dashboardConfig } = useAppContext();
const { projects: unfilteredProjects } = React.useContext(ProjectsContext);
const navigate = useNavigate();
const [searchType, setSearchType] = React.useState<SearchType>(SearchType.NAME);
Expand Down Expand Up @@ -87,20 +89,16 @@ const ProjectListView: React.FC<ProjectListViewProps> = ({ allowCreate }) => {
}}
/>
</ToolbarItem>
{allowCreate ? (
<>
<ToolbarItem>
<NewProjectButton
onProjectCreated={(projectName) => navigate(`/projects/${projectName}`)}
/>
</ToolbarItem>
<ToolbarItem>
<LaunchJupyterButton variant={ButtonVariant.link} />
</ToolbarItem>
</>
) : (
{allowCreate && (
<ToolbarItem>
<LaunchJupyterButton variant={ButtonVariant.primary} />
<NewProjectButton
onProjectCreated={(projectName) => navigate(`/projects/${projectName}`)}
/>
</ToolbarItem>
)}
{dashboardConfig.spec.notebookController?.enabled && (
<ToolbarItem>
<LaunchJupyterButton variant={ButtonVariant.link} />
</ToolbarItem>
)}
</React.Fragment>
Expand Down

0 comments on commit 4c898c7

Please sign in to comment.