mirror of https://github.com/portainer/portainer
fix(more-resources): address CE review comments [r8s-103] (#110)
parent
6d31f4876a
commit
d25de4f459
|
@ -21,7 +21,7 @@ import { DefaultDatatableSettings } from '../../../datatables/DefaultDatatableSe
|
|||
import { ClusterRoleBinding } from './types';
|
||||
import { columns } from './columns';
|
||||
import { useClusterRoleBindings } from './queries/useClusterRoleBindings';
|
||||
import { useDeleteClusterRoleBindings } from './queries/useDeleteClusterRoleBindings';
|
||||
import { useDeleteClusterRoleBindingsMutation } from './queries/useDeleteClusterRoleBindingsMutation';
|
||||
|
||||
const storageKey = 'clusterRoleBindings';
|
||||
const settingsStore = createStore(storageKey);
|
||||
|
@ -99,7 +99,7 @@ type TableActionsProps = {
|
|||
function TableActions({ selectedItems }: TableActionsProps) {
|
||||
const environmentId = useEnvironmentId();
|
||||
const deleteClusterRoleBindingsMutation =
|
||||
useDeleteClusterRoleBindings(environmentId);
|
||||
useDeleteClusterRoleBindingsMutation(environmentId);
|
||||
const router = useRouter();
|
||||
|
||||
async function handleRemoveClick(roles: SelectedRole[]) {
|
||||
|
|
|
@ -6,7 +6,9 @@ import { EnvironmentId } from '@/react/portainer/environments/types';
|
|||
|
||||
import { queryKeys } from './query-keys';
|
||||
|
||||
export function useDeleteClusterRoleBindings(environmentId: EnvironmentId) {
|
||||
export function useDeleteClusterRoleBindingsMutation(
|
||||
environmentId: EnvironmentId
|
||||
) {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation(deleteClusterRoleBindings, {
|
||||
...withInvalidate(queryClient, [queryKeys.list(environmentId)]),
|
|
@ -23,7 +23,7 @@ import { RoleBinding } from '../../RolesView/RoleBindingsDatatable/types';
|
|||
import { ClusterRole, ClusterRoleRowData } from './types';
|
||||
import { columns } from './columns';
|
||||
import { useClusterRoles } from './queries/useClusterRoles';
|
||||
import { useDeleteClusterRoles } from './queries/useDeleteClusterRoles';
|
||||
import { useDeleteClusterRolesMutation } from './queries/useDeleteClusterRolesMutation';
|
||||
|
||||
const storageKey = 'clusterRoles';
|
||||
const settingsStore = createStore(storageKey);
|
||||
|
@ -101,7 +101,8 @@ type TableActionsProps = {
|
|||
|
||||
function TableActions({ selectedItems }: TableActionsProps) {
|
||||
const environmentId = useEnvironmentId();
|
||||
const deleteClusterRolesMutation = useDeleteClusterRoles(environmentId);
|
||||
const deleteClusterRolesMutation =
|
||||
useDeleteClusterRolesMutation(environmentId);
|
||||
const router = useRouter();
|
||||
|
||||
async function handleRemoveClick(roles: SelectedRole[]) {
|
||||
|
|
|
@ -6,7 +6,7 @@ import { EnvironmentId } from '@/react/portainer/environments/types';
|
|||
|
||||
import { queryKeys } from './query-keys';
|
||||
|
||||
export function useDeleteClusterRoles(environmentId: EnvironmentId) {
|
||||
export function useDeleteClusterRolesMutation(environmentId: EnvironmentId) {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation(deleteClusterRoles, {
|
||||
onSuccess: () =>
|
|
@ -26,7 +26,7 @@ import {
|
|||
import { RoleBinding } from './types';
|
||||
import { columns } from './columns';
|
||||
import { useRoleBindings } from './queries/useRoleBindings';
|
||||
import { useDeleteRoleBindings } from './queries/useDeleteRoleBindings';
|
||||
import { useDeleteRoleBindingsMutation } from './queries/useDeleteRoleBindingsMutation';
|
||||
|
||||
const storageKey = 'roleBindings';
|
||||
interface TableSettings
|
||||
|
@ -111,7 +111,8 @@ type TableActionsProps = {
|
|||
|
||||
function TableActions({ selectedItems }: TableActionsProps) {
|
||||
const environmentId = useEnvironmentId();
|
||||
const deleteRoleBindingsMutation = useDeleteRoleBindings(environmentId);
|
||||
const deleteRoleBindingsMutation =
|
||||
useDeleteRoleBindingsMutation(environmentId);
|
||||
const router = useRouter();
|
||||
|
||||
async function handleRemoveClick(roles: SelectedRole[]) {
|
||||
|
|
|
@ -6,7 +6,7 @@ import { EnvironmentId } from '@/react/portainer/environments/types';
|
|||
|
||||
import { queryKeys } from './query-keys';
|
||||
|
||||
export function useDeleteRoleBindings(environmentId: EnvironmentId) {
|
||||
export function useDeleteRoleBindingsMutation(environmentId: EnvironmentId) {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation(deleteRoleBindings, {
|
||||
...withInvalidate(queryClient, [queryKeys.list(environmentId)]),
|
|
@ -27,7 +27,7 @@ import { RoleBinding } from '../RoleBindingsDatatable/types';
|
|||
import { columns } from './columns';
|
||||
import { Role, RoleRowData } from './types';
|
||||
import { useRoles } from './queries/useRoles';
|
||||
import { useDeleteRoles } from './queries/useDeleteRoles';
|
||||
import { useDeleteRolesMutation } from './queries/useDeleteRolesMutation';
|
||||
|
||||
const storageKey = 'roles';
|
||||
interface TableSettings
|
||||
|
@ -99,7 +99,7 @@ type TableActionsProps = {
|
|||
|
||||
function TableActions({ selectedItems }: TableActionsProps) {
|
||||
const environmentId = useEnvironmentId();
|
||||
const deleteRolesMutation = useDeleteRoles(environmentId);
|
||||
const deleteRolesMutation = useDeleteRolesMutation(environmentId);
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
|
|
|
@ -6,7 +6,7 @@ import { EnvironmentId } from '@/react/portainer/environments/types';
|
|||
|
||||
import { queryKeys } from './query-keys';
|
||||
|
||||
export function useDeleteRoles(environmentId: EnvironmentId) {
|
||||
export function useDeleteRolesMutation(environmentId: EnvironmentId) {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation(deleteRole, {
|
||||
...withInvalidate(queryClient, [queryKeys.list(environmentId)]),
|
Loading…
Reference in New Issue