dorsale 3.14.8 → 3.14.9

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
  SHA256:
3
- metadata.gz: d7fa35a5738f83f5a6ffe07e3357dd0d95e06a1e01e882d79e97a0b103cb6358
4
- data.tar.gz: fae747e4c22a18ae7efc3e683c014a1513d6cf5c798022f45959b053b0338b00
3
+ metadata.gz: c02356f6d8c0cf4484b3c5bbf8ae14b4afb5807b79a836c3ac3def7fe4f0d795
4
+ data.tar.gz: 10e1416b942207884fc2a84665285e6a5ebb9d73fe5d65a69057f89d05ac75fa
5
5
  SHA512:
6
- metadata.gz: cac3603f69fbda59905d4c191af33ede03c001c537ad0e3c387c95429033838e9ec8a10028b350448e7c5be7f69cd19079b847c962e36c01f45b8c3d3545dfd5
7
- data.tar.gz: 95675692f74edd6c555c209857939c84b3628616c2b3cd144a3876c3a264de65c7df972a6daa957ef3d49e6f4efe46f76e23c289c09bd59cd9f57e455792c3a0
6
+ metadata.gz: ad1c5adb07688951372ec42e57c85f9487c06257827dcf0e712ab3a87794c9c9ac5e6fe6ba09115fe3813e55ceba36b56dc871729e5aead840b3815af4a8b3a8
7
+ data.tar.gz: 90da6df14ad83c78ea0abe031686ea1f9cbbdb3750005c669c19f89875b7ea77a9fce70c4bfbdc9dd7f28e28f95b954ef85395c8422b86148c9bbeefffeeed1d
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Next version
4
4
 
5
+ ## 3.14.9
6
+ - Create corporation from individual form
7
+ - Quotations: add draft state
8
+ - Fix carrierwave white lists
9
+
5
10
  ## 3.14.8
6
11
  - Rails 6
7
12
 
@@ -1,4 +1,4 @@
1
- $(document).on "turbolinks:load", ->
1
+ $(document).on "turbolinks:load modal:load", ->
2
2
  $("form:not([action*=filters]) select[multiple][name*=tag]").not(".select2-hidden-accessible").map ->
3
3
  placeholder = $(this).attr("placeholder")
4
4
 
@@ -45,13 +45,19 @@ class Dorsale::CustomerVault::PeopleController < ::Dorsale::CustomerVault::Appli
45
45
 
46
46
  @person ||= scope.new(person_params_for_create)
47
47
 
48
- if @person.save
49
- generate_event!("create")
50
- flash[:notice] = t("messages.#{person_type.to_s.pluralize}.create_ok")
51
- redirect_to back_url
52
- else
48
+ unless @person.save
53
49
  render :new
50
+ return
54
51
  end
52
+
53
+ if request.xhr? && @person.corporation?
54
+ render :create_corporation_js
55
+ return
56
+ end
57
+
58
+ generate_event!("create")
59
+ flash[:notice] = t("messages.#{person_type.to_s.pluralize}.create_ok")
60
+ redirect_to back_url
55
61
  end
56
62
 
57
63
  def show
@@ -1,7 +1,7 @@
1
1
  class Dorsale::BillingMachine::Quotation < ::Dorsale::ApplicationRecord
2
2
  self.table_name = "dorsale_billing_machine_quotations"
3
3
 
4
- STATES = %w(pending accepted refused canceled)
4
+ STATES = %w(draft pending accepted refused canceled)
5
5
 
6
6
  belongs_to :customer, polymorphic: true
7
7
  belongs_to :payment_term
@@ -1,5 +1,5 @@
1
1
  class Dorsale::ImageUploader < ::Dorsale::ApplicationUploader
2
- def extension_white_list
2
+ def extension_whitelist
3
3
  %w(jpg jpeg gif png)
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  class Dorsale::PdfUploader < ::Dorsale::ApplicationUploader
2
- def extension_white_list
2
+ def extension_whitelist
3
3
  %w(pdf)
4
4
  end
5
5
  end
@@ -30,8 +30,16 @@
30
30
 
31
31
  - if @person.individual?
32
32
  = f.input :title
33
- = f.association :corporation, collection: policy_scope(Dorsale::CustomerVault::Corporation), input_html: {class: 'select2'}
33
+ .row.form-group
34
+ = f.label :corporation, class: "control-label col-sm-3"
35
+ .col-sm-9
36
+ div style="display:flex"
37
+ = f.collection_select :corporation_id, policy_scope(Dorsale::CustomerVault::Corporation), :id, :to_s, {include_blank: true}, {class: "select2", style: "width:100%"}
38
+ a.btn.btn-success.btn-xs href=new_customer_vault_corporation_path data-modal="nested" style="margin-left:1em;padding-top:5px"
39
+ = icon(:plus)
40
+
34
41
  = f.input :context, as: :text, input_html: {rows: 4}
