Skip to content

Commit

Permalink
Merge pull request #173 from opencdms/development
Browse files Browse the repository at this point in the history
Sync branch with development branch.
  • Loading branch information
AbnerBissolli authored Oct 23, 2024
2 parents e611a2b + bd47155 commit fc8a452
Show file tree
Hide file tree
Showing 7 changed files with 408 additions and 381 deletions.
48 changes: 39 additions & 9 deletions api/fixtures/wx_variable.json
Original file line number Diff line number Diff line change
Expand Up @@ -4115,15 +4115,15 @@
"fields": {
"created_at": "2024-07-26T23:59:28.639Z",
"updated_at": "2024-07-26T23:59:28.639Z",
"variable_type": "Code",
"variable_type": "Numeric",
"symbol": "LOWCLH",
"name": "Lowest Cloud height",
"sampling_operation": null,
"measurement_variable": null,
"unit": null,
"precision": null,
"scale": null,
"code_table": 1600,
"sampling_operation": 1,
"measurement_variable": 27,
"unit": 20,
"precision": 5,
"scale": 0,
"code_table": null,
"color": "#FF0000",
"range_min": null,
"range_max": null,
Expand Down Expand Up @@ -4238,7 +4238,7 @@
"variable_type": "Numeric",
"symbol": "EVAPINI",
"name": "Evaporation Initial (mm.)",
"sampling_operation": 6,
"sampling_operation": 1,
"measurement_variable": 4,
"unit": 2,
"precision": 5,
Expand Down Expand Up @@ -4268,7 +4268,7 @@
"variable_type": "Numeric",
"symbol": "EVAPRES",
"name": "Evaporation Reset (mm.)",
"sampling_operation": 6,
"sampling_operation": 1,
"measurement_variable": 4,
"unit": 2,
"precision": 5,
Expand All @@ -4288,5 +4288,35 @@
"default_representation": "bar",
"synoptic_code_form": null
}
},
{
"model": "wx.variable",
"pk": 4055,
"fields": {
"created_at": "2024-10-18T00:19:02.390Z",
"updated_at": "2024-10-18T00:19:02.390Z",
"variable_type": "Numeric",
"symbol": "PREC24H",
"name": "Precipitation 24 hours",
"sampling_operation": 6,
"measurement_variable": 3,
"unit": 2,
"precision": 4,
"scale": 1,
"code_table": null,
"color": "#FF0000",
"range_min": null,
"range_max": null,
"range_min_hourly": null,
"range_max_hourly": null,
"step": null,
"step_hourly": null,
"persistence": null,
"persistence_hourly": null,
"persistence_window": null,
"persistence_window_hourly": null,
"default_representation": "line",
"synoptic_code_form": "R24R24R24R24"
}
}
]
12 changes: 8 additions & 4 deletions api/wx/templates/wx/data/synop.html
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@
}
},
// HandsonTable Validators
dropdownValidator(value, callback){
dropdownFieldValidator(value, callback){
if(value == null) {
callback(true);
return
Expand All @@ -476,6 +476,13 @@
return
}

const column = this.hotSettings.columns.find(column => column.data == this.validating.column);
if (!this.codedvalues[column.codetable].includes(value)) {
error = `Value ${value} not in dropdown value list`;
this.addErrorMessage(this.validating.row, this.validating.column, error);
callback(false);
}

const column_data = this.hotSettings.columns.find(column => column.data == this.validating.column)
if(column_data) {
const exists = column_data.source.find(v => v == value)
Expand Down Expand Up @@ -527,16 +534,13 @@
return
}


const ranges = this.columnRanges[this.validating.column];


if (ranges == null){
callback(true);
return
}


const isValid = ranges.min <= numValue && numValue <= ranges.max;
if (!isValid){
error = `Value must be between ${ranges.min} and ${ranges.max}.`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ <h6>Search Form</h6>
</template>
<span>Download Maintenance Report</span>
</v-tooltip>
<!-- <v-tooltip bottom>
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn icon :href="viewMaintenanceReport(item.maintenance_report_id)">
<v-icon v-on="on" small>
Expand All @@ -140,7 +140,7 @@ <h6>Search Form</h6>
</v-btn>
</template>
<span>View Maintenance Report</span>
</v-tooltip> -->
</v-tooltip>
{% if perms.wx.delete_maintenancereport %}
<v-tooltip bottom>
<template v-slot:activator="{ on }">
Expand Down Expand Up @@ -222,7 +222,7 @@ <h6>Search Form</h6>
today: moment().format('YYYY-MM-DD'),
today_lm: moment().add(-1, 'M').format('YYYY-MM-DD'),
start_date_menu: false,
start_date: moment().subtract(3, 'months').format('YYYY-MM-DD'),
start_date: moment().subtract(1, 'years').format('YYYY-MM-DD'),
end_date_menu: false,
end_date: moment().format('YYYY-MM-DD'),
filter: {isAutomatic: true},
Expand Down Expand Up @@ -366,6 +366,7 @@ <h6>Search Form</h6>
mounted() {
axios.defaults.xsrfHeaderName = "X-CSRFToken";
axios.defaults.xsrfCookieName = "csrftoken";
this.getMaintenanceReportList()
},
});
</script>
Expand Down
6 changes: 3 additions & 3 deletions api/wx/templates/wx/maintenance_reports/new_report.html
Original file line number Diff line number Diff line change
Expand Up @@ -608,11 +608,11 @@ <h6>Removing Equipment: [[equipment_type.secondary_equipment.old_equipment_name]
</v-layout>

<v-flex mt-8>
<!-- <v-btn color="grey"
<v-btn color="grey"
:disabled="futureTime() || futureDate()"
@click="updateMaintenanceReportSummary(maintenance_report, 'D')"
:href="viewMaintenanceReport(maintenance_report.id)"
> Preview </v-btn> -->
> Preview </v-btn>
<v-btn
color="warning"
:disabled="futureTime() || futureDate()"
Expand Down Expand Up @@ -997,7 +997,7 @@ <h6>Removing Equipment: [[equipment_type.secondary_equipment.old_equipment_name]
axios({
method: 'post',
url: '/wx/maintenance_report/equipmenttype_data/update/',
params: {
data: {
'maintenance_report_id': this.maintenance_report.id,
'equipment_order': equipment_order,
'equipment_type_id': equipment_type.id,
Expand Down
Loading

0 comments on commit fc8a452

Please sign in to comment.