lesli_audit 0.4.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/lesli_audit/application.js +2776 -1688
  3. data/app/assets/stylesheets/lesli_audit/application.css +35 -0
  4. data/app/controllers/lesli_audit/dashboards_controller.rb +26 -49
  5. data/app/controllers/lesli_audit/users_controller.rb +35 -0
  6. data/app/helpers/lesli_audit/dashboard/components_helper.rb +4 -0
  7. data/app/models/lesli_audit/account.rb +7 -0
  8. data/app/models/lesli_audit/dashboard/component.rb +18 -0
  9. data/app/models/lesli_audit/dashboard.rb +30 -2
  10. data/app/services/lesli_audit/account/activity_services.rb +2 -2
  11. data/app/services/lesli_audit/analytics/trend_services.rb +2 -2
  12. data/app/services/lesli_audit/user_service.rb +63 -0
  13. data/app/services/lesli_audit/users/activity_services.rb +2 -2
  14. data/app/services/lesli_audit/users/log_services.rb +2 -2
  15. data/app/services/lesli_audit/users/registration_services.rb +2 -2
  16. data/app/services/lesli_audit/users/role_services.rb +2 -2
  17. data/app/services/lesli_audit/users/working_hour_services.rb +2 -2
  18. data/app/views/lesli_audit/dashboard/components/_component.html.erb +2 -0
  19. data/app/views/lesli_audit/dashboard/components/_form.html.erb +17 -0
  20. data/app/views/lesli_audit/dashboard/components/edit.html.erb +1 -0
  21. data/app/views/lesli_audit/dashboard/components/index.html.erb +14 -0
  22. data/app/views/lesli_audit/dashboard/components/new.html.erb +9 -0
  23. data/app/views/lesli_audit/dashboard/components/show.html.erb +1 -0
  24. data/app/views/lesli_audit/dashboards/edit.html.erb +1 -10
  25. data/app/views/lesli_audit/partials/_engine-navigation.html.erb +4 -4
  26. data/config/locales/translations.en.yml +17 -1
  27. data/config/locales/translations.es.yml +17 -1
  28. data/config/locales/translations.fr.yml +21 -0
  29. data/config/locales/translations.it.yml +21 -0
  30. data/config/locales/translations.pt.yml +21 -0
  31. data/config/routes.rb +17 -3
  32. data/db/seeds.rb +4 -1
  33. data/lib/lesli_audit/version.rb +2 -2
  34. data/{app/assets/stylesheets/lesli_audit → lib/scss}/application.scss +0 -4
  35. data/lib/vue/application.js +47 -5
  36. data/lib/vue/apps/analytics/index.vue +1 -1
  37. data/lib/vue/apps/analytics/trends.vue +2 -3
  38. data/lib/vue/apps/dashboards/components/roles.vue +71 -0
  39. data/lib/vue/apps/dashboards/components/users.vue +71 -0
  40. data/lib/vue/apps/dashboards/show.vue +8 -0
  41. data/lib/vue/apps/requests/index.vue +1 -1
  42. data/lib/vue/apps/users/index.vue +80 -22
  43. data/lib/vue/apps/users/registrations.vue +21 -44
  44. data/lib/vue/components/requests.vue +1 -1
  45. data/lib/vue/components/visitors.vue +1 -1
  46. data/lib/vue/stores/analytics.js +24 -9
  47. data/lib/vue/stores/translations.json +133 -19
  48. data/lib/vue/stores/users.js +56 -0
  49. metadata +25 -10
  50. data/app/assets/javascripts/lesli_audit/application.js.LICENSE.txt +0 -327
  51. data/app/assets/stylesheets/lesli_audit/dashboard.scss +0 -0
  52. /data/db/migrate/v1.0/{0803000110_create_lesli_audit_accounts.rb → 0503000110_create_lesli_audit_accounts.rb} +0 -0
  53. /data/db/migrate/v1.0/{0803050110_create_lesli_audit_dashboards.rb → 0503050110_create_lesli_audit_dashboards.rb} +0 -0
  54. /data/db/migrate/v1.0/{0803050210_create_lesli_audit_dashboard_components.rb → 0503050210_create_lesli_audit_dashboard_components.rb} +0 -0
  55. /data/db/migrate/v1.0/{0803100010_create_lesli_audit_account_requests.rb → 0503100010_create_lesli_audit_account_requests.rb} +0 -0
  56. /data/db/migrate/v1.0/{0803110010_create_lesli_audit_user_requests.rb → 0503110010_create_lesli_audit_user_requests.rb} +0 -0
