dorsale 3.9.7 → 3.9.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 19154c764ac2dbbf08f847870a9e25551c745ea0
4
- data.tar.gz: 401461784af4a331967feb30e8769623584ec539
3
+ metadata.gz: 92313d3e11ca03d76f1153193497dd581e8cf4ad
4
+ data.tar.gz: 4e9f7171df37fff5047abecf671cd2408affb103
5
5
  SHA512:
6
- metadata.gz: cd9a9eba500e6e8d9941029c64cffca4b7165bad1f63b922e4a6297243df75e26759a305cd3799d31252cd869b5d430624142fef1461dcc4af7de162c7ce9caa
7
- data.tar.gz: ece4ad04640bfeddd6b406a00233752b9c58c539952dcb74152346beb41976ea3b2fcd0dbcae21b21984d061063cb4a90724b1bde9c7579998bd30e2f1151103
6
+ metadata.gz: e836be0347fe2fafd0bfedc565599c89ab786f58dc665ac923489cb900aaad73e5b34c9b06e4a8fff1681181ac3a81591315c9734ee424455ebb536da0380ed2
7
+ data.tar.gz: 3a377cbad257367addc9a05df944d4e22608001ba8ec15624efedabb023519879e0f7160ea73032d9f30be59cf3e512cc48528deee29726a37de6c7457524835
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Next version
4
4
 
5
+ ## 3.9.8
6
+
7
+ - Tasks : add increment progress buttons
8
+ - Tasks : small improvements
9
+
5
10
  ## 3.9.7
6
11
 
7
12
  - Attachments : refactor + sorting
@@ -1,6 +1,6 @@
1
1
  class Dorsale::BillingMachine::SmallData::FilterForInvoices < ::Agilibox::SmallData::Filter
