dorsale 3.7.2 → 3.7.4
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 +15 -0
- data/app/assets/javascripts/dorsale/common/comments.coffee +2 -2
- data/app/controllers/dorsale/customer_vault/events_controller.rb +18 -0
- data/app/controllers/dorsale/customer_vault/people_controller.rb +1 -8
- data/app/controllers/dorsale/flyboy/tasks_controller.rb +8 -5
- data/app/filters/dorsale/customer_vault/small_data/filter_for_events.rb +5 -0
- data/app/helpers/dorsale/comments_helper.rb +1 -1
- data/app/helpers/dorsale/customer_vault/application_helper.rb +7 -0
- data/app/models/dorsale/application_record.rb +1 -1
- data/app/models/dorsale/customer_vault/event.rb +1 -6
- data/app/models/dorsale/customer_vault/person.rb +8 -1
- data/app/policies/dorsale/customer_vault/event_policy_helper.rb +3 -2
- data/app/views/dorsale/customer_vault/events/_filters.html.slim +2 -0
- data/app/views/dorsale/customer_vault/{people/activity.slim → events/index.html.slim} +4 -1
- data/app/views/dorsale/customer_vault/people/_index_tabs.html.slim +3 -3
- data/app/views/dorsale/customer_vault/people/_show_tabs.html.slim +1 -1
- data/config/locales/customer_vault.en.yml +8 -4
- data/config/locales/customer_vault.fr.yml +8 -4
- data/config/routes.rb +1 -3
- data/db/migrate/20170915070538_dorsale_customer_vault_events_add_text.rb +8 -0
- data/features/step_definitions/customer_vault_corporations_steps.rb +1 -1
- data/lib/dorsale/version.rb +1 -1
- data/spec/controllers/dorsale/comments_controller_spec.rb +13 -0
- data/spec/controllers/dorsale/customer_vault/events_controller_spec.rb +42 -0
- data/spec/controllers/dorsale/customer_vault/people_controller_spec.rb +1 -15
- data/spec/models/dorsale/customer_vault/event_spec.rb +1 -1
- data/spec/models/dorsale/customer_vault/person_spec.rb +6 -0
- data/spec/routing/dorsale/customer_vault/events_routing_spec.rb +12 -0
- data/spec/routing/dorsale/customer_vault/people_routing_spec.rb +0 -5
- metadata +13 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b0894fffed18b6a992d19d31f7e07b37a15988cf
|
|
4
|
+
data.tar.gz: 6469c9e20f4f12edc13f070e4f3f599f6f44aedb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 81e5992cd8182154c49b12e1c0f14f9d9985871b1509ae1d0fd9180e1f59515640a0bb1cb7fb02d2cfaa4ff123fb86a2e853ee24fe010742c79cb9f18e68e34f
|
|
7
|
+
data.tar.gz: cf161f045d9c3db79530b6babc7a52f3185045461668913173c2754ac947625278299010bbe589c57e17b7a6ffec5e52bcab52510574611d2465cbba2322e4c1
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Next version
|
|
4
|
+
|
|
5
|
+
## 3.7.4
|
|
6
|
+
|
|
7
|
+
- Change nilify_blanks config
|
|
8
|
+
- CustomerVault Events : persist text
|
|
9
|
+
- CustomerVault : delete event when deleting comment
|
|
10
|
+
- Comments : fix double comments JS
|
|
11
|
+
- CustomerVault : do not validate events author
|
|
12
|
+
- CustomerVault : move PeopleController#activity to EventsController#index
|
|
13
|
+
- CustomerVault : add events filters
|
|
14
|
+
|
|
15
|
+
## 3.7.3
|
|
16
|
+
- Fix copy action
|
|
17
|
+
|
|
3
18
|
## 3.7.2
|
|
4
19
|
- Add sorting for task comments
|
|
5
20
|
- Add copy for tasks
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
class Dorsale::CustomerVault::EventsController < ::Dorsale::CustomerVault::ApplicationController
|
|
2
|
+
def index
|
|
3
|
+
authorize model, :list?
|
|
4
|
+
|
|
5
|
+
@events ||= scope.all
|
|
6
|
+
|
|
7
|
+
@filters ||= ::Dorsale::CustomerVault::SmallData::FilterForEvents.new(filters_jar)
|
|
8
|
+
@events = @filters.apply(@events)
|
|
9
|
+
|
|
10
|
+
@events = @events.page(params[:page]).per(50)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
private
|
|
14
|
+
|
|
15
|
+
def model
|
|
16
|
+
Dorsale::CustomerVault::Event
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -31,14 +31,6 @@ class Dorsale::CustomerVault::PeopleController < ::Dorsale::CustomerVault::Appli
|
|
|
31
31
|
render :index
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
-
def activity
|
|
35
|
-
authorize model, :list?
|
|
36
|
-
|
|
37
|
-
@events ||= policy_scope(::Dorsale::CustomerVault::Event)
|
|
38
|
-
|
|
39
|
-
@events = @events.page(params[:page]).per(50)
|
|
40
|
-
end
|
|
41
|
-
|
|
42
34
|
def new
|
|
43
35
|
authorize model, :create?
|
|
44
36
|
|
|
@@ -213,6 +205,7 @@ class Dorsale::CustomerVault::PeopleController < ::Dorsale::CustomerVault::Appli
|
|
|
213
205
|
:author => current_user,
|
|
214
206
|
:person => @person,
|
|
215
207
|
:action => action,
|
|
208
|
+
:text => ::Dorsale::CustomerVault::Event.t("text.#{action}")
|
|
216
209
|
)
|
|
217
210
|
end
|
|
218
211
|
|
|
@@ -11,6 +11,14 @@ class Dorsale::Flyboy::TasksController < ::Dorsale::Flyboy::ApplicationControlle
|
|
|
11
11
|
:copy,
|
|
12
12
|
]
|
|
13
13
|
|
|
14
|
+
before_action :set_owners, only: [
|
|
15
|
+
:new,
|
|
16
|
+
:create,
|
|
17
|
+
:edit,
|
|
18
|
+
:update,
|
|
19
|
+
:copy,
|
|
20
|
+
]
|
|
21
|
+
|
|
14
22
|
def index
|
|
15
23
|
authorize model, :list?
|
|
16
24
|
|
|
@@ -72,8 +80,6 @@ class Dorsale::Flyboy::TasksController < ::Dorsale::Flyboy::ApplicationControlle
|
|
|
72
80
|
@task.owner ||= current_user
|
|
73
81
|
@task.taskable_guid = params[:taskable_guid]
|
|
74
82
|
|
|
75
|
-
set_owners
|
|
76
|
-
|
|
77
83
|
authorize @task, :create?
|
|
78
84
|
end
|
|
79
85
|
|
|
@@ -87,7 +93,6 @@ class Dorsale::Flyboy::TasksController < ::Dorsale::Flyboy::ApplicationControlle
|
|
|
87
93
|
notify_owner(current_user, @task)
|
|
88
94
|
redirect_to back_url
|
|
89
95
|
else
|
|
90
|
-
set_owners
|
|
91
96
|
render :new
|
|
92
97
|
end
|
|
93
98
|
end
|
|
@@ -95,7 +100,6 @@ class Dorsale::Flyboy::TasksController < ::Dorsale::Flyboy::ApplicationControlle
|
|
|
95
100
|
def edit
|
|
96
101
|
authorize @task, :update?
|
|
97
102
|
|
|
98
|
-
set_owners
|
|
99
103
|
end
|
|
100
104
|
|
|
101
105
|
def update
|
|
@@ -105,7 +109,6 @@ class Dorsale::Flyboy::TasksController < ::Dorsale::Flyboy::ApplicationControlle
|
|
|
105
109
|
flash[:success] = t("messages.tasks.update_ok")
|
|
106
110
|
redirect_to back_url
|
|
107
111
|
else
|
|
108
|
-
set_owners
|
|
109
112
|
render :edit
|
|
110
113
|
end
|
|
111
114
|
end
|
|
@@ -39,4 +39,11 @@ module Dorsale::CustomerVault::ApplicationHelper
|
|
|
39
39
|
def person_related_people_blank?(person)
|
|
40
40
|
person.individuals.empty?
|
|
41
41
|
end
|
|
42
|
+
|
|
43
|
+
def customer_vault_event_actions_for_filter_select
|
|
44
|
+
model = Dorsale::CustomerVault::Event
|
|
45
|
+
model::ACTIONS.map do |action|
|
|
46
|
+
[model.t("action.#{action}"), action]
|
|
47
|
+
end
|
|
48
|
+
end
|
|
42
49
|
end
|
|
@@ -7,9 +7,8 @@ class Dorsale::CustomerVault::Event < ::Dorsale::ApplicationRecord
|
|
|
7
7
|
belongs_to :person, class_name: Dorsale::CustomerVault::Person
|
|
8
8
|
belongs_to :comment, class_name: Dorsale::Comment
|
|
9
9
|
|
|
10
|
-
validates :author, presence: true
|
|
11
10
|
validates :person, presence: true
|
|
12
|
-
validates :action, presence: true, inclusion: {in: ACTIONS}
|
|
11
|
+
validates :action, presence: true, inclusion: {in: proc {ACTIONS} }
|
|
13
12
|
validates :comment, presence: true, if: proc { action == "comment" }
|
|
14
13
|
|
|
15
14
|
default_scope -> {
|
|
@@ -21,8 +20,4 @@ class Dorsale::CustomerVault::Event < ::Dorsale::ApplicationRecord
|
|
|
21
20
|
def date
|
|
22
21
|
created_at.try(:to_date)
|
|
23
22
|
end
|
|
24
|
-
|
|
25
|
-
def text
|
|
26
|
-
t("text.#{action}")
|
|
27
|
-
end
|
|
28
23
|
end
|
|
@@ -36,6 +36,8 @@ class Dorsale::CustomerVault::Person < ::Dorsale::ApplicationRecord
|
|
|
36
36
|
order("LOWER(COALESCE(corporation_name, '') || COALESCE(last_name, '') || COALESCE(first_name, '')) ASC")
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
after_initialize :build_address, unless: :address
|
|
40
|
+
|
|
39
41
|
def person_type
|
|
40
42
|
self.class.to_s.demodulize.downcase.to_sym
|
|
41
43
|
end
|
|
@@ -71,8 +73,9 @@ class Dorsale::CustomerVault::Person < ::Dorsale::ApplicationRecord
|
|
|
71
73
|
end
|
|
72
74
|
|
|
73
75
|
def receive_comment_notification(comment, action)
|
|
76
|
+
scope = Pundit.policy_scope!(comment.author, ::Dorsale::CustomerVault::Event)
|
|
77
|
+
|
|
74
78
|
if action == :create
|
|
75
|
-
scope = Pundit.policy_scope!(comment.author, ::Dorsale::CustomerVault::Event)
|
|
76
79
|
scope.create!(
|
|
77
80
|
:author => comment.author,
|
|
78
81
|
:person => self,
|
|
@@ -80,6 +83,10 @@ class Dorsale::CustomerVault::Person < ::Dorsale::ApplicationRecord
|
|
|
80
83
|
:action => "comment",
|
|
81
84
|
)
|
|
82
85
|
end
|
|
86
|
+
|
|
87
|
+
if action == :delete
|
|
88
|
+
scope.where(comment: comment).destroy_all
|
|
89
|
+
end
|
|
83
90
|
end
|
|
84
91
|
|
|
85
92
|
end
|
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
- content_for :title
|
|
3
3
|
= icon(:comments)
|
|
4
4
|
= " "
|
|
5
|
-
=
|
|
5
|
+
= Dorsale::CustomerVault::Event.ts
|
|
6
6
|
|
|
7
7
|
- content_for :actions
|
|
8
8
|
= render "dorsale/customer_vault/people/index_actions"
|
|
9
9
|
|
|
10
|
+
- content_for :filters
|
|
11
|
+
= render "dorsale/customer_vault/events/filters"
|
|
12
|
+
|
|
10
13
|
- content_for :page_header
|
|
11
14
|
= render "dorsale/customer_vault/people/index_tabs"
|
|
12
15
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.index-tabs-container
|
|
2
2
|
= nav class: "index-tabs" do
|
|
3
|
-
= link_to
|
|
4
|
-
= link_to Dorsale::CustomerVault::Person.ts,
|
|
3
|
+
= link_to Dorsale::CustomerVault::Event.ts, dorsale.customer_vault_events_path
|
|
4
|
+
= link_to Dorsale::CustomerVault::Person.ts, dorsale.customer_vault_people_path
|
|
5
5
|
|
|
6
|
-
= search_form action:
|
|
6
|
+
= search_form action: dorsale.customer_vault_people_path
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.nav.nav-tabs#person-tabs
|
|
2
2
|
li class=("active" if request.path == dorsale.customer_vault_person_path(@person))
|
|
3
3
|
a href=dorsale.customer_vault_person_path(@person)
|
|
4
|
-
=
|
|
4
|
+
= Dorsale::CustomerVault::Event.ts
|
|
5
5
|
= " "
|
|
6
6
|
span.badge = @person.comments.count
|
|
7
7
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
en:
|
|
2
2
|
customer_vault:
|
|
3
3
|
name: "Directory"
|
|
4
|
-
activity: "Activity"
|
|
5
4
|
identity_informations: "Identity informations"
|
|
6
5
|
contact_informations: "Contact informations"
|
|
7
6
|
address_informations: "Address informations"
|
|
@@ -67,8 +66,8 @@ en:
|
|
|
67
66
|
one: "Link"
|
|
68
67
|
other: "Links"
|
|
69
68
|
dorsale/customer_vault/event:
|
|
70
|
-
one: "
|
|
71
|
-
other: "
|
|
69
|
+
one: "Activity"
|
|
70
|
+
other: "Activity"
|
|
72
71
|
dorsale/customer_vault/origin:
|
|
73
72
|
one: "Origin"
|
|
74
73
|
other: "Origin"
|
|
@@ -108,9 +107,14 @@ en:
|
|
|
108
107
|
alice: "Person"
|
|
109
108
|
bob: "Person"
|
|
110
109
|
dorsale/customer_vault/event:
|
|
111
|
-
action: "
|
|
110
|
+
action: "Activity type"
|
|
112
111
|
person: "Person"
|
|
113
112
|
authored_by: "by"
|
|
113
|
+
all_actions: "All types"
|
|
114
|
+
dorsale/customer_vault/event/action:
|
|
115
|
+
create: "Create"
|
|
116
|
+
update: "Update"
|
|
117
|
+
comment: "Comment"
|
|
114
118
|
dorsale/customer_vault/event/text:
|
|
115
119
|
create: "Creation of the person"
|
|
116
120
|
update: "Update person informations"
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
fr:
|
|
2
2
|
customer_vault:
|
|
3
3
|
name: "Annuaire"
|
|
4
|
-
activity: "Activité"
|
|
5
4
|
identity_informations: "Identité"
|
|
6
5
|
contact_informations: "Cordonnées"
|
|
7
6
|
address_informations: "Adresse"
|
|
@@ -67,8 +66,8 @@ fr:
|
|
|
67
66
|
one: "Lien"
|
|
68
67
|
other: "Liens"
|
|
69
68
|
dorsale/customer_vault/event:
|
|
70
|
-
one: "
|
|
71
|
-
other: "
|
|
69
|
+
one: "Activité"
|
|
70
|
+
other: "Activité"
|
|
72
71
|
dorsale/customer_vault/origin:
|
|
73
72
|
one: "Origine du contact"
|
|
74
73
|
other: "Origines du contact"
|
|
@@ -107,9 +106,14 @@ fr:
|
|
|
107
106
|
alice: "Personne"
|
|
108
107
|
bob: "Personne"
|
|
109
108
|
dorsale/customer_vault/event:
|
|
110
|
-
action: "
|
|
109
|
+
action: "Type d'activité"
|
|
111
110
|
person: "Personne"
|
|
112
111
|
authored_by: "par"
|
|
112
|
+
all_actions: "Tous les types"
|
|
113
|
+
dorsale/customer_vault/event/action:
|
|
114
|
+
create: "Création"
|
|
115
|
+
update: "Modification"
|
|
116
|
+
comment: "Commentaire"
|
|
113
117
|
dorsale/customer_vault/event/text:
|
|
114
118
|
create: "Création de la personne"
|
|
115
119
|
update: "Mise à jour des informations de la personne"
|
data/config/routes.rb
CHANGED
|
@@ -58,9 +58,7 @@ Dorsale::Engine.routes.draw do
|
|
|
58
58
|
resources :activity_types, except: [:destroy, :show]
|
|
59
59
|
resources :origins, except: [:destroy, :show]
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
get :activity
|
|
63
|
-
end
|
|
61
|
+
resources :events, only: [:index]
|
|
64
62
|
|
|
65
63
|
resources :people do
|
|
66
64
|
resources :links
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
class DorsaleCustomerVaultEventsAddText < ActiveRecord::Migration[5.0]
|
|
2
|
+
def change
|
|
3
|
+
add_column :dorsale_customer_vault_events, :text, :text
|
|
4
|
+
model = Dorsale::CustomerVault::Event
|
|
5
|
+
model.where(action: "create").update_all(text: model.t("text.create"))
|
|
6
|
+
model.where(action: "update").update_all(text: model.t("text.update"))
|
|
7
|
+
end
|
|
8
|
+
end
|
|
@@ -116,7 +116,7 @@ Given(/^an existing corporation with recent comments$/) do
|
|
|
116
116
|
end
|
|
117
117
|
|
|
118
118
|
When(/^I go on the people activity$/) do
|
|
119
|
-
visit dorsale.
|
|
119
|
+
visit dorsale.customer_vault_events_path
|
|
120
120
|
end
|
|
121
121
|
|
|
122
122
|
Then(/^I see all these comments$/) do
|
data/lib/dorsale/version.rb
CHANGED
|
@@ -60,5 +60,18 @@ describe Dorsale::CommentsController, type: :controller do
|
|
|
60
60
|
delete :destroy, params: {id: comment, back_url: "/"}
|
|
61
61
|
expect(response).to redirect_to("/")
|
|
62
62
|
end
|
|
63
|
+
|
|
64
|
+
describe "on person" do
|
|
65
|
+
it "should delete event" do
|
|
66
|
+
person = create(:customer_vault_corporation)
|
|
67
|
+
comment = create(:dorsale_comment, commentable: person)
|
|
68
|
+
event = create(:customer_vault_event, person: person, comment: comment, action: "comment")
|
|
69
|
+
|
|
70
|
+
delete :destroy, params: {id: comment}
|
|
71
|
+
|
|
72
|
+
expect { comment.reload }.to raise_error(ActiveRecord::RecordNotFound)
|
|
73
|
+
expect { event.reload }.to raise_error(ActiveRecord::RecordNotFound)
|
|
74
|
+
end
|
|
75
|
+
end # describe "on person"
|
|
63
76
|
end
|
|
64
77
|
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
require "rails_helper"
|
|
2
|
+
|
|
3
|
+
describe ::Dorsale::CustomerVault::EventsController, type: :controller do
|
|
4
|
+
routes { Dorsale::Engine.routes }
|
|
5
|
+
|
|
6
|
+
let(:user) { create(:user) }
|
|
7
|
+
|
|
8
|
+
before(:each) { sign_in(user) }
|
|
9
|
+
|
|
10
|
+
describe "#filters" do
|
|
11
|
+
before do
|
|
12
|
+
@event_1 = create(:customer_vault_event, action: "create")
|
|
13
|
+
@event_2 = create(:customer_vault_event, action: "update")
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it "should filter by event_action" do
|
|
17
|
+
cookies[:filters] = {event_action: "create"}.to_json
|
|
18
|
+
get :index
|
|
19
|
+
expect(assigns(:events)).to eq [@event_1]
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it "should filter by multiple event_action" do
|
|
23
|
+
cookies[:filters] = {event_action: "create update"}.to_json
|
|
24
|
+
get :index
|
|
25
|
+
expect(assigns(:events)).to contain_exactly(@event_1, @event_2)
|
|
26
|
+
end
|
|
27
|
+
end # describe "#filters"
|
|
28
|
+
|
|
29
|
+
describe "#index" do
|
|
30
|
+
before do
|
|
31
|
+
@corporation_1 = create(:customer_vault_corporation)
|
|
32
|
+
@corporation_2 = create(:customer_vault_corporation)
|
|
33
|
+
@event_1 = create(:customer_vault_event, person: @corporation_1, created_at: "2012-02-15")
|
|
34
|
+
@event_2 = create(:customer_vault_event, person: @corporation_2, created_at: "2012-03-15")
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
it "should assigns all events ordered by created_at DESC" do
|
|
38
|
+
get :index
|
|
39
|
+
expect(assigns(:events)).to eq [@event_2, @event_1]
|
|
40
|
+
end
|
|
41
|
+
end # describe "#index"
|
|
42
|
+
end
|
|
@@ -77,7 +77,7 @@ RSpec.describe ::Dorsale::CustomerVault::PeopleController, type: :controller do
|
|
|
77
77
|
|
|
78
78
|
get :index
|
|
79
79
|
|
|
80
|
-
expect(assigns(:people)).to
|
|
80
|
+
expect(assigns(:people)).to contain_exactly(corpo1, individual)
|
|
81
81
|
end
|
|
82
82
|
end # describe "filters"
|
|
83
83
|
|
|
@@ -92,20 +92,6 @@ RSpec.describe ::Dorsale::CustomerVault::PeopleController, type: :controller do
|
|
|
92
92
|
end # describe "search"
|
|
93
93
|
end # describe "#list"
|
|
94
94
|
|
|
95
|
-
describe "#activity" do
|
|
96
|
-
before do
|
|
97
|
-
@corporation_1 = create(:customer_vault_corporation)
|
|
98
|
-
@corporation_2 = create(:customer_vault_corporation)
|
|
99
|
-
@event_1 = create(:customer_vault_event, person: @corporation_1, created_at: "2012-02-15")
|
|
100
|
-
@event_2 = create(:customer_vault_event, person: @corporation_2, created_at: "2012-03-15")
|
|
101
|
-
end
|
|
102
|
-
|
|
103
|
-
it "should assigns all events ordered by created_at DESC" do
|
|
104
|
-
get :activity
|
|
105
|
-
expect(assigns(:events)).to eq [@event_2, @event_1]
|
|
106
|
-
end
|
|
107
|
-
end # describe "#activity"
|
|
108
|
-
|
|
109
95
|
describe "#create" do
|
|
110
96
|
before do
|
|
111
97
|
allow_any_instance_of(Dorsale::CustomerVault::PeopleController).to \
|
|
@@ -5,10 +5,10 @@ RSpec.describe ::Dorsale::CustomerVault::Event, type: :model do
|
|
|
5
5
|
it { is_expected.to belong_to :person }
|
|
6
6
|
it { is_expected.to belong_to :comment }
|
|
7
7
|
|
|
8
|
-
it { is_expected.to validate_presence_of :author }
|
|
9
8
|
it { is_expected.to validate_presence_of :person }
|
|
10
9
|
it { is_expected.to validate_presence_of :action }
|
|
11
10
|
|
|
11
|
+
it { is_expected.to_not validate_presence_of :author }
|
|
12
12
|
it { is_expected.to_not validate_presence_of :comment }
|
|
13
13
|
|
|
14
14
|
it "should validate comment if action is comment" do
|
|
@@ -36,4 +36,10 @@ RSpec.describe ::Dorsale::CustomerVault::Person, type: :model do
|
|
|
36
36
|
expect(individual.self_and_related_events).to contain_exactly(individual_event)
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
+
describe "address" do
|
|
40
|
+
it "should auto create address" do
|
|
41
|
+
corporation = Dorsale::CustomerVault::Corporation.create!(name: "agilidée")
|
|
42
|
+
expect(corporation.address).to_not be nil
|
|
43
|
+
end
|
|
44
|
+
end # describe "address"
|
|
39
45
|
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
require "rails_helper"
|
|
2
|
+
|
|
3
|
+
RSpec.describe ::Dorsale::CustomerVault::EventsController, type: :routing do
|
|
4
|
+
routes { ::Dorsale::Engine.routes }
|
|
5
|
+
|
|
6
|
+
describe "routing" do
|
|
7
|
+
it "#index" do
|
|
8
|
+
expect(get "/customer_vault/events").to \
|
|
9
|
+
route_to("dorsale/customer_vault/events#index")
|
|
10
|
+
end
|
|
11
|
+
end # describe "routing"
|
|
12
|
+
end
|
|
@@ -19,11 +19,6 @@ RSpec.describe ::Dorsale::CustomerVault::PeopleController, type: :routing do
|
|
|
19
19
|
route_to("dorsale/customer_vault/people#individuals")
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
it "#activity" do
|
|
23
|
-
expect(get "/customer_vault/people/activity").to \
|
|
24
|
-
route_to("dorsale/customer_vault/people#activity")
|
|
25
|
-
end
|
|
26
|
-
|
|
27
22
|
it "#new person" do
|
|
28
23
|
expect(get "/customer_vault/people/new").to \
|
|
29
24
|
route_to("dorsale/customer_vault/people#new")
|
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.4
|
|
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-
|
|
11
|
+
date: 2017-09-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -30,14 +30,14 @@ dependencies:
|
|
|
30
30
|
requirements:
|
|
31
31
|
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: 1.0.
|
|
33
|
+
version: 1.0.6
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
38
|
- - ">="
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: 1.0.
|
|
40
|
+
version: 1.0.6
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: virtus
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -537,6 +537,7 @@ files:
|
|
|
537
537
|
- app/controllers/dorsale/comments_controller.rb
|
|
538
538
|
- app/controllers/dorsale/customer_vault/activity_types_controller.rb
|
|
539
539
|
- app/controllers/dorsale/customer_vault/application_controller.rb
|
|
540
|
+
- app/controllers/dorsale/customer_vault/events_controller.rb
|
|
540
541
|
- app/controllers/dorsale/customer_vault/links_controller.rb
|
|
541
542
|
- app/controllers/dorsale/customer_vault/origins_controller.rb
|
|
542
543
|
- app/controllers/dorsale/customer_vault/people_controller.rb
|
|
@@ -552,6 +553,7 @@ files:
|
|
|
552
553
|
- app/filters/dorsale/billing_machine/small_data/filter_strategy_by_customer.rb
|
|
553
554
|
- app/filters/dorsale/billing_machine/small_data/filter_strategy_by_payment_status.rb
|
|
554
555
|
- app/filters/dorsale/billing_machine/small_data/filter_strategy_by_state.rb
|
|
556
|
+
- app/filters/dorsale/customer_vault/small_data/filter_for_events.rb
|
|
555
557
|
- app/filters/dorsale/customer_vault/small_data/filter_for_people.rb
|
|
556
558
|
- app/filters/dorsale/customer_vault/small_data/filter_strategy_by_activity_type.rb
|
|
557
559
|
- app/filters/dorsale/expense_gun/small_data/filter_for_expenses.rb
|
|
@@ -714,7 +716,9 @@ files:
|
|
|
714
716
|
- app/views/dorsale/customer_vault/activity_types/new.html.slim
|
|
715
717
|
- app/views/dorsale/customer_vault/corporations/_context.html.slim
|
|
716
718
|
- app/views/dorsale/customer_vault/events/_event.html.slim
|
|
719
|
+
- app/views/dorsale/customer_vault/events/_filters.html.slim
|
|
717
720
|
- app/views/dorsale/customer_vault/events/_list.html.slim
|
|
721
|
+
- app/views/dorsale/customer_vault/events/index.html.slim
|
|
718
722
|
- app/views/dorsale/customer_vault/individuals/_context.html.slim
|
|
719
723
|
- app/views/dorsale/customer_vault/links/edit.html.slim
|
|
720
724
|
- app/views/dorsale/customer_vault/links/index.html.slim
|
|
@@ -739,7 +743,6 @@ files:
|
|
|
739
743
|
- app/views/dorsale/customer_vault/people/_list_item.html.slim
|
|
740
744
|
- app/views/dorsale/customer_vault/people/_show_layout.html.slim
|
|
741
745
|
- app/views/dorsale/customer_vault/people/_show_tabs.html.slim
|
|
742
|
-
- app/views/dorsale/customer_vault/people/activity.slim
|
|
743
746
|
- app/views/dorsale/customer_vault/people/edit.html.slim
|
|
744
747
|
- app/views/dorsale/customer_vault/people/index.html.slim
|
|
745
748
|
- app/views/dorsale/customer_vault/people/index.xlsx.ruby
|
|
@@ -848,6 +851,7 @@ files:
|
|
|
848
851
|
- db/migrate/20170427082920_create_dorsale_customer_vault_activity_types.rb
|
|
849
852
|
- db/migrate/20170427083541_remove_useless_polymorphic_belongs_to.rb
|
|
850
853
|
- db/migrate/20170427093507_add_origin_and_activity_type_to_customer_vault_people.rb
|
|
854
|
+
- db/migrate/20170915070538_dorsale_customer_vault_events_add_text.rb
|
|
851
855
|
- features/access.feature
|
|
852
856
|
- features/billing_machine_id_cards.feature
|
|
853
857
|
- features/billing_machine_invoices.feature
|
|
@@ -918,6 +922,7 @@ files:
|
|
|
918
922
|
- spec/controllers/dorsale/billing_machine/invoices_controller_spec.rb
|
|
919
923
|
- spec/controllers/dorsale/billing_machine/quotations_controller_spec.rb
|
|
920
924
|
- spec/controllers/dorsale/comments_controller_spec.rb
|
|
925
|
+
- spec/controllers/dorsale/customer_vault/events_controller_spec.rb
|
|
921
926
|
- spec/controllers/dorsale/customer_vault/people_controller_spec.rb
|
|
922
927
|
- spec/controllers/dorsale/expense_gun/expenses_controller_spec.rb
|
|
923
928
|
- spec/controllers/dorsale/flyboy/task_comments_controller_spec.rb
|
|
@@ -981,6 +986,7 @@ files:
|
|
|
981
986
|
- spec/routing/dorsale/billing_machine/quotations_routing_spec.rb
|
|
982
987
|
- spec/routing/dorsale/comments_routing_spec.rb
|
|
983
988
|
- spec/routing/dorsale/customer_vault/activity_types_routing_spec.rb
|
|
989
|
+
- spec/routing/dorsale/customer_vault/events_routing_spec.rb
|
|
984
990
|
- spec/routing/dorsale/customer_vault/origins_routing_spec.rb
|
|
985
991
|
- spec/routing/dorsale/customer_vault/people_routing_spec.rb
|
|
986
992
|
- spec/routing/dorsale/expense_gun/expenses_routing_spec.rb
|
|
@@ -1024,6 +1030,7 @@ test_files:
|
|
|
1024
1030
|
- spec/controllers/dorsale/billing_machine/invoices_controller_spec.rb
|
|
1025
1031
|
- spec/controllers/dorsale/billing_machine/quotations_controller_spec.rb
|
|
1026
1032
|
- spec/controllers/dorsale/comments_controller_spec.rb
|
|
1033
|
+
- spec/controllers/dorsale/customer_vault/events_controller_spec.rb
|
|
1027
1034
|
- spec/controllers/dorsale/customer_vault/people_controller_spec.rb
|
|
1028
1035
|
- spec/controllers/dorsale/expense_gun/expenses_controller_spec.rb
|
|
1029
1036
|
- spec/controllers/dorsale/flyboy/task_comments_controller_spec.rb
|
|
@@ -1087,6 +1094,7 @@ test_files:
|
|
|
1087
1094
|
- spec/routing/dorsale/billing_machine/quotations_routing_spec.rb
|
|
1088
1095
|
- spec/routing/dorsale/comments_routing_spec.rb
|
|
1089
1096
|
- spec/routing/dorsale/customer_vault/activity_types_routing_spec.rb
|
|
1097
|
+
- spec/routing/dorsale/customer_vault/events_routing_spec.rb
|
|
1090
1098
|
- spec/routing/dorsale/customer_vault/origins_routing_spec.rb
|
|
1091
1099
|
- spec/routing/dorsale/customer_vault/people_routing_spec.rb
|
|
1092
1100
|
- spec/routing/dorsale/expense_gun/expenses_routing_spec.rb
|