Skip to content

Commit 2380330

Browse files
formatting
1 parent 6e704bd commit 2380330

File tree

19 files changed

+158
-157
lines changed

19 files changed

+158
-157
lines changed

client/src/components/Map.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ onMounted(() => {
7979
</a>`,
8080
})
8181
);
82-
if(props.scaleControl){
82+
if (props.scaleControl) {
8383
map.value.addControl(new mapboxgl.ScaleControl(), "bottom-right");
8484
}
8585
// Map Style Control (street || satellite)
@@ -136,11 +136,11 @@ onMounted(() => {
136136
return;
137137
}
138138
};
139-
if(props.styleControl){
139+
if (props.styleControl) {
140140
map.value.addControl(mapStyleControl, 'bottom-right');
141141
}
142142
143-
if(props.navControl){
143+
if (props.navControl) {
144144
map.value.addControl(new mapboxgl.NavigationControl({ showCompass: true }), 'bottom-right');
145145
}
146146
map.value.on("load", () => {

client/src/components/MapFilters.vue

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@
276276
outlined
277277
@update:model-value="(newval) => {
278278
localFilters.uniqueFilters.yearRange.min = newval;
279-
if(newval && newval.toString().length === 4){
280-
if(newval && newval.toString().length === 4){
279+
if (newval && newval.toString().length === 4) {
280+
if (newval && newval.toString().length === 4) {
281281
emit('update-filter', localFilters)
282282
}
283283
}
@@ -291,7 +291,7 @@
291291
outlined
292292
@update:model-value="(newval) => {
293293
localFilters.uniqueFilters.yearRange.max = newval;
294-
if(newval && newval.toString().length === 4){
294+
if (newval && newval.toString().length === 4) {
295295
emit('update-filter', localFilters)
296296
}
297297
}"
@@ -578,7 +578,7 @@ watch(() => props.selectedPointFromMap, (newval) => {
578578
});
579579
580580
watch(() => props.filterableProperties, () => {
581-
if(!props.filterableProperties || !('matchFilters' in props.filterableProperties) && !('uniqueFilters' in props.filterableProperties)) return;
581+
if (!props.filterableProperties || !('matchFilters' in props.filterableProperties) && !('uniqueFilters' in props.filterableProperties)) return;
582582
localFilters.value = props.filterableProperties;
583583
584584
// add a toggle-able model for the matching-type boolean filters
@@ -594,7 +594,7 @@ watch(() => props.filterableProperties, () => {
594594
if (props.filterableProperties.uniqueFilters.hasQuantity) {
595595
localFilters.value.uniqueFilters.quantity = JSON.parse(JSON.stringify(flowRangeDefault));
596596
}
597-
if(props.filterableProperties.uniqueFilters.hasYearRange){
597+
if (props.filterableProperties.uniqueFilters.hasYearRange) {
598598
yearRangeDefault.value = JSON.parse(JSON.stringify(props.filterableProperties.uniqueFilters.yearRange));
599599
}
600600
});
@@ -612,23 +612,23 @@ const selectPoint = (item) => {
612612
613613
// search term filtering in sidebar
614614
const filteredPoints = computed(() => {
615-
if(textFilter.value === '' || textFilter.value === null) return props.pointsToShow;
615+
if (textFilter.value === '' || textFilter.value === null) return props.pointsToShow;
616616
return props.pointsToShow.filter((point) => {
617-
if(props.page === 'water-portal'){
617+
if (props.page === 'water-portal') {
618618
return (
619619
point.properties.id.toString().includes(textFilter.value) ||
620620
('net' in point.properties && point.properties.net.toString().toLowerCase().includes(textFilter.value.toLowerCase())) ||
621621
('area' in point.properties && point.properties.area !== null && point.properties.area.toString().toLowerCase().includes(textFilter.value.toLowerCase())) ||
622622
('name' in point.properties && point.properties.name.toString().toLowerCase().includes(textFilter.value.toLowerCase()))
623623
)
624624
}
625-
if(props.page === 'groundwater'){
625+
if (props.page === 'groundwater') {
626626
return (
627627
('id' in point.properties && point.properties.id.toString().toLowerCase().includes(textFilter.value.toLowerCase())) ||
628628
('well_tag_no' in point.properties && point.properties.well_tag_no.toString().toLowerCase().includes(textFilter.value.toLowerCase()))
629629
)
630630
}
631-
if(props.page === 'watershed'){
631+
if (props.page === 'watershed') {
632632
return (
633633
point.properties.id.toString().includes(textFilter.value) ||
634634
('lic' in point.properties && point.properties.lic.toString().toLowerCase().includes(textFilter.value.toLowerCase())) ||
@@ -642,45 +642,45 @@ const filteredPoints = computed(() => {
642642
});
643643
644644
const resetFilters = () => {
645-
if(!Object.keys(localFilters.value).length) return;
645+
if (!Object.keys(localFilters.value).length) return;
646646
localFilters.value.matchFilters.forEach(category => {
647647
category.filters.forEach(filter => {
648648
filter.model = true;
649649
});
650650
});
651651
652652
// special handling for the uniqueFilters categories
653-
if(localFilters.value.uniqueFilters.hasArea){
653+
if (localFilters.value.uniqueFilters.hasArea) {
654654
localFilters.value.uniqueFilters.areaRange = areaRangeDefaults;
655655
}
656-
if(localFilters.value.uniqueFilters.hasQuantity){
656+
if (localFilters.value.uniqueFilters.hasQuantity) {
657657
localFilters.value.uniqueFilters.quantity.forEach(el => {
658658
el.value = true;
659659
})
660660
}
661-
if(localFilters.value.uniqueFilters.hasYearRange){
661+
if (localFilters.value.uniqueFilters.hasYearRange) {
662662
localFilters.value.uniqueFilters.yearRange = yearRangeDefault.value;
663663
}
664664
665665
emit('update-filter', localFilters.value);
666666
};
667667
668668
const clearFilters = () => {
669-
if(!Object.keys(localFilters.value).length) return;
669+
if (!Object.keys(localFilters.value).length) return;
670670
localFilters.value.matchFilters.forEach(category => {
671671
category.filters.forEach(filter => {
672672
filter.model = false;
673673
});
674674
});
675-
if(localFilters.value.uniqueFilters.hasQuantity){
675+
if (localFilters.value.uniqueFilters.hasQuantity) {
676676
localFilters.value.uniqueFilters.quantity.forEach(el => {
677677
el.value = false;
678678
});
679679
}
680-
if(localFilters.value.uniqueFilters.hasArea){
680+
if (localFilters.value.uniqueFilters.hasArea) {
681681
localFilters.value.uniqueFilters.areaRange = areaRangeDefaults;
682682
}
683-
if(localFilters.value.uniqueFilters.hasYearRange){
683+
if (localFilters.value.uniqueFilters.hasYearRange) {
684684
localFilters.value.uniqueFilters.yearRange = {
685685
min: '',
686686
max: ''

client/src/components/MapPointSelector.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ const props = defineProps({
116116
});
117117
118118
const selectPoint = (point) => {
119+
console.log(point)
119120
emit('close', point);
120121
}
121122

client/src/components/MonthlyMeanFlowTable.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const setTableData = () => {
8383
tableRows.value = [...props.tableData.terms, ...props.tableData.years];
8484
8585
Object.keys(props.tableData).forEach(() => {
86-
if('current' in props.tableData.years){
86+
if ('current' in props.tableData.years) {
8787
const max = [{}];
8888
const avg = [{}];
8989
const min = [{}];
@@ -97,7 +97,7 @@ const setTableData = () => {
9797
const groupedByYears = [];
9898
props.tableData.yearly.forEach(el => {
9999
const idx = groupedByYears.findIndex(years => years.year === el.year);
100-
if(idx === -1){
100+
if (idx === -1) {
101101
groupedByYears.push({ year: el.year })
102102
} else {
103103
groupedByYears[idx][monthAbbrList[el.m - 1]] = el.v;

client/src/components/ReportChart.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ watch(() => yearlyData.value, (newVal, oldVal) => {
190190
* determine which years of data are available for the point
191191
*/
192192
const yearlyDataOptions = computed(() => {
193-
try{
193+
try {
194194
return Array(props.chartOptions.endYear - props.chartOptions.startYear + 1).fill().map((_, idx) => props.chartOptions.startYear + idx).sort((a, b) => a > b ? -1 : 1);
195195
} catch(e) {
196196
return [];

client/src/components/Tour.vue

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<template>
2-
<div
2+
<div
33
class="highlight-element"
44
ref="highlighter"
55
/>
66
<div class="tour-container">
7-
<div
7+
<div
88
v-if="step > 0"
99
class="tour-step"
1010
:style="`top: ${posY}px; left: ${posX}px;`"
@@ -15,7 +15,7 @@
1515
{{ tourSteps[step - 1].stepContent }}
1616
</div>
1717
<div class="tour-controls q-mt-sm">
18-
<q-btn
18+
<q-btn
1919
v-if="step > 1"
2020
label="back"
2121
flat
@@ -30,7 +30,7 @@
3030
data-cy="tour-leave"
3131
@click="cancelTour"
3232
/>
33-
<q-btn
33+
<q-btn
3434
:label="step < tourSteps.length ? 'next' : 'got it!'"
3535
flat
3636
@click="step += 1"
@@ -40,7 +40,7 @@
4040
</q-card>
4141
</div>
4242
</div>
43-
<q-dialog
43+
<q-dialog
4444
v-model="tourIntro"
4545
persistent
4646
backdrop-filter="blur(2px)"
@@ -50,23 +50,23 @@
5050
Welcome to the BC Water Tool
5151
</div>
5252
<p>
53-
The BC Water Tool is a modular application which provides access to water related data and knowledge in support of sustainable resource management.
54-
On this site you’ll find custom watershed reports for every stream, river and watershed in BC. You’ll also find monitoring
55-
data from more than 50 organizations, at more than 50,000 locations across BC.
53+
The BC Water Tool is a modular application which provides access to water related data and knowledge in support of sustainable resource management.
54+
On this site you’ll find custom watershed reports for every stream, river and watershed in BC. You’ll also find monitoring
55+
data from more than 50 organizations, at more than 50,000 locations across BC.
5656
</p>
5757
<p>
58-
This short tour will help you find your way around. Let’s get started!
58+
This short tour will help you find your way around. Let’s get started!
5959
</p>
6060
<div class="col">
6161
<div class="row">
62-
<q-btn
62+
<q-btn
6363
color="primary"
6464
label="No Thanks"
6565
flat
6666
data-cy="tour-cancel"
6767
@click="cancelTour"
6868
/>
69-
<q-btn
69+
<q-btn
7070
color="primary"
7171
label="Sure"
7272
data-cy="tour-start"
@@ -108,12 +108,12 @@ const tourSteps = computed(() => {
108108
},
109109
{
110110
selector: 'climate',
111-
stepContent: 'Active and historical weather stations (temperature, precipitation, and snow).'
111+
stepContent: 'Active and historical weather stations (temperature, precipitation, and snow).'
112112
},
113113
];
114114
115115
const report = document.getElementsByClassName('report-container')[0];
116-
if(report && report.className.includes('open')) {
116+
if (report && report.className.includes('open')) {
117117
steps.push(
118118
{
119119
selector: 'help-icon',
@@ -123,7 +123,7 @@ const tourSteps = computed(() => {
123123
return steps;
124124
};
125125
126-
if(route.path !== '/'){
126+
if (route.path !== '/') {
127127
steps.push(
128128
{
129129
selector: 'q-list',
@@ -139,7 +139,7 @@ const tourSteps = computed(() => {
139139
}
140140
)
141141
}
142-
142+
143143
return steps;
144144
});
145145
const tourIntro = ref(false)
@@ -151,7 +151,7 @@ const highlighter = ref('highlighter');
151151
const emit = defineEmits(['show-tour'])
152152
153153
watch(() => step.value, (currentStep) => {
154-
if(currentStep <= tourSteps.value.length && currentStep > 0){
154+
if (currentStep <= tourSteps.value.length && currentStep > 0) {
155155
setHighlightPosition(tourSteps.value[currentStep - 1]);
156156
} else {
157157
step.value = 0;
@@ -166,12 +166,12 @@ onMounted(() => {
166166
167167
const setHighlightPosition = (currentStep) => {
168168
const currentElement = document.getElementsByClassName(currentStep.selector)[0];
169-
if(!currentElement) return;
169+
if (!currentElement) return;
170170
171171
posY.value = currentElement.offsetTop > (window.innerHeight * 0.8) ? window.innerHeight - 150 : currentElement.offsetTop;
172172
posX.value = currentElement.offsetWidth + 10;
173173
174-
if(currentStep.selector === 'search-bar-container'){
174+
if (currentStep.selector === 'search-bar-container') {
175175
posY.value = 60;
176176
posX.value = window.innerWidth - 500;
177177
highlighter.value.style.left = `${window.innerWidth - (currentElement.offsetWidth + 15)}px`;

client/src/components/groundwater-level/GroundWaterLevelReport.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,14 @@ const chartOptions = computed(() => {
130130
});
131131
132132
const startYear = computed(() => {
133-
if(typeof props.activePoint.yr === 'string'){
133+
if (typeof props.activePoint.yr === 'string') {
134134
const year = JSON.parse(props.activePoint.yr);
135135
return year[0];
136136
}
137137
return props.activePoint.yr[0];
138138
});
139139
const endYear = computed(() => {
140-
if(typeof props.activePoint.yr === 'string'){
140+
if (typeof props.activePoint.yr === 'string') {
141141
const year = JSON.parse(props.activePoint.yr);
142142
return year[year.length - 1];
143143
}

client/src/components/streamflow/FlowMetrics.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ onMounted(async () => {
6565
});
6666
6767
const formatTableData = (data) => {
68-
if(data.length > 0){
68+
if (data.length > 0) {
6969
tableCols.value = [
7070
{ name: 'Parameter', field: 'Parameter', label: 'Parameter' },
7171
{ name: '200', field: '200', label: '200' },

client/src/components/streamflow/StreamflowReport.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,15 @@ const viewPage = ref('sevenDayFlow');
158158
159159
160160
const startYear = computed(() => {
161-
if(typeof props.activePoint.yr === 'string'){
161+
if (typeof props.activePoint.yr === 'string') {
162162
const year = JSON.parse(props.activePoint.yr);
163163
return year[0];
164164
}
165165
return props.activePoint.yr[0];
166166
});
167167
168168
const endYear = computed(() => {
169-
if(typeof props.activePoint.yr === 'string'){
169+
if (typeof props.activePoint.yr === 'string') {
170170
const year = JSON.parse(props.activePoint.yr);
171171
return year[year.length - 1];
172172
}

0 commit comments

Comments
 (0)