2
2
  STRATEGIES = {
3
- "bm_time_period" => ::Agilibox::SmallData::FilterStrategyByTimePeriod.new(:date),
3
+ "bm_time_period" => ::Agilibox::SmallData::FilterStrategyByDatePeriod.new(:date),
4
4
  "bm_date_begin" => ::Agilibox::SmallData::FilterStrategyByDateBegin.new(:date),
5
5
  "bm_date_end" => ::Agilibox::SmallData::FilterStrategyByDateEnd.new(:date),
6
6
  "bm_customer_guid" => ::Dorsale::BillingMachine::SmallData::FilterStrategyByCustomer.new,
@@ -1,6 +1,6 @@
1
1
  class Dorsale::BillingMachine::SmallData::FilterForQuotations < ::Agilibox::SmallData::Filter
2
2
  STRATEGIES = {
3
- "bm_time_period" => ::Agilibox::SmallData::FilterStrategyByTimePeriod.new(:date),
3
+ "bm_time_period" => ::Agilibox::SmallData::FilterStrategyByDatePeriod.new(:date),
4
4
  "bm_date_begin" => ::Agilibox::SmallData::FilterStrategyByDateBegin.new(:date),
5
5
  "bm_date_end" => ::Agilibox::SmallData::FilterStrategyByDateEnd.new(:date),
6
6
  "bm_customer_guid" => ::Dorsale::BillingMachine::SmallData::FilterStrategyByCustomer.new,
@@ -65,7 +65,7 @@ class Dorsale::CustomerVault::Person < ::Dorsale::ApplicationRecord
65
65
  def validate_taken_emails
66
66
  return if taken_emails.empty?
67
67
 
68
- if taken_emails.keys.include?(email)
68
+ if taken_emails.key?(email)
69
69
  errors.add(:email, :taken)
70
70
  end
71
71
 
@@ -1,2 +1,9 @@
1
1
  module Dorsale::Flyboy
2
+ class << self
3
+ attr_writer :progress_increment_buttons
4
+
5
+ def progress_increment_buttons
6
+ @progress_increment_buttons ||= [5, 10, 25, 50]
7
+ end
8
+ end
2
9
  end
@@ -93,7 +93,7 @@ module Dorsale::PrawnHelpers
93
93
  if ApplicationUploader.storage.to_s.end_with?("File") # Local
94
94
  obj.path
95
95
  elsif ApplicationUploader.storage.to_s.end_with?("Fog") # Amazon S3
96
- open(obj.url)
96
+ URI.parse(obj.url).open
97
97
  else
98
98
  raise NotImplementedError
99
99
  end
@@ -2,6 +2,7 @@
2
2
  tr#new_task_comment_tr
3
3
  td.task_comment-progress
4
4
  = f.input :progress, label: false
5
+ = render "dorsale/flyboy/task_comments/increment_buttons"
5
6
 
6
7
  td.task_comment-content
7
8
  = f.hidden_field :task_id
@@ -0,0 +1,16 @@
1
+ .task_comment-increment-buttons.text-center
2
+ - Dorsale::Flyboy.progress_increment_buttons.each do |value|
3
+ button.btn.btn-xs.increment type="button" data-value=value
4
+ = "+" if value.positive?
5
+ = "-" if value.negative?
6
+ = value.abs
7
+
8
+ coffee:
9
+ $("button.increment").click ->
10
+ current = parseInt $("#task_comment_progress").val()
11
+ increment = parseInt this.dataset.value
12
+ newValue = current + increment
13
+ newValue = 0 if newValue < 0
14
+ newValue = 100 if newValue > 100
15
+ $("#task_comment_progress").val(newValue)
16
+ $(this).blur()
@@ -8,6 +8,10 @@
8
8
  th.task_comment-description
9
9
  = sortable_column Dorsale::Flyboy::TaskComment.t(:description), :description
10
10
 
11
+ - if policy(@task).complete?
12
+ .pull-right = complete_button complete_flyboy_task_path(task)
13
+
14
+
11
15
  tbody
12
16
  - if params[:sort] != "date"
13
17
  = render "dorsale/flyboy/task_comments/form", f: f
@@ -0,0 +1,10 @@
1
+ = actions_for task
2
+
3
+ - if policy(task).copy?
4
+ = copy_button copy_flyboy_task_path(task)
5
+
6
+ - if policy(task).snooze?
7
+ = snooze_button snooze_flyboy_task_path(task), method: :patch
8
+
9
+ - if policy(task).complete?
10
+ = complete_button complete_flyboy_task_path(task)
@@ -14,10 +14,4 @@
14
14
  = info task, :done
15
15
 
16
16
  .context-footer
17
- = actions_for task
18
-
19
- - if policy(task).copy?
20
- = copy_button copy_flyboy_task_path(task), method: :patch
21
-
22
- - if policy(task).snooze?
23
- = snooze_button snooze_flyboy_task_path(task), method: :patch
17
+ = render "dorsale/flyboy/tasks/actions", task: task
@@ -11,7 +11,7 @@ data = [
11
11
  @tasks_without_pagination.each do |task|
12
12
  data << [
13
13
  task.taskable.to_s,
14
- (task.taskable.class.t if task.taskable),
14
+ task.taskable&.class&.t,
15
15
  task.name,
16
16
  percentage(task.progress),
17
17
  date(task.term),
data/config/routes.rb CHANGED
@@ -21,7 +21,7 @@ Dorsale::Engine.routes.draw do
21
21
  member do
22
22
  patch :complete
23
23
  patch :snooze
24
- patch :copy
24
+ get :copy
25
25
  end
26
26
  end
27
27
 
@@ -258,4 +258,4 @@ Feature: Invoice Management
258
258
  Scenario: Invoices data
259
259
  Given existing "100" invoices with "123" amount
260
260
  When the user goes to the invoices page
261
- Then data total amount is "12 300"
261
+ Then data total amount is "12 300"
@@ -190,4 +190,4 @@ Feature: Quotation Management
190
190
  Scenario: Quotations data
191
191
  Given existing "100" quotations with "123" amount
192
192
  When the user goes to the quotations page
193
- Then data total amount is "12 300"
193
+ Then data total amount is "12 300"
@@ -10,3 +10,12 @@ Feature: Manage task comments
10
10
  And I create a new task comment
11
11
  Then I am on this task
12
12
  And the task comment is created
13
+
14
+ Scenario: Increment task comment progress JS
15
+ Given an existing task
16
+ When I go to the tasks section
17
+ And I consult this task
18
+ And I fill "task_comment_progress" with "0"
19
+ Then "task_comment_progress" has value "0"
20
+ When I click on "+5"
21
+ Then "task_comment_progress" has value "5"
@@ -182,7 +182,7 @@ Then(/^he should see (\d+) invoices?$/) do |count|
182
182
  end
183
183
 
184
184
  Then(/^the invoice is displayed correctly$/) do
185
- expect(page).to have_selector ".tracking_id", @invoice.tracking_id
185
+ expect(page).to have_selector ".tracking_id", text: @invoice.tracking_id
186
186
  end
187
187
 
188
188
  Then(/^the total excluding taxes is "(.*?)"$/) do |total|
@@ -303,7 +303,7 @@ Then(/^a new invoice is displayed with the informations$/) do
303
303
  end
304
304
 
305
305
  Then(/^he can see all the informations$/) do
306
- expect(page).to have_selector ".invoice-label", @invoice.label
306
+ expect(page).to have_selector ".invoice-label", text: @invoice.label
307
307
  end
308
308
 
309
309
  Then(/^only the invoices of this customer do appear$/) do
@@ -141,9 +141,7 @@ Then(/^I am on the created quotation$/) do
141
141
  end
142
142
 
143
143
  Then(/^he can see all the quotation informations$/) do
144
- expect(page).to have_selector ".quotation-label", @quotation.label
145
-
146
- expect(page).to have_selector ".quotation-expires_at", "21/12/2012"
144
+ expect(page).to have_selector ".quotation-label", text: @quotation.label
147
145
  end
148
146
 
149
147
  Then(/^the quotation default date is set to today's date\.$/) do
@@ -155,7 +153,7 @@ Then(/^he should see (\d+) quotations?$/) do |arg1|
155
153
  end
156
154
 
157
155
  Then(/^the quotation is displayed correctly$/) do
158
- expect(page).to have_selector ".tracking_id", @quotation.tracking_id
156
+ expect(page).to have_selector ".tracking_id", text: @quotation.tracking_id
159
157
  end
160
158
 
161
159
  Then(/^a message signals the success of the quotation creation$/) do
@@ -84,3 +84,7 @@ end
84
84
  Then(/^I see "([^"]*)" element$/) do |element_selector|
85
85
  expect(page).to have_selector element_selector
86
86
  end
87
+
88
+ When("I click on {string}") do |text|
89
+ click_on text
90
+ end
@@ -1,4 +1,3 @@
1
-
2
1
  Given(/^an existing corporation$/) do
3
2
  @corporation = create(:customer_vault_corporation)
4
3
  @person = @corporation
@@ -1,7 +1,8 @@
1
- ENV["RAILS_ROOT"] ||= File.expand_path("../../../spec/dummy", __FILE__)
1
+ ENV["RAILS_ROOT"] ||= File.expand_path("../../spec/dummy", __dir__)
2
2
  require "cucumber/rails"
3
3
  require "agilibox/cucumber_config"
4
4
  def Zonebie.set_random_timezone
5
5
  # https://github.com/agilidee/dorsale/issues/273
6
6
  end
7
7
  Agilibox::CucumberConfig.require_all_helpers!
8
+ Agilibox::CucumberConfig.require_poltergeist!
@@ -1,3 +1,3 @@
1
1
  module Dorsale
2
- VERSION = "3.9.7"
2
+ VERSION = "3.9.8"
3
3
  end
@@ -45,7 +45,7 @@ describe ::Dorsale::Flyboy::TasksController, type: :routing do
45
45
  end
46
46
 
47
47
  it "routes to #copy" do
48
- expect(patch("flyboy/tasks/1/copy")).to route_to("dorsale/flyboy/tasks#copy", id: "1")
48
+ expect(get("flyboy/tasks/1/copy")).to route_to("dorsale/flyboy/tasks#copy", id: "1")
49
49
  end
50
50
  end
51
51
  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.9.7
4
+ version: 3.9.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - agilidée
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-07 00:00:00.000000000 Z
11
+ date: 2018-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -776,10 +776,12 @@ files:
776
776
  - app/views/dorsale/expense_gun/expenses/new.html.slim
777
777
  - app/views/dorsale/expense_gun/expenses/show.html.slim
778
778
  - app/views/dorsale/flyboy/task_comments/_form.html.slim
779
+ - app/views/dorsale/flyboy/task_comments/_increment_buttons.html.slim
779
780
  - app/views/dorsale/flyboy/task_comments/_list.html.slim
780
781
  - app/views/dorsale/flyboy/task_comments/_task_comment.html.slim
781
782
  - app/views/dorsale/flyboy/task_mailer/new_task.html.slim
782
783
  - app/views/dorsale/flyboy/task_mailer/term_email.html.slim
784
+ - app/views/dorsale/flyboy/tasks/_actions.html.slim
783
785
  - app/views/dorsale/flyboy/tasks/_context.html.slim
784
786
  - app/views/dorsale/flyboy/tasks/_filters.html.slim
785
787
  - app/views/dorsale/flyboy/tasks/_form.html.slim