Enable Date edition on People view (#105)

* Enable Date edition on People view

* Fix linter
This commit is contained in:
Charles Bochet
2023-05-05 18:52:04 +02:00
committed by GitHub
parent b8cd842633
commit 406e1dc02e
11 changed files with 372 additions and 8 deletions

View File

@ -34,6 +34,7 @@ import {
import { GraphqlQueryCompany } from '../../interfaces/company.interface';
import EditablePhone from '../../components/table/editable-cell/EditablePhone';
import EditableFullName from '../../components/table/editable-cell/EditableFullName';
import EditableDate from '../../components/table/editable-cell/EditableDate';
export const availableSorts = [
{
@ -309,13 +310,14 @@ export const peopleColumns = [
columnHelper.accessor('creationDate', {
header: () => <ColumnHead viewName="Creation" viewIcon={<FaCalendar />} />,
cell: (props) => (
<ClickableCell href="#">
{new Intl.DateTimeFormat(undefined, {
month: 'short',
day: 'numeric',
year: 'numeric',
}).format(props.row.original.creationDate)}
</ClickableCell>
<EditableDate
value={props.row.original.creationDate}
changeHandler={(value: Date) => {
const person = props.row.original;
person.creationDate = value;
updatePerson(person).catch((error) => console.error(error)); // TODO: handle error
}}
/>
),
}),
columnHelper.accessor('pipe', {