fix(docker/stacks): show orphaned stacks option [EE-6149] (#10346)

pull/10459/head
Chaim Lev-Ari 1 year ago committed by GitHub
parent 66ca73f98b
commit b80fcb0467
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,7 +1,6 @@
import { Table } from '@tanstack/react-table';
import { Authorized } from '@/react/hooks/useUser';
import { isBE } from '@/react/portainer/feature-flags/feature-flags.service';
import { ColumnVisibilityMenu } from '@@/datatables/ColumnVisibilityMenu';
import { TableSettingsMenu } from '@@/datatables';
@ -35,22 +34,21 @@ export function TableSettingsMenus({
value={tableState.hiddenColumns}
/>
<TableSettingsMenu>
{isBE && (
<Authorized authorizations="EndpointResourcesAccess">
<Checkbox
id="setting_all_orphaned_stacks"
label="Show all orphaned stacks"
checked={tableState.showOrphanedStacks}
onChange={(e) => {
tableState.setShowOrphanedStacks(e.target.checked);
tableInstance.setGlobalFilter((filter: object) => ({
...filter,
showOrphanedStacks: e.target.checked,
}));
}}
/>
</Authorized>
)}
<Authorized authorizations="EndpointResourcesAccess">
<Checkbox
id="setting_all_orphaned_stacks"
label="Show all orphaned stacks"
checked={tableState.showOrphanedStacks}
onChange={(e) => {
tableState.setShowOrphanedStacks(e.target.checked);
tableInstance.setGlobalFilter((filter: object) => ({
...filter,
showOrphanedStacks: e.target.checked,
}));
}}
/>
</Authorized>
<TableSettingsMenuAutoRefresh
value={tableState.autoRefreshRate}
onChange={(value) => tableState.setAutoRefreshRate(value)}

Loading…
Cancel
Save