Skip to content

Commit 76edf1c

Browse files
committed
add field region to project grid
1 parent 1627b84 commit 76edf1c

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

src/components/ProjectDataGrid/ProjectColumns.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
} from '../Grid';
2828
import { ProjectNameColumn } from '../Grid/Columns/ProjectNameColumn';
2929
import { SensitivityColumn } from '../Grid/Columns/SensitivityColumn';
30+
import { Link } from '../Routing';
3031
import { ProjectDataGridRowFragment as Project } from './projectDataGridRow.graphql';
3132

3233
export const ProjectColumns: Array<GridColDef<Project>> = [
@@ -43,6 +44,21 @@ export const ProjectColumns: Array<GridColDef<Project>> = [
4344
headerName: 'Country',
4445
width: 300,
4546
},
47+
{
48+
field: 'fieldRegion.name',
49+
headerName: 'Field Region',
50+
...textColumn(),
51+
width: 250,
52+
valueGetter: (_, { fieldRegion }) => fieldRegion.value?.name.value,
53+
renderCell: ({ row: project }) => {
54+
const { fieldRegion } = project;
55+
return (
56+
<Link to={`/field-regions/${fieldRegion.value?.id}`}>
57+
{fieldRegion.value?.name.value}
58+
</Link>
59+
);
60+
},
61+
},
4662
{
4763
field: 'step',
4864
...enumColumn(ProjectStepList, ProjectStepLabels, {

src/components/ProjectDataGrid/projectDataGridRow.graphql

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,21 @@ fragment projectDataGridRow on Project {
1818
}
1919
}
2020
}
21+
fieldRegion {
22+
value {
23+
id
24+
name {
25+
value
26+
}
27+
}
28+
}
2129
mouStart {
2230
value
2331
}
2432
mouEnd {
2533
value
2634
}
35+
2736
isMember
2837
pinned
2938
}

0 commit comments

Comments
 (0)