Skip to content

Commit

Permalink
feat(exports): indication du nom personnalisé aux bons endroits
Browse files Browse the repository at this point in the history
  • Loading branch information
thom4parisot committed Apr 16, 2024
1 parent 786c35e commit ed50716
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function getSheet () {

getFeatureGroups(featureCollection, [GROUPE_CULTURE, GROUPE_NIVEAU_CONVERSION, GROUPE_DATE_ENGAGEMENT]).forEach(({ features, mainKey, surface }, index) => {
const culture = fromCodeCpf(mainKey)
const autresInfos = generateAutresInfos(features, { pivot: mainKey })
const autresInfos = generateAutresInfos(features, { pivot: mainKey, withExplicitName: true, withName: true })
const varietes = generateAutresInfos(features, { pivot: mainKey, withNotes: false, withDate: false, withName: false, withSurface: false })

sheet_add_aoa(sheet, [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('BureauVeritasExporter', () => {
"Luzerne",
"1125",
"",
"Ilots : 1.1 ; 1.2",
"Ilots : 1.1 (nom personnalisé) ; 1.2",
2.092976314534671,
"ha",
"C1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function getSheet () {
// Libellé Culture #C
culture?.libelle_code_cpf ?? `[ERREUR] culture inconnue (${props.cultures?.at(0).CPF})`,
// Variété / infos #D
generateAutresInfos([{ id, geometry, properties: props }], { withCode: false, withDate: false, withName: false, withNotes: true, withSurface: false, withVariete: true, initialCulture: culture?.code_cpf }),
generateAutresInfos([{ id, geometry, properties: props }], { withCode: false, withDate: false, withExplicitName: true, withName: false, withNotes: true, withSurface: false, withVariete: true, initialCulture: culture?.code_cpf }),
// C0 - AB - C1 - C2 - C3
props.conversion_niveau === 'CONV' ? surfaceHa : '',
props.conversion_niveau === 'AB' ? surfaceHa : '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('CertipaqExporter', () => {
'',
'1_1',
'Luzerne',
'',
'nom personnalisé',
'',
'',
'1,05',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('CertisExporter', () => {
"Id. Parcelle"
],
[
'',
'nom personnalisé',
'1',
'1',
1.0464881572673355,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function getSheet () {

getFeatureGroups(featureCollection, [GROUPE_CULTURE, GROUPE_NIVEAU_CONVERSION, GROUPE_DATE_ENGAGEMENT]).forEach(({ features, mainKey, surface }, index) => {
const culture = fromCodeCpf(mainKey)
const autresInfos = generateAutresInfos(features, { withAnnotations: true, pivot: mainKey, permissions })
const autresInfos = generateAutresInfos(features, { withAnnotations: true, withExplicitName: true, withName: true, pivot: mainKey, permissions })

sheet_add_aoa(sheet, [
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('CertisudExporter', () => {
'Luzerne',
// expect.closeTo(2.1), // in vite@5 + vitest@1
2.092976314534671,
'1.1, Visitée ; 1.2, Prélèvement effectué, À risque',
'1.1 (nom personnalisé), Visitée ; 1.2, Prélèvement effectué, À risque',
'C1',
new Date('2023-01-01T00:00:00.000Z'),
'1,2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function getSheet () {
surfaceHa,
props.engagement_date ? new Date(props.engagement_date) : '',
props.conversion_niveau,
generateAutresInfos([{ properties: props }], { withAnnotations: true, initialCulture: culture?.code_cpf, permissions }),
generateAutresInfos([{ properties: props }], { withAnnotations: true, withExplicitName: true, withName: true, initialCulture: culture?.code_cpf, permissions }),
String(props.id),
culture?.code_cpf
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('ControlUnionExporter', () => {
1.0464881572673355,
new Date('2023-01-01T00:00:00.000Z'),
'C1',
'1.1, Visitée',
'1.1 (nom personnalisé), Visitée',
'1',
'01.19.10.8',
],
Expand Down
4 changes: 2 additions & 2 deletions src/components/Features/ExportStrategies/OcaciaExporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function getSheet () {
// N° Cadastre
props.cadastre,
// Variété / infos
generateAutresInfos([{ id, geometry, properties: props }], { withDate: false, withName: false, withNotes: false, withSurface: false, withVariete: true, initialCulture: culture?.code_cpf }),
generateAutresInfos([{ id, geometry, properties: props }], { withDate: false, withExplicitName: false, withName: false, withNotes: false, withSurface: false, withVariete: true, initialCulture: culture?.code_cpf }),
// C0 - AB - C1 - C2 - C3
props.conversion_niveau === 'CONV' ? surfaceHa : '',
props.conversion_niveau === 'AB' ? surfaceHa : '',
Expand All @@ -68,7 +68,7 @@ function getSheet () {
// Date conv #K
props.engagement_date ? new Date(props.engagement_date) : '',
// Observation / date de semis
generateAutresInfos([{ id, geometry, properties: props }], { withAnnotations: true, withDate: true, withName: false, withNotes: true, withSurface: true, withVariete: false, initialCulture: culture?.code_cpf, permissions }),
generateAutresInfos([{ id, geometry, properties: props }], { withAnnotations: true, withDate: true, withExplicitName: true, withName: false, withNotes: true, withSurface: true, withVariete: false, initialCulture: culture?.code_cpf, permissions }),
// Précédent
'',
// Anté précédent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('OcaciaExporter', () => {
'',
'',
new Date('2023-01-01T00:00:00.000Z'),
'Visitée',
'nom personnalisé, Visitée',
'',
'',
'',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function getSheet () {
[
firstCulture?.code_cpf ?? `[ERREUR] culture inconnue (${properties.cultures.at(0)?.CPF})`,
autresInfos,
featureName({ properties }, { placeholder: '' }),
featureName({ properties }, { placeholder: '', explicitName: true }),
surface(geometry) / 10_000,
properties.conversion_niveau,
properties.engagement_date ? new Date(properties.engagement_date) : '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('QualisudExporter', () => {
[
'01.19.10.8',
'Visitée',
'ilot 1, parcelle 1',
'ilot 1, parcelle 1 (nom personnalisé)',
1.0464881572673355,
'C1',
new Date('2023-01-01T00:00:00.000Z'),
Expand Down

0 comments on commit ed50716

Please sign in to comment.