Skip to content

Commit

Permalink
Update the name of some fields
Browse files Browse the repository at this point in the history
  • Loading branch information
clementprdhomme committed Oct 10, 2024
1 parent be34032 commit f90d8a8
Show file tree
Hide file tree
Showing 16 changed files with 392 additions and 159 deletions.
357 changes: 294 additions & 63 deletions cms/config/sync/admin-role.strapi-author.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions cms/config/sync/admin-role.strapi-editor.json
Original file line number Diff line number Diff line change
Expand Up @@ -799,8 +799,8 @@
"location",
"habitat",
"year",
"protectedArea",
"totalArea",
"protected_area",
"total_area",
"environment"
]
},
Expand All @@ -822,8 +822,8 @@
"location",
"habitat",
"year",
"protectedArea",
"totalArea",
"protected_area",
"total_area",
"environment"
]
},
Expand All @@ -838,8 +838,8 @@
"location",
"habitat",
"year",
"protectedArea",
"totalArea",
"protected_area",
"total_area",
"environment"
]
},
Expand Down Expand Up @@ -1468,8 +1468,8 @@
"fields": [
"location",
"year",
"protectedArea",
"protectedAreasCount",
"protected_area",
"protected_areas_count",
"environment",
"coverage",
"pas",
Expand All @@ -1495,8 +1495,8 @@
"fields": [
"location",
"year",
"protectedArea",
"protectedAreasCount",
"protected_area",
"protected_areas_count",
"environment",
"coverage",
"pas",
Expand All @@ -1515,8 +1515,8 @@
"fields": [
"location",
"year",
"protectedArea",
"protectedAreasCount",
"protected_area",
"protected_areas_count",
"environment",
"coverage",
"pas",
Expand Down
26 changes: 13 additions & 13 deletions cms/config/sync/admin-role.strapi-super-admin.json
Original file line number Diff line number Diff line change
Expand Up @@ -811,8 +811,8 @@
"location",
"habitat",
"year",
"protectedArea",
"totalArea",
"protected_area",
"total_area",
"environment"
]
},
Expand All @@ -834,8 +834,8 @@
"location",
"habitat",
"year",
"protectedArea",
"totalArea",
"protected_area",
"total_area",
"environment"
]
},
Expand All @@ -850,8 +850,8 @@
"location",
"habitat",
"year",
"protectedArea",
"totalArea",
"protected_area",
"total_area",
"environment"
]
},
Expand Down Expand Up @@ -1480,8 +1480,8 @@
"fields": [
"location",
"year",
"protectedArea",
"protectedAreasCount",
"protected_area",
"protected_areas_count",
"environment",
"coverage",
"pas",
Expand All @@ -1507,8 +1507,8 @@
"fields": [
"location",
"year",
"protectedArea",
"protectedAreasCount",
"protected_area",
"protected_areas_count",
"environment",
"coverage",
"pas",
Expand All @@ -1527,8 +1527,8 @@
"fields": [
"location",
"year",
"protectedArea",
"protectedAreasCount",
"protected_area",
"protected_areas_count",
"environment",
"coverage",
"pas",
Expand Down Expand Up @@ -2182,4 +2182,4 @@
"actionParameters": {}
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,30 +64,30 @@
"sortable": true
}
},
"protectedArea": {
"protected_area": {
"edit": {
"label": "protectedArea",
"label": "protected_area",
"description": "",
"placeholder": "",
"visible": true,
"editable": true
},
"list": {
"label": "protectedArea",
"label": "protected_area",
"searchable": true,
"sortable": true
}
},
"totalArea": {
"total_area": {
"edit": {
"label": "totalArea",
"label": "total_area",
"description": "",
"placeholder": "",
"visible": true,
"editable": true
},
"list": {
"label": "totalArea",
"label": "total_area",
"searchable": true,
"sortable": true
}
Expand Down Expand Up @@ -188,20 +188,22 @@
{
"name": "year",
"size": 4
},
}
],
[
{
"name": "protectedArea",
"size": 4
"name": "environment",
"size": 6
},
{
"name": "totalArea",
"name": "protected_area",
"size": 4
}
],
[
{
"name": "environment",
"size": 6
"name": "total_area",
"size": 4
}
]
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,30 @@
"sortable": true
}
},
"protectedArea": {
"protected_area": {
"edit": {
"label": "protectedArea",
"label": "protected_area",
"description": "",
"placeholder": "",
"visible": true,
"editable": true
},
"list": {
"label": "protectedArea",
"label": "protected_area",
"searchable": true,
"sortable": true
}
},
"protectedAreasCount": {
"protected_areas_count": {
"edit": {
"label": "protectedAreasCount",
"label": "protected_areas_count",
"description": "",
"placeholder": "",
"visible": true,
"editable": true
},
"list": {
"label": "protectedAreasCount",
"label": "protected_areas_count",
"searchable": true,
"sortable": true
}
Expand Down Expand Up @@ -246,14 +246,6 @@
}
],
[
{
"name": "protectedArea",
"size": 4
},
{
"name": "protectedAreasCount",
"size": 4
},
{
"name": "coverage",
"size": 4
Expand All @@ -277,6 +269,14 @@
{
"name": "global_contribution",
"size": 4
},
{
"name": "protected_area",
"size": 4
},
{
"name": "protected_areas_count",
"size": 4
}
]
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"type": "integer",
"required": true
},
"protectedArea": {
"protected_area": {
"type": "decimal",
"required": true,
"min": 0,
Expand All @@ -39,7 +39,7 @@
]
}
},
"totalArea": {
"total_area": {
"type": "decimal",
"required": true,
"min": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"required": true,
"min": 0
},
"protectedArea": {
"protected_area": {
"type": "decimal",
"min": 0,
"column": {
Expand All @@ -35,7 +35,7 @@
]
}
},
"protectedAreasCount": {
"protected_areas_count": {
"type": "integer",
"required": true
},
Expand Down
8 changes: 4 additions & 4 deletions cms/types/generated/contentTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1406,12 +1406,12 @@ export interface ApiHabitatStatHabitatStat extends Schema.CollectionType {
'api::habitat.habitat'
>;
year: Attribute.Integer & Attribute.Required;
protectedArea: Attribute.Decimal &
protected_area: Attribute.Decimal &
Attribute.Required &
Attribute.SetMinMax<{
min: 0;
}>;
totalArea: Attribute.Decimal &
total_area: Attribute.Decimal &
Attribute.Required &
Attribute.SetMinMax<{
min: 0;
Expand Down Expand Up @@ -1938,11 +1938,11 @@ export interface ApiProtectionCoverageStatProtectionCoverageStat
Attribute.SetMinMax<{
min: 0;
}>;
protectedArea: Attribute.Decimal &
protected_area: Attribute.Decimal &
Attribute.SetMinMax<{
min: 0;
}>;
protectedAreasCount: Attribute.Integer & Attribute.Required;
protected_areas_count: Attribute.Integer & Attribute.Required;
environment: Attribute.Relation<
'api::protection-coverage-stat.protection-coverage-stat',
'oneToOne',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export type GlobalRegionalTableColumns = {
slug: string;
};
coverage: number;
protectedArea: number;
protected_area: number;
pas: number;
oecms: number;
global_contribution: number;
Expand Down Expand Up @@ -206,8 +206,8 @@ export const useColumns = (
},
},
{
id: 'protectedArea',
accessorKey: 'protectedArea',
id: 'protected_area',
accessorKey: 'protected_area',
header: ({ column }) => (
<HeaderItem>
<SortingButton column={column} />
Expand All @@ -216,7 +216,7 @@ export const useColumns = (
</HeaderItem>
),
cell: ({ row }) => {
const { protectedArea: value } = row.original;
const { protected_area: value } = row.original;
const formattedValue = cellFormatter.area(locale, value);
return <span>{t('area-km2', { area: formattedValue })}</span>;
},
Expand Down Expand Up @@ -349,7 +349,7 @@ export const useData = (
{
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
fields: ['coverage', 'protectedArea', 'pas', 'oecms', 'global_contribution'],
fields: ['coverage', 'protected_area', 'pas', 'oecms', 'global_contribution'],
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
populate: {
Expand Down Expand Up @@ -454,7 +454,7 @@ export const useData = (
slug: localizedEnvironment.slug,
},
coverage: attributes.coverage,
protectedArea: attributes.protectedArea,
protected_area: attributes.protected_area,
pas: attributes.pas,
oecms: attributes.oecms,
global_contribution: attributes.global_contribution,
Expand Down
Loading

0 comments on commit f90d8a8

Please sign in to comment.