From 65f03e3ac08726e929624aac29cea080b34382a7 Mon Sep 17 00:00:00 2001 From: imaimai17468 Date: Tue, 18 Apr 2023 18:58:07 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20lint=E3=81=AE=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/auth/SignInView.tsx | 2 +- .../src/components/auth/SignUpView.tsx | 2 +- .../src/components/budgets/DetailModal.tsx | 2 +- .../src/components/budgets/EditModal.tsx | 2 +- .../common/BureauLabel/BureauLabel.tsx | 4 +- .../src/components/common/Header/Header.tsx | 2 +- .../src/components/common/Label/Label.tsx | 2 +- .../src/components/common/OpenModalButton.tsx | 2 +- .../components/fund_information/AddModal.tsx | 2 +- .../components/fund_information/EditModal.tsx | 2 +- .../fund_information/OpenAddModalButton.tsx | 2 +- .../OpenDeleteModalButton.tsx | 2 +- .../fund_information/OpenEditModalButton.tsx | 2 +- .../src/components/layout/Layout/Layout.tsx | 2 +- .../layout/MainLayout/MainLayout.tsx | 3 +- .../components/purchaseorders/DeleteModal.tsx | 2 +- .../components/purchaseorders/EditModal.tsx | 2 +- .../purchaseorders/OpenAddModalButton.tsx | 2 +- .../purchaseorders/OpenDeleteModalButton.tsx | 3 +- .../purchasereports/DeleteModal.tsx | 3 +- .../PurchaseOrderListModal.tsx | 3 +- .../OpenDeleteModalButton.tsx | 3 +- .../sponsoractivities/OpenEditModalButton.tsx | 5 +- .../SponsorActivitiesAddModal.tsx | 3 +- .../sponsors/OpenDeleteModalButton.tsx | 3 +- .../sponsors/OpenEditModalButton.tsx | 3 +- .../sponsorstyles/OpenAddModalButton.tsx | 3 +- .../sponsorstyles/OpenDeleteModalButton.tsx | 3 +- .../src/components/teacher/AddModal.tsx | 6 +- .../src/components/teacher/DeleteModal.tsx | 43 +++++++------- .../src/components/teacher/EditModal.tsx | 2 +- .../components/teacher/OpenAddModalButton.tsx | 2 +- .../teacher/OpenDeleteModalButton.tsx | 2 +- .../teacher/OpenEditModalButton.tsx | 7 +-- view/next-project/src/constants/linkItem.tsx | 2 +- view/next-project/src/index.js | 0 view/next-project/src/pages/_app.tsx | 2 +- view/next-project/src/pages/budgets/index.tsx | 56 +++++++++---------- .../src/pages/fund_informations/index.tsx | 4 +- .../src/pages/purchaseorders/index.tsx | 28 ++++------ .../src/pages/purchasereports/index.tsx | 42 ++++++-------- .../next-project/src/pages/sponsors/index.tsx | 3 +- .../next-project/src/pages/teachers/index.tsx | 14 ++--- 43 files changed, 125 insertions(+), 159 deletions(-) delete mode 100644 view/next-project/src/index.js diff --git a/view/next-project/src/components/auth/SignInView.tsx b/view/next-project/src/components/auth/SignInView.tsx index 20e213c19..8acbcde7b 100644 --- a/view/next-project/src/components/auth/SignInView.tsx +++ b/view/next-project/src/components/auth/SignInView.tsx @@ -3,13 +3,13 @@ import { useState } from 'react'; import { useForm } from 'react-hook-form'; import { useRecoilState } from 'recoil'; +import { PrimaryButton } from '../common'; import { authAtom, userAtom } from '@/store/atoms'; import { get_with_token } from '@api/api_methods'; import { signIn } from '@api/signIn'; import LoadingButton from '@components/common/LoadingButton'; import { SignIn } from '@type/common'; -import { PrimaryButton } from '../common'; export default function SignInView() { // ログイン中フラグ diff --git a/view/next-project/src/components/auth/SignUpView.tsx b/view/next-project/src/components/auth/SignUpView.tsx index 8e9b98233..c508b75d8 100644 --- a/view/next-project/src/components/auth/SignUpView.tsx +++ b/view/next-project/src/components/auth/SignUpView.tsx @@ -3,6 +3,7 @@ import React, { useState } from 'react'; import { useForm } from 'react-hook-form'; import { useRecoilState } from 'recoil'; +import { PrimaryButton } from '../common'; import { BUREAUS } from '@/constants/bureaus'; import { authAtom, userAtom } from '@/store/atoms'; import { get } from '@api/api_methods'; @@ -11,7 +12,6 @@ import { post } from '@api/user'; import LoadingButton from '@components/common/LoadingButton'; import { SignUp, User } from '@type/common'; -import { PrimaryButton } from '../common'; export default function SignUpView() { const [, setAuth] = useRecoilState(authAtom); diff --git a/view/next-project/src/components/budgets/DetailModal.tsx b/view/next-project/src/components/budgets/DetailModal.tsx index 96cb4f60b..fec946749 100644 --- a/view/next-project/src/components/budgets/DetailModal.tsx +++ b/view/next-project/src/components/budgets/DetailModal.tsx @@ -83,7 +83,7 @@ const DetailModal: FC = (props) => { {props.expenseView.purchaseDetails ? (props.expenseView.purchaseDetails.map((purchaseDetail) => ( purchaseDetail.purchaseItems.map((purchaseItem) => ( - +
{purchaseItem.item} diff --git a/view/next-project/src/components/budgets/EditModal.tsx b/view/next-project/src/components/budgets/EditModal.tsx index 91b1ee150..3c0f03bb4 100644 --- a/view/next-project/src/components/budgets/EditModal.tsx +++ b/view/next-project/src/components/budgets/EditModal.tsx @@ -19,8 +19,8 @@ import { Dispatch, FC, SetStateAction, useEffect, useState } from 'react'; import { RiCloseCircleLine } from 'react-icons/ri'; import { SOURCES } from '@/constants/sources'; -import { put } from '@api/budget'; import { get } from '@api/api_methods'; +import { put } from '@api/budget'; import theme from '@assets/theme'; import RegistButton from '@components/common/RegistButton'; import { Budget, Source, Year } from '@type/common'; diff --git a/view/next-project/src/components/common/BureauLabel/BureauLabel.tsx b/view/next-project/src/components/common/BureauLabel/BureauLabel.tsx index c090a7d48..241b7f7b2 100644 --- a/view/next-project/src/components/common/BureauLabel/BureauLabel.tsx +++ b/view/next-project/src/components/common/BureauLabel/BureauLabel.tsx @@ -1,9 +1,9 @@ import React, { useMemo } from 'react'; +import Label from '../Label'; +import { BureauLabelProps } from './BureauLabel.type'; import { BUREAUS_WITH_EN } from '@constants/bureaus'; -import { BureauLabelProps } from './BureauLabel.type'; -import Label from '../Label'; const BureauLabel: React.FC = (props) => { const { bureauName } = props; diff --git a/view/next-project/src/components/common/Header/Header.tsx b/view/next-project/src/components/common/Header/Header.tsx index 0622fc176..9cccb3f6f 100644 --- a/view/next-project/src/components/common/Header/Header.tsx +++ b/view/next-project/src/components/common/Header/Header.tsx @@ -4,12 +4,12 @@ import { AiOutlineMenu } from 'react-icons/ai'; import { RiAccountCircleFill } from 'react-icons/ri'; import { useRecoilState } from 'recoil'; +import { HeaderProps } from './Header.type'; import { authAtom, userAtom } from '@/store/atoms'; import { del } from '@api/signOut'; import { ChakraUIDropdown } from '@components/common'; import { User } from '@type/common'; -import { HeaderProps } from './Header.type'; const Header = (props: HeaderProps) => { const { onSideNavOpen } = props; diff --git a/view/next-project/src/components/common/Label/Label.tsx b/view/next-project/src/components/common/Label/Label.tsx index 7369ccd48..49a5d10b2 100644 --- a/view/next-project/src/components/common/Label/Label.tsx +++ b/view/next-project/src/components/common/Label/Label.tsx @@ -1,9 +1,9 @@ import { Box, ChakraProvider } from '@chakra-ui/react'; import React, { useMemo } from 'react'; +import { LabelProps } from './Label.type'; import theme from '@/assets/theme'; -import { LabelProps } from './Label.type'; const Label: React.FC = (props) => { const { diff --git a/view/next-project/src/components/common/OpenModalButton.tsx b/view/next-project/src/components/common/OpenModalButton.tsx index ab1986d03..cf5e04eed 100644 --- a/view/next-project/src/components/common/OpenModalButton.tsx +++ b/view/next-project/src/components/common/OpenModalButton.tsx @@ -2,9 +2,9 @@ import { ChakraProvider, Button } from '@chakra-ui/react'; import * as React from 'react'; import { useState } from 'react'; +import RegistModal from './RegistModal'; import theme from '@assets/theme'; -import RegistModal from './RegistModal'; interface Props { width?: string; diff --git a/view/next-project/src/components/fund_information/AddModal.tsx b/view/next-project/src/components/fund_information/AddModal.tsx index 8d94b1a66..adaf94998 100644 --- a/view/next-project/src/components/fund_information/AddModal.tsx +++ b/view/next-project/src/components/fund_information/AddModal.tsx @@ -2,11 +2,11 @@ import { useRouter } from 'next/router'; import React, { Dispatch, FC, SetStateAction, useEffect, useState } from 'react'; import { useRecoilState } from 'recoil'; +import { Modal, CloseButton, Input, Select, PrimaryButton } from '../common'; import { userAtom } from '@/store/atoms'; import { post } from '@api/fundInformations'; import { Department, FundInformation, Teacher, User } from '@type/common'; -import { Modal, CloseButton, Input, Select, PrimaryButton } from '../common'; interface ModalProps { setShowModal: Dispatch>; diff --git a/view/next-project/src/components/fund_information/EditModal.tsx b/view/next-project/src/components/fund_information/EditModal.tsx index 40ef5b50d..6b082cfc0 100644 --- a/view/next-project/src/components/fund_information/EditModal.tsx +++ b/view/next-project/src/components/fund_information/EditModal.tsx @@ -1,10 +1,10 @@ import { useRouter } from 'next/router'; import { Dispatch, SetStateAction, useEffect, useState } from 'react'; +import { Modal, Input, Select, CloseButton, PrimaryButton } from '../common'; import { put } from '@api/fundInformations'; import { FundInformation, Teacher, User, Department } from '@type/common'; -import { Modal, Input, Select, CloseButton, PrimaryButton } from '../common'; interface ModalProps { setShowModal: Dispatch>; diff --git a/view/next-project/src/components/fund_information/OpenAddModalButton.tsx b/view/next-project/src/components/fund_information/OpenAddModalButton.tsx index 5e7f75608..d9c342e22 100644 --- a/view/next-project/src/components/fund_information/OpenAddModalButton.tsx +++ b/view/next-project/src/components/fund_information/OpenAddModalButton.tsx @@ -1,9 +1,9 @@ import React, { useState } from 'react'; +import OpenAddModal from './AddModal'; import { AddButton } from '@components/common'; import { Teacher, Department, User } from '@type/common'; -import OpenAddModal from './AddModal'; interface Props { children?: React.ReactNode; diff --git a/view/next-project/src/components/fund_information/OpenDeleteModalButton.tsx b/view/next-project/src/components/fund_information/OpenDeleteModalButton.tsx index 9f8f6e156..17110fafa 100644 --- a/view/next-project/src/components/fund_information/OpenDeleteModalButton.tsx +++ b/view/next-project/src/components/fund_information/OpenDeleteModalButton.tsx @@ -1,8 +1,8 @@ import React, { useState } from 'react'; +import DeleteModal from './DeleteModal'; import { DeleteButton } from '@components/common'; -import DeleteModal from './DeleteModal'; interface Props { children?: React.ReactNode; diff --git a/view/next-project/src/components/fund_information/OpenEditModalButton.tsx b/view/next-project/src/components/fund_information/OpenEditModalButton.tsx index 3ffb26252..7d2fd7d29 100644 --- a/view/next-project/src/components/fund_information/OpenEditModalButton.tsx +++ b/view/next-project/src/components/fund_information/OpenEditModalButton.tsx @@ -1,9 +1,9 @@ import React, { useState } from 'react'; +import EditModal from './EditModal'; import { EditButton } from '@components/common'; import { Teacher, Department, User, FundInformation } from '@type/common'; -import EditModal from './EditModal'; interface Props { teachers: Teacher[]; diff --git a/view/next-project/src/components/layout/Layout/Layout.tsx b/view/next-project/src/components/layout/Layout/Layout.tsx index 96f734c67..49fb61ba3 100644 --- a/view/next-project/src/components/layout/Layout/Layout.tsx +++ b/view/next-project/src/components/layout/Layout/Layout.tsx @@ -1,5 +1,6 @@ import React, { ReactNode } from 'react'; +import s from './Layout.module.css'; import SponsorActivitiesAddModal from '@/components/sponsoractivities/SponsorActivitiesAddModal'; import SponsorAddModal from '@/components/sponsors/SponsorAddModal'; import PurchaseReportAddModal from '@components/purchasereports/AddModal'; @@ -7,7 +8,6 @@ import PurchaseOrderListModal from '@components/purchasereports/PurchaseOrderLis import PurchaseReportItemNumModal from '@components/purchasereports/PurchaseReportItemNumModal'; import { useUI } from '@components/ui/context'; -import s from './Layout.module.css'; const ModalView: React.FC<{ modalView: string }> = ({ modalView }) => { return ( diff --git a/view/next-project/src/components/layout/MainLayout/MainLayout.tsx b/view/next-project/src/components/layout/MainLayout/MainLayout.tsx index 354f60e04..30f6cd693 100644 --- a/view/next-project/src/components/layout/MainLayout/MainLayout.tsx +++ b/view/next-project/src/components/layout/MainLayout/MainLayout.tsx @@ -3,13 +3,12 @@ import Head from 'next/head'; import { useRouter } from 'next/router'; import React, { useEffect, useState } from 'react'; import { useRecoilState } from 'recoil'; +import s from './MainLayout.module.css'; import { authAtom } from '@/store/atoms'; import 'tailwindcss/tailwind.css'; import { Header, SideNav } from '@components/common'; -import s from './MainLayout.module.css'; - interface LayoutProps { children?: React.ReactNode; } diff --git a/view/next-project/src/components/purchaseorders/DeleteModal.tsx b/view/next-project/src/components/purchaseorders/DeleteModal.tsx index 419d3a04c..051d7d704 100644 --- a/view/next-project/src/components/purchaseorders/DeleteModal.tsx +++ b/view/next-project/src/components/purchaseorders/DeleteModal.tsx @@ -1,9 +1,9 @@ import { useRouter } from 'next/router'; import React, { Dispatch, FC, SetStateAction } from 'react'; +import { CloseButton, Modal, OutlinePrimaryButton, PrimaryButton } from '../common'; import { del } from '@api/api_methods'; -import { CloseButton, Modal, OutlinePrimaryButton, PrimaryButton } from '../common'; interface ModalProps { setShowModal: Dispatch>; diff --git a/view/next-project/src/components/purchaseorders/EditModal.tsx b/view/next-project/src/components/purchaseorders/EditModal.tsx index dddc589a6..c163b6c3b 100644 --- a/view/next-project/src/components/purchaseorders/EditModal.tsx +++ b/view/next-project/src/components/purchaseorders/EditModal.tsx @@ -2,6 +2,7 @@ import { useRouter } from 'next/router'; import React, { useState } from 'react'; import { RiArrowDropRightLine } from 'react-icons/ri'; +import { RiExternalLinkLine, RiFileCopyLine } from 'react-icons/ri' import { put } from '@api/purchaseItem'; import { PrimaryButton, @@ -13,7 +14,6 @@ import { Tooltip } from '@components/common'; import { PurchaseItem } from '@type/common'; -import { RiExternalLinkLine, RiFileCopyLine } from 'react-icons/ri' interface ModalProps { purchaseOrderId: number; diff --git a/view/next-project/src/components/purchaseorders/OpenAddModalButton.tsx b/view/next-project/src/components/purchaseorders/OpenAddModalButton.tsx index 9868b6613..4f882501c 100644 --- a/view/next-project/src/components/purchaseorders/OpenAddModalButton.tsx +++ b/view/next-project/src/components/purchaseorders/OpenAddModalButton.tsx @@ -1,9 +1,9 @@ import React, { useState } from 'react'; +import PurchaseItemNumModal from './PurchaseItemNumModal'; import { AddButton } from '@components/common'; import { Expense } from '@type/common'; -import PurchaseItemNumModal from './PurchaseItemNumModal'; interface Props { children?: React.ReactNode; diff --git a/view/next-project/src/components/purchaseorders/OpenDeleteModalButton.tsx b/view/next-project/src/components/purchaseorders/OpenDeleteModalButton.tsx index f06ec57a0..e884a0a9e 100644 --- a/view/next-project/src/components/purchaseorders/OpenDeleteModalButton.tsx +++ b/view/next-project/src/components/purchaseorders/OpenDeleteModalButton.tsx @@ -1,9 +1,8 @@ import React from 'react'; import { useState } from 'react'; -import { DeleteButton } from '@components/common'; - import DeleteModal from './DeleteModal'; +import { DeleteButton } from '@components/common'; interface Props { id: number; diff --git a/view/next-project/src/components/purchasereports/DeleteModal.tsx b/view/next-project/src/components/purchasereports/DeleteModal.tsx index 86e1a83f9..eb4f3abe7 100644 --- a/view/next-project/src/components/purchasereports/DeleteModal.tsx +++ b/view/next-project/src/components/purchasereports/DeleteModal.tsx @@ -1,9 +1,8 @@ import { useRouter } from 'next/router'; import React, { Dispatch, FC, SetStateAction } from 'react'; -import { del } from '@api/api_methods'; - import { CloseButton, Modal, OutlinePrimaryButton, PrimaryButton } from '../common'; +import { del } from '@api/api_methods'; interface ModalProps { setShowModal: Dispatch>; diff --git a/view/next-project/src/components/purchasereports/PurchaseOrderListModal.tsx b/view/next-project/src/components/purchasereports/PurchaseOrderListModal.tsx index eff1769f0..4df14b749 100644 --- a/view/next-project/src/components/purchasereports/PurchaseOrderListModal.tsx +++ b/view/next-project/src/components/purchasereports/PurchaseOrderListModal.tsx @@ -2,13 +2,12 @@ import clsx from 'clsx'; import { useRouter } from 'next/router'; import { useEffect, useState } from 'react'; +import PurchaseReportAddModal from './PurchaseReportAddModal'; import { get } from '@api/api_methods'; import { CloseButton, Modal, OutlinePrimaryButton, PrimaryButton, Radio } from '@components/common'; import { useUI } from '@components/ui/context'; import { PurchaseOrder, User, PurchaseItem, Expense } from '@type/common'; -import PurchaseReportAddModal from './PurchaseReportAddModal'; - interface PurchaseOrderView { purchaseOrder: PurchaseOrder; user: User; diff --git a/view/next-project/src/components/sponsoractivities/OpenDeleteModalButton.tsx b/view/next-project/src/components/sponsoractivities/OpenDeleteModalButton.tsx index 42bd248d0..92c0b6518 100644 --- a/view/next-project/src/components/sponsoractivities/OpenDeleteModalButton.tsx +++ b/view/next-project/src/components/sponsoractivities/OpenDeleteModalButton.tsx @@ -1,8 +1,7 @@ import React, { useState } from 'react'; -import { DeleteButton } from '@components/common'; - import DeleteModal from '../sponsoractivities/DeleteModal'; +import { DeleteButton } from '@components/common'; interface Props { children?: React.ReactNode; diff --git a/view/next-project/src/components/sponsoractivities/OpenEditModalButton.tsx b/view/next-project/src/components/sponsoractivities/OpenEditModalButton.tsx index 6a40fe227..b760465c6 100644 --- a/view/next-project/src/components/sponsoractivities/OpenEditModalButton.tsx +++ b/view/next-project/src/components/sponsoractivities/OpenEditModalButton.tsx @@ -1,10 +1,9 @@ import * as React from 'react'; import { useState } from 'react'; -import { SponsorActivity, SponsorStyle, Sponsor, User } from '@/type/common'; - -import EditModal from './EditModal'; import { EditButton } from '../common'; +import EditModal from './EditModal'; +import { SponsorActivity, SponsorStyle, Sponsor, User } from '@/type/common'; interface Props { children?: React.ReactNode; diff --git a/view/next-project/src/components/sponsoractivities/SponsorActivitiesAddModal.tsx b/view/next-project/src/components/sponsoractivities/SponsorActivitiesAddModal.tsx index a2afcb809..34b6559e9 100644 --- a/view/next-project/src/components/sponsoractivities/SponsorActivitiesAddModal.tsx +++ b/view/next-project/src/components/sponsoractivities/SponsorActivitiesAddModal.tsx @@ -2,6 +2,7 @@ import { useRouter } from 'next/router'; import React, { useState, useEffect } from 'react'; import { RiArrowDropRightLine } from 'react-icons/ri'; +import { useUI } from '../ui/context'; import { post } from '@/utils/api/sponsorActivities'; import { CloseButton, @@ -12,8 +13,6 @@ import { } from '@components/common'; import { SponsorActivity, Sponsor, SponsorStyle, User } from '@type/common'; -import { useUI } from '../ui/context'; - const TABLE_COLUMNS = ['企業名', '協賛スタイル', '担当者名', '回収状況']; export default function SponsorActivitiesAddModal() { diff --git a/view/next-project/src/components/sponsors/OpenDeleteModalButton.tsx b/view/next-project/src/components/sponsors/OpenDeleteModalButton.tsx index 5138fada6..b7c6a797c 100644 --- a/view/next-project/src/components/sponsors/OpenDeleteModalButton.tsx +++ b/view/next-project/src/components/sponsors/OpenDeleteModalButton.tsx @@ -1,8 +1,7 @@ import React, { useState } from 'react'; -import { DeleteButton } from '@components/common'; - import DeleteModal from './DeleteModal'; +import { DeleteButton } from '@components/common'; interface Props { children?: React.ReactNode; diff --git a/view/next-project/src/components/sponsors/OpenEditModalButton.tsx b/view/next-project/src/components/sponsors/OpenEditModalButton.tsx index 339330c63..450124194 100644 --- a/view/next-project/src/components/sponsors/OpenEditModalButton.tsx +++ b/view/next-project/src/components/sponsors/OpenEditModalButton.tsx @@ -1,11 +1,10 @@ import * as React from 'react'; import { useState } from 'react'; +import SponsorEditModal from './SponsorEditModal'; import { EditButton } from '@components/common'; import { Sponsor } from '@type/common'; -import SponsorEditModal from './SponsorEditModal'; - interface Props { children?: React.ReactNode; sponsor: Sponsor; diff --git a/view/next-project/src/components/sponsorstyles/OpenAddModalButton.tsx b/view/next-project/src/components/sponsorstyles/OpenAddModalButton.tsx index b485ad999..9968faacd 100644 --- a/view/next-project/src/components/sponsorstyles/OpenAddModalButton.tsx +++ b/view/next-project/src/components/sponsorstyles/OpenAddModalButton.tsx @@ -1,8 +1,7 @@ import React, { useState } from 'react'; -import { AddButton } from '@components/common'; - import SponsorStyleAddModal from './SponsorStyleAddModal'; +import { AddButton } from '@components/common'; interface Props { children?: React.ReactNode; diff --git a/view/next-project/src/components/sponsorstyles/OpenDeleteModalButton.tsx b/view/next-project/src/components/sponsorstyles/OpenDeleteModalButton.tsx index 5138fada6..b7c6a797c 100644 --- a/view/next-project/src/components/sponsorstyles/OpenDeleteModalButton.tsx +++ b/view/next-project/src/components/sponsorstyles/OpenDeleteModalButton.tsx @@ -1,8 +1,7 @@ import React, { useState } from 'react'; -import { DeleteButton } from '@components/common'; - import DeleteModal from './DeleteModal'; +import { DeleteButton } from '@components/common'; interface Props { children?: React.ReactNode; diff --git a/view/next-project/src/components/teacher/AddModal.tsx b/view/next-project/src/components/teacher/AddModal.tsx index aec44b327..db1606d50 100644 --- a/view/next-project/src/components/teacher/AddModal.tsx +++ b/view/next-project/src/components/teacher/AddModal.tsx @@ -4,8 +4,8 @@ import { RiCloseCircleLine } from 'react-icons/ri'; import { post } from '@api/teachers'; import { PrimaryButton, Modal, Select, Input } from '@components/common'; +import { DEPARTMENTS } from '@constants/departments'; import { Teacher } from '@type/common'; -import { DEPARTMENTS } from '@/constants/departments'; interface ModalProps { setShowModal: Dispatch>; @@ -81,7 +81,7 @@ const OpenAddModal: FC = (props) => {

ブラックリスト

-
+
= (props) => { />
-
+
-
-
- props.setShowModal(false)} /> +
+
+ props.setShowModal(false)} /> +
-
-
教員データの削除
-
削除しますか?
-
-
- 戻る - { - deleteTeacher(); - closeModal(); - }} - > - 削除 - +
教員データの削除
+
削除しますか?
+
+
+ 戻る + { + deleteTeacher(); + closeModal(); + }} + > + 削除 + +
-
- + ); } diff --git a/view/next-project/src/components/teacher/EditModal.tsx b/view/next-project/src/components/teacher/EditModal.tsx index 3c95220cf..b86181c9b 100644 --- a/view/next-project/src/components/teacher/EditModal.tsx +++ b/view/next-project/src/components/teacher/EditModal.tsx @@ -4,8 +4,8 @@ import { RiCloseCircleLine } from 'react-icons/ri'; import { put } from '@api/teachers'; import { PrimaryButton, Modal, Input, Select } from '@components/common'; +import { DEPARTMENTS } from '@constants/departments'; import { Teacher } from '@type/common'; -import { DEPARTMENTS } from '@/constants/departments'; interface ModalProps { setShowModal: Dispatch>; diff --git a/view/next-project/src/components/teacher/OpenAddModalButton.tsx b/view/next-project/src/components/teacher/OpenAddModalButton.tsx index 1170b65aa..bd0734381 100644 --- a/view/next-project/src/components/teacher/OpenAddModalButton.tsx +++ b/view/next-project/src/components/teacher/OpenAddModalButton.tsx @@ -1,8 +1,8 @@ import * as React from 'react'; import { useState } from 'react'; -import AddModal from '@components/teacher/AddModal'; import { AddButton } from '../common'; +import AddModal from '@components/teacher/AddModal'; interface Props { children?: React.ReactNode; diff --git a/view/next-project/src/components/teacher/OpenDeleteModalButton.tsx b/view/next-project/src/components/teacher/OpenDeleteModalButton.tsx index feaeae689..3f062b422 100644 --- a/view/next-project/src/components/teacher/OpenDeleteModalButton.tsx +++ b/view/next-project/src/components/teacher/OpenDeleteModalButton.tsx @@ -1,8 +1,8 @@ import * as React from 'react'; import { useState } from 'react'; -import DeleteModal from '@components/teacher/DeleteModal'; import { DeleteButton } from '../common'; +import DeleteModal from '@components/teacher/DeleteModal'; interface Props { id: number; diff --git a/view/next-project/src/components/teacher/OpenEditModalButton.tsx b/view/next-project/src/components/teacher/OpenEditModalButton.tsx index 1e81131fb..8d00a11aa 100644 --- a/view/next-project/src/components/teacher/OpenEditModalButton.tsx +++ b/view/next-project/src/components/teacher/OpenEditModalButton.tsx @@ -1,12 +1,9 @@ -import { Button, ChakraProvider } from '@chakra-ui/react'; import * as React from 'react'; import { useState } from 'react'; -import { RiPencilFill } from 'react-icons/ri'; -import theme from '@assets/theme'; -import EditModal from '@components/teacher/EditModal'; -import { Department, Teacher } from '@type/common'; import { EditButton } from '../common'; +import EditModal from '@components/teacher/EditModal'; +import { Teacher } from '@type/common'; interface Props { id: number; diff --git a/view/next-project/src/constants/linkItem.tsx b/view/next-project/src/constants/linkItem.tsx index 30556fbe5..7e71a5e2a 100644 --- a/view/next-project/src/constants/linkItem.tsx +++ b/view/next-project/src/constants/linkItem.tsx @@ -1,9 +1,9 @@ import { ReactNode } from 'react'; import { BsBuilding, BsVectorPen } from 'react-icons/bs'; +import { FaChalkboardTeacher } from 'react-icons/fa'; import { HiOutlineShoppingCart, HiOutlineDocumentText, HiCurrencyDollar } from 'react-icons/hi'; import { IoIosArrowDropup } from 'react-icons/io'; import { MdOutlineSavings, MdOutlineWorkOutline } from 'react-icons/md'; -import { FaChalkboardTeacher } from 'react-icons/fa'; interface LinkItemProps { name: string; diff --git a/view/next-project/src/index.js b/view/next-project/src/index.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/view/next-project/src/pages/_app.tsx b/view/next-project/src/pages/_app.tsx index 8abb35956..296137fc6 100644 --- a/view/next-project/src/pages/_app.tsx +++ b/view/next-project/src/pages/_app.tsx @@ -1,11 +1,11 @@ import { ChakraProvider } from '@chakra-ui/react'; +import type { AppProps } from 'next/app'; import Head from 'next/head'; import { RecoilRoot } from 'recoil'; import Layout from '@components/layout/Layout'; import { ManagedUIContext } from '@components/ui/context'; -import type { AppProps } from 'next/app'; import 'tailwindcss/tailwind.css'; function MyApp({ Component, pageProps }: AppProps) { diff --git a/view/next-project/src/pages/budgets/index.tsx b/view/next-project/src/pages/budgets/index.tsx index c718eb954..080037a2f 100644 --- a/view/next-project/src/pages/budgets/index.tsx +++ b/view/next-project/src/pages/budgets/index.tsx @@ -1,17 +1,17 @@ import { Tabs, TabList, TabPanels, Tab, TabPanel } from '@chakra-ui/react'; import clsx from 'clsx'; import Head from 'next/head'; +import { useState } from 'react'; import { RiAddCircleLine } from 'react-icons/ri'; import { get } from '@api/api_methods'; +import DetailModal from '@components/budgets/DetailModal'; import OpenAddModalButton from '@components/budgets/OpenAddModalButton'; import OpenDeleteModalButton from '@components/budgets/OpenDeleteModalButton'; import OpenEditModalButton from '@components/budgets/OpenEditModalButton'; import { Card, Title } from '@components/common'; import MainLayout from '@components/layout/MainLayout'; import { BudgetView, Source, Year, ExpenseView } from '@type/common'; -import DetailModal from '@components/budgets/DetailModal'; -import { useState } from 'react'; interface Props { budgets: BudgetView[]; @@ -124,27 +124,28 @@ export default function BudgetList(props: Props) { {budgets.map((budgetView, index) => ( - - + {budgetView.source.name} - + {budgetView.year.year} {budgetView.budget.price} - {formatDate(budgetView.budget.createdAt ? budgetView.budget.createdAt : '')} + {formatDate( + budgetView.budget.createdAt ? budgetView.budget.createdAt : '', + )} - {formatDate(budgetView.budget.updatedAt ? budgetView.budget.updatedAt : '')} + {formatDate( + budgetView.budget.updatedAt ? budgetView.budget.updatedAt : '', + )}
@@ -156,7 +157,9 @@ export default function BudgetList(props: Props) { />
- +
@@ -170,9 +173,7 @@ export default function BudgetList(props: Props) { > - - 合計金額 - + 合計金額 {budgetsTotalFee} @@ -218,9 +219,9 @@ export default function BudgetList(props: Props) { {expenses.map((expenseView, index) => ( - onOpen(expenseView.expense.id || 0, expenseView)} > @@ -230,10 +231,14 @@ export default function BudgetList(props: Props) { {expenseView.expense.totalPrice} - {formatDate(expenseView.expense.createdAt ? expenseView.expense.createdAt : '')} + {formatDate( + expenseView.expense.createdAt ? expenseView.expense.createdAt : '', + )} - {formatDate(expenseView.expense.updatedAt ? expenseView.expense.updatedAt : '')} + {formatDate( + expenseView.expense.updatedAt ? expenseView.expense.updatedAt : '', + )} ))} @@ -245,9 +250,7 @@ export default function BudgetList(props: Props) { > - - 合計金額 - + 合計金額 {expensesTotalFee} @@ -261,12 +264,7 @@ export default function BudgetList(props: Props) { - {isOpen && ( - - )} + {isOpen && } ); } diff --git a/view/next-project/src/pages/fund_informations/index.tsx b/view/next-project/src/pages/fund_informations/index.tsx index a08f2aade..098c0f37b 100644 --- a/view/next-project/src/pages/fund_informations/index.tsx +++ b/view/next-project/src/pages/fund_informations/index.tsx @@ -12,8 +12,8 @@ import OpenAddModalButton from '@components/fund_information/OpenAddModalButton' import OpenDeleteModalButton from '@components/fund_information/OpenDeleteModalButton'; import OpenEditModalButton from '@components/fund_information/OpenEditModalButton'; import MainLayout from '@components/layout/MainLayout'; -import { Department, FundInformation, Teacher, User } from '@type/common'; import { DEPARTMENTS } from '@constants/departments'; +import { Department, FundInformation, Teacher, User } from '@type/common'; interface FundInformationView { fundInformation: FundInformation; @@ -273,7 +273,7 @@ export default function FundInformations(props: Props) { {fundInformationView && fundInformationView.map((fundViewItem: FundInformationView, index) => ( - diff --git a/view/next-project/src/pages/purchaseorders/index.tsx b/view/next-project/src/pages/purchaseorders/index.tsx index 228f307cc..c6f231a13 100644 --- a/view/next-project/src/pages/purchaseorders/index.tsx +++ b/view/next-project/src/pages/purchaseorders/index.tsx @@ -1,11 +1,10 @@ -import clsx from 'clsx'; import Head from 'next/head'; import { useCallback, useEffect, useState, useMemo } from 'react'; import { useRecoilValue } from 'recoil'; import { authAtom } from '@/store/atoms'; -import { get } from '@api/api_methods'; import { put } from '@/utils/api/purchaseOrder'; +import { get } from '@api/api_methods'; import { getCurrentUser } from '@api/currentUser'; import { Card, Checkbox, Title, BureauLabel } from '@components/common'; import MainLayout from '@components/layout/MainLayout'; @@ -171,14 +170,11 @@ export default function PurchaseOrders(props: Props) { {props.purchaseOrderView.map((purchaseOrderViewItem, index) => ( - { - onOpen( - purchaseOrderViewItem.purchaseOrder.id || 0, - purchaseOrderViewItem, - ); + onOpen(purchaseOrderViewItem.purchaseOrder.id || 0, purchaseOrderViewItem); }} > @@ -187,16 +183,15 @@ export default function PurchaseOrders(props: Props) { checked={purchaseOrderChecks[index]} disabled={!isFinanceDirector} onChange={() => { - updatePurchaseOrder( - purchaseOrderViewItem.purchaseOrder.id || 0, - {...purchaseOrderViewItem.purchaseOrder, financeCheck: !purchaseOrderChecks[index]}, - ); + updatePurchaseOrder(purchaseOrderViewItem.purchaseOrder.id || 0, { + ...purchaseOrderViewItem.purchaseOrder, + financeCheck: !purchaseOrderChecks[index], + }); }} />
- +
- +
{formatDate( purchaseOrderViewItem.purchaseOrder.createdAt @@ -278,9 +272,7 @@ export default function PurchaseOrders(props: Props) {
-
- {totalPurchaseOrderFee} -
+
{totalPurchaseOrderFee}
diff --git a/view/next-project/src/pages/purchasereports/index.tsx b/view/next-project/src/pages/purchasereports/index.tsx index 0468a3900..9387a834c 100644 --- a/view/next-project/src/pages/purchasereports/index.tsx +++ b/view/next-project/src/pages/purchasereports/index.tsx @@ -4,8 +4,8 @@ import { useCallback, useEffect, useState, useMemo } from 'react'; import { useRecoilValue } from 'recoil'; import { authAtom } from '@/store/atoms'; -import { get } from '@api/api_methods'; import { put } from '@/utils/api/purchaseReport'; +import { get } from '@api/api_methods'; import { getCurrentUser } from '@api/currentUser'; import { Card, Checkbox, Title, BureauLabel } from '@components/common'; import MainLayout from '@components/layout/MainLayout'; @@ -57,7 +57,6 @@ export default function PurchaseReports(props: Props) { const [purchaseReports, setPurchaseReports] = useState(props.purchaseReports); const [purchaseReportChecks, setPurchaseReportChecks] = useState([]); - const [isOpen, setIsOpen] = useState(false); const onOpen = (purchaseOrderID: number, purchaseReportViewItem: PurchaseReportView) => { setPurchaseReportID(purchaseOrderID); @@ -71,19 +70,16 @@ export default function PurchaseReports(props: Props) { return datetime2; }, []); - const TotalFee = useCallback( - (purchaseReport: PurchaseReport, purchaseItems: PurchaseItem[]) => { - let totalFee = 0; - purchaseItems.map((purchaseItem: PurchaseItem) => { - if (purchaseItem.financeCheck) { - totalFee += purchaseItem.price * purchaseItem.quantity; - } - }); - totalFee += purchaseReport.addition - purchaseReport.discount; - return totalFee; - }, - [], - ); + const TotalFee = useCallback((purchaseReport: PurchaseReport, purchaseItems: PurchaseItem[]) => { + let totalFee = 0; + purchaseItems.map((purchaseItem: PurchaseItem) => { + if (purchaseItem.financeCheck) { + totalFee += purchaseItem.price * purchaseItem.quantity; + } + }); + totalFee += purchaseReport.addition - purchaseReport.discount; + return totalFee; + }, []); // すべてのpurchaseReportの合計金額 const totalReportFee = useMemo(() => { @@ -94,7 +90,6 @@ export default function PurchaseReports(props: Props) { return totalFee; }, [props.purchaseReportView]); - const isDisabled = useCallback( (purchaseReportView: PurchaseReportView) => { if ( @@ -195,13 +190,10 @@ export default function PurchaseReports(props: Props) { {props.purchaseReportView.map((purchaseReportViewItem, index) => ( - { - onOpen( - purchaseReportViewItem.purchaseOrder.id || 0, - purchaseReportViewItem, - ); + onOpen(purchaseReportViewItem.purchaseOrder.id || 0, purchaseReportViewItem); }} key={purchaseReportViewItem.purchaseReport.id} > @@ -211,10 +203,10 @@ export default function PurchaseReports(props: Props) { checked={purchaseReportChecks[index]} disabled={!isFinanceDirector} onChange={() => { - updatePurchaseReport( - purchaseReportViewItem.purchaseReport.id || 0, - {...purchaseReportViewItem.purchaseReport, financeCheck: !purchaseReportChecks[index]}, - ); + updatePurchaseReport(purchaseReportViewItem.purchaseReport.id || 0, { + ...purchaseReportViewItem.purchaseReport, + financeCheck: !purchaseReportChecks[index], + }); }} />
diff --git a/view/next-project/src/pages/sponsors/index.tsx b/view/next-project/src/pages/sponsors/index.tsx index 728ef91ae..0b2192ac2 100644 --- a/view/next-project/src/pages/sponsors/index.tsx +++ b/view/next-project/src/pages/sponsors/index.tsx @@ -1,4 +1,5 @@ import clsx from 'clsx'; +import type { NextPage } from 'next'; import Head from 'next/head'; import OpenDeleteModalButton from '@/components/sponsors/OpenDeleteModalButton'; @@ -9,8 +10,6 @@ import MainLayout from '@components/layout/MainLayout'; import OpenAddModalButton from '@components/sponsors/OpenAddModalButton'; import { Sponsor } from '@type/common'; -import type { NextPage } from 'next'; - interface Props { sponsor: Sponsor[]; } diff --git a/view/next-project/src/pages/teachers/index.tsx b/view/next-project/src/pages/teachers/index.tsx index 620c96b1e..6553f2614 100644 --- a/view/next-project/src/pages/teachers/index.tsx +++ b/view/next-project/src/pages/teachers/index.tsx @@ -1,17 +1,17 @@ import clsx from 'clsx'; -import { useCallback, useMemo, useState, useEffect } from 'react'; +import Head from 'next/head'; +import { useMemo, useState, useEffect } from 'react'; +import { useRecoilValue } from 'recoil'; +import { DEPARTMENTS } from '@/constants/departments'; +import { authAtom } from '@/store/atoms'; +import { getCurrentUser } from '@/utils/api/currentUser'; import { get } from '@api/api_methods'; +import { Card, Title } from '@components/common'; import MainLayout from '@components/layout/MainLayout'; import OpenAddModalButton from '@components/teacher/OpenAddModalButton'; import OpenDeleteModalButton from '@components/teacher/OpenDeleteModalButton'; import OpenEditModalButton from '@components/teacher/OpenEditModalButton'; import { Teacher, User } from '@type/common'; -import { DEPARTMENTS } from '@/constants/departments'; -import Head from 'next/head'; -import { Card, Title } from '@components/common'; -import { authAtom } from '@/store/atoms'; -import { useRecoilValue } from 'recoil'; -import { getCurrentUser } from '@/utils/api/currentUser'; interface Props { teachers: Teacher[];