Merge pull request #276 from eReuse/bugfix/#3360-computermonitor-instead-monitor

computer monitor instead of monitor
This commit is contained in:
cayop 2022-05-16 12:59:41 +02:00 committed by GitHub
commit 8794223385
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View File

@ -33,10 +33,10 @@ from ereuse_devicehub.resources.device.models import (
SAI, SAI,
Cellphone, Cellphone,
Computer, Computer,
ComputerMonitor,
Device, Device,
Keyboard, Keyboard,
MemoryCardReader, MemoryCardReader,
Monitor,
Mouse, Mouse,
Smartphone, Smartphone,
Tablet, Tablet,
@ -121,7 +121,7 @@ class FilterForm(FlaskForm):
# Generic Filters # Generic Filters
if "All Devices" == self.device_type: if "All Devices" == self.device_type:
filter_type = COMPUTERS + ["Monitor"] + MOBILE filter_type = COMPUTERS + MONITORS + MOBILE
elif "All Computers" == self.device_type: elif "All Computers" == self.device_type:
filter_type = COMPUTERS filter_type = COMPUTERS
@ -334,7 +334,7 @@ class NewDeviceForm(FlaskForm):
"Smartphone": Smartphone, "Smartphone": Smartphone,
"Tablet": Tablet, "Tablet": Tablet,
"Cellphone": Cellphone, "Cellphone": Cellphone,
"Monitor": Monitor, "ComputerMonitor": ComputerMonitor,
"Mouse": Mouse, "Mouse": Mouse,
"Keyboard": Keyboard, "Keyboard": Keyboard,
"SAI": SAI, "SAI": SAI,
@ -450,7 +450,7 @@ class NewDeviceForm(FlaskForm):
path_snapshot = save_json(json_snapshot, self.tmp_snapshots, g.user.email) path_snapshot = save_json(json_snapshot, self.tmp_snapshots, g.user.email)
snapshot_json = schema.load(json_snapshot) snapshot_json = schema.load(json_snapshot)
if self.type.data == 'Monitor': if self.type.data == 'ComputerMonitor':
snapshot_json['device'].resolution_width = self.resolution.data snapshot_json['device'].resolution_width = self.resolution.data
snapshot_json['device'].size = self.screen.data snapshot_json['device'].size = self.screen.data
@ -461,7 +461,7 @@ class NewDeviceForm(FlaskForm):
snapshot = upload_form.build(snapshot_json) snapshot = upload_form.build(snapshot_json)
move_json(self.tmp_snapshots, path_snapshot, g.user.email) move_json(self.tmp_snapshots, path_snapshot, g.user.email)
if self.type.data == 'Monitor': if self.type.data == 'ComputerMonitor':
snapshot.device.resolution = self.resolution.data snapshot.device.resolution = self.resolution.data
snapshot.device.screen = self.screen.data snapshot.device.screen = self.screen.data

View File

@ -4,7 +4,7 @@ $(document).ready(() => {
}) })
function deviceInputs() { function deviceInputs() {
if ($("#type").val() == "Monitor") { if ($("#type").val() == "ComputerMonitor") {
$("#screen").show(); $("#screen").show();
$("#resolution").show(); $("#resolution").show();
$("#imei").hide(); $("#imei").hide();

View File

@ -36,9 +36,9 @@
<label for="name" class="form-label">Type *</label> <label for="name" class="form-label">Type *</label>
<select id="type" class="form-control" name="type" required=""> <select id="type" class="form-control" name="type" required="">
<option value="">Select one Type</option> <option value="">Select one Type</option>
<optgroup label="Computer Monitor"> <optgroup label="Monitor">
<option value="Monitor" <option value="ComputerMonitor"
{% if form.type.data == 'Monitor' %} selected="selected"{% endif %}>Monitor</option> {% if form.type.data == 'Monitor' %} selected="selected"{% endif %}>Computer Monitor</option>
</optgroup> </optgroup>
<optgroup label="Mobile"> <optgroup label="Mobile">
<option value="Smartphone" <option value="Smartphone"