lesli_audit 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/lesli_audit/application.js +1092 -263
- data/app/assets/stylesheets/lesli_audit/application.css +35 -0
- data/app/controllers/lesli_audit/users_controller.rb +35 -0
- data/app/services/lesli_audit/account/activity_services.rb +2 -2
- data/app/services/lesli_audit/analytics/trend_services.rb +2 -2
- data/app/services/lesli_audit/user_service.rb +63 -0
- data/app/services/lesli_audit/users/activity_services.rb +2 -2
- data/app/services/lesli_audit/users/log_services.rb +2 -2
- data/app/services/lesli_audit/users/registration_services.rb +2 -2
- data/app/services/lesli_audit/users/role_services.rb +2 -2
- data/app/services/lesli_audit/users/working_hour_services.rb +2 -2
- data/app/views/lesli_audit/partials/_engine-navigation.html.erb +4 -4
- data/config/locales/translations.en.yml +1 -0
- data/config/locales/translations.es.yml +1 -0
- data/config/locales/translations.fr.yml +21 -0
- data/config/locales/translations.it.yml +21 -0
- data/config/locales/translations.pt.yml +21 -0
- data/config/routes.rb +4 -2
- data/lib/lesli_audit/version.rb +2 -2
- data/{app/assets/stylesheets/lesli_audit → lib/scss}/application.scss +0 -4
- data/lib/vue/application.js +14 -14
- data/lib/vue/apps/analytics/index.vue +1 -1
- data/lib/vue/apps/analytics/trends.vue +2 -3
- data/lib/vue/apps/dashboards/components/roles.vue +3 -3
- data/lib/vue/apps/dashboards/components/users.vue +3 -3
- data/lib/vue/apps/dashboards/show.vue +1 -1
- data/lib/vue/apps/requests/index.vue +1 -1
- data/lib/vue/apps/users/index.vue +80 -22
- data/lib/vue/apps/users/registrations.vue +21 -44
- data/lib/vue/components/requests.vue +1 -1
- data/lib/vue/components/visitors.vue +4 -4
- data/lib/vue/stores/analytics.js +24 -9
- data/lib/vue/stores/translations.json +104 -0
- data/lib/vue/stores/users.js +56 -0
- metadata +9 -5
- data/app/assets/stylesheets/lesli_audit/dashboard.scss +0 -0
- data/app/controllers/lesli_audit/dashboard/components_controller.rb +0 -60
@@ -22,77 +22,54 @@ import { ref, reactive, onMounted, watch, computed } from "vue"
|
|
22
22
|
|
23
23
|
|
24
24
|
// · import Lesli components
|
25
|
-
import
|
25
|
+
import { lesliChartBar } from "lesli-vue/components"
|
26
26
|
|
27
27
|
|
28
28
|
// · import stores
|
29
|
-
import {
|
29
|
+
import { useUsers } from "LesliAudit/vue/stores/users"
|
30
30
|
|
31
31
|
|
32
32
|
// · implement stores
|
33
|
-
const
|
33
|
+
const storeUsers = useUsers()
|
34
34
|
|
35
35
|
|
36
36
|
// · define variables
|
37
37
|
var registrationSeries = ref([]);
|
38
|
-
var registrationLabels = ref([]);
|
39
|
-
var selectedPeriod = ref("month");
|
40
|
-
var filterPeriod = ref("");
|
41
|
-
var selectOptions = ref([]);
|
42
38
|
|
43
39
|
|
44
40
|
// · initializing
|
45
41
|
onMounted(() => {
|
46
|
-
|
47
|
-
storeUsersRegistrations.getOptions()
|
42
|
+
storeUsers.getRegistrations()
|
48
43
|
})
|
49
44
|
|
50
45
|
|
51
46
|
// ·
|
52
|
-
watch(() =>
|
53
|
-
selectOptions.value = storeUsersRegistrations.periods
|
54
|
-
})
|
47
|
+
watch(() => storeUsers.registrations, (oldData, newData) => {
|
55
48
|
|
49
|
+
if (storeUsers.registrations.length == 0) {
|
50
|
+
return
|
51
|
+
}
|
56
52
|
|
57
|
-
// ·
|
58
|
-
watch(() => storeUsersRegistrations.records, () => {
|
59
|
-
registrationLabels.value = storeUsersRegistrations.records.map(visit => visit.date)
|
60
53
|
registrationSeries.value = [{
|
61
|
-
|
62
|
-
|
54
|
+
data: storeUsers.registrations.map(registration => {
|
55
|
+
return {
|
56
|
+
x: registration.date,
|
57
|
+
y: registration.count
|
58
|
+
}
|
59
|
+
})
|
63
60
|
}]
|
64
61
|
})
|
65
62
|
|
66
|
-
|
67
|
-
// ·
|
68
|
-
function updateDate(){
|
69
|
-
filterPeriod = selectedPeriod.value;
|
70
|
-
storeUsersRegistrations.fetch(filterPeriod)
|
71
|
-
}
|
72
|
-
|
73
63
|
</script>
|
74
64
|
<template>
|
75
65
|
<section class="application-component">
|
76
|
-
<lesli-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
v-model = "selectedPeriod"
|
84
|
-
:options="selectOptions">
|
85
|
-
</lesli-select>
|
86
|
-
</div>
|
87
|
-
<div class="card">
|
88
|
-
<div class="card-content">
|
89
|
-
<chartLine
|
90
|
-
:series="registrationSeries"
|
91
|
-
:labels="registrationLabels"
|
92
|
-
@marker-click="markerClick">
|
93
|
-
</chartLine>
|
94
|
-
</div>
|
95
|
-
</div>
|
66
|
+
<lesli-card>
|
67
|
+
<lesli-chart-bar
|
68
|
+
title="Registrations by date"
|
69
|
+
:series="registrationSeries"
|
70
|
+
@marker-click="markerClick">
|
71
|
+
</lesli-chart-bar>
|
72
|
+
</lesli-card>
|
96
73
|
</section>
|
97
74
|
</template>
|
98
75
|
|
@@ -36,11 +36,11 @@ import { ref, reactive, onMounted, watch, computed } from "vue"
|
|
36
36
|
|
37
37
|
|
38
38
|
// · import Lesli components
|
39
|
-
import {
|
39
|
+
import { lesliChartLine } from "lesli-vue/components"
|
40
40
|
|
41
41
|
|
42
42
|
// · import stores
|
43
|
-
import { useAnalytics } from "LesliAudit/stores/analytics"
|
43
|
+
import { useAnalytics } from "LesliAudit/vue/stores/analytics"
|
44
44
|
|
45
45
|
|
46
46
|
// · implement stores
|
@@ -67,10 +67,10 @@ watch(() => storeAnalytics.visitors.records, () => {
|
|
67
67
|
</script>
|
68
68
|
<template>
|
69
69
|
<lesli-application-component>
|
70
|
-
<chart-line
|
70
|
+
<lesli-chart-line
|
71
71
|
:title="'Visitors'"
|
72
72
|
:series="series"
|
73
73
|
:labels="labels">
|
74
|
-
</chart-line>
|
74
|
+
</lesli-chart-line>
|
75
75
|
</lesli-application-component>
|
76
76
|
</template>
|
data/lib/vue/stores/analytics.js
CHANGED
@@ -1,17 +1,32 @@
|
|
1
1
|
/*
|
2
|
-
Copyright (c) 2022, all rights reserved.
|
3
2
|
|
4
|
-
|
5
|
-
industrial property, intellectual property, copyright and relative international laws.
|
6
|
-
All intellectual or industrial property rights of the code, texts, trade mark, design,
|
7
|
-
pictures and any other information belongs to the owner of this platform.
|
3
|
+
Lesli
|
8
4
|
|
9
|
-
|
10
|
-
transmission, publication is strictly forbidden.
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
11
6
|
|
12
|
-
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
13
11
|
|
14
|
-
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
21
|
+
|
22
|
+
Made with ♥ by LesliTech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
15
30
|
// ·
|
16
31
|
*/
|
17
32
|
|
@@ -5,6 +5,12 @@
|
|
5
5
|
"navigation_logout": "Logout",
|
6
6
|
"navigation_my_profile": "My profile"
|
7
7
|
},
|
8
|
+
"dashboards": {
|
9
|
+
"column_default": "Default",
|
10
|
+
"column_name": "Name",
|
11
|
+
"title": "Dashboards",
|
12
|
+
"view_add_component": "Add component"
|
13
|
+
},
|
8
14
|
"shared": {
|
9
15
|
"button_add_new": "Add new",
|
10
16
|
"button_delete": "Delete",
|
@@ -14,6 +20,7 @@
|
|
14
20
|
"button_save": "Save",
|
15
21
|
"button_settings": "Settings",
|
16
22
|
"button_show": "Show",
|
23
|
+
"toolbar_search": "Search...",
|
17
24
|
"view_discussions": "Discussions",
|
18
25
|
"view_files": "Files",
|
19
26
|
"view_quick_actions": "Quick actions",
|
@@ -28,6 +35,12 @@
|
|
28
35
|
"navigation_logout": "Cerrar sesión",
|
29
36
|
"navigation_my_profile": "Mi perfil"
|
30
37
|
},
|
38
|
+
"dashboards": {
|
39
|
+
"column_default": "Default",
|
40
|
+
"column_name": "Nombre",
|
41
|
+
"title": "Dashboards",
|
42
|
+
"view_add_component": "Agregar componente"
|
43
|
+
},
|
31
44
|
"shared": {
|
32
45
|
"button_add_new": "Agregar nuevo",
|
33
46
|
"button_delete": "Eliminar",
|
@@ -37,6 +50,7 @@
|
|
37
50
|
"button_save": "Guardar",
|
38
51
|
"button_settings": "Configuración",
|
39
52
|
"button_show": "Ver",
|
53
|
+
"toolbar_search": "Buscar...",
|
40
54
|
"view_discussions": "Discusiones",
|
41
55
|
"view_files": "Archivos",
|
42
56
|
"view_quick_actions": "Acciones rapidas",
|
@@ -44,5 +58,95 @@
|
|
44
58
|
"view_status_inactive": "Inactivo"
|
45
59
|
}
|
46
60
|
}
|
61
|
+
},
|
62
|
+
"fr": {
|
63
|
+
"lesli": {
|
64
|
+
"application": {
|
65
|
+
"navigation_logout": ":lesli.application.navigation_logout:",
|
66
|
+
"navigation_my_profile": ":lesli.application.navigation_my_profile:"
|
67
|
+
},
|
68
|
+
"dashboards": {
|
69
|
+
"column_default": ":lesli.dashboards.column_default:",
|
70
|
+
"column_name": ":lesli.dashboards.column_name:",
|
71
|
+
"title": ":lesli.dashboards.title:",
|
72
|
+
"view_add_component": ":lesli.dashboards.view_add_component:"
|
73
|
+
},
|
74
|
+
"shared": {
|
75
|
+
"button_add_new": ":lesli.shared.button_add_new:",
|
76
|
+
"button_delete": ":lesli.shared.button_delete:",
|
77
|
+
"button_edit": ":lesli.shared.button_edit:",
|
78
|
+
"button_list": ":lesli.shared.button_list:",
|
79
|
+
"button_reload": ":lesli.shared.button_reload:",
|
80
|
+
"button_save": ":lesli.shared.button_save:",
|
81
|
+
"button_settings": ":lesli.shared.button_settings:",
|
82
|
+
"button_show": ":lesli.shared.button_show:",
|
83
|
+
"toolbar_search": ":lesli.shared.toolbar_search:",
|
84
|
+
"view_discussions": ":lesli.shared.view_discussions:",
|
85
|
+
"view_files": ":lesli.shared.view_files:",
|
86
|
+
"view_quick_actions": ":lesli.shared.view_quick_actions:",
|
87
|
+
"view_status_active": ":lesli.shared.view_status_active:",
|
88
|
+
"view_status_inactive": ":lesli.shared.view_status_inactive:"
|
89
|
+
}
|
90
|
+
}
|
91
|
+
},
|
92
|
+
"it": {
|
93
|
+
"lesli": {
|
94
|
+
"application": {
|
95
|
+
"navigation_logout": ":lesli.application.navigation_logout:",
|
96
|
+
"navigation_my_profile": ":lesli.application.navigation_my_profile:"
|
97
|
+
},
|
98
|
+
"dashboards": {
|
99
|
+
"column_default": ":lesli.dashboards.column_default:",
|
100
|
+
"column_name": ":lesli.dashboards.column_name:",
|
101
|
+
"title": ":lesli.dashboards.title:",
|
102
|
+
"view_add_component": ":lesli.dashboards.view_add_component:"
|
103
|
+
},
|
104
|
+
"shared": {
|
105
|
+
"button_add_new": ":lesli.shared.button_add_new:",
|
106
|
+
"button_delete": ":lesli.shared.button_delete:",
|
107
|
+
"button_edit": ":lesli.shared.button_edit:",
|
108
|
+
"button_list": ":lesli.shared.button_list:",
|
109
|
+
"button_reload": ":lesli.shared.button_reload:",
|
110
|
+
"button_save": ":lesli.shared.button_save:",
|
111
|
+
"button_settings": ":lesli.shared.button_settings:",
|
112
|
+
"button_show": ":lesli.shared.button_show:",
|
113
|
+
"toolbar_search": ":lesli.shared.toolbar_search:",
|
114
|
+
"view_discussions": ":lesli.shared.view_discussions:",
|
115
|
+
"view_files": ":lesli.shared.view_files:",
|
116
|
+
"view_quick_actions": ":lesli.shared.view_quick_actions:",
|
117
|
+
"view_status_active": ":lesli.shared.view_status_active:",
|
118
|
+
"view_status_inactive": ":lesli.shared.view_status_inactive:"
|
119
|
+
}
|
120
|
+
}
|
121
|
+
},
|
122
|
+
"pt": {
|
123
|
+
"lesli": {
|
124
|
+
"application": {
|
125
|
+
"navigation_logout": ":lesli.application.navigation_logout:",
|
126
|
+
"navigation_my_profile": ":lesli.application.navigation_my_profile:"
|
127
|
+
},
|
128
|
+
"dashboards": {
|
129
|
+
"column_default": ":lesli.dashboards.column_default:",
|
130
|
+
"column_name": ":lesli.dashboards.column_name:",
|
131
|
+
"title": ":lesli.dashboards.title:",
|
132
|
+
"view_add_component": ":lesli.dashboards.view_add_component:"
|
133
|
+
},
|
134
|
+
"shared": {
|
135
|
+
"button_add_new": ":lesli.shared.button_add_new:",
|
136
|
+
"button_delete": ":lesli.shared.button_delete:",
|
137
|
+
"button_edit": ":lesli.shared.button_edit:",
|
138
|
+
"button_list": ":lesli.shared.button_list:",
|
139
|
+
"button_reload": ":lesli.shared.button_reload:",
|
140
|
+
"button_save": ":lesli.shared.button_save:",
|
141
|
+
"button_settings": ":lesli.shared.button_settings:",
|
142
|
+
"button_show": ":lesli.shared.button_show:",
|
143
|
+
"toolbar_search": ":lesli.shared.toolbar_search:",
|
144
|
+
"view_discussions": ":lesli.shared.view_discussions:",
|
145
|
+
"view_files": ":lesli.shared.view_files:",
|
146
|
+
"view_quick_actions": ":lesli.shared.view_quick_actions:",
|
147
|
+
"view_status_active": ":lesli.shared.view_status_active:",
|
148
|
+
"view_status_inactive": ":lesli.shared.view_status_inactive:"
|
149
|
+
}
|
150
|
+
}
|
47
151
|
}
|
48
152
|
}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
21
|
+
|
22
|
+
Made with ♥ by LesliTech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
*/
|
32
|
+
|
33
|
+
|
34
|
+
// ·
|
35
|
+
import { defineStore } from "pinia"
|
36
|
+
|
37
|
+
|
38
|
+
// ·
|
39
|
+
export const useUsers = defineStore("audit.users", {
|
40
|
+
state: () => {
|
41
|
+
return {
|
42
|
+
registrations: []
|
43
|
+
}
|
44
|
+
},
|
45
|
+
actions: {
|
46
|
+
|
47
|
+
getRegistrations() {
|
48
|
+
this.registrations = []
|
49
|
+
this.http.get(this.url.audit("users/registrations")).then(result => {
|
50
|
+
this.registrations = result
|
51
|
+
}).catch(error => {
|
52
|
+
console.log(error)
|
53
|
+
})
|
54
|
+
}
|
55
|
+
}
|
56
|
+
})
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lesli_audit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Lesli Development Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -35,12 +35,10 @@ files:
|
|
35
35
|
- app/assets/config/lesli_audit_manifest.js
|
36
36
|
- app/assets/images/lesli_audit/audit-logo.svg
|
37
37
|
- app/assets/javascripts/lesli_audit/application.js
|
38
|
-
- app/assets/stylesheets/lesli_audit/application.
|
39
|
-
- app/assets/stylesheets/lesli_audit/dashboard.scss
|
38
|
+
- app/assets/stylesheets/lesli_audit/application.css
|
40
39
|
- app/controllers/lesli_audit/accounts_controller.rb
|
41
40
|
- app/controllers/lesli_audit/analytics_controller.rb
|
42
41
|
- app/controllers/lesli_audit/application_controller.rb
|
43
|
-
- app/controllers/lesli_audit/dashboard/components_controller.rb
|
44
42
|
- app/controllers/lesli_audit/dashboards_controller.rb
|
45
43
|
- app/controllers/lesli_audit/requests_controller.rb
|
46
44
|
- app/controllers/lesli_audit/users_controller.rb
|
@@ -68,6 +66,7 @@ files:
|
|
68
66
|
- app/services/lesli_audit/analytics/trend_services.rb
|
69
67
|
- app/services/lesli_audit/analytics/visitor_service.rb
|
70
68
|
- app/services/lesli_audit/request_service.rb
|
69
|
+
- app/services/lesli_audit/user_service.rb
|
71
70
|
- app/services/lesli_audit/users/activity_services.rb
|
72
71
|
- app/services/lesli_audit/users/log_services.rb
|
73
72
|
- app/services/lesli_audit/users/registration_services.rb
|
@@ -112,6 +111,9 @@ files:
|
|
112
111
|
- app/views/lesli_audit/users/show.html.erb
|
113
112
|
- config/locales/translations.en.yml
|
114
113
|
- config/locales/translations.es.yml
|
114
|
+
- config/locales/translations.fr.yml
|
115
|
+
- config/locales/translations.it.yml
|
116
|
+
- config/locales/translations.pt.yml
|
115
117
|
- config/routes.rb
|
116
118
|
- db/migrate/v1.0/0503000110_create_lesli_audit_accounts.rb
|
117
119
|
- db/migrate/v1.0/0503050110_create_lesli_audit_dashboards.rb
|
@@ -125,6 +127,7 @@ files:
|
|
125
127
|
- lib/lesli_audit.rb
|
126
128
|
- lib/lesli_audit/engine.rb
|
127
129
|
- lib/lesli_audit/version.rb
|
130
|
+
- lib/scss/application.scss
|
128
131
|
- lib/tasks/lesli_audit_tasks.rake
|
129
132
|
- lib/vue/application.js
|
130
133
|
- lib/vue/apps/accounts/activities.vue
|
@@ -150,6 +153,7 @@ files:
|
|
150
153
|
- lib/vue/stores/security/password.js
|
151
154
|
- lib/vue/stores/security/session.js
|
152
155
|
- lib/vue/stores/translations.json
|
156
|
+
- lib/vue/stores/users.js
|
153
157
|
- lib/vue/stores/users/activities.js
|
154
158
|
- lib/vue/stores/users/logs.js
|
155
159
|
- lib/vue/stores/users/registrations.js
|
File without changes
|
@@ -1,60 +0,0 @@
|
|
1
|
-
module LesliAudit
|
2
|
-
class Dashboard::ComponentsController < ApplicationController
|
3
|
-
before_action :set_dashboard_component, only: %i[ show edit update destroy ]
|
4
|
-
|
5
|
-
# GET /dashboard/components
|
6
|
-
def index
|
7
|
-
@dashboard_components = Dashboard::Component.all
|
8
|
-
end
|
9
|
-
|
10
|
-
# GET /dashboard/components/1
|
11
|
-
def show
|
12
|
-
end
|
13
|
-
|
14
|
-
# GET /dashboard/components/new
|
15
|
-
def new
|
16
|
-
@dashboard_component = Dashboard::Component.new
|
17
|
-
end
|
18
|
-
|
19
|
-
# GET /dashboard/components/1/edit
|
20
|
-
def edit
|
21
|
-
end
|
22
|
-
|
23
|
-
# POST /dashboard/components
|
24
|
-
def create
|
25
|
-
@dashboard_component = Dashboard::Component.new(dashboard_component_params)
|
26
|
-
|
27
|
-
if @dashboard_component.save
|
28
|
-
redirect_to @dashboard_component, notice: "Component was successfully created."
|
29
|
-
else
|
30
|
-
render :new, status: :unprocessable_entity
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
# PATCH/PUT /dashboard/components/1
|
35
|
-
def update
|
36
|
-
if @dashboard_component.update(dashboard_component_params)
|
37
|
-
redirect_to @dashboard_component, notice: "Component was successfully updated.", status: :see_other
|
38
|
-
else
|
39
|
-
render :edit, status: :unprocessable_entity
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
# DELETE /dashboard/components/1
|
44
|
-
def destroy
|
45
|
-
@dashboard_component.destroy
|
46
|
-
redirect_to dashboard_components_url, notice: "Component was successfully destroyed.", status: :see_other
|
47
|
-
end
|
48
|
-
|
49
|
-
private
|
50
|
-
# Use callbacks to share common setup or constraints between actions.
|
51
|
-
def set_dashboard_component
|
52
|
-
@dashboard_component = Dashboard::Component.find(params[:id])
|
53
|
-
end
|
54
|
-
|
55
|
-
# Only allow a list of trusted parameters through.
|
56
|
-
def dashboard_component_params
|
57
|
-
params.fetch(:dashboard_component, {})
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|