-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: prettier 맞춤법 수정 * chore: worker 주석처리 * feat: 컴패니 뷰 데이터 API 구현 * remove: 파일 제거 * remove: 컴포넌트 제거 * feat: 셀 수정 구현 * feat: 해당 회사 클릭했을때 모달창 나타내기 구현 * feat: column 데이터 값 받아오기 구현 * feat: column 생성 모달창 구현 * remove: 필요없는 함수 제거 * feat: dayjs 패키지 매니저 설치 * chore: 파일 이동 * feat: company col생성구현 * remove: 코드 제거 * feat: customEditor 구현 * feat: customeditor 구현 * feat: 파일 이동 및 제거 * remove: companyId제거
- Loading branch information
Showing
25 changed files
with
367 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { axiosClient } from '../AxiosClient'; | ||
|
||
export const UsePWcpCellsHook = async ({ | ||
columnId, | ||
rowId, | ||
value, | ||
}: { | ||
columnId: number; | ||
rowId: number; | ||
value: string; | ||
}) => { | ||
try { | ||
const response = await axiosClient.patch(`/workspaces/cells`, { | ||
columnId, | ||
rowId, | ||
value, | ||
}); | ||
|
||
return response.data; | ||
} catch (error) { | ||
console.error(error); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { useState } from 'react'; | ||
|
||
import { Input } from 'antd'; | ||
|
||
import { usePWcpCellQ } from '@finnect/hooks/queries/company/usePWcpCellQ'; | ||
import { useGetCV } from '@finnect/hooks/queries/company/useGetCV'; | ||
|
||
const CustomCellEditor = (props: any) => { | ||
const { refetch } = useGetCV(); | ||
|
||
const { mutate, isPending } = usePWcpCellQ(() => { | ||
refetch(); | ||
}); | ||
const [value, setValue] = useState(props.value); | ||
|
||
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => { | ||
setValue(e.target.value); | ||
}; | ||
|
||
const handleSave = async () => { | ||
await mutate({ | ||
columnId: props.colDef.columnId, | ||
rowId: props.data.rowId, | ||
value, | ||
}); | ||
}; | ||
|
||
return ( | ||
<> | ||
<Input value={value} onChange={handleChange} onBlur={handleSave} /> | ||
{isPending && <span>Loading...</span>} | ||
</> | ||
); | ||
}; | ||
|
||
export default CustomCellEditor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { useState } from 'react'; | ||
|
||
import { DatePicker } from 'antd'; | ||
import dayjs from 'dayjs'; | ||
|
||
import { usePWcpCellQ } from '@finnect/hooks/queries/company/usePWcpCellQ'; | ||
import { useGetCV } from '@finnect/hooks/queries/company/useGetCV'; | ||
|
||
const CustomDateEditor = (props: any) => { | ||
const { refetch } = useGetCV(); | ||
const { mutate, isPending } = usePWcpCellQ(() => { | ||
refetch(); | ||
}); | ||
const [value, setValue] = useState(dayjs(props.value)); | ||
const handleChange = (date: any) => { | ||
setValue(dayjs(date)); | ||
}; | ||
|
||
const handleSave = async () => { | ||
await mutate({ | ||
columnId: props.colDef.columnId, | ||
rowId: props.data.rowId, | ||
value: value.format('YYYY-MM-DD'), | ||
}); | ||
refetch(); | ||
}; | ||
|
||
return ( | ||
<> | ||
<DatePicker | ||
value={value.toDate()} | ||
onChange={handleChange} | ||
onBlur={handleSave} | ||
/> | ||
{isPending && <span>Loading...</span>} | ||
</> | ||
); | ||
}; | ||
|
||
export default CustomDateEditor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { Select } from 'antd'; | ||
import { useState } from 'react'; | ||
|
||
import { usePWcpCellQ } from '@finnect/hooks/queries/company/usePWcpCellQ'; | ||
import { useGetCV } from '@finnect/hooks/queries/company/useGetCV'; | ||
|
||
import StatusCategory from '@finnect/components/common/columnOption/CustomStatusEditor'; | ||
|
||
const { Option } = Select; | ||
|
||
const CustomCategoryEditor = (props: any) => { | ||
const { refetch } = useGetCV(); | ||
const { mutate, isPending } = usePWcpCellQ(() => { | ||
refetch(); | ||
}); | ||
const [value, setValue] = useState(props.value); | ||
|
||
const handleChange = (newValue: string) => { | ||
setValue(newValue); | ||
}; | ||
|
||
const handleSave = async () => { | ||
await mutate({ | ||
columnId: props.colDef.columnId, | ||
rowId: props.data.rowId, | ||
value, | ||
}); | ||
refetch(); | ||
}; | ||
|
||
return ( | ||
<> | ||
<Select value={value} onChange={handleChange} onBlur={handleSave}> | ||
{Array.isArray(StatusCategory) && | ||
StatusCategory.map((category: string) => ( | ||
<Option key={category} value={category}> | ||
{category} | ||
</Option> | ||
))} | ||
</Select> | ||
{isPending && <span>Loading...</span>} | ||
</> | ||
); | ||
}; | ||
|
||
export default CustomCategoryEditor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const StatusCategory = ['stand-by', 'IN PROGRESS', 'DONE DISCARDED']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.