42
+
35
43
  .panel.panel-default
36
44
  .panel-heading: .panel-title = t("customer_vault.contact_informations")
37
45
  .panel-body
@@ -0,0 +1,7 @@
1
+ javascript:
2
+ option = document.createElement("option")
3
+ option.value = #{@person.id.to_json.html_safe}
4
+ option.innerHTML = #{@person.to_s.to_json.html_safe}
5
+ option.selected = true
6
+ $("select[id$=corporation_id]").append(option)
7
+ modal.close()
@@ -66,6 +66,7 @@ en:
66
66
 
67
67
  dorsale/billing_machine/quotation/state:
68
68
  all: "All states"
69
+ draft: Draft
69
70
  pending: "Pending"
70
71
  accepted: "Accepted"
71
72
  refused: "Refused"
@@ -66,6 +66,7 @@ fr:
66
66
 
67
67
  dorsale/billing_machine/quotation/state:
68
68
  all: "Tous les états"
69
+ draft: Brouillon
69
70
  pending: "En attente"
70
71
  accepted: "Accepté"
71
72
  refused: "Refusé"
@@ -14,7 +14,7 @@ Feature: Manage individuals
14
14
  And I validate the new individual
15
15
  Then the individual is created
16
16
 
17
- Scenario: New individual without individual
17
+ Scenario: New individual errors
18
18
  When I create an new individual
19
19
  And I fill the address
20
20
  And I validate the new individual
@@ -33,3 +33,11 @@ Feature: Manage individuals
33
33
  And I remove tags to this individual
34
34
  And I submit this individual
35
35
  Then tags are removed
36
+
37
+ Scenario: Create corporation from individual
38
+ When I create an new individual
39
+ And I create corporation from individual
40
+ And I add his first_name, last_name and email
41
+ And I validate the new individual
42
+ Then the individual is created
43
+ And the new corporation is associated to individual
@@ -65,3 +65,14 @@ end
65
65
  When(/^I go on this individual$/) do
66
66
  visit dorsale.customer_vault_individual_path(@individual)
67
67
  end
68
+
69
+ When("I create corporation from individual") do
70
+ find("a[href*=corporation][href$=new]").click
71
+ fill_in :person_corporation_name, with: "agilidée"
72
+ find("#modal [type=submit]").click
73
+ end
74
+
75
+ Then("the new corporation is associated to individual") do
76
+ expect(@individual.corporation).to be_present
77
+ expect(@individual.corporation.name).to eq "agilidée"
78
+ end
@@ -1,3 +1,3 @@
1
1
  module Dorsale
2
- VERSION = "3.14.8"
2
+ VERSION = "3.14.9"
3
3
  end
@@ -36,7 +36,7 @@ describe Dorsale::BillingMachine::Quotation do
36
36
  end
37
37
 
38
38
  it "default state should be pending" do
39
- expect(described_class.new.state).to eq "pending"
39
+ expect(described_class.new.state).to eq "draft"
40
40
  end
41
41
  end
42
42
 
@@ -50,6 +50,6 @@ RSpec.describe Dorsale::BillingMachine::Quotation::Copy do
50
50
 
51
51
  it "should reset state to pending" do
52
52
  expect(quotation.reload.state).to eq "canceled"
53
- expect(copy.reload.state).to eq "pending"
53
+ expect(copy.reload.state).to eq "draft"
54
54
  end
55
55
  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.14.8
4
+ version: 3.14.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - agilidée
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-11 00:00:00.000000000 Z
11
+ date: 2020-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -714,6 +714,7 @@ files:
714
714
  - app/views/dorsale/customer_vault/people/_list_item.html.slim
715
715
  - app/views/dorsale/customer_vault/people/_show_layout.html.slim
716
716
  - app/views/dorsale/customer_vault/people/_show_tabs.html.slim
717
+ - app/views/dorsale/customer_vault/people/create_corporation_js.html.slim
717
718
  - app/views/dorsale/customer_vault/people/edit.html.slim
718
719
  - app/views/dorsale/customer_vault/people/index.html.slim
719
720
  - app/views/dorsale/customer_vault/people/index.xlsx.ruby
@@ -973,7 +974,7 @@ homepage: https://github.com/agilidee/dorsale
973
974
  licenses:
974
975
  - Nonstandard
975
976
  metadata: {}
976
- post_install_message:
977
+ post_install_message:
977
978
  rdoc_options: []
978
979
  require_paths:
979
980
  - lib
@@ -989,7 +990,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
989
990
  version: '0'
990
991
  requirements: []
991
992
  rubygems_version: 3.0.3
992
- signing_key:
993
+ signing_key:
993
994
  specification_version: 4
994
995
  summary: Modular ERP made with Ruby on Rails
995
996
  test_files: