Skip to content

Commit 0f934cf

Browse files
committed
Fixed security issues in dependencies, fixed data type issues reported in #29.
1 parent 67d477d commit 0f934cf

File tree

2 files changed

+27
-14
lines changed

2 files changed

+27
-14
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
},
3333
"dependencies": {
3434
"@openeo/js-client": "^0.3.2",
35-
"@openeo/vue-components": "^0.3.4",
35+
"@openeo/vue-components": "^0.3.5",
3636
"codemirror": "^5.42.2",
3737
"leaflet": "^1.4.0",
3838
"leaflet-fullscreen": "^1.0.2",
@@ -44,8 +44,8 @@
4444
"vuedraggable": "^2.17.0"
4545
},
4646
"devDependencies": {
47-
"@vue/cli-plugin-babel": "^3.3.0",
48-
"@vue/cli-service": "^3.3.0",
47+
"@vue/cli-plugin-babel": "^3.5.5",
48+
"@vue/cli-service": "^3.5.3",
4949
"vue-template-compiler": "^2.5.22"
5050
},
5151
"browserslist": [

src/components/EditorField.vue

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default {
4444
draggable,
4545
VueCtkDateTimePicker
4646
},
47-
props: {
47+
props: {
4848
field: Object,
4949
pass: {},
5050
isItem: {
@@ -103,12 +103,12 @@ export default {
103103
});
104104
}
105105
},
106-
computed: {
106+
computed: {
107107
fieldName() {
108108
return this.field.name + (this.field.isArray ? '[]' : '');
109109
}
110-
},
111-
methods: {
110+
},
111+
methods: {
112112
type() {
113113
if (this.getFormat() === 'temporal_extent') {
114114
return 'temporal_extent';
@@ -125,30 +125,43 @@ export default {
125125
else if (this.field.type === 'boolean') {
126126
return 'boolean';
127127
}
128+
else if (this.field.type === 'number') {
129+
return 'number';
130+
}
131+
else if (this.field.type === 'integer') {
132+
return 'integer';
133+
}
128134
else {
129135
return 'string';
130136
}
131137
},
132138
getValue() {
133-
if (this.type() === 'temporal_extent') {
139+
var type = this.type();
140+
if (type === 'temporal_extent') {
134141
return [this.value.start, this.value.end];
135142
}
136-
else if (this.type() === 'spatial_extent') {
137-
return {
143+
else if (type === 'spatial_extent') {
144+
return {
138145
// Round to 6 decimals, the leading + removes the trailing zeros appended by toFixed.
139146
west: +this.value.getWest().toFixed(6),
140147
south: +this.value.getSouth().toFixed(6),
141148
east: +this.value.getEast().toFixed(6),
142149
north: +this.value.getNorth().toFixed(6),
143150
};
144151
}
145-
else if (this.type() === 'array') {
152+
else if (type === 'array') {
146153
var values = [];
147154
for(var i in this.$refs.arrayFields) {
148155
values.push(this.$refs.arrayFields[i].getValue());
149156
}
150157
return values;
151158
}
159+
else if (type === 'number') {
160+
return Number.parseFloat(this.value);
161+
}
162+
else if (type === 'integer') {
163+
return Number.parseInt(this.value);
164+
}
152165
else {
153166
return this.value;
154167
}
@@ -167,17 +180,17 @@ export default {
167180
this.value.splice(k, 1);
168181
return false;
169182
}
170-
}
183+
}
171184
};
172185
</script>
173186

174187
<style scoped>
175188
.arrayElement {
176-
transition: all 0.5s;
189+
transition: all 0.5s;
177190
}
178191
179192
.arrayElements-enter, .arrayElements-active {
180-
opacity: 0;
193+
opacity: 0;
181194
}
182195
183196
.mover {

0 commit comments

Comments
 (0)