diff --git a/app/Device.php b/app/Device.php
index 1cf48faec4..6767989937 100644
--- a/app/Device.php
+++ b/app/Device.php
@@ -432,13 +432,13 @@ public static function getItemTypes()
// ANY_VALUE is used to suppress errors when SQL mode is not set to ONLY_FULL_GROUP_BY.
$types = DB::select(DB::raw("
SELECT item_type,
- ANY_VALUE(powered) AS powered,
- ANY_VALUE(idcategories) AS idcategories,
- ANY_VALUE(categoryname)
+ MAX(powered) AS powered,
+ MAX(idcategories) AS idcategories,
+ MAX(categoryname)
FROM (SELECT DISTINCT s.*
FROM (SELECT item_type,
- ANY_VALUE(powered) AS powered,
- ANY_VALUE(idcategories) AS idcategories,
+ MAX(powered) AS powered,
+ MAX(idcategories) AS idcategories,
categories.name AS categoryname,
COUNT(*) AS count
FROM devices
@@ -450,8 +450,8 @@ public static function getItemTypes()
JOIN (SELECT item_type,
MAX(count) AS maxcount
FROM (SELECT item_type AS item_type,
- ANY_VALUE(powered) AS powered,
- ANY_VALUE(idcategories) AS idcategories,
+ MAX(powered) AS powered,
+ MAX(idcategories) AS idcategories,
categories.name AS categoryname,
COUNT(*) AS count
FROM devices
diff --git a/app/Http/Controllers/API/GroupController.php b/app/Http/Controllers/API/GroupController.php
index 86a3f665d2..896d5ca0bc 100644
--- a/app/Http/Controllers/API/GroupController.php
+++ b/app/Http/Controllers/API/GroupController.php
@@ -224,27 +224,6 @@ public static function getGroupList()
return response()->json($groups);
}
- public static function getEventsForGroup(Request $request, Group $group)
- {
- // Used by old JS client.
- $group = $group->load('parties');
-
- $events = $group->parties->sortByDesc('event_start_utc');
-
- if ($request->has('format') && $request->input('format') == 'location') {
- $events = $events->map(function ($event) {
- return (object) [
- 'id' => $event->idevents,
- 'location' => $event->FriendlyLocation,
- ];
- });
- }
-
- return response()->json([
- 'events' => $events->values()->toJson(),
- ]);
- }
-
/**
* @OA\Get(
* path="/api/v2/groups/names",
diff --git a/lang/en/groups.php b/lang/en/groups.php
index e68717f6b0..74f0ad9309 100644
--- a/lang/en/groups.php
+++ b/lang/en/groups.php
@@ -171,5 +171,7 @@
'made_host' => 'We have made :name a host for this group.',
'permission' => 'Sorry, you do not have permission to do this.',
'volunteer_remove_success' => 'We have removed :name from this group.',
- 'volunteer_remove_error' => 'We are unable to remove :name from this group.'
+ 'volunteer_remove_error' => 'We are unable to remove :name from this group.',
+ 'create_event_first' => 'Please first create an event in order to add repair data.',
+ 'follow_group_first' => 'Repair data is added to community repair events. Please first follow a group and then choose an event in order to add repair data.',
];
diff --git a/lang/fr-BE/groups.php b/lang/fr-BE/groups.php
index cc6f64b8cd..7b2a483080 100644
--- a/lang/fr-BE/groups.php
+++ b/lang/fr-BE/groups.php
@@ -174,4 +174,6 @@
'permission' => 'Désolé, vous n\'avez pas la permission de faire ça.',
'volunteer_remove_success' => 'Nous avons retiré :name de ce Repair Café.',
'volunteer_remove_error' => 'Nous ne sommes pas en mesure de supprimer :name de ce Repair Café.',
+ 'create_event_first' => 'Veuillez d\'abord créer un événement afin d\'ajouter des données de réparation.',
+ 'follow_group_first' => 'Les données de réparation sont ajoutées aux événements de réparation de la communauté. Veuillez d\'abord suivre un Repair Café, puis choisir un événement afin d\'ajouter des données de réparation.',
];
diff --git a/lang/fr/groups.php b/lang/fr/groups.php
index 48031b50b3..cd535b7aff 100644
--- a/lang/fr/groups.php
+++ b/lang/fr/groups.php
@@ -174,4 +174,6 @@
'permission' => 'Désolé, vous n\'avez pas la permission de faire ça.',
'volunteer_remove_success' => 'Nous avons retiré :name de ce Repair Café.',
'volunteer_remove_error' => 'Nous ne sommes pas en mesure de supprimer :name de ce Repair Café.',
+ 'create_event_first' => 'Veuillez d\'abord créer un événement afin d\'ajouter des données de réparation.',
+ 'follow_group_first' => 'Les données de réparation sont ajoutées aux événements de réparation de la communauté. Veuillez d\'abord suivre un Repair Café, puis choisir un événement afin d\'ajouter des données de réparation.',
];
diff --git a/resources/js/app.js b/resources/js/app.js
index 50b3701067..860b26125c 100644
--- a/resources/js/app.js
+++ b/resources/js/app.js
@@ -12,7 +12,6 @@ require('slick-carousel');
require('ekko-lightbox');
require('bootstrap4-datetimepicker');
require('./misc/notifications');
-require('./fixometer');
require('leaflet');
require('./constants');
diff --git a/resources/js/components/AddDataModal.vue b/resources/js/components/AddDataModal.vue
new file mode 100644
index 0000000000..9693a8e9f9
--- /dev/null
+++ b/resources/js/components/AddDataModal.vue
@@ -0,0 +1,133 @@
+
+
+
+ {{ __('devices.add_data_title') }}
+
+
+
+ {{ __('devices.add_data_description') }}
+
+
+ {{ __('groups.follow_group_first') }}
+
+
+
+
+
+ {{ __('groups.create_event_first') }}
+
+
+
+
+
+
+
+
+ {{ __('dashboard.see_all_groups') }}
+
+
+ {{ __('events.create_event') }}
+
+
+ {{ __('devices.add_data_action_button') }}
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/js/components/EventAddEdit.vue b/resources/js/components/EventAddEdit.vue
index a3a42dd63a..ca074074e5 100644
--- a/resources/js/components/EventAddEdit.vue
+++ b/resources/js/components/EventAddEdit.vue
@@ -180,6 +180,11 @@ export default {
required: false,
default: false
},
+ createGroup: {
+ type: Number,
+ required: false,
+ default: null
+ }
},
data () {
return {
@@ -270,6 +275,8 @@ export default {
// and so that as/when it changes then reactivity updates all the views.
//
// Further down the line this may change so that the data is obtained via an AJAX call and perhaps SSR.
+ this.idgroups = this.createGroup
+
this.$store.dispatch('groups/setList', {
groups: this.groups
})
diff --git a/resources/js/components/EventAddEditPage.vue b/resources/js/components/EventAddEditPage.vue
index 176763b27a..1b5b47487d 100644
--- a/resources/js/components/EventAddEditPage.vue
+++ b/resources/js/components/EventAddEditPage.vue
@@ -7,6 +7,7 @@
@@ -47,6 +48,11 @@ export default {
required: false,
default: false
},
+ createGroup: {
+ type: Number,
+ required: false,
+ default: null
+ }
},
data() {
return {
diff --git a/resources/js/components/FixometerHeading.vue b/resources/js/components/FixometerHeading.vue
index 860495394e..35f9ff0263 100644
--- a/resources/js/components/FixometerHeading.vue
+++ b/resources/js/components/FixometerHeading.vue
@@ -6,7 +6,7 @@