lesli_bell 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +5 -0
- data/app/assets/config/lesli_bell_manifest.js +40 -0
- data/app/assets/javascripts/lesli_bell/application.js +2848 -0
- data/app/assets/stylesheets/lesli_bell/application.css +15 -0
- data/app/controllers/lesli_bell/accounts_controller.rb +4 -0
- data/app/controllers/lesli_bell/announcements_controller.rb +60 -0
- data/app/controllers/lesli_bell/application_controller.rb +4 -0
- data/app/controllers/lesli_bell/dashboards_controller.rb +59 -0
- data/app/controllers/lesli_bell/notifications_controller.rb +60 -0
- data/app/helpers/lesli_bell/accounts_helper.rb +4 -0
- data/app/helpers/lesli_bell/announcements_helper.rb +4 -0
- data/app/helpers/lesli_bell/application_helper.rb +4 -0
- data/app/helpers/lesli_bell/dashboards_helper.rb +4 -0
- data/app/helpers/lesli_bell/notifications_helper.rb +4 -0
- data/app/jobs/lesli_bell/application_job.rb +4 -0
- data/app/mailers/lesli_bell/application_mailer.rb +6 -0
- data/app/models/lesli_bell/account.rb +7 -0
- data/app/models/lesli_bell/announcement.rb +4 -0
- data/app/models/lesli_bell/application_record.rb +5 -0
- data/app/models/lesli_bell/dashboard.rb +4 -0
- data/app/models/lesli_bell/notification.rb +28 -0
- data/app/services/lesli_bell/notification_service.rb +87 -0
- data/app/views/lesli_bell/accounts/_account.html.erb +2 -0
- data/app/views/lesli_bell/accounts/_form.html.erb +17 -0
- data/app/views/lesli_bell/accounts/edit.html.erb +10 -0
- data/app/views/lesli_bell/accounts/index.html.erb +14 -0
- data/app/views/lesli_bell/accounts/new.html.erb +9 -0
- data/app/views/lesli_bell/accounts/show.html.erb +10 -0
- data/app/views/lesli_bell/announcements/_announcement.html.erb +2 -0
- data/app/views/lesli_bell/announcements/_form.html.erb +17 -0
- data/app/views/lesli_bell/announcements/edit.html.erb +10 -0
- data/app/views/lesli_bell/announcements/index.html.erb +14 -0
- data/app/views/lesli_bell/announcements/new.html.erb +9 -0
- data/app/views/lesli_bell/announcements/show.html.erb +10 -0
- data/app/views/lesli_bell/dashboards/_dashboard.html.erb +2 -0
- data/app/views/lesli_bell/dashboards/_form.html.erb +17 -0
- data/app/views/lesli_bell/dashboards/edit.html.erb +10 -0
- data/app/views/lesli_bell/dashboards/index.html.erb +14 -0
- data/app/views/lesli_bell/dashboards/new.html.erb +9 -0
- data/app/views/lesli_bell/dashboards/show.html.erb +1 -0
- data/app/views/lesli_bell/notifications/edit.html.erb +10 -0
- data/app/views/lesli_bell/notifications/index.html.erb +33 -0
- data/app/views/lesli_bell/notifications/new.html.erb +9 -0
- data/app/views/lesli_bell/notifications/show.html.erb +10 -0
- data/app/views/lesli_bell/partials/_engine-navigation.html.erb +24 -0
- data/config/routes.rb +6 -0
- data/db/migrate/v1.0/0308000110_create_lesli_bell_accounts.rb +28 -0
- data/db/migrate/v1.0/0308100110_create_lesli_bell_notifications.rb +41 -0
- data/db/migrate/v1.0/0308100210_create_lesli_bell_notification_activities.rb +17 -0
- data/db/migrate/v1.0/0308110110_create_lesli_bell_announcements.rb +40 -0
- data/db/migrate/v1.0/0308110210_create_lesli_bell_announcement_activities.rb +17 -0
- data/db/migrate/v1.0/0308110310_create_lesli_bell_announcement_users.rb +12 -0
- data/db/seed/development.rb +36 -0
- data/db/seed/production.rb +0 -0
- data/db/seed/test.rb +0 -0
- data/db/seeds.rb +25 -0
- data/lib/lesli_bell/engine.rb +18 -0
- data/lib/lesli_bell/version.rb +4 -0
- data/lib/lesli_bell.rb +6 -0
- data/lib/tasks/lesli_bell_tasks.rake +4 -0
- data/lib/vue/application.js +51 -0
- data/lib/vue/apps/announcements/components/form.vue +237 -0
- data/lib/vue/apps/announcements/index.vue +124 -0
- data/lib/vue/apps/announcements/new.vue +48 -0
- data/lib/vue/apps/notifications/components/notification-form.vue +149 -0
- data/lib/vue/apps/notifications/index.vue +129 -0
- data/lib/vue/apps/notifications/new.vue +45 -0
- data/lib/vue/stores/announcement.js +142 -0
- data/lib/vue/stores/notification.js +115 -0
- data/readme.md +28 -0
- metadata +116 -0
@@ -0,0 +1,115 @@
|
|
1
|
+
/*
|
2
|
+
Copyright (c) 2022, all rights reserved.
|
3
|
+
|
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.
|
8
|
+
|
9
|
+
Without the written permission of the owner, any replication, modification,
|
10
|
+
transmission, publication is strictly forbidden.
|
11
|
+
|
12
|
+
For more information read the license file including with this software.
|
13
|
+
|
14
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
15
|
+
// ·
|
16
|
+
*/
|
17
|
+
|
18
|
+
|
19
|
+
// ·
|
20
|
+
import { defineStore } from "pinia"
|
21
|
+
|
22
|
+
export const useBellNotification = defineStore("bell.Notification", {
|
23
|
+
state: () => {
|
24
|
+
return {
|
25
|
+
loading: false,
|
26
|
+
users: [],
|
27
|
+
roles: [],
|
28
|
+
filteredUsers: [],
|
29
|
+
filteredRoles: [],
|
30
|
+
record: {
|
31
|
+
subject: null,
|
32
|
+
body: null,
|
33
|
+
url: null,
|
34
|
+
status: null,
|
35
|
+
notification_type: null,
|
36
|
+
category: null,
|
37
|
+
},
|
38
|
+
receiverUsers: [],
|
39
|
+
receiverRoles: [],
|
40
|
+
pagination: {},
|
41
|
+
records: []
|
42
|
+
}
|
43
|
+
},
|
44
|
+
actions: {
|
45
|
+
/**
|
46
|
+
* @description This action is used to add pagination to notification index
|
47
|
+
* @param {Integer} page the actual page showing in the index
|
48
|
+
*/
|
49
|
+
paginate(page) {
|
50
|
+
this.pagination.page = page
|
51
|
+
this.fetch()
|
52
|
+
},
|
53
|
+
/**
|
54
|
+
* @description This action is used to fetch all notifications
|
55
|
+
*/
|
56
|
+
fetch() {
|
57
|
+
this.http.get(
|
58
|
+
this.url.bell("notifications").paginate(this.pagination.page)
|
59
|
+
).then(result => {
|
60
|
+
this.pagination = result.pagination
|
61
|
+
this.records = result.records
|
62
|
+
})
|
63
|
+
},
|
64
|
+
/**
|
65
|
+
* @description This action is used to create a new notification
|
66
|
+
*/
|
67
|
+
async createNotification() {
|
68
|
+
this.loading = true
|
69
|
+
this.msg.info(I18n.t("bell.notifications.messages_info_creating_notifications"))
|
70
|
+
return this.http.post(this.url.bell("notifications"), {
|
71
|
+
notification: {
|
72
|
+
...this.record,
|
73
|
+
user_receiver_emails: this.receiverUsers.map(user => user.email),
|
74
|
+
role_receiver_names: this.receiverRoles.map(role => role.name),
|
75
|
+
}
|
76
|
+
}).then(() => {
|
77
|
+
this.msg.success(I18n.t("bell.notifications.messages_success_notification_created_successfully"))
|
78
|
+
}).catch(error => {
|
79
|
+
this.msg.danger(error)
|
80
|
+
}).finally(() => {
|
81
|
+
this.record = {}
|
82
|
+
this.receiverUsers = []
|
83
|
+
this.receiverRoles = []
|
84
|
+
this.loading = false
|
85
|
+
})
|
86
|
+
},
|
87
|
+
/**
|
88
|
+
* @description This action is used to get the list of users for showing them on the autocomplete field in the form
|
89
|
+
*/
|
90
|
+
getUsers() {
|
91
|
+
this.loading = true
|
92
|
+
this.http.get(this.url.admin('users/list')).then(result => {
|
93
|
+
this.users = result
|
94
|
+
}).catch(error => {
|
95
|
+
this.msg.danger(error)
|
96
|
+
}).finally(() => {
|
97
|
+
this.loading = false
|
98
|
+
})
|
99
|
+
},
|
100
|
+
/**
|
101
|
+
* @description This action is used to get the list of roles for showing them on the autocomplete field in the form
|
102
|
+
*/
|
103
|
+
getRoles() {
|
104
|
+
this.loading = true
|
105
|
+
this.http.get(this.url.admin('roles/list')).then(result => {
|
106
|
+
this.roles = result
|
107
|
+
}).catch(error => {
|
108
|
+
this.msg.danger(error)
|
109
|
+
}).finally(() => {
|
110
|
+
this.loading = false
|
111
|
+
})
|
112
|
+
},
|
113
|
+
|
114
|
+
}
|
115
|
+
})
|
data/readme.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# LesliBell
|
2
|
+
Short description and motivation.
|
3
|
+
|
4
|
+
## Usage
|
5
|
+
How to use my plugin.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem "lesli_bell"
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
```bash
|
16
|
+
$ bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
```bash
|
21
|
+
$ gem install lesli_bell
|
22
|
+
```
|
23
|
+
|
24
|
+
## Contributing
|
25
|
+
Contribution directions go here.
|
26
|
+
|
27
|
+
## License
|
28
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
metadata
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: lesli_bell
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- The Lesli Development Team
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-10-01 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Notification system for The Lesli Platform
|
14
|
+
email:
|
15
|
+
- hello@lesli.tech
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- Rakefile
|
21
|
+
- app/assets/config/lesli_bell_manifest.js
|
22
|
+
- app/assets/javascripts/lesli_bell/application.js
|
23
|
+
- app/assets/stylesheets/lesli_bell/application.css
|
24
|
+
- app/controllers/lesli_bell/accounts_controller.rb
|
25
|
+
- app/controllers/lesli_bell/announcements_controller.rb
|
26
|
+
- app/controllers/lesli_bell/application_controller.rb
|
27
|
+
- app/controllers/lesli_bell/dashboards_controller.rb
|
28
|
+
- app/controllers/lesli_bell/notifications_controller.rb
|
29
|
+
- app/helpers/lesli_bell/accounts_helper.rb
|
30
|
+
- app/helpers/lesli_bell/announcements_helper.rb
|
31
|
+
- app/helpers/lesli_bell/application_helper.rb
|
32
|
+
- app/helpers/lesli_bell/dashboards_helper.rb
|
33
|
+
- app/helpers/lesli_bell/notifications_helper.rb
|
34
|
+
- app/jobs/lesli_bell/application_job.rb
|
35
|
+
- app/mailers/lesli_bell/application_mailer.rb
|
36
|
+
- app/models/lesli_bell/account.rb
|
37
|
+
- app/models/lesli_bell/announcement.rb
|
38
|
+
- app/models/lesli_bell/application_record.rb
|
39
|
+
- app/models/lesli_bell/dashboard.rb
|
40
|
+
- app/models/lesli_bell/notification.rb
|
41
|
+
- app/services/lesli_bell/notification_service.rb
|
42
|
+
- app/views/lesli_bell/accounts/_account.html.erb
|
43
|
+
- app/views/lesli_bell/accounts/_form.html.erb
|
44
|
+
- app/views/lesli_bell/accounts/edit.html.erb
|
45
|
+
- app/views/lesli_bell/accounts/index.html.erb
|
46
|
+
- app/views/lesli_bell/accounts/new.html.erb
|
47
|
+
- app/views/lesli_bell/accounts/show.html.erb
|
48
|
+
- app/views/lesli_bell/announcements/_announcement.html.erb
|
49
|
+
- app/views/lesli_bell/announcements/_form.html.erb
|
50
|
+
- app/views/lesli_bell/announcements/edit.html.erb
|
51
|
+
- app/views/lesli_bell/announcements/index.html.erb
|
52
|
+
- app/views/lesli_bell/announcements/new.html.erb
|
53
|
+
- app/views/lesli_bell/announcements/show.html.erb
|
54
|
+
- app/views/lesli_bell/dashboards/_dashboard.html.erb
|
55
|
+
- app/views/lesli_bell/dashboards/_form.html.erb
|
56
|
+
- app/views/lesli_bell/dashboards/edit.html.erb
|
57
|
+
- app/views/lesli_bell/dashboards/index.html.erb
|
58
|
+
- app/views/lesli_bell/dashboards/new.html.erb
|
59
|
+
- app/views/lesli_bell/dashboards/show.html.erb
|
60
|
+
- app/views/lesli_bell/notifications/edit.html.erb
|
61
|
+
- app/views/lesli_bell/notifications/index.html.erb
|
62
|
+
- app/views/lesli_bell/notifications/new.html.erb
|
63
|
+
- app/views/lesli_bell/notifications/show.html.erb
|
64
|
+
- app/views/lesli_bell/partials/_engine-navigation.html.erb
|
65
|
+
- config/routes.rb
|
66
|
+
- db/migrate/v1.0/0308000110_create_lesli_bell_accounts.rb
|
67
|
+
- db/migrate/v1.0/0308100110_create_lesli_bell_notifications.rb
|
68
|
+
- db/migrate/v1.0/0308100210_create_lesli_bell_notification_activities.rb
|
69
|
+
- db/migrate/v1.0/0308110110_create_lesli_bell_announcements.rb
|
70
|
+
- db/migrate/v1.0/0308110210_create_lesli_bell_announcement_activities.rb
|
71
|
+
- db/migrate/v1.0/0308110310_create_lesli_bell_announcement_users.rb
|
72
|
+
- db/seed/development.rb
|
73
|
+
- db/seed/production.rb
|
74
|
+
- db/seed/test.rb
|
75
|
+
- db/seeds.rb
|
76
|
+
- lib/lesli_bell.rb
|
77
|
+
- lib/lesli_bell/engine.rb
|
78
|
+
- lib/lesli_bell/version.rb
|
79
|
+
- lib/tasks/lesli_bell_tasks.rake
|
80
|
+
- lib/vue/application.js
|
81
|
+
- lib/vue/apps/announcements/components/form.vue
|
82
|
+
- lib/vue/apps/announcements/index.vue
|
83
|
+
- lib/vue/apps/announcements/new.vue
|
84
|
+
- lib/vue/apps/notifications/components/notification-form.vue
|
85
|
+
- lib/vue/apps/notifications/index.vue
|
86
|
+
- lib/vue/apps/notifications/new.vue
|
87
|
+
- lib/vue/stores/announcement.js
|
88
|
+
- lib/vue/stores/notification.js
|
89
|
+
- readme.md
|
90
|
+
homepage: https://www.lesli.dev/
|
91
|
+
licenses:
|
92
|
+
- GPL-3.0
|
93
|
+
metadata:
|
94
|
+
homepage_uri: https://www.lesli.dev/
|
95
|
+
changelog_uri: https://github.com/LesliTech/LesliBell
|
96
|
+
source_code_uri: https://github.com/LesliTech/LesliBell
|
97
|
+
post_install_message:
|
98
|
+
rdoc_options: []
|
99
|
+
require_paths:
|
100
|
+
- lib
|
101
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
requirements: []
|
112
|
+
rubygems_version: 3.3.7
|
113
|
+
signing_key:
|
114
|
+
specification_version: 4
|
115
|
+
summary: Notification system for The Lesli Platform
|
116
|
+
test_files: []
|