slocks 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/lib/slocks/modal_builder.rb +5 -0
- data/lib/slocks/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: aec70a18b669cfe2fc989a0e608b955e92bc14aedf73ecd2f904f0fb16030466
|
|
4
|
+
data.tar.gz: 13b8545cf3f91c8b9404a782f0b86f63ca4aedf7dcab6647faa7cfb4b8e60bfc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d2d9c94877cce9328aa3d79f379d47e2ddb7dd07e0f01512efdaafecc5bdcad5bb078c2b8dabb05ccfff835213cfb159489afab8fca66364bf2d7312eadaf535
|
|
7
|
+
data.tar.gz: d08cedbca583e8a3050686642b5ff366ffdc2746d77090fdb7a3bbe73600ad3f1a057da7db72fb1f6092346157e4438cf21b337745cea87c518f22d4eac54345
|
data/README.md
CHANGED
|
@@ -28,7 +28,7 @@ bundle install
|
|
|
28
28
|
Create a template with the **.slack_blocks** extension.
|
|
29
29
|
|
|
30
30
|
```ruby
|
|
31
|
-
# app/views/notifications/order_shipped.
|
|
31
|
+
# app/views/notifications/order_shipped.slack_message.slocks
|
|
32
32
|
|
|
33
33
|
header "📦 Your order has shipped!"
|
|
34
34
|
|
|
@@ -282,6 +282,7 @@ title "Send Feedback"
|
|
|
282
282
|
submit "Submit"
|
|
283
283
|
close "Cancel"
|
|
284
284
|
callback "feedback_modal"
|
|
285
|
+
private_metadata({ user_id: @user.id }.to_json)
|
|
285
286
|
|
|
286
287
|
section "How was your experience?", markdown: true
|
|
287
288
|
|
|
@@ -381,6 +382,6 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
|
381
382
|
|
|
382
383
|
## Credits
|
|
383
384
|
|
|
384
|
-
built with <3
|
|
385
|
+
built with <3 by nora and various LLM-slop providers.
|
|
385
386
|
|
|
386
387
|
heavily inspired by Akira Matsuda's fantastic [JB](https://github.com/amatsuda/jb/) gem.
|
data/lib/slocks/modal_builder.rb
CHANGED
|
@@ -20,6 +20,10 @@ module Slocks
|
|
|
20
20
|
@callback_id = id
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
+
def private_metadata(value)
|
|
24
|
+
@private_metadata = value.to_s
|
|
25
|
+
end
|
|
26
|
+
|
|
23
27
|
def to_h
|
|
24
28
|
modal = {
|
|
25
29
|
type: "modal",
|
|
@@ -29,6 +33,7 @@ module Slocks
|
|
|
29
33
|
}.compact
|
|
30
34
|
modal[:submit] = { type: "plain_text", text: @submit_text } if @submit_text
|
|
31
35
|
modal[:close] = { type: "plain_text", text: @close_text } if @close_text
|
|
36
|
+
modal[:private_metadata] = @private_metadata if @private_metadata
|
|
32
37
|
modal
|
|
33
38
|
end
|
|
34
39
|
end
|
data/lib/slocks/version.rb
CHANGED