signum 0.4.13 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/components/signum/notification_body/component.html.slim +6 -4
- data/app/components/signum/notification_body/component_controller.js +1 -1
- data/app/components/signum/notifications/component.html.slim +5 -0
- data/app/components/signum/notifications/component.rb +9 -0
- data/app/models/signum/signal.rb +2 -2
- data/lib/signum/configuration.rb +2 -2
- data/lib/signum/version.rb +1 -1
- data/signum.gemspec +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80bcbf3b5c508331a717b1f9b17b7d14b06c88612f54635e45f87643453ddf5b
|
4
|
+
data.tar.gz: 5e44b69680cd000e0a048d595aa0539114b3fb1b9424a9b5812eff94d41d80fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d698d607336e153b25d2dfbe5717bbdeb7338a88c77049dbfa7c40e24b3cbcdd2918baedb902e360b47b67a0bed9827b73bc9604562263c27de95279d89c9571
|
7
|
+
data.tar.gz: a94a9bea7fb4242fd2f9fd312ffbf2730bd4f8479244828ce977f39b54ea784c7b4048e0c66b6a04a133a1665a590d633964ade726d4af7b73414f3618bd2122
|
@@ -14,9 +14,10 @@
|
|
14
14
|
- if signal.metadata.present? && signal.metadata["links"].present?
|
15
15
|
.signum-notification-body__mb__bc__mc__lkc
|
16
16
|
- signal.metadata["links"].each do | link |
|
17
|
-
|
17
|
+
- next unless link.is_a?(Hash)
|
18
|
+
a.signum-notification-body__mb__bc__mc__lkc__lk*{href: link.fetch('url', '#'), target:link.fetch("target", "_blank") }.merge(link.fetch("link_attributes", {}))
|
18
19
|
i.fas.fa-link
|
19
|
-
=< link["title"]
|
20
|
+
=< link["title"] || link["url"] || '(...)'
|
20
21
|
- if signal.attachments.attached?
|
21
22
|
.signum-notification-body__mb__bc__mc__attc
|
22
23
|
- signal.attachments.each do | attachment |
|
@@ -32,10 +33,11 @@
|
|
32
33
|
- if signal.metadata.present? && signal.metadata["buttons"].present?
|
33
34
|
.signum-notification-body__mb__bmc
|
34
35
|
- signal.metadata["buttons"].each do | button |
|
36
|
+
- next unless button.is_a?(Hash)
|
35
37
|
.signum-notification-body__mb__bmc__bc
|
36
|
-
a.signum-notification-body__mb__bmc__bc__b
|
38
|
+
a.signum-notification-body__mb__bmc__bc__b*{href: button.fetch('url', '#'), target:button.fetch("target", "_blank")}.merge(button.fetch("link_attributes", {}))
|
37
39
|
= button["title"]
|
38
40
|
- if signal.count.present?
|
39
41
|
- percentage = signal.total.present? ? signal.count.fdiv(signal.total) * 100 : signal.count
|
40
42
|
.signum-notification-body__pbc
|
41
|
-
= sts.progress_bar percentage, size: :small, label: false
|
43
|
+
= sts.progress_bar percentage, size: :small, label: false
|
@@ -0,0 +1,5 @@
|
|
1
|
+
= helpers.turbo_stream_from :signals
|
2
|
+
|
3
|
+
.pointer-events-none.fixed.inset-0.flex.items-end.px-2.py-6.sm:items-start.sm:p-6.z-10 data-turbo-permanent="true" id="signum_notifications"
|
4
|
+
#notifications_all.flex.w-full.flex-col.items-center.space-y-2.sm:items-end
|
5
|
+
div.flex.w-full.flex-col.items-center.space-y-2.sm:items-end[id="#{Signum.config.balloon_notifications_container_id.call}"]
|
data/app/models/signum/signal.rb
CHANGED
@@ -11,10 +11,10 @@ module Signum
|
|
11
11
|
def broadcast_create
|
12
12
|
broadcast! if can_broadcast?
|
13
13
|
|
14
|
-
broadcast_prepend_to(:signals, target: Signum.config.balloon_notifications_container_id.call,
|
14
|
+
broadcast_prepend_to(:signals, target: Signum.config.balloon_notifications_container_id.call(signalable, id),
|
15
15
|
html: ApplicationController.render(Signum::Notification::Component.new(self)))
|
16
16
|
|
17
|
-
broadcast_prepend_to(:signals, target: Signum.config.drawer_notifications_container_id.call,
|
17
|
+
broadcast_prepend_to(:signals, target: Signum.config.drawer_notifications_container_id.call(signalable, id),
|
18
18
|
html: ApplicationController.render(Signum::NotificationDrawerItem::Component.new(signal: self)))
|
19
19
|
end
|
20
20
|
|
data/lib/signum/configuration.rb
CHANGED
@@ -35,8 +35,8 @@ module Signum
|
|
35
35
|
option :base_service, default: '::ApplicationService'
|
36
36
|
option :base_service_context, default: '::ApplicationContext'
|
37
37
|
option :current_user, default: -> {}
|
38
|
-
option :drawer_notifications_container_id, default: -> {}
|
39
|
-
option :balloon_notifications_container_id, default: -> {}
|
38
|
+
option :drawer_notifications_container_id, default: ->(signalable = nil, id = nil) {}
|
39
|
+
option :balloon_notifications_container_id, default: ->(signalable = nil, id = nil) {}
|
40
40
|
option :icons,
|
41
41
|
default: { info: 'fa-solid fa-circle-info fa-lg',
|
42
42
|
error: 'fa-solid fa-square-xmark fa-lg',
|
data/lib/signum/version.rb
CHANGED
data/signum.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_dependency 'pg'
|
22
22
|
spec.add_dependency 'rails', '> 6.0'
|
23
|
-
spec.add_dependency 'state_machines-
|
23
|
+
spec.add_dependency 'state_machines-activerecord'
|
24
24
|
|
25
25
|
spec.add_development_dependency 'auxilium', '~> 3'
|
26
26
|
spec.add_development_dependency 'sqlite3'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: signum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom de Grunt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '6.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: state_machines-
|
42
|
+
name: state_machines-activerecord
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -183,6 +183,8 @@ files:
|
|
183
183
|
- app/components/signum/notification_drawer_item/component.html.slim
|
184
184
|
- app/components/signum/notification_drawer_item/component.rb
|
185
185
|
- app/components/signum/notification_drawer_item/component_controller.js
|
186
|
+
- app/components/signum/notifications/component.html.slim
|
187
|
+
- app/components/signum/notifications/component.rb
|
186
188
|
- app/controllers/signum/api_controller.rb
|
187
189
|
- app/controllers/signum/application_controller.rb
|
188
190
|
- app/controllers/signum/signal_controller.rb
|