meta_workflows 0.8.3 → 0.8.5
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/app/assets/javascripts/meta_workflows/controllers/meta_flash_controller.js +55 -0
- data/app/assets/javascripts/meta_workflows/controllers/redirect_controller.js +7 -1
- data/app/assets/javascripts/meta_workflows_manifest.js +3 -1
- data/app/jobs/meta_workflows/record_redirect_job.rb +3 -1
- data/app/views/meta_workflows/_redirect.html.erb +5 -1
- data/lib/meta_workflows/version.rb +1 -1
- metadata +11 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21f1e85fae97d61be9f9b8379a855a10f4dfbdd102d52e6d38fe131dd45b9e00
|
4
|
+
data.tar.gz: c3c33844806e0e3245ea31d487de7e93c1283c6d5a7af0603ba2716c02e82815
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6978a0fa0531f9901c2cf7127df12ffb41678cd504561b152a58cb4f94d4f509eaa3999cb62af12e6dec508342f0515ab9a07de62a326678a55016492ee12bca
|
7
|
+
data.tar.gz: 6a70ac8ef1c376c906fd2b78f8dfa2958f1b1ad4105a594f27d85c387b2a5d1d857c4ea51863e908a5a7e4e30d742d356c5283b07304869e7ef74b146e9a7fea
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
2
|
+
|
3
|
+
// Auto-initializing flash controller that checks for messages on every page load
|
4
|
+
export default class extends Controller {
|
5
|
+
static targets = []
|
6
|
+
|
7
|
+
connect() {
|
8
|
+
this.checkForFlashMessage()
|
9
|
+
}
|
10
|
+
|
11
|
+
checkForFlashMessage() {
|
12
|
+
const flashMessage = localStorage.getItem('meta_workflows_flash_message')
|
13
|
+
|
14
|
+
if (flashMessage) {
|
15
|
+
this.displayFlashMessage(flashMessage)
|
16
|
+
localStorage.removeItem('meta_workflows_flash_message')
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
displayFlashMessage(message) {
|
21
|
+
const flashDiv = document.createElement('div')
|
22
|
+
flashDiv.style.cssText = `
|
23
|
+
position: fixed;
|
24
|
+
top: 20px;
|
25
|
+
left: 50%;
|
26
|
+
transform: translateX(-50%);
|
27
|
+
background: #10b981;
|
28
|
+
color: white;
|
29
|
+
padding: 12px 16px;
|
30
|
+
border-radius: 6px;
|
31
|
+
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
32
|
+
z-index: 9999;
|
33
|
+
opacity: 0;
|
34
|
+
transition: opacity 0.3s ease-in-out;
|
35
|
+
`
|
36
|
+
flashDiv.textContent = message
|
37
|
+
|
38
|
+
document.body.appendChild(flashDiv)
|
39
|
+
|
40
|
+
// Fade in
|
41
|
+
setTimeout(() => {
|
42
|
+
flashDiv.style.opacity = '1'
|
43
|
+
}, 10)
|
44
|
+
|
45
|
+
// Auto-remove after 5 seconds
|
46
|
+
setTimeout(() => {
|
47
|
+
flashDiv.style.opacity = '0'
|
48
|
+
setTimeout(() => {
|
49
|
+
if (flashDiv.parentNode) {
|
50
|
+
flashDiv.parentNode.removeChild(flashDiv)
|
51
|
+
}
|
52
|
+
}, 300)
|
53
|
+
}, 5000)
|
54
|
+
}
|
55
|
+
}
|
@@ -4,11 +4,17 @@ import { Controller } from "@hotwired/stimulus"
|
|
4
4
|
export default class extends Controller {
|
5
5
|
static values = {
|
6
6
|
url: String,
|
7
|
-
delay: { type: Number, default: 500 }
|
7
|
+
delay: { type: Number, default: 500 },
|
8
|
+
message: String
|
8
9
|
}
|
9
10
|
|
10
11
|
connect() {
|
11
12
|
setTimeout(() => {
|
13
|
+
// Store flash message in localStorage if present
|
14
|
+
if (this.hasMessageValue && this.messageValue) {
|
15
|
+
localStorage.setItem('meta_workflows_flash_message', this.messageValue)
|
16
|
+
}
|
17
|
+
|
12
18
|
Turbo.visit(this.urlValue)
|
13
19
|
}, this.delayValue)
|
14
20
|
}
|
@@ -4,10 +4,12 @@
|
|
4
4
|
import LoadingPhrasesController from "./meta_workflows/controllers/loading_phrases_controller"
|
5
5
|
import ResponseScrollController from "./meta_workflows/controllers/response_scroll_controller"
|
6
6
|
import RedirectController from "./meta_workflows/controllers/redirect_controller"
|
7
|
+
import MetaFlashController from "./meta_workflows/controllers/meta_flash_controller"
|
7
8
|
|
8
9
|
// Register controllers with Stimulus
|
9
10
|
const application = window.Stimulus || Application.start()
|
10
11
|
|
11
12
|
application.register("loading-phrases", LoadingPhrasesController)
|
12
13
|
application.register("response-scroll", ResponseScrollController)
|
13
|
-
application.register("redirect", RedirectController)
|
14
|
+
application.register("redirect", RedirectController)
|
15
|
+
application.register("meta-flash", MetaFlashController)
|
@@ -17,6 +17,7 @@ module MetaWorkflows
|
|
17
17
|
record_id = params['redirect_id']
|
18
18
|
record_class = params['redirect_class']
|
19
19
|
redirect_method = params['redirect_method']
|
20
|
+
redirect_message = params['redirect_message']
|
20
21
|
|
21
22
|
record_class_constant = record_class.to_s.safe_constantize
|
22
23
|
record = record_class_constant&.find_by(id: record_id)
|
@@ -28,7 +29,8 @@ module MetaWorkflows
|
|
28
29
|
target: target_frame_id(@workflow_execution.record, form: true),
|
29
30
|
partial: meta_redirect,
|
30
31
|
locals: {
|
31
|
-
redirect_path: redirect_path
|
32
|
+
redirect_path: redirect_path,
|
33
|
+
redirect_message: redirect_message
|
32
34
|
}
|
33
35
|
)
|
34
36
|
end
|
@@ -1 +1,5 @@
|
|
1
|
-
<div data-controller="redirect"
|
1
|
+
<div data-controller="redirect"
|
2
|
+
data-redirect-url-value="<%= redirect_path %>"
|
3
|
+
data-redirect-delay-value="0"
|
4
|
+
data-redirect-message-value="<%= local_assigns[:redirect_message] %>">
|
5
|
+
</div>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module MetaWorkflows
|
4
4
|
MAJOR = 0
|
5
5
|
MINOR = 8
|
6
|
-
PATCH =
|
6
|
+
PATCH = 5 # this is automatically incremented by the build process
|
7
7
|
|
8
8
|
VERSION = "#{MetaWorkflows::MAJOR}.#{MetaWorkflows::MINOR}.#{MetaWorkflows::PATCH}".freeze
|
9
9
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meta_workflows
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leonid Medovyy
|
@@ -9,22 +9,28 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2025-06-
|
12
|
+
date: 2025-06-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: 7.2.0
|
21
|
+
- - "<"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: '9.0'
|
21
24
|
type: :runtime
|
22
25
|
prerelease: false
|
23
26
|
version_requirements: !ruby/object:Gem::Requirement
|
24
27
|
requirements:
|
25
|
-
- - "
|
28
|
+
- - ">="
|
26
29
|
- !ruby/object:Gem::Version
|
27
30
|
version: 7.2.0
|
31
|
+
- - "<"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '9.0'
|
28
34
|
- !ruby/object:Gem::Dependency
|
29
35
|
name: sidekiq
|
30
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -109,6 +115,7 @@ files:
|
|
109
115
|
- README.md
|
110
116
|
- Rakefile
|
111
117
|
- app/assets/javascripts/meta_workflows/controllers/loading_phrases_controller.js
|
118
|
+
- app/assets/javascripts/meta_workflows/controllers/meta_flash_controller.js
|
112
119
|
- app/assets/javascripts/meta_workflows/controllers/redirect_controller.js
|
113
120
|
- app/assets/javascripts/meta_workflows/controllers/response_scroll_controller.js
|
114
121
|
- app/assets/javascripts/meta_workflows/controllers/tray_controller.js
|