Skip to content

Commit b5e1472

Browse files
author
Antonio Contreras LEMONCODE
committed
Fix others components
1 parent 2e266c9 commit b5e1472

6 files changed

Lines changed: 20 additions & 24 deletions

File tree

src/pods/project-list/api/project-list.api-model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export interface Project {
22
id: string;
33
active: boolean;
44
code: string;
5-
projectName: string;
5+
name: string;
66
lastDateIncurred: string;
77
creationDate: string;
88
}

src/pods/project-list/api/project-list.mock-data.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,63 +5,63 @@ export const mockProjectList: Project[] = [
55
id: '1',
66
active: true,
77
code: '23212',
8-
projectName: 'Bankia',
8+
name: 'Bankia',
99
lastDateIncurred: '02/02/2020',
1010
creationDate: '01/08/2018',
1111
},
1212
{
1313
id: '2',
1414
active: true,
1515
code: '4323',
16-
projectName: 'Mapfre',
16+
name: 'Mapfre',
1717
lastDateIncurred: '05/02/2020',
1818
creationDate: '01/04/2018',
1919
},
2020
{
2121
id: '3',
2222
active: true,
2323
code: '002',
24-
projectName: 'Vacaciones',
24+
name: 'Vacaciones',
2525
lastDateIncurred: '05/02/2020',
2626
creationDate: '01/04/2018',
2727
},
2828
{
2929
id: '4',
3030
active: true,
3131
code: '003',
32-
projectName: 'Baja Médica',
32+
name: 'Baja Médica',
3333
lastDateIncurred: '05/03/2018',
3434
creationDate: '01/05/2019',
3535
},
3636
{
3737
id: '5',
3838
active: false,
3939
code: '2586',
40-
projectName: 'Proyecto interno',
40+
name: 'Proyecto interno',
4141
lastDateIncurred: '05/08/2020',
4242
creationDate: '01/10/2018',
4343
},
4444
{
4545
id: '6',
4646
active: false,
4747
code: '3025',
48-
projectName: 'BBVA',
48+
name: 'BBVA',
4949
lastDateIncurred: '06/05/2020',
5050
creationDate: '01/03/2019',
5151
},
5252
{
5353
id: '7',
5454
active: false,
5555
code: '8563',
56-
projectName: 'Baja Médica',
56+
name: 'Baja Médica',
5757
lastDateIncurred: '02/08/2018',
5858
creationDate: '01/11/2020',
5959
},
6060
{
6161
id: '8',
6262
active: true,
6363
code: '4125',
64-
projectName: 'Microsoft España',
64+
name: 'Microsoft España',
6565
lastDateIncurred: '11/10/2018',
6666
creationDate: '01/07/2020',
6767
},

src/pods/project-list/components/project-row.component.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,20 @@ export const ProjectRowComponent: React.FunctionComponent<Props> = ({
1818
onEdit,
1919
onDelete,
2020
}) => {
21-
const projectToDeleted: Lookup = {
22-
id: row.id,
23-
name: row.projectName,
24-
};
2521
return (
2622
<RowComponent>
2723
<CellComponent>
2824
<Checkbox checked={row.active} disabled />
2925
</CellComponent>
3026
<CellComponent>{row.code}</CellComponent>
31-
<CellComponent>{row.projectName}</CellComponent>
27+
<CellComponent>{row.name}</CellComponent>
3228
<CellComponent>{row.lastDateIncurred}</CellComponent>
3329
<CellComponent>
3430
{row.creationDate}
3531
<IconButton onClick={() => onEdit(row.id)}>
3632
<EditIcon />
3733
</IconButton>
38-
<IconButton onClick={() => onDelete(projectToDeleted)}>
34+
<IconButton onClick={() => onDelete(row)}>
3935
<DeleteIcon />
4036
</IconButton>
4137
</CellComponent>

src/pods/project-list/project-list.container.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { useHistory } from 'react-router-dom';
1010
const editProjectId = '0';
1111

1212
export const ProjectListContainer: React.FunctionComponent = () => {
13-
const [projectes, setProjects] = React.useState<Project[]>([]);
13+
const [projects, setProjects] = React.useState<Project[]>([]);
1414
const { showMessage } = useSnackbarContext();
1515
const history = useHistory();
1616

@@ -49,7 +49,7 @@ export const ProjectListContainer: React.FunctionComponent = () => {
4949

5050
return (
5151
<ProjectListComponent
52-
projectList={projectes}
52+
projectList={projects}
5353
onCreate={handleCreate}
5454
onEdit={handleEdit}
5555
onDelete={handleDelete}

src/pods/project-list/project-list.mappers.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('./pods/project-list', () => {
4343
id: 'test id',
4444
active: true,
4545
code: 'test code',
46-
projectName: 'test project name',
46+
name: 'test project name',
4747
lastDateIncurred: '02/02/2020',
4848
creationDate: '05/11/2019',
4949
},
@@ -54,7 +54,7 @@ describe('./pods/project-list', () => {
5454
id: 'test id',
5555
active: true,
5656
code: 'test code',
57-
projectName: 'test project name',
57+
name: 'test project name',
5858
lastDateIncurred: '02/02/2020',
5959
creationDate: '05/11/2019',
6060
},
@@ -74,15 +74,15 @@ describe('./pods/project-list', () => {
7474
id: 'test id 1',
7575
active: true,
7676
code: 'test code',
77-
projectName: 'test project name 1',
77+
name: 'test project name 1',
7878
lastDateIncurred: '02/02/2020',
7979
creationDate: '05/11/2019',
8080
},
8181
{
8282
id: 'test id 2',
8383
active: false,
8484
code: 'test code',
85-
projectName: 'test project name 2',
85+
name: 'test project name 2',
8686
lastDateIncurred: '02/11/2020',
8787
creationDate: '05/05/2019',
8888
},
@@ -93,15 +93,15 @@ describe('./pods/project-list', () => {
9393
id: 'test id 1',
9494
active: true,
9595
code: 'test code',
96-
projectName: 'test project name 1',
96+
name: 'test project name 1',
9797
lastDateIncurred: '02/02/2020',
9898
creationDate: '05/11/2019',
9999
},
100100
{
101101
id: 'test id 2',
102102
active: false,
103103
code: 'test code',
104-
projectName: 'test project name 2',
104+
name: 'test project name 2',
105105
lastDateIncurred: '02/11/2020',
106106
creationDate: '05/05/2019',
107107
},

src/pods/project-list/project-list.vm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export interface Project {
22
id: string;
33
active: boolean;
44
code: string;
5-
projectName: string;
5+
name: string;
66
lastDateIncurred: string;
77
creationDate: string;
88
}

0 commit comments

Comments
 (0)