@@ -1,4 +1,4 @@
1
1
  module LesliAudit
2
- VERSION = "0.4.0"
3
- BUILD = "1697000148"
2
+ VERSION = "0.6.0"
3
+ BUILD = "1713121383"
4
4
  end
@@ -29,7 +29,3 @@ Building a better future, one line of code at a time.
29
29
  // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
30
  // ·
31
31
  */
32
-
33
-
34
- // // ·
35
- body.cloud_audit-dashboard { @import "lesli/templates/dashboards"; }
@@ -30,15 +30,27 @@ Building a better future, one line of code at a time.
30
30
  */
31
31
 
32
32
 
33
+ // · Import Lesli builders
34
+ import application from "Lesli/vue/application"
35
+ import translation from "Lesli/vue/translation"
36
+
37
+
38
+ // · Import engine translations
39
+ import translations from "LesliAudit/vue/stores/translations.json"
40
+
41
+
33
42
  // ·
34
- import application from "Lesli/application"
35
- import appAnalytics from "LesliAudit/apps/analytics/index.vue"
36
- import appRequests from "LesliAudit/apps/requests/index.vue"
37
- import appUsers from "LesliAudit/apps/users/index.vue"
43
+ import appAnalytics from "LesliAudit/vue/apps/analytics/index.vue"
44
+ import appRequests from "LesliAudit/vue/apps/requests/index.vue"
45
+ import appUsers from "LesliAudit/vue/apps/users/index.vue"
46
+
47
+ //import appDashboardShow from "LesliAudit/vue/apps/dashboards/show.vue"
48
+ import appDashboardShow from "Lesli/vue/shared/dashboards/apps/show.vue"
49
+ import appDashboardEdit from "Lesli/vue/shared/dashboards/apps/edit.vue"
38
50
 
39
51
  // ·
