Просмотр исходного кода

move SearchTypes to user-group-response file

kaori 3 лет назад
Родитель
Сommit
ad586bdc2f

+ 2 - 3
packages/app/src/components/Admin/UserGroupDetail/UserGroupDetailPage.tsx

@@ -12,7 +12,7 @@ import {
   apiv3Get, apiv3Put, apiv3Delete, apiv3Post,
 } from '~/client/util/apiv3-client';
 import { IUserGroup, IUserGroupHasId } from '~/interfaces/user';
-import { SearchTypes, SearchType } from '~/interfaces/user-group';
+import { SearchTypes, SearchType } from '~/interfaces/user-group-response';
 import Xss from '~/services/xss';
 import { useIsAclEnabled } from '~/stores/context';
 import { useUpdateUserGroupConfirmModal } from '~/stores/modal';
@@ -178,7 +178,7 @@ const UserGroupDetailPage = (props: Props): JSX.Element => {
     mutateUserGroupRelations();
   }, [currentUserGroupId, mutateUserGroupRelations]);
 
-  // Fix: invalid csrf token https://redmine.weseek.co.jp/issues/102704
+  // Fix: invalid csrf token => https://redmine.weseek.co.jp/issues/102704
   const removeUserByUsername = useCallback(async(username: string) => {
     try {
       await apiv3Delete(`/user-groups/${currentUserGroupId}/users/${username}`);
@@ -186,7 +186,6 @@ const UserGroupDetailPage = (props: Props): JSX.Element => {
       mutateUserGroupRelations();
     }
     catch (err) {
-      // eslint-disable-next-line max-len
       toastError(new Error(`Unable to remove "${xss.process(username)}" from "${xss.process(currentUserGroup?.name)}"`));
     }
   }, [currentUserGroup?.name, currentUserGroupId, mutateUserGroupRelations, xss]);

+ 1 - 1
packages/app/src/components/Admin/UserGroupDetail/UserGroupUserModal.tsx

@@ -6,7 +6,7 @@ import {
 } from 'reactstrap';
 
 import { IUserGroupHasId } from '~/interfaces/user';
-import { SearchTypes, SearchType } from '~/interfaces/user-group';
+import { SearchTypes, SearchType } from '~/interfaces/user-group-response';
 
 import CheckBoxForSerchUserOption from './CheckBoxForSerchUserOption';
 import RadioButtonForSerchUserOption from './RadioButtonForSerchUserOption';

+ 8 - 0
packages/app/src/interfaces/user-group-response.ts

@@ -37,3 +37,11 @@ export type SelectableUserChildGroupsResult = {
 export type AncestorUserGroupsResult = {
   ancestorUserGroups: IUserGroupHasId[],
 }
+
+export const SearchTypes = {
+  FORWARD: 'forward',
+  PARTIAL: 'partial',
+  BACKWORD: 'backword',
+} as const;
+
+export type SearchType = typeof SearchTypes[keyof typeof SearchTypes];

+ 0 - 7
packages/app/src/interfaces/user-group.ts

@@ -1,7 +0,0 @@
-export const SearchTypes = {
-  FORWARD: 'forward',
-  PARTIAL: 'partial',
-  BACKWORD: 'backword',
-} as const;
-
-export type SearchType = typeof SearchTypes[keyof typeof SearchTypes];