- {{number}} Notification(s) non lue(s)
+ {{ number }}
@@ -15,7 +15,7 @@ import {
CategoryScale,
LinearScale
} from 'chart.js'
-import { Bar } from 'vue-chartjs'
+import {Bar} from 'vue-chartjs'
import {defineComponent} from 'vue'
import {makeFetch} from "../../lib/api/apiMethods";
@@ -36,23 +36,56 @@ export default defineComponent({
}
},
async mounted() {
- this.loaded_bar=false;
- this.loaded_number=false;
+ this.loaded_bar = false;
+ this.loaded_number = false;
const url = '/fr/dashboard/raw_data';
try {
- const response: { data: any, options: any, type: any} = await makeFetch("GET", url);
+ const response: { data: any, options: any, type: any } = await makeFetch("GET", url);
this.chartData = response.data;
this.chartOptions = response.options;
- if(response.type == 'bar'){
+ if (response.type == 'bar') {
this.loaded_bar = true;
- }
- else {
+ } else {
this.loaded_number = true
- this.number = response.data.datasets[0].data[0];
+ this.number = response.data.datasets[0].data[0] + " "+ response.data.labels[0];
}
} catch (error) {
console.log(error);
}
- }
+ },
+ /*methods: {
+ async makeNumberWidget() {
+ let body = {
+ config: {
+ alias: 'number'
+ },
+ context: {
+ what: 'notification_unread',
+ user: 19 //Ne rien mettre ou via les refs
+ }
+ };
+ try {
+ const response: {
+ data: any,
+ options: any,
+ type: any
+ } = await makeFetch('POST', '/{_locale}//{_locale}/dashboard/widget/number', body)
+ this.chartData = response.data;
+ this.chartOptions = response.options;
+ this.loaded_number = true;
+ this.number = response.data.datasets[0].data[0] + response.data.labels[0];
+ } catch (error) {
+ console.log(error)
+ }
+
+
+ },
+ }*/
})
+
diff --git a/src/Bundle/ChillMainBundle/Widget/Widgets/WidgetNumber.php b/src/Bundle/ChillMainBundle/Widget/Widgets/WidgetNumber.php
index 1ee41df67..ad2f1566e 100644
--- a/src/Bundle/ChillMainBundle/Widget/Widgets/WidgetNumber.php
+++ b/src/Bundle/ChillMainBundle/Widget/Widgets/WidgetNumber.php
@@ -70,7 +70,7 @@ class WidgetNumber implements WidgetHandlerInterface
//Count the number of notification the sender send
$countSend = $this->notificationRepository->countAllForSender($user);
$dataForWidget = [
- 'labels' => ['Notification Send'],
+ 'labels' => ['notification(s) envoyée(s)'],
'datasets' => [
[
'backgroundColor' => ['#41B883'],
@@ -84,7 +84,7 @@ class WidgetNumber implements WidgetHandlerInterface
//Count the number of unread notification by the current User
$countUnread = $this->notificationRepository->countUnreadByUser($user);
$dataForWidget = [
- 'labels' => ['Notification Unread'],
+ 'labels' => ['notification(s) non lue(s)'],
'datasets' => [
[
'backgroundColor' => ['#41B883'],