From 6c36eb4dbc132e7176ffd6d3bc668ac0ff4b4b94 Mon Sep 17 00:00:00 2001
From: Franck Kerbiriou
Date: Tue, 11 Feb 2020 23:29:15 +0100
Subject: [PATCH 1/4] Update shore_length in meters, fix distance
---
app/models/report.rb | 6 +--
config/locales/en.yml | 2 +-
config/locales/es.yml | 2 +-
config/locales/fr.yml | 2 +-
frontend/src/components/TracerCard.vue | 12 +++---
frontend/src/components/TracersGrid.vue | 20 +++++-----
frontend/src/components/TracersList.vue | 18 ++++-----
frontend/src/components/tools/AddReport.vue | 40 +++++++++++---------
frontend/src/store/modules/reports.js | 26 ++++++++-----
frontend/src/views/MyReports.vue | 6 +--
lib/tasks/populate_shore_length.rake | 16 ++++----
lib/tasks/update_shore_length.rake | 16 ++++++++
spec/factories/report.rb | 2 +-
spec/requests/api_spec.rb | 4 +-
spec/requests/reports_spec.rb | 4 +-
spec/support/api/schemas/geojson-report.json | 2 +-
spec/support/api/schemas/report.json | 2 +-
17 files changed, 106 insertions(+), 74 deletions(-)
create mode 100644 lib/tasks/update_shore_length.rake
diff --git a/app/models/report.rb b/app/models/report.rb
index 963b4479..15fc5427 100644
--- a/app/models/report.rb
+++ b/app/models/report.rb
@@ -36,10 +36,10 @@ class Report < ApplicationRecord
belongs_to :tracer
belongs_to :user, optional: true
- validates :tracer_id, :name, :latitude, :longitude, :reported_at, :quantity, :shore_length, presence: true
+ validates :tracer_id, :name, :latitude, :longitude, :reported_at, :quantity, presence: true
validates :photo, attached: true,
content_type: ['image/png', 'image/jpeg', 'image/tiff', 'image/webp'],
if: -> { !self.user&.senior && self.status != 'accepted' }
- validates :shore_length, numericality: { only_integer: true, greater_than_or_equal_to: 1, less_than_or_equal_to: 10 }
- validates :quantity, numericality: { only_integer: true, greater_than_or_equal_to: 1, less_than_or_equal_to: 500 }
+ validates :quantity, numericality: { only_integer: true, greater_than_or_equal_to: 1, less_than_or_equal_to: 1000 }
+ validates :shore_length, numericality: { greater_than_or_equal_to: 100, less_than_or_equal_to: 15000 }
end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 8ea6ad2e..91d66a43 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -37,7 +37,7 @@ en:
reported_at: Reported at
tracer: Tracer
quantity: Quantity
- shore_length: Shore kilometers
+ shore_length: Shore meters
date: Date of report
status: Status
user:
diff --git a/config/locales/es.yml b/config/locales/es.yml
index b1e11c56..4b4307e9 100644
--- a/config/locales/es.yml
+++ b/config/locales/es.yml
@@ -37,7 +37,7 @@ es:
reported_at: Informado a
tracer: Localizador
quantity: Cantidad
- shore_length: kilómetro costero
+ shore_length: metro costero
date: Fecha del informe
status: Status
user:
diff --git a/config/locales/fr.yml b/config/locales/fr.yml
index 1b3c6973..2bb8ef96 100644
--- a/config/locales/fr.yml
+++ b/config/locales/fr.yml
@@ -37,7 +37,7 @@ fr:
reported_at: Signalé le
tracer: Traceur
quantity: Quantité
- shore_length: Kilomètre de rivages
+ shore_length: Mètre de rivages
date: Date du signalement
status: Statut
user:
diff --git a/frontend/src/components/TracerCard.vue b/frontend/src/components/TracerCard.vue
index d6ed5f0f..fe8bec3c 100644
--- a/frontend/src/components/TracerCard.vue
+++ b/frontend/src/components/TracerCard.vue
@@ -29,8 +29,8 @@
{{ getReportCount()(tracer.id) }}
- {{ $t('quantity_by_km') }}:
- {{ $n(getQuantitybyShoreLength()(tracer.id)) }}/km
+ {{ $t('distance_between_tracers') }}:
+ {{ $n(getReportsEveryKilometers()(tracer.id)) }}/km
@@ -51,7 +51,7 @@ export default {
},
computed: {},
methods: {
- ...reportsModule.mapGetters(['getReportCount', 'getQuantitybyShoreLength'])
+ ...reportsModule.mapGetters(['getReportCount', 'getReportsEveryKilometers'])
}
}
@@ -79,7 +79,7 @@ export default {
"created_at": "Created at",
"origin": "Origin",
"quantity": "Reported quantity",
- "quantity_by_km": "Quantity by km",
+ "distance_between_tracers": "Distance between tracers",
"name": "Name",
"kind": "Type"
},
@@ -87,7 +87,7 @@ export default {
"created_at": "Créé le",
"origin": "Origine",
"quantity": "Quantité signalée",
- "quantity_by_km": "Quantité par km",
+ "distance_between_tracers": "Distance entre traceurs",
"name": "Nom",
"kind": "Type"
},
@@ -95,7 +95,7 @@ export default {
"created_at": "Creado en",
"origin": "Origen",
"quantity": "Cantidad testificada",
- "quantity_by_km": "Cantidad por km",
+ "distance_between_tracers": "Distancia entre trazadores",
"name": "Apellido",
"kind": "Tipo"
}
diff --git a/frontend/src/components/TracersGrid.vue b/frontend/src/components/TracersGrid.vue
index e11599db..af16046e 100644
--- a/frontend/src/components/TracersGrid.vue
+++ b/frontend/src/components/TracersGrid.vue
@@ -72,7 +72,7 @@ export default {
type: 'num',
order: 'asc'
},
- shore_length: {
+ distance_between_tracers: {
active: false,
type: 'num',
order: 'asc'
@@ -97,7 +97,7 @@ export default {
},
methods: {
...mapGetters(['getTracers', 'getCategories']),
- ...reportsModule.mapGetters(['getReportCount', 'getQuantitybyShoreLength']),
+ ...reportsModule.mapGetters(['getReportCount', 'getReportsEveryKilometers']),
sortTracersBy: function(field, order) {
if (order == null) {
order = this.sortFields[field].order
@@ -127,16 +127,16 @@ export default {
})
}
- if (field === 'shore_length') {
+ if (field === 'distance_between_tracers') {
this.sortedTracers.sort((a, b) => {
if (
- this.getQuantitybyShoreLength()(a.id) <
- this.getQuantitybyShoreLength()(b.id)
+ this.getReportsEveryKilometers()(a.id) <
+ this.getReportsEveryKilometers()(b.id)
) {
return 0 - modifier
} else if (
- this.getQuantitybyShoreLength()(a.id) >
- this.getQuantitybyShoreLength()(b.id)
+ this.getReportsEveryKilometers()(a.id) >
+ this.getReportsEveryKilometers()(b.id)
) {
return modifier
} else {
@@ -189,7 +189,7 @@ export default {
"created_at": "Created at",
"origin": "Origin",
"quantity": "Reported quantity",
- "shore_length": "Quantity by km",
+ "distance_between_tracers": "Distance between tracers",
"name": "Name",
"research": "Research",
"drift": "Drift",
@@ -204,7 +204,7 @@ export default {
"created_at": "Créé le",
"origin": "Origine",
"quantity": "Quantité signalée",
- "shore_length": "Quantité par km",
+ "distance_between_tracers": "Distance entre traceurs",
"name": "Nom",
"research": "Recherche",
"drift": "Dérive",
@@ -219,7 +219,7 @@ export default {
"created_at": "Creado en",
"origin": "Origen",
"quantity": "Cantidad testificada",
- "shore_length": "Cantidad por km",
+ "distance_between_tracers": "Distancia entre trazadores",
"name": "Apellido",
"research": "Búsqueda",
"drift": "Dériva",
diff --git a/frontend/src/components/TracersList.vue b/frontend/src/components/TracersList.vue
index 63a6b1ed..daea5574 100644
--- a/frontend/src/components/TracersList.vue
+++ b/frontend/src/components/TracersList.vue
@@ -53,13 +53,13 @@
>{{ getReportCount()(props.row.id) }}
{{ $n(getQuantitybyShoreLength()(props.row.id)) }}{{ $n(getReportsEveryKilometers()(props.row.id)) }}
@@ -111,7 +111,7 @@ export default {
methods: {
...mapMutations(['setPerPage']),
...mapGetters(['getPerPage']),
- ...reportsModule.mapGetters(['getReportCount', 'getQuantitybyShoreLength']),
+ ...reportsModule.mapGetters(['getReportCount', 'getReportsEveryKilometers']),
sortByReportedQuantity: function(tracerA, tracerB, isAsc) {
const reportCountA = this.getReportCount()(tracerA.id)
const reportCountB = this.getReportCount()(tracerB.id)
@@ -119,8 +119,8 @@ export default {
return isAsc ? reportCountA - reportCountB : reportCountB - reportCountA
},
sortByQuantityPerKm: function(tracerA, tracerB, isAsc) {
- const reportCountPerKmA = this.getQuantitybyShoreLength()(tracerA.id)
- const reportCountPerKmB = this.getQuantitybyShoreLength()(tracerB.id)
+ const reportCountPerKmA = this.getReportsEveryKilometers()(tracerA.id)
+ const reportCountPerKmB = this.getReportsEveryKilometers()(tracerB.id)
return isAsc
? reportCountPerKmA - reportCountPerKmB
@@ -168,7 +168,7 @@ export default {
"origin": "Origin",
"per_page": "per page",
"reported_quantity": "Reported quantity",
- "quantity_by_km": "Quantity by km",
+ "distance_between_tracers": "Distance between tracers",
"research": "Research",
"drift": "Drift",
"container": "Container",
@@ -183,7 +183,7 @@ export default {
"origin": "Origine",
"per_page": "par page",
"reported_quantity": "Quantité signalée",
- "quantity_by_km": "Quantité par km",
+ "distance_between_tracers": "Distance entre traceurs",
"research": "Recherche",
"drift": "Dérive",
"container": "Conteneur",
@@ -198,7 +198,7 @@ export default {
"origin": "Origen",
"per_page": "por página",
"reported_quantity": "Cantidad testificada",
- "quantity_by_km": "Cantidad por km",
+ "distance_between_tracers": "Distancia entre trazadores",
"research": "Búsqueda",
"drift": "Dériva",
"container": "Envase",
diff --git a/frontend/src/components/tools/AddReport.vue b/frontend/src/components/tools/AddReport.vue
index 14c37b52..15f61d97 100644
--- a/frontend/src/components/tools/AddReport.vue
+++ b/frontend/src/components/tools/AddReport.vue
@@ -268,11 +268,11 @@
v-model="shoreLengths[index]"
name="shoreLength"
type="number"
- step="1"
- min="1"
- max="10"
+ step="0.1"
+ min="0.1"
+ max="15"
:data-vv-as="$t('shore_length')"
- v-validate="'required|min_value:1|max_value:10'"
+ v-validate="'required|min_value:0.1|max_value:15'"
>
km
@@ -319,7 +319,7 @@
areSomeReportsSubmitted
"
>
- {{ $t('add') }}
+ {{ $t('add_tracer') }}
tracerId =>
- (state.reports.features || []).reduce((total, report) => {
+ (state.reports.features || []).reduce((sum, report) => {
return tracerId === report.properties.tracer_id
- ? (total += report.properties.quantity)
- : total
+ ? (sum += report.properties.quantity)
+ : sum
}, 0),
- getQuantitybyShoreLength: state => tracerId =>
- (state.reports.features || []).reduce((total, report) => {
- return tracerId === report.properties.tracer_id
- ? (total +=
- report.properties.quantity / (report.properties.shore_length || 1))
- : total
+ getReportsEveryKilometers: state => tracerId => {
+ let reportWithShoreLength = 0
+ const sumDistanceBetweenReports = (state.reports.features || []).reduce((sum, report) => {
+ if (tracerId === report.properties.tracer_id && report.properties.shore_length) {
+ reportWithShoreLength++
+ sum += (report.properties.shore_length / 1000) / report.properties.quantity
+ }
+ return sum
}, 0)
+ if (sumDistanceBetweenReports > 0 && reportWithShoreLength > 0){
+ return sumDistanceBetweenReports / reportWithShoreLength
+ } else {
+ return Infinity
+ }
+ }
}
const mutations = {
setLoading: (state, loading) => {
diff --git a/frontend/src/views/MyReports.vue b/frontend/src/views/MyReports.vue
index 2265cd57..19db01a4 100644
--- a/frontend/src/views/MyReports.vue
+++ b/frontend/src/views/MyReports.vue
@@ -134,7 +134,7 @@ export default {
"address": "Address",
"reported_at": "Reported at",
"quantity": "Quantity",
- "shore_length": "Shore kilometers",
+ "shore_length": "Shore meters",
"per_page": "per page",
"search": "Search"
},
@@ -146,7 +146,7 @@ export default {
"reported_at": "Témoigné le",
"name": "Nom",
"quantity": "Quantité",
- "shore_length": "Kilomètre de rivage",
+ "shore_length": "Mètre de rivage",
"per_page": "par page",
"search": "Rechercher"
},
@@ -158,7 +158,7 @@ export default {
"reported_at": "Reportado en",
"name": "Apellido",
"quantity": "Cantidad",
- "shore_length": "Costa kilómetro",
+ "shore_length": "Costa metro",
"per_page": "por página",
"search": "Buscar"
}
diff --git a/lib/tasks/populate_shore_length.rake b/lib/tasks/populate_shore_length.rake
index f06fa29c..4c7d3305 100644
--- a/lib/tasks/populate_shore_length.rake
+++ b/lib/tasks/populate_shore_length.rake
@@ -1,13 +1,15 @@
namespace :db do
desc 'Populate shore length'
task populate_shore_length: :environment do
- for report in Report.all
- if report.shore_length.nil?
- report.update_attributes!(shore_length: 1)
- puts "Updated report #{report.id} with shore_length of 1"
- else
- puts 'Nothing to do on this report'
+ production_date = Date.strptime("02-05-2020", "%m-%d-%Y")
+
+ Report.all.each do |report|
+ if report.shore_length == 1 && report.created_at < production_date
+ report.update_attributes!(shore_length: nil)
+ elsif report.shore_length < 1000
+ report.update_attributes!(shore_length: report.shore_length * 1000)
+ puts "Updated report #{report.id} with shore_length of 1000"
end
end
end
-end
\ No newline at end of file
+end
diff --git a/lib/tasks/update_shore_length.rake b/lib/tasks/update_shore_length.rake
new file mode 100644
index 00000000..6a995c06
--- /dev/null
+++ b/lib/tasks/update_shore_length.rake
@@ -0,0 +1,16 @@
+namespace :db do
+ desc 'Update shore length'
+ task update_shore_length: :environment do
+ production_date = Date.new(2020, 02, 05)
+
+ Report.all.each do |report|
+ if report.shore_length == 1 && report.created_at < production_date
+ report.update_attribute(shore_length, nil)
+ puts "Updated report #{report.id} with shore_length of nil"
+ elsif report.shore_length < 1000
+ report.update_attributes!(shore_length: report.shore_length * 1000)
+ puts "Updated report #{report.id} with shore_length of 1000"
+ end
+ end
+ end
+end
diff --git a/spec/factories/report.rb b/spec/factories/report.rb
index 741c74b2..8d9c65bf 100644
--- a/spec/factories/report.rb
+++ b/spec/factories/report.rb
@@ -5,7 +5,7 @@
name { Faker::Name.name }
quantity { Random.new.rand(42)+1 }
- shore_length { Random.new.rand(9)+1 }
+ shore_length { Random.new.rand(42)+420 }
longitude { Random.new.rand(42) }
latitude { Random.new.rand(42) }
description { Faker::Lorem.sentence }
diff --git a/spec/requests/api_spec.rb b/spec/requests/api_spec.rb
index 95837a08..0ae33f38 100644
--- a/spec/requests/api_spec.rb
+++ b/spec/requests/api_spec.rb
@@ -76,7 +76,7 @@
{
name: 'toto',
quantity: 42,
- shore_length: 7,
+ shore_length: 4200,
missing: 'required params'
}
end
@@ -100,7 +100,7 @@
{
name: 'toto',
quantity: 42,
- shore_length: 7,
+ shore_length: 4200,
address: 'somewhere',
longitude: 42,
latitude: 42.42,
diff --git a/spec/requests/reports_spec.rb b/spec/requests/reports_spec.rb
index 29b66e90..a814ca7a 100644
--- a/spec/requests/reports_spec.rb
+++ b/spec/requests/reports_spec.rb
@@ -170,7 +170,7 @@
{
name: 'toto',
quantity: 42,
- shore_length: 7,
+ shore_length: 4200,
address: 'somewhere',
longitude: 42,
latitude: 42.42,
@@ -269,7 +269,7 @@
{
name: 'toto',
quantity: 42,
- shore_length: 7,
+ shore_length: 4200,
address: 'somewhere',
longitude: 42,
latitude: 42.42,
diff --git a/spec/support/api/schemas/geojson-report.json b/spec/support/api/schemas/geojson-report.json
index da1a7813..0a78528f 100644
--- a/spec/support/api/schemas/geojson-report.json
+++ b/spec/support/api/schemas/geojson-report.json
@@ -35,7 +35,7 @@
"pattern": "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"
},
"quantity": { "type": "integer" },
- "shore_length": { "type": "integer", "minimum": 0, "maximum": 10 }
+ "shore_length": { "type": "integer", "minimum": 100, "maximum": 15000 }
}
},
"geometry": {
diff --git a/spec/support/api/schemas/report.json b/spec/support/api/schemas/report.json
index aec25412..d0bdc1bb 100644
--- a/spec/support/api/schemas/report.json
+++ b/spec/support/api/schemas/report.json
@@ -28,7 +28,7 @@
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"quantity": { "type": "integer" },
- "shore_length": { "type": "integer", "minimum": 0, "maximum": 10 },
+ "shore_length": { "type": "integer", "minimum": 100, "maximum": 15000 },
"address": { "type": "string" },
"status": { "type": "string" }
},
From f2ce848bd65e40624aa02521781c572f1f1f6523 Mon Sep 17 00:00:00 2001
From: Franck Kerbiriou
Date: Tue, 11 Feb 2020 23:42:22 +0100
Subject: [PATCH 2/4] Fix rake task
---
lib/tasks/update_shore_length.rake | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/tasks/update_shore_length.rake b/lib/tasks/update_shore_length.rake
index 6a995c06..8c9cab72 100644
--- a/lib/tasks/update_shore_length.rake
+++ b/lib/tasks/update_shore_length.rake
@@ -4,12 +4,13 @@ namespace :db do
production_date = Date.new(2020, 02, 05)
Report.all.each do |report|
+ next unless report.shore_length
if report.shore_length == 1 && report.created_at < production_date
- report.update_attribute(shore_length, nil)
+ report.update_attribute(:shore_length, nil)
puts "Updated report #{report.id} with shore_length of nil"
elsif report.shore_length < 1000
report.update_attributes!(shore_length: report.shore_length * 1000)
- puts "Updated report #{report.id} with shore_length of 1000"
+ puts "Updated report #{report.id} with shore_length of #{report.shore_length}"
end
end
end
From e0e9f83b70006f212ea626ac9683460105ba806c Mon Sep 17 00:00:00 2001
From: Franck Kerbiriou
Date: Mon, 17 Feb 2020 19:07:28 +0100
Subject: [PATCH 3/4] Fix distance on popup
Fix missing km unit
Fix capitalize
Format
---
config/locales/es.yml | 2 +-
frontend/src/components/TracerCard.vue | 8 ++++----
frontend/src/components/TracersGrid.vue | 11 +++++++++--
frontend/src/components/TracersList.vue | 10 ++++++++--
frontend/src/store/modules/reports.js | 25 ++++++++++++++++---------
frontend/src/views/Home.vue | 22 ++++++++++++----------
6 files changed, 50 insertions(+), 28 deletions(-)
diff --git a/config/locales/es.yml b/config/locales/es.yml
index 4b4307e9..c7e48dd6 100644
--- a/config/locales/es.yml
+++ b/config/locales/es.yml
@@ -37,7 +37,7 @@ es:
reported_at: Informado a
tracer: Localizador
quantity: Cantidad
- shore_length: metro costero
+ shore_length: Metro costero
date: Fecha del informe
status: Status
user:
diff --git a/frontend/src/components/TracerCard.vue b/frontend/src/components/TracerCard.vue
index fe8bec3c..79020c8b 100644
--- a/frontend/src/components/TracerCard.vue
+++ b/frontend/src/components/TracerCard.vue
@@ -20,9 +20,9 @@
{{ $t('created_at') }}:
-
+
{{ $t('quantity') }}:
@@ -30,7 +30,7 @@
{{ $t('distance_between_tracers') }}:
- {{ $n(getReportsEveryKilometers()(tracer.id)) }}/km
+ {{ $n(getReportsEveryKilometers()(tracer.id)) }} km
diff --git a/frontend/src/components/TracersGrid.vue b/frontend/src/components/TracersGrid.vue
index af16046e..e890208d 100644
--- a/frontend/src/components/TracersGrid.vue
+++ b/frontend/src/components/TracersGrid.vue
@@ -14,7 +14,11 @@
}})
-
+
{{ $t(category) }}
{{ $n(getReportsEveryKilometers()(props.row.id)) }}{{
+ $n(getReportsEveryKilometers()(props.row.id))
+ }}
+ km
@@ -111,7 +114,10 @@ export default {
methods: {
...mapMutations(['setPerPage']),
...mapGetters(['getPerPage']),
- ...reportsModule.mapGetters(['getReportCount', 'getReportsEveryKilometers']),
+ ...reportsModule.mapGetters([
+ 'getReportCount',
+ 'getReportsEveryKilometers'
+ ]),
sortByReportedQuantity: function(tracerA, tracerB, isAsc) {
const reportCountA = this.getReportCount()(tracerA.id)
const reportCountB = this.getReportCount()(tracerB.id)
diff --git a/frontend/src/store/modules/reports.js b/frontend/src/store/modules/reports.js
index d0a5c5fd..9c0641a1 100644
--- a/frontend/src/store/modules/reports.js
+++ b/frontend/src/store/modules/reports.js
@@ -41,19 +41,26 @@ const getters = {
}, 0),
getReportsEveryKilometers: state => tracerId => {
let reportWithShoreLength = 0
- const sumDistanceBetweenReports = (state.reports.features || []).reduce((sum, report) => {
- if (tracerId === report.properties.tracer_id && report.properties.shore_length) {
- reportWithShoreLength++
- sum += (report.properties.shore_length / 1000) / report.properties.quantity
- }
- return sum
- }, 0)
- if (sumDistanceBetweenReports > 0 && reportWithShoreLength > 0){
+ const sumDistanceBetweenReports = (state.reports.features || []).reduce(
+ (sum, report) => {
+ if (
+ tracerId === report.properties.tracer_id &&
+ report.properties.shore_length
+ ) {
+ reportWithShoreLength++
+ sum +=
+ report.properties.shore_length / 1000 / report.properties.quantity
+ }
+ return sum
+ },
+ 0
+ )
+ if (sumDistanceBetweenReports > 0 && reportWithShoreLength > 0) {
return sumDistanceBetweenReports / reportWithShoreLength
} else {
return Infinity
}
- }
+ }
}
const mutations = {
setLoading: (state, loading) => {
diff --git a/frontend/src/views/Home.vue b/frontend/src/views/Home.vue
index 42eb4116..6fc6960d 100644
--- a/frontend/src/views/Home.vue
+++ b/frontend/src/views/Home.vue
@@ -188,6 +188,7 @@ export default {
this.popup = new mapboxgl.Popup(popupOption)
currentPopup = this.popup
}
+
currentPopup
.setLngLat(coordinates)
.setHTML(
@@ -205,9 +206,9 @@ export default {
${this.$i18n.tc(
'tracers',
reportProperties.quantity
- )} ${this.$i18n.t('on')} ${
- reportProperties.shore_length
- } km
+ )} ${this.$i18n.t(
+ 'every'
+ )} ${this.getReportsEveryKilometers()(tracer.id)} km
${this.$i18n.t('per')} ${userProperties.name}
${this.$options.filters.formatDate(
@@ -479,7 +480,8 @@ export default {
'getReports',
'getFilteredReports',
'getLoading',
- 'getErrors'
+ 'getErrors',
+ 'getReportsEveryKilometers'
]),
...toolBarModule.mapActions(['closeToolbar']),
removeSourceAndLayer: function(map, id) {
@@ -856,24 +858,24 @@ export default {
"tracers": "tracer | tracers",
"search_location": "Find a place",
"no_address_found": "No address found",
- "per": "per",
- "on": "on",
+ "per": "Per",
+ "every": "every",
"map_init_failure": "Error initializing map"
},
"fr": {
"tracers": "traceur | traceurs",
"search_location": "Rechercher un endroit",
"no_address_found": "Pas d'adresse trouvée",
- "per": "par",
- "on": "sur",
+ "per": "Par",
+ "every": "tous les",
"map_init_failure": "Échec d'initialisation de la carte"
},
"es": {
"tracers": "trazador | trazadores",
"search_location": "Encontrar un lugar",
"no_address_found": "No se encontró dirección",
- "per": "pro",
- "on": "más de",
+ "per": "Pro",
+ "every": "todos los",
"map_init_failure": "Error al inicializar el mapa"
}
}
From 7aaab289b86f7d2773ca331e232ee12f6d95e36a Mon Sep 17 00:00:00 2001
From: Franck Kerbiriou
Date: Mon, 17 Feb 2020 19:17:31 +0100
Subject: [PATCH 4/4] Format
---
frontend/src/views/MyReports.vue | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/frontend/src/views/MyReports.vue b/frontend/src/views/MyReports.vue
index 19db01a4..c8b4f5cb 100644
--- a/frontend/src/views/MyReports.vue
+++ b/frontend/src/views/MyReports.vue
@@ -12,7 +12,12 @@
-
+
@@ -32,7 +37,8 @@
v-bind:label="$t('tracer')"
width="40"
sortable
- >{{ props.row.tracer }}
+ >{{ props.row.tracer }}
{{ props.row.quantity }}
+ >{{ props.row.quantity }}
{{ props.row.shore_length }}
+ >{{ props.row.shore_length }}
{{ props.row.reported_at | formatDate }}
+ >{{ props.row.reported_at | formatDate }}
{{ props.row.address }}
+ >{{ props.row.address }}
{{ props.row.status | capitalize }}
+ >{{ props.row.status | capitalize }}