40
52
  /*
41
- import dashboard from "Lesli/shared/dashboards/apps/show.vue"
53
+ import dashboard from "Lesli/vue/shared/dashboards/apps/show.vue"
42
54
  import appUsersRegistrations from "CloudAudit/apps/users/registrations.vue"
43
55
  import appUsersWorkingHours from "CloudAudit/apps/users/workingHours.vue"
44
56
  import appUsersActivities from "CloudAudit/apps/users/activities.vue"
@@ -56,7 +68,37 @@ import appSecurityPasswords from "CloudAudit/apps/security/passwords.vue"
56
68
 
57
69
 
58
70
  // ·
71
+ import componentDashboardUsers from "LesliAudit/vue/apps/dashboards/components/users.vue"
72
+ import componentDashboardRoles from "LesliAudit/vue/apps/dashboards/components/roles.vue"
73
+
74
+
75
+ // ·
76
+ const dashboardProps = {
77
+ components: {
78
+ // "audit-users": componentDashboardUsers,
79
+ // "audit-roles": componentDashboardRoles
80
+ }
81
+ }
82
+
83
+
84
+ // · Buil Lesli translations
85
+ translation(translations)
86
+
87
+
88
+ // · Build a new Lesli application
59
89
  application("LesliAudit", [{
90
+ path: "/",
91
+ component: appDashboardShow,
92
+ props: dashboardProps
93
+ }, {
94
+ path: "/dashboard",
95
+ component: appDashboardShow,
96
+ props: dashboardProps
97
+ }, {
98
+ path: "/dashboards/:id/edit",
99
+ component: appDashboardEdit,
100
+ props: dashboardProps
101
+ }, {
60
102
  path: "/analytics",
61
103
  component: appAnalytics,
62
104
  props: { engine: "audit" }
@@ -5,7 +5,7 @@ import { ref, reactive, onMounted, watch, computed } from "vue"
5
5
 
6
6
 
7
7
  // · import stores
8
- import { useAnalytics } from "LesliAudit/stores/analytics"
8
+ import { useAnalytics } from "LesliAudit/vue/stores/analytics"
9
9
 
10
10
 
11
11
  // · implement stores
@@ -22,12 +22,11 @@ import { ref, reactive, onMounted, watch, computed } from "vue"
22
22
 
23
23
 
24
24
  // . import Lesli components
25
- import chartBar from "Lesli/components/charts/bar.vue"
26
- import chartLine from "Lesli/components/charts/line.vue"
25
+ import { lesliChartBar, lesliChartLine } from "lesli-vue/components"
27
26
 
28
27
 
29
28
  // · import lesli stores
30
- import { useAnalytics } from "CloudAudit/stores/analytics"
29
+ import { useAnalytics } from "LesliAudit/vue/stores/analytics"
31
30
 
32
31
 
33
32
  // · implement stores
@@ -0,0 +1,71 @@
1
+ <script setup>
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 https://www.lesli.tech
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 { onMounted } from "vue"
36
+
37
+
38
+ // ·
39
+ import { useUsers } from "LesliSecurity/vue/stores/users"
40
+
41
+
42
+ // ·
43
+ const storeUsers = useUsers()
44
+
45
+
46
+ // ·
47
+ const props = defineProps({
48
+ component: {
49
+ type: Object,
50
+ required: true
51
+ }
52
+ })
53
+
54
+
55
+ // ·
56
+ onMounted(() => {
57
+ //storeUsers.getUsersList()
58
+ })
59
+
60
+ </script>
61
+ <template>
62
+ <lesli-card>
63
+ <h6 class="title is-6 mb-4">{{ props.component.name }}</h6>
64
+ <p>{ { storeUsers.list.length } }</p>
65
+ </lesli-card>
66
+ </template>
67
+ <style scoped>
68
+ p {
69
+ font-size: 2rem;
70
+ }
71
+ </style>
@@ -0,0 +1,71 @@
1
+ <script setup>
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 https://www.lesli.tech
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 { onMounted } from "vue"
36
+
37
+
38
+ // ·
39
+ import { useUsers } from "LesliSecurity/vue/stores/users"
40
+
41
+
42
+ // ·
43
+ const storeUsers = useUsers()
44
+
45
+
46
+ // ·
47
+ const props = defineProps({
48
+ component: {
49
+ type: Object,
50
+ required: true
51
+ }
52
+ })
53
+
54
+
55
+ // ·
56
+ onMounted(() => {
57
+ //storeUsers.getUsersList()
58
+ })
59
+
60
+ </script>
61
+ <template>
62
+ <lesli-card>
63
+ <h6 class="title is-6 mb-4">{{ props.component.name }}</h6>
64
+
65
+ </lesli-card>
66
+ </template>
67
+ <style scoped>
68
+ p {
69
+ font-size: 2rem;
70
+ }
71
+ </style>
@@ -0,0 +1,8 @@
1
+ <script setup>
2
+
3
+ import LesliDashboard from "Lesli/vue/shared/dashboards/apps/show.vue"
4
+
5
+ </script>
6
+ <template>
7
+ <lesli-dashboard></lesli-dashboard>
8
+ </template>
@@ -37,7 +37,7 @@ import { ref, reactive, onMounted, watch, computed } from "vue"
37
37
 
38
38
 
39
39
  // · import lesli stores
40
- import { useRequests } from "LesliAudit/stores/request"
40
+ import { useRequests } from "LesliAudit/vue/stores/request"
41
41
 
42
42
 
43
43
  // · implement stores
@@ -1,31 +1,89 @@
1
1
  <script setup>
2
+ /*
3
+
4
+ Lesli
5
+
6
+ Copyright (c) 2023, Lesli Technologies, S. A.
7
+
8
+ This program is free software: you can redistribute it and/or modify
9
+ it under the terms of the GNU General Public License as published by
10
+ the Free Software Foundation, either version 3 of the License, or
11
+ (at your option) any later version.
12
+
13
+ This program is distributed in the hope that it will be useful,
14
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ GNU General Public License for more details.
17
+
18
+ You should have received a copy of the GNU General Public License
19
+ along with this program. If not, see http://www.gnu.org/licenses/.
20
+
21
+ Lesli · Ruby on Rails SaaS Development Framework.
22
+
23
+ Made with ♥ by LesliTech
24
+ Building a better future, one line of code at a time.
25
+
26
+ @contact hello@lesli.tech
27
+ @website https://www.lesli.tech
28
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
29
+
30
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
31
+ // ·
32
+ */
33
+
34
+
35
+ // · import vue tools
36
+ import { onMounted, ref } from "vue"
37
+
38
+
39
+ // · import stores
40
+ import componentRegistrations from "./registrations.vue"
41
+
42
+
43
+ // · import stores
44
+ import { useUsers } from "LesliAudit/vue/stores/users"
45
+
46
+
47
+ // · implement stores
48
+ const storeUsers = useUsers()
49
+
50
+
51
+ // ·
52
+ var selectedPeriod = ref("month");
53
+
54
+
55
+ // ·
56
+ function updateDate(){
57
+ // filterPeriod = selectedPeriod.value;
58
+ // storeUsersRegistrations.fetch(filterPeriod)
59
+ }
2
60
 
