Skip to content

Commit c78aafb

Browse files
authored
Remove duplicated Create new project button when no project in a workspace (#1406)
1 parent 483cb31 commit c78aafb

File tree

2 files changed

+25
-24
lines changed

2 files changed

+25
-24
lines changed

web_ui/src/pages/landing-page/landing-page-workspace/components/no-projects-area/no-projects-area.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const NoProjectArea = ({ openImportDatasetDialog }: NoProjectsAreaProps)
2222
const DESCRIPTION = 'Create new project to leverage AI to automate your Computer Vision task';
2323

2424
return (
25-
<Flex width={'100%'} gap={'size-300'}>
25+
<Flex width={'100%'} gap={'size-300'} marginTop={'size-700'}>
2626
<CustomWell
2727
height={'size-3400'}
2828
minWidth={'size-3000'}

web_ui/src/pages/landing-page/landing-page-workspace/projects-actions.component.tsx

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -53,31 +53,30 @@ export const ProjectsActions = ({
5353
handleQueryOptions(value);
5454
};
5555

56-
return (
56+
return shouldShowProjectActions ? (
5757
<Flex marginY='size-200' width={'100%'} gap='size-150' alignItems={'center'} justifyContent={'end'}>
5858
<Flex gap={'size-100'}>
59-
{shouldShowProjectActions && (
60-
<>
61-
<SearchField
62-
isQuiet
63-
value={filterText}
64-
onChange={handleFilterTextChange}
65-
aria-label={'Search...'}
66-
id={'list-search-field'}
67-
UNSAFE_className={`${sharedClasses.searchField} ${
68-
filterText.length ? sharedClasses.searchFieldOpen : ''
69-
}`}
70-
placeholder='Search by name'
71-
/>
72-
73-
<ProjectSorting
74-
nameKey={ProjectSortingOptions.name}
75-
dateKey={ProjectSortingOptions.creationDate}
76-
sortingOptions={queryOptions}
77-
setSortingOptions={setQueryOptions}
78-
/>
79-
</>
80-
)}
59+
<>
60+
<SearchField
61+
isQuiet
62+
value={filterText}
63+
onChange={handleFilterTextChange}
64+
aria-label={'Search...'}
65+
id={'list-search-field'}
66+
UNSAFE_className={`${sharedClasses.searchField} ${
67+
filterText.length ? sharedClasses.searchFieldOpen : ''
68+
}`}
69+
placeholder='Search by name'
70+
/>
71+
72+
<ProjectSorting
73+
nameKey={ProjectSortingOptions.name}
74+
dateKey={ProjectSortingOptions.creationDate}
75+
sortingOptions={queryOptions}
76+
setSortingOptions={setQueryOptions}
77+
/>
78+
</>
79+
8180
<HasPermission operations={[OPERATION.PROJECT_CREATION]}>
8281
<NewProjectDialog
8382
buttonText={'Create new project'}
@@ -86,5 +85,7 @@ export const ProjectsActions = ({
8685
</HasPermission>
8786
</Flex>
8887
</Flex>
88+
) : (
89+
<></>
8990
);
9091
};

0 commit comments

Comments
 (0)