Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cypress/integration/projection.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ describe('Projection mode', () => {
});

describe('Projection in form mode', () => {
const selectField = (name, item) => {
const selectField = (name, item, force) => {
cy.get(`[data-cypress=projectionForm${name}]`)
.scrollIntoView()
.click();
cy.get(`[data-cypress=projectionForm${name}] ${item}`).click();
.click({ force });
cy.get(`[data-cypress=projectionForm${name}] ${item}`).click({ force });
};
beforeEach(() => {
cy.visit('');
Expand All @@ -38,7 +38,7 @@ describe('Projection in form mode', () => {
selectField('ForestEcoregion', '.item:first-child');
selectField('AltitudinalZone', '.item:last-child');
selectField('ForestType', '.item:first-child');
selectField('TargetAltitudinalZone', '.item:first-child');
selectField('TargetAltitudinalZone', '.item:first-child', true);
cy.get('[data-cypress=recommendationPane]')
.scrollIntoView()
.should('be.visible');
Expand All @@ -50,8 +50,8 @@ describe('Projection in form mode', () => {
selectField('ForestType', '.item:first-child');
cy.get(`[data-cypress=projectionFormTransition] .ui:last-child`).click();
selectField('TransitionForestType', '.item:first-child');
selectField('TransitionAltitudinalZone', '.item:last-child');
selectField('TargetAltitudinalZone', '.item:first-child');
selectField('TransitionAltitudinalZone', '.item:last-child', true);
selectField('TargetAltitudinalZone', '.item:first-child', true);
cy.get('[data-cypress=projectionResultMenuItem]').contains(/\w+\s\(\w+\)/);
});
});
46 changes: 8 additions & 38 deletions lib/data/locations.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,12 @@
{
"1": {
"20": 1,
"40": 7,
"50": 9,
"60": 11,
"81": 14,
"82": 14,
"83": 14,
"90": 22,
"100": 26
},
"3": { "81": 18, "82": 18, "83": 18, "90": 22, "100": 27 },
"4": { "20": 3, "81": 20, "82": 20, "83": 20, "90": 23, "100": 24 },
"M": { "20": 1, "40": 7, "50": 9, "60": 11, "81": 14, "82": 14, "83": 14 },
"J": { "20": 1, "40": 7, "50": 9, "60": 11, "81": 14, "82": 14, "83": 14 },
"2a": {
"20": 2,
"40": 8,
"50": 10,
"60": 12,
"81": 17,
"82": 17,
"83": 17,
"90": 22,
"100": 27
},
"5a": {
"10": 5,
"20": 4,
"30": 4,
"70": 13,
"81": 21,
"82": 21,
"83": 21,
"90": 25,
"100": 25
},
"1": { "20": 1, "40": 7, "50": 9, "60": 11, "80": 14, "90": 22, "100": 26 },
"3": { "80": 18, "90": 22, "100": 27 },
"4": { "20": 3, "80": 20, "90": 23, "100": 24 },
"M": { "20": 1, "40": 7, "50": 9, "60": 11, "80": 14 },
"J": { "20": 1, "40": 7, "50": 9, "60": 11, "80": 14 },
"2a": { "20": 2, "40": 8, "50": 10, "60": 12, "80": 17, "90": 22, "100": 27 },
"5a": { "10": 5, "20": 4, "30": 4, "70": 13, "80": 21, "90": 25, "100": 25 },
"5b": { "10": 5, "20": 4, "30": 4, "70": 13, "90": 25, "100": 25 },
"2b": { "20": 2, "81": 17, "82": 17, "83": 17, "90": 22, "100": 27 },
"2b": { "20": 2, "80": 17, "90": 22, "100": 27 },
"Me": { "10": 6, "30": 6 }
}
9 changes: 2 additions & 7 deletions lib/data/nais/ecogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,12 @@ const aggregateEcograms = () => {
const ecogram = JSON.parse(rawdata);

const { forestEcoregions, altitudinalZones } = ecogram.properties || {};
// TODO: remove the following variable once branch "hochmontan" is merged!
const filteredAltitudinalZones = altitudinalZones.includes('80')
? [...altitudinalZones.filter((z) => z !== '80'), '81', '82', '83']
: altitudinalZones;

validate('forestEcoregion', forestEcoregions);
validate('altitudinalZone', filteredAltitudinalZones);
validate('altitudinalZone', altitudinalZones);

forestEcoregions.forEach((region) => {
locations[region] = locations[region] || {};
filteredAltitudinalZones.forEach((zone) => {
altitudinalZones.forEach((zone) => {
locations[region][zone] = id;
});
});
Expand Down
Loading