Skip to content

Commit

Permalink
fix: styling and display fixes after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
lubojr committed Sep 16, 2024
1 parent cc957c3 commit 07420b5
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 47 deletions.
3 changes: 1 addition & 2 deletions app/src/components/AreaStatistics.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<template>
<v-card>
<v-card-title class="pa-2">Custom Area Statistics</v-card-title>
<v-col>
<v-row class="pt-4 area-statistics justify-space-between align-center mx-2">
<h3>Custom Area Statistics</h3>

<v-btn
@click="fetchData"
color="primary"
Expand Down
35 changes: 16 additions & 19 deletions app/src/components/DataPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -278,22 +278,6 @@
class="my-1"
><span><v-icon left>mdi-open-in-new</v-icon>{{externalData.label}}</span>
</v-btn>
<v-card
class="ma-5"
v-if="indicatorSelected
&& indicatorSelected.indicator === 'IND2_1'"
>
<h1 class="ml-5">Species Info</h1>
<v-col>
<SpeciesList v-if="selectedArea && sortedSpecies.length > 0"
:species=sortedSpecies />
<div v-else-if="selectedArea">No species in this area.</div>
<div v-else>
Select an area on the map using the rectangle or polygon buttons.
</div>
</v-col>
</v-card>
</v-col>
</v-row>
</v-col>
Expand Down Expand Up @@ -321,6 +305,21 @@
</v-text-field>
</v-card>
</v-col>
<v-card
class="ma-5"
v-if="indicatorSelected
&& indicatorSelected.indicator === 'IND2_1'"
>
<h1 class="ml-5">Species Info</h1>
<v-col>
<SpeciesList v-if="selectedArea && sortedSpecies.length > 0"
:species=sortedSpecies />
<div v-else-if="selectedArea">No species in this area.</div>
<div v-else>
Select an area on the map using the rectangle or polygon buttons.
</div>
</v-col>
</v-card>
<GTIFProcessingButtons
v-if="mergedConfigsData[0].processingEnabled">
</GTIFProcessingButtons>
Expand Down Expand Up @@ -587,9 +586,7 @@ export default {
},
async refreshSpeciesInfo() {
if (this.selectedArea
&& this.indicatorSelected
&& this.indicatorSelected.indicator === 'IND2_1_minesweeper'
&& !this.mergedConfigsData[0].minesweeperOptions
&& this.indicatorSelected?.indicator === 'IND2_1'
) {
const bbox = [
...this.selectedArea.coordinates[0][0],
Expand Down
14 changes: 6 additions & 8 deletions app/src/components/map/CustomWmsVariables.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<template>
<v-container>
<v-row align="center">
<v-col cols="12" class="pa-0">
<v-subheader v-if="wmsVariables.title" class="pa-0">
<v-card>
<v-card-title class="pa-2"><span v-if="wmsVariables.title" class="pa-0">
<b>{{ compareEnabledDisplay ? 'Right side' : '' }} {{ wmsVariables.title }}</b>
</v-subheader>
</v-col>
</span></v-card-title>
<v-row align="center" class="ma-0 pa-2">
<v-row class="ma-0" cols="6" v-for="key in Object.keys(wmsVariables.variables)" :key="key">
<v-col class="pa-0">
<v-subheader class="pa-0">
Expand Down Expand Up @@ -36,7 +34,7 @@
<v-icon color="black">mdi-compare</v-icon>
{{ compareEnabledDisplay ? 'Stop': 'Start' }} model comparison
</p>
<v-row align="center" v-if="compareEnabledDisplay">
<v-row class="ma-0 pa-2" align="center" v-if="compareEnabledDisplay">
<v-col cols="12" class="pa-0">
<v-subheader v-if="wmsVariables.title" class="pa-0">
<b>Left side {{ wmsVariables.title }}</b>
Expand Down Expand Up @@ -65,7 +63,7 @@
</v-col>
</v-row>
</v-row>
</v-container>
</v-card>
</template>

<script>
Expand Down
28 changes: 13 additions & 15 deletions app/src/components/map/FeatureQueryParams.vue
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
<template>
<v-container>
<v-row align="center">
<v-col cols="12" class="pa-0">
<h3 v-if="featureQueryParamsData.title">{{ featureQueryParamsData.title }}</h3>
<p>
Toggle any combination of OpenStreetMap features
to check how different areas can be affected.
<br>Note: Availability of OSM data for crops
differs for different parts of the world.
</p>
</v-col>
<v-row class="ma-0" cols="6"
<v-card>
<v-card-title class="pa-2">{{ featureQueryParamsData.title }}</v-card-title>
<p class="pa-2 ma-0">
Toggle any combination of OpenStreetMap features
to check how different areas can be affected.
<br>Note: Availability of OSM data for crops
differs for different parts of the world.
</p>
<v-row class="ma-0 pa-2">
<v-col class="ma-0 pa-0" cols="6"
v-for="configItem in featureQueryParamsData.items"
:key="getConfigItemLabel(configItem)">
<v-checkbox class="ma-0"
<v-checkbox class="ma-0 pa-0"
v-bind:false-value="false"
v-bind:true-value="true"
v-model="configItem.selected"
:label="getConfigItemLabel(configItem)"
:value="configItem.value"
@change="(evt) => updateMapBool(evt, configItem.key, configItem.value)"
></v-checkbox>
</v-row>
</v-col>
</v-row>
</v-container>
</v-card>
</template>

<script>
Expand Down
2 changes: 1 addition & 1 deletion app/src/config/esa.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,5 +436,5 @@ export const globalIndicators = [
},
},
},
...createIDEASDatasetConfigs(['IDEAS1_hopi_minesweeper', 'IDEAS1_hopi', 'IDEAS2_wildlife_minesweeper', 'IDEAS2_wildlife', 'IDEAS3_locust', 'IDEAS4_flood_risk']),
...createIDEASDatasetConfigs(['IND1_1_minesweeper', 'IND1_1', 'IND2_1_minesweeper', 'IND2_1', 'IND3_1', 'IND4_1']),
];
8 changes: 6 additions & 2 deletions app/src/config/ideas_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const defaultLayersDisplayIdeasSh = {
projection: 'EPSG:3857',
};

export const createIDEASDatasetConfigs = (indicatorCodes) => [
const IDEASConfigs = [
{
properties: {
indicatorObject: {
Expand Down Expand Up @@ -874,4 +874,8 @@ export const createIDEASDatasetConfigs = (indicatorCodes) => [
},
},
},
].filter((item) => (indicatorCodes.includes(item.properties.indicatorObject.indicator)));
];
export const createIDEASDatasetConfigs = (indicatorCodes) => {
const configsToReturn = IDEASConfigs.filter((item) => (indicatorCodes.includes(item.properties.indicatorObject.indicator)));
return configsToReturn;
};

0 comments on commit 07420b5

Please sign in to comment.