Hide format filter and column for system projects
System projects like _pypi only contain packages of one format, so the format filter dropdown and column are redundant.
This commit is contained in:
@@ -294,18 +294,20 @@ function ProjectPage() {
|
|||||||
placeholder="Filter packages..."
|
placeholder="Filter packages..."
|
||||||
className="list-controls__search"
|
className="list-controls__search"
|
||||||
/>
|
/>
|
||||||
<select
|
{!project?.is_system && (
|
||||||
className="list-controls__select"
|
<select
|
||||||
value={format}
|
className="list-controls__select"
|
||||||
onChange={(e) => handleFormatChange(e.target.value)}
|
value={format}
|
||||||
>
|
onChange={(e) => handleFormatChange(e.target.value)}
|
||||||
<option value="">All formats</option>
|
>
|
||||||
{FORMAT_OPTIONS.map((f) => (
|
<option value="">All formats</option>
|
||||||
<option key={f} value={f}>
|
{FORMAT_OPTIONS.map((f) => (
|
||||||
{f}
|
<option key={f} value={f}>
|
||||||
</option>
|
{f}
|
||||||
))}
|
</option>
|
||||||
</select>
|
))}
|
||||||
|
</select>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{hasActiveFilters && (
|
{hasActiveFilters && (
|
||||||
@@ -341,11 +343,11 @@ function ProjectPage() {
|
|||||||
className: 'cell-description',
|
className: 'cell-description',
|
||||||
render: (pkg) => pkg.description || '—',
|
render: (pkg) => pkg.description || '—',
|
||||||
},
|
},
|
||||||
{
|
...(!project?.is_system ? [{
|
||||||
key: 'format',
|
key: 'format',
|
||||||
header: 'Format',
|
header: 'Format',
|
||||||
render: (pkg) => <Badge variant="default">{pkg.format}</Badge>,
|
render: (pkg: Package) => <Badge variant="default">{pkg.format}</Badge>,
|
||||||
},
|
}] : []),
|
||||||
{
|
{
|
||||||
key: 'tag_count',
|
key: 'tag_count',
|
||||||
header: 'Tags',
|
header: 'Tags',
|
||||||
|
|||||||
Reference in New Issue
Block a user