dorsale 3.7.1 → 3.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/app/assets/stylesheets/dorsale/engines/flyboy.sass +3 -3
- data/app/controllers/dorsale/application_controller.rb +5 -0
- data/app/controllers/dorsale/billing_machine/invoices_controller.rb +1 -1
- data/app/controllers/dorsale/billing_machine/quotations_controller.rb +1 -1
- data/app/controllers/dorsale/customer_vault/people_controller.rb +1 -1
- data/app/controllers/dorsale/expense_gun/expenses_controller.rb +1 -1
- data/app/controllers/dorsale/flyboy/tasks_controller.rb +26 -2
- data/app/helpers/dorsale/flyboy/application_helper.rb +1 -1
- data/app/policies/dorsale/flyboy/task_policy_helper.rb +1 -8
- data/app/services/dorsale/flyboy/task/copy.rb +18 -0
- data/app/views/dorsale/flyboy/task_comments/_list.html.slim +3 -3
- data/app/views/dorsale/flyboy/tasks/_context.html.slim +7 -1
- data/config/locales/flyboy.fr.yml +2 -0
- data/config/routes.rb +1 -0
- data/lib/dorsale/version.rb +1 -1
- data/spec/controllers/dorsale/flyboy/tasks_controller_spec.rb +5 -0
- data/spec/routing/dorsale/flyboy/tasks_routing_spec.rb +3 -0
- data/spec/services/dorsale/flyboy/task/copy_spec.rb +25 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0af47396cd8de5b81e92f797844f5df65ae2de4
|
4
|
+
data.tar.gz: 5ab1c66f64fe05aa3fedee65da652ce0cdf7b9c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79e8263485452c962cf22e8f45ddc8696ce5ebb5af6d3f9f8fcc3f3fac19c4163d9c705fc240a8048546aea7a871608451de77c40480a833f69ab2f9702f345b
|
7
|
+
data.tar.gz: 509a11ebc78b11f47e64557ff9f7f00898a0ead78f718bec312445dbbfcc004ea9ef362e8a31ae89f304522d0593682842297b7b865667cf8a44b941a02d3d7e
|
data/CHANGELOG.md
CHANGED
@@ -9,13 +9,13 @@
|
|
9
9
|
th
|
10
10
|
text-align: left
|
11
11
|
|
12
|
-
.finished td
|
12
|
+
.finished td, .context-body.finished
|
13
13
|
background: $state-success-bg !important
|
14
14
|
|
15
|
-
.onwarning td
|
15
|
+
.onwarning td, .context-body.onwarning
|
16
16
|
background: $state-warning-bg !important
|
17
17
|
|
18
|
-
.onalert td
|
18
|
+
.onalert td, .context-body.onalert
|
19
19
|
background: $state-danger-bg !important
|
20
20
|
|
21
21
|
td.actions
|
@@ -14,11 +14,16 @@ class Dorsale::ApplicationController < ::ApplicationController
|
|
14
14
|
end
|
15
15
|
}
|
16
16
|
|
17
|
+
def filters_jar
|
18
|
+
cookies
|
19
|
+
end
|
20
|
+
|
17
21
|
def model
|
18
22
|
raise NotImplementedError
|
19
23
|
end
|
20
24
|
|
21
25
|
helper_method :model
|
26
|
+
helper_method :filters_jar
|
22
27
|
|
23
28
|
def scope
|
24
29
|
policy_scope(model)
|
@@ -13,7 +13,7 @@ class Dorsale::BillingMachine::InvoicesController < ::Dorsale::BillingMachine::A
|
|
13
13
|
authorize model, :list?
|
14
14
|
|
15
15
|
@invoices ||= scope.all.preload(:customer)
|
16
|
-
@filters ||= ::Dorsale::BillingMachine::SmallData::FilterForInvoices.new(
|
16
|
+
@filters ||= ::Dorsale::BillingMachine::SmallData::FilterForInvoices.new(filters_jar)
|
17
17
|
|
18
18
|
@invoices = @filters.apply(@invoices)
|
19
19
|
@invoices_without_pagination = @invoices
|
@@ -13,7 +13,7 @@ class Dorsale::BillingMachine::QuotationsController < ::Dorsale::BillingMachine:
|
|
13
13
|
authorize model, :list?
|
14
14
|
|
15
15
|
@quotations ||= scope.all.preload(:customer)
|
16
|
-
@filters ||= ::Dorsale::BillingMachine::SmallData::FilterForQuotations.new(
|
16
|
+
@filters ||= ::Dorsale::BillingMachine::SmallData::FilterForQuotations.new(filters_jar)
|
17
17
|
|
18
18
|
@quotations = @filters.apply(@quotations)
|
19
19
|
@quotations_without_pagination = @quotations # All filtered quotations (not paginated)
|
@@ -4,7 +4,7 @@ class Dorsale::CustomerVault::PeopleController < ::Dorsale::CustomerVault::Appli
|
|
4
4
|
def index
|
5
5
|
authorize model, :list?
|
6
6
|
|
7
|
-
@filters ||= ::Dorsale::CustomerVault::SmallData::FilterForPeople.new(
|
7
|
+
@filters ||= ::Dorsale::CustomerVault::SmallData::FilterForPeople.new(filters_jar)
|
8
8
|
@tags ||= customer_vault_tag_list
|
9
9
|
@origins ||= policy_scope(Dorsale::CustomerVault::Origin)
|
10
10
|
@activity_types ||= policy_scope(Dorsale::CustomerVault::ActivityType)
|
@@ -16,7 +16,7 @@ class Dorsale::ExpenseGun::ExpensesController < Dorsale::ExpenseGun::Application
|
|
16
16
|
authorize model, :list?
|
17
17
|
|
18
18
|
@expenses ||= scope.all.preload(:user, :expense_lines)
|
19
|
-
@filters ||= Dorsale::ExpenseGun::SmallData::FilterForExpenses.new(
|
19
|
+
@filters ||= Dorsale::ExpenseGun::SmallData::FilterForExpenses.new(filters_jar)
|
20
20
|
@expenses = @filters.apply(@expenses)
|
21
21
|
@expenses = @expenses.page(params[:page]).per(25)
|
22
22
|
end
|
@@ -7,7 +7,8 @@ class Dorsale::Flyboy::TasksController < ::Dorsale::Flyboy::ApplicationControlle
|
|
7
7
|
:update,
|
8
8
|
:destroy,
|
9
9
|
:complete,
|
10
|
-
:snooze
|
10
|
+
:snooze,
|
11
|
+
:copy,
|
11
12
|
]
|
12
13
|
|
13
14
|
def index
|
@@ -33,7 +34,7 @@ class Dorsale::Flyboy::TasksController < ::Dorsale::Flyboy::ApplicationControlle
|
|
33
34
|
end
|
34
35
|
end
|
35
36
|
|
36
|
-
@filters ||= ::Dorsale::Flyboy::SmallData::FilterForTasks.new(
|
37
|
+
@filters ||= ::Dorsale::Flyboy::SmallData::FilterForTasks.new(filters_jar)
|
37
38
|
|
38
39
|
@tasks = @filters.apply(@tasks)
|
39
40
|
@tasks = @tasks.search(params[:q])
|
@@ -51,6 +52,19 @@ class Dorsale::Flyboy::TasksController < ::Dorsale::Flyboy::ApplicationControlle
|
|
51
52
|
|
52
53
|
def show
|
53
54
|
authorize @task, :read?
|
55
|
+
@task_comments = @task.comments
|
56
|
+
|
57
|
+
@order ||= sortable_column_order do |column, direction|
|
58
|
+
case column
|
59
|
+
when :description
|
60
|
+
%(LOWER(#{column}) #{direction})
|
61
|
+
when :progress
|
62
|
+
%(#{column} #{direction})
|
63
|
+
else
|
64
|
+
"date #{direction}"
|
65
|
+
end
|
66
|
+
end
|
67
|
+
@task_comments = @task_comments.reorder(@order)
|
54
68
|
end
|
55
69
|
|
56
70
|
def new
|
@@ -131,6 +145,8 @@ class Dorsale::Flyboy::TasksController < ::Dorsale::Flyboy::ApplicationControlle
|
|
131
145
|
authorize @task, :snooze?
|
132
146
|
|
133
147
|
if @task.snoozer.snooze
|
148
|
+
comment = Dorsale::Flyboy::TaskComment.new(task: @task, progress: @task.progress, description: t("messages.tasks.snooze_ok"), author: current_user)
|
149
|
+
comment.save!
|
134
150
|
flash[:success] = t("messages.tasks.snooze_ok")
|
135
151
|
else
|
136
152
|
flash[:danger] = t("messages.tasks.snooze_error")
|
@@ -139,6 +155,14 @@ class Dorsale::Flyboy::TasksController < ::Dorsale::Flyboy::ApplicationControlle
|
|
139
155
|
redirect_to back_url
|
140
156
|
end
|
141
157
|
|
158
|
+
def copy
|
159
|
+
authorize @task, :copy?
|
160
|
+
|
161
|
+
@original = @task
|
162
|
+
@task = Dorsale::Flyboy::Task::Copy.(@original)
|
163
|
+
render :new
|
164
|
+
end
|
165
|
+
|
142
166
|
def summary
|
143
167
|
authorize model, :list?
|
144
168
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Dorsale::Flyboy::ApplicationHelper
|
2
2
|
def tasks_for(taskable)
|
3
|
-
@filters = ::Dorsale::Flyboy::SmallData::FilterForTasks.new(
|
3
|
+
@filters = ::Dorsale::Flyboy::SmallData::FilterForTasks.new(filters_jar)
|
4
4
|
|
5
5
|
order ||= sortable_column_order do |column, direction|
|
6
6
|
case column
|
@@ -9,6 +9,7 @@ module Dorsale::Flyboy::TaskPolicyHelper
|
|
9
9
|
:delete?,
|
10
10
|
:complete?,
|
11
11
|
:snooze?,
|
12
|
+
:copy?,
|
12
13
|
]
|
13
14
|
|
14
15
|
def create?
|
@@ -16,14 +17,6 @@ module Dorsale::Flyboy::TaskPolicyHelper
|
|
16
17
|
super
|
17
18
|
end
|
18
19
|
|
19
|
-
def update?
|
20
|
-
super
|
21
|
-
end
|
22
|
-
|
23
|
-
def delete?
|
24
|
-
super
|
25
|
-
end
|
26
|
-
|
27
20
|
def complete?
|
28
21
|
return false if task.done?
|
29
22
|
super
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class Dorsale::Flyboy::Task::Copy < ::Dorsale::Service
|
2
|
+
attr_accessor :task, :copy
|
3
|
+
|
4
|
+
def initialize(task)
|
5
|
+
@task = task
|
6
|
+
end
|
7
|
+
|
8
|
+
def call
|
9
|
+
@copy = @task.dup
|
10
|
+
@copy.reminder_date = nil
|
11
|
+
@copy.reminder_type = nil
|
12
|
+
@copy.term = nil
|
13
|
+
@copy.done = nil
|
14
|
+
@copy.progress = nil
|
15
|
+
@copy.assign_default_values
|
16
|
+
@copy
|
17
|
+
end
|
18
|
+
end
|
@@ -3,10 +3,10 @@
|
|
3
3
|
thead
|
4
4
|
tr
|
5
5
|
th.task_comment-progress
|
6
|
-
= Dorsale::Flyboy::TaskComment.t(:progress)
|
6
|
+
= sortable_column Dorsale::Flyboy::TaskComment.t(:progress), :progress
|
7
7
|
|
8
8
|
th.task_comment-description
|
9
|
-
= Dorsale::Flyboy::TaskComment.t(:description)
|
9
|
+
= sortable_column Dorsale::Flyboy::TaskComment.t(:description), :description
|
10
10
|
|
11
11
|
tbody
|
12
12
|
- if policy(@task).comment?
|
@@ -22,7 +22,7 @@
|
|
22
22
|
input type="submit" value=t("actions.save")
|
23
23
|
|
24
24
|
|
25
|
-
- @
|
25
|
+
- @task_comments.each do |comment|
|
26
26
|
tr.task_comment
|
27
27
|
td.task_comment-progress
|
28
28
|
= progress_bar percentage: comment.progress, label: true
|
@@ -4,7 +4,7 @@
|
|
4
4
|
= " "
|
5
5
|
= task
|
6
6
|
|
7
|
-
.context-body
|
7
|
+
.context-body class=task_color(task)
|
8
8
|
= info task, :progress, progress_bar(percentage: task.progress, label: true)
|
9
9
|
= info task, :owner
|
10
10
|
= info task, :created_at
|
@@ -14,3 +14,9 @@
|
|
14
14
|
|
15
15
|
.context-footer
|
16
16
|
= actions_for task
|
17
|
+
|
18
|
+
- if policy(task).copy?
|
19
|
+
= copy_button copy_flyboy_task_path(task), method: :patch
|
20
|
+
|
21
|
+
- if policy(task).snooze?
|
22
|
+
= snooze_button snooze_flyboy_task_path(task), method: :patch
|
@@ -11,6 +11,8 @@ fr:
|
|
11
11
|
snooze_eror: "Impossible de reporter la tâche"
|
12
12
|
complete_ok: "La tâche a été marquée comme terminée"
|
13
13
|
complete_eror: "Impossible de terminer la tâche"
|
14
|
+
copy_ok: "La tâche a été copiée"
|
15
|
+
copy_ko: "Impossible de copier cette tâche"
|
14
16
|
|
15
17
|
task_mailer:
|
16
18
|
new_task:
|
data/config/routes.rb
CHANGED
data/lib/dorsale/version.rb
CHANGED
@@ -234,6 +234,11 @@ describe Dorsale::Flyboy::TasksController, type: :controller do
|
|
234
234
|
patch :snooze, params: {:id => task.to_param}
|
235
235
|
expect(response).to redirect_to(task)
|
236
236
|
end
|
237
|
+
|
238
|
+
it "is expected to create a task comment" do
|
239
|
+
task = create(:flyboy_task, term: 3.days.ago)
|
240
|
+
expect{patch :snooze, params: {:id => task.to_param}}.to change{Dorsale::Flyboy::TaskComment.count}.by(1)
|
241
|
+
end
|
237
242
|
end
|
238
243
|
|
239
244
|
describe "summary" do
|
@@ -44,5 +44,8 @@ describe ::Dorsale::Flyboy::TasksController, type: :routing do
|
|
44
44
|
expect(delete("flyboy/tasks/1")).to route_to("dorsale/flyboy/tasks#destroy", id: "1")
|
45
45
|
end
|
46
46
|
|
47
|
+
it "routes to #copy" do
|
48
|
+
expect(patch("flyboy/tasks/1/copy")).to route_to("dorsale/flyboy/tasks#copy", id: "1")
|
49
|
+
end
|
47
50
|
end
|
48
51
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require "rails_helper"
|
2
|
+
|
3
|
+
RSpec.describe Dorsale::Flyboy::Task::Copy do
|
4
|
+
let(:task) {
|
5
|
+
create(:flyboy_task, done: true, progress: 50)
|
6
|
+
}
|
7
|
+
|
8
|
+
let(:copy) {
|
9
|
+
copy = Dorsale::Flyboy::Task::Copy.(task)
|
10
|
+
copy.save
|
11
|
+
copy
|
12
|
+
}
|
13
|
+
|
14
|
+
it "is expected to duplicate the whole object" do
|
15
|
+
expect(copy).to be_persisted
|
16
|
+
expect(copy.name).to eq task.name
|
17
|
+
expect(copy.owner).to eq task.owner
|
18
|
+
expect(copy.description).to eq task.description
|
19
|
+
end
|
20
|
+
|
21
|
+
it "is expected to set the progress to 0" do
|
22
|
+
expect(copy.progress).to eq 0
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
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.7.
|
4
|
+
version: 3.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- agilidée
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -636,6 +636,7 @@ files:
|
|
636
636
|
- app/services/dorsale/billing_machine/quotation/statistics.rb
|
637
637
|
- app/services/dorsale/billing_machine/quotation/to_invoice.rb
|
638
638
|
- app/services/dorsale/expense_gun/expense/copy.rb
|
639
|
+
- app/services/dorsale/flyboy/task/copy.rb
|
639
640
|
- app/services/dorsale/flyboy/task/snoozer.rb
|
640
641
|
- app/services/dorsale/service.rb
|
641
642
|
- app/services/dorsale/tag_list_for_model.rb
|
@@ -990,6 +991,7 @@ files:
|
|
990
991
|
- spec/services/dorsale/billing_machine/quotation/statistics.rb
|
991
992
|
- spec/services/dorsale/billing_machine/quotation/to_invoice_spec.rb
|
992
993
|
- spec/services/dorsale/expense_gun/expense/copy_spec.rb
|
994
|
+
- spec/services/dorsale/flyboy/task/copy_spec.rb
|
993
995
|
- spec/services/dorsale/flyboy/task/snoozer_spec.rb
|
994
996
|
- spec/spec_helper.rb
|
995
997
|
- spec/support/devise.rb
|
@@ -1095,6 +1097,7 @@ test_files:
|
|
1095
1097
|
- spec/services/dorsale/billing_machine/quotation/statistics.rb
|
1096
1098
|
- spec/services/dorsale/billing_machine/quotation/to_invoice_spec.rb
|
1097
1099
|
- spec/services/dorsale/expense_gun/expense/copy_spec.rb
|
1100
|
+
- spec/services/dorsale/flyboy/task/copy_spec.rb
|
1098
1101
|
- spec/services/dorsale/flyboy/task/snoozer_spec.rb
|
1099
1102
|
- spec/spec_helper.rb
|
1100
1103
|
- spec/support/devise.rb
|