3
61
  </script>
4
62
  <template>
5
63
  <lesli-application-container>
6
- <lesli-columns>
7
- <lesli-column>
8
- <lesli-card title="Users registered">
9
- <p class="number">160</p>
10
- </lesli-card>
11
- </lesli-column>
12
- <lesli-column>
13
- <lesli-card title="Active roles">
14
- <p class="number">12</p>
15
- </lesli-card>
16
- </lesli-column>
17
- <lesli-column>
18
- <lesli-card title="Active descriptors">
19
- <p class="number">70</p>
20
- </lesli-card>
21
- </lesli-column>
22
- </lesli-columns>
64
+ <lesli-header title="Users">
65
+ <lesli-select
66
+ id = "selectPeriod"
67
+ @change="updateDate"
68
+ v-model = "selectedPeriod"
69
+ :options="[{
70
+ label: 'Year',
71
+ value: 'year'
72
+ }, {
73
+ label: 'Month',
74
+ value: 'month'
75
+ }, {
76
+ label: 'Week',
77
+ value: 'week'
78
+ }, {
79
+ label: 'Day',
80
+ value: 'day'
81
+ }]">
82
+ </lesli-select>
83
+ </lesli-header>
84
+ <component-registrations>
85
+ </component-registrations>
23
86
  </lesli-application-container>
24
87
  </template>
25
88
  <style>
26
- .number {
27
- padding: 1rem;
28
- font-size: 3rem;
29
- text-align: center;
30
- }
31
89
  </style>
@@ -22,77 +22,54 @@ import { ref, reactive, onMounted, watch, computed } from "vue"
22
22
 
23
23
 
24
24
  // · import Lesli components
25
- import chartLine from "Lesli/components/charts/line.vue"
25
+ import { lesliChartBar } from "lesli-vue/components"
26
26
 
27
27
 
28
28
  // · import stores
29
- import { useUsersRegistrations } from "CloudAudit/stores/users/registrations"
29
+ import { useUsers } from "LesliAudit/vue/stores/users"
30
30
 
31
31
 
32
32
  // · implement stores
33
- const storeUsersRegistrations = useUsersRegistrations()
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
- storeUsersRegistrations.fetchIfEmpty()
47
- storeUsersRegistrations.getOptions()
42
+ storeUsers.getRegistrations()
48
43
  })
49
44
 
50
45
 
51
46
  // ·
52
- watch(() => storeUsersRegistrations.periods, () => {
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
- name: "Users",
62
- data: storeUsersRegistrations.records.map(visit => visit.count)
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-header title="User registered by date" @reload="storeUsersRegistrations.reload()">
77
- </lesli-header>
78
-
79
- <div class="block">
80
- <lesli-select
81
- id = "selectPeriod"
82
- @change="updateDate"
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,7 +36,7 @@ import { } from "vue"
36
36
 
37
37
 
38
38
  // · import stores
39
- import { useAnalytics } from "LesliAudit/stores/analytics"
39
+ import { useAnalytics } from "LesliAudit/vue/stores/analytics"
40
40
 
41
41
 
42
42
  // · implement stores
@@ -40,7 +40,7 @@ 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
@@ -1,17 +1,32 @@
1
1
  /*
2
- Copyright (c) 2022, all rights reserved.
3
2
 
4
- All the information provided by this platform is protected by international laws related to
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
- Without the written permission of the owner, any replication, modification,
10
- transmission, publication is strictly forbidden.
5
+ Copyright (c) 2023, Lesli Technologies, S. A.
11
6
 
12
- For more information read the license file including with this software.
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