dorsale 3.9.5 → 3.9.6
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/CHANGELOG.md +5 -0
- data/app/controllers/dorsale/flyboy/task_comments_controller.rb +8 -1
- data/app/filters/dorsale/flyboy/small_data/filter_strategy_by_task_state.rb +4 -2
- data/app/helpers/dorsale/flyboy/application_helper.rb +1 -1
- data/app/models/dorsale/flyboy/task.rb +4 -0
- data/config/locales/flyboy.en.yml +1 -0
- data/config/locales/flyboy.fr.yml +1 -0
- data/lib/dorsale/version.rb +1 -1
- data/spec/controllers/dorsale/flyboy/task_comments_controller_spec.rb +12 -4
- data/spec/models/dorsale/flyboy/task_spec.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c35bf78225914a8dfc322164de561790f97b6e49
|
|
4
|
+
data.tar.gz: 9fd0de39cdcbb701862e92777891924ad6669123
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 84dd08892c8727c90daa2b55f452b334a75e78a3e434dc2cc955fb3055efd83485850a4dc0908b463fa51b2ec2c8a277308db8a489c6bc2002c562f82819e1f9
|
|
7
|
+
data.tar.gz: ae773eb9c50e3a42460e7c59a0298e6f5db3ab515fc3c7ae1a7eda3e7ff5148f5009631a6e2cb8c2aa564240357cd77759f0337891e2a9b16179124083c23752
|
data/CHANGELOG.md
CHANGED
|
@@ -18,7 +18,14 @@ class Dorsale::Flyboy::TaskCommentsController < ::Dorsale::Flyboy::ApplicationCo
|
|
|
18
18
|
private
|
|
19
19
|
|
|
20
20
|
def back_url
|
|
21
|
-
|
|
21
|
+
task_path = flyboy_task_path(@task)
|
|
22
|
+
back_url = super
|
|
23
|
+
|
|
24
|
+
if back_url.to_s.start_with?(task_path)
|
|
25
|
+
back_url
|
|
26
|
+
else
|
|
27
|
+
task_path
|
|
28
|
+
end
|
|
22
29
|
end
|
|
23
30
|
|
|
24
31
|
def model
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
class Dorsale::Flyboy::SmallData::FilterStrategyByTaskState < ::Agilibox::SmallData::FilterStrategy
|
|
2
|
+
STATES = Dorsale::Flyboy::Task::STATES + %w(on_warning_or_alert)
|
|
3
|
+
|
|
2
4
|
def apply(query, value)
|
|
3
|
-
if value.in?(
|
|
4
|
-
query.
|
|
5
|
+
if value.in?(STATES)
|
|
6
|
+
query.public_send(value)
|
|
5
7
|
else
|
|
6
8
|
query
|
|
7
9
|
end
|
|
@@ -26,7 +26,7 @@ module Dorsale::Flyboy::ApplicationHelper
|
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def flyboy_status_for_filters_select
|
|
29
|
-
Dorsale::Flyboy::
|
|
29
|
+
Dorsale::Flyboy::SmallData::FilterStrategyByTaskState::STATES.map do |state|
|
|
30
30
|
[Dorsale::Flyboy::Task.t("state.#{state}"), state]
|
|
31
31
|
end
|
|
32
32
|
end
|
|
@@ -48,6 +48,10 @@ class Dorsale::Flyboy::Task < ::Dorsale::ApplicationRecord
|
|
|
48
48
|
.where("#{table_name}.term <= ?", Date.current)
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
scope :on_warning_or_alert, -> {
|
|
52
|
+
undone.where("#{table_name}.reminder_date <= :d OR #{table_name}.term <= :d", d: Date.current)
|
|
53
|
+
}
|
|
54
|
+
|
|
51
55
|
scope :delayed, -> { where(done: false).where("#{table_name}.term < ?", Date.current) }
|
|
52
56
|
scope :today, -> { where(done: false).where("#{table_name}.term = ?", Date.current) }
|
|
53
57
|
scope :tomorrow, -> { where(done: false).where("#{table_name}.term = ?", Date.tomorrow) }
|
data/lib/dorsale/version.rb
CHANGED
|
@@ -18,13 +18,21 @@ describe Dorsale::Flyboy::TaskCommentsController, type: :controller do
|
|
|
18
18
|
expect(assigns(:task_comment).persisted?).to be true
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
it "should redirect to referrer" do
|
|
22
|
-
|
|
21
|
+
it "should redirect to referrer if referrer is task" do
|
|
22
|
+
url = flyboy_task_path(task) + "?sort=xxx"
|
|
23
|
+
request.env["HTTP_REFERER"] = url
|
|
23
24
|
post :create, params: valid_params
|
|
24
|
-
expect(response).to redirect_to
|
|
25
|
+
expect(response).to redirect_to url
|
|
25
26
|
end
|
|
26
27
|
|
|
27
|
-
it "should redirect to task" do
|
|
28
|
+
it "should redirect to task if referrer is not task" do
|
|
29
|
+
url = "/anywhere"
|
|
30
|
+
request.env["HTTP_REFERER"] = url
|
|
31
|
+
post :create, params: valid_params
|
|
32
|
+
expect(response).to redirect_to flyboy_task_path(task)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
it "should redirect to task if referrer is missing" do
|
|
28
36
|
post :create, params: valid_params
|
|
29
37
|
expect(response).to redirect_to flyboy_task_path(task)
|
|
30
38
|
end
|
|
@@ -219,6 +219,10 @@ describe Dorsale::Flyboy::Task do
|
|
|
219
219
|
)
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
+
it "should return on_warning_or_alert" do
|
|
223
|
+
expect(described_class.on_warning_or_alert).to contain_exactly(task_onwarning, task_onalert)
|
|
224
|
+
end
|
|
225
|
+
|
|
222
226
|
it "should return :done" do
|
|
223
227
|
expect(task_done.state).to eq "done"
|
|
224
228
|
expect(described_class.done).to eq [task_done]
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dorsale
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.9.
|
|
4
|
+
version: 3.9.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- agilidée
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2018-01-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|