effective_memberships 0.4.15 → 0.4.18

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28543acc716acda559f603f4f8b1da0b608897ff9e251c04936f4cc32e186f2e
4
- data.tar.gz: d524120cc69e13abc09af94999aef3bc7a00c5866b7ec97d450c6bf88bbe68d2
3
+ metadata.gz: 51b551fdd6f2f1148fcca4d2d34a8745c14e359210634508ae26939d4a4563ec
4
+ data.tar.gz: 85fff32681fd9c9e64e1010df663fb2ec7aeb5f95e2b9a95aeb7e944aad370c2
5
5
  SHA512:
6
- metadata.gz: a4a4f48f38e7e504be81e7914c3612405ac82121c47774dafcadf1e46b734a58b63ae9a689de62af385bed7a249cab8bd8714a3008eacd96b86483a4ea56ee1b
7
- data.tar.gz: 1f69dbcd48f106c91b7226a3dc99bc105783b6bbdaf22db60e30f89b6ad5200b06190477599bb7fbf8ef07e804aac5d8decc619c467ce3e3597514ab2a90e62d
6
+ metadata.gz: 9e8c76e43c5e006162ffdc8c13274f3a6f70046a52bafac971487161f6720ba3ea056235c271d1e41778d2ec93cbc9feb4ca07e89486fd5f97a36e57f6308abc
7
+ data.tar.gz: 6cbadbdab149dd6f473fede0536c5f79710cd354cf229fc24f30ae3dbc0ae3706167eb45374e6839fd4e578da45944389c885fb279238dbd9d326872a9677d55
@@ -53,6 +53,7 @@ module EffectiveMembershipsApplicant
53
53
  organization: 'Organization', # Organization only. Organization fields.
54
54
  education: 'Education',
55
55
  course_amounts: 'Courses',
56
+ equivalences: 'Equivalent Memberships',
56
57
  transcripts: 'Transcripts',
57
58
  experience: 'Work Experience',
58
59
  references: 'References',
@@ -373,6 +374,14 @@ module EffectiveMembershipsApplicant
373
374
  can_revisit_completed_steps(step)
374
375
  end
375
376
 
377
+ def applicant_fee_category
378
+ category
379
+ end
380
+
381
+ def applicant_fee_price
382
+ category.applicant_fee
383
+ end
384
+
376
385
  # All Fees and Orders
377
386
  def submit_fees
378
387
  # Find or build submit fee
@@ -380,10 +389,10 @@ module EffectiveMembershipsApplicant
380
389
 
381
390
  unless fee.purchased?
382
391
  fee.assign_attributes(
383
- category: category,
384
- price: category.applicant_fee,
385
- tax_exempt: category.applicant_fee_tax_exempt,
386
- qb_item_name: category.applicant_fee_qb_item_name
392
+ category: applicant_fee_category(),
393
+ price: applicant_fee_price(),
394
+ tax_exempt: applicant_fee_category().applicant_fee_tax_exempt,
395
+ qb_item_name: applicant_fee_category().applicant_fee_qb_item_name
387
396
  )
388
397
  end
389
398
 
@@ -101,6 +101,7 @@ module EffectiveMembershipsCategory
101
101
 
102
102
  serialize :can_apply_restricted_ids, Array
103
103
  serialize :applicant_wizard_steps, Array
104
+ serialize :applicant_review_wizard_steps, Array
104
105
  serialize :fee_payment_wizard_steps, Array
105
106
 
106
107
  scope :deep, -> { includes(:rich_texts) }
@@ -53,6 +53,15 @@ module EffectiveMembershipsOwner
53
53
  where(id: with_paid_fees_through.select(:owner_id))
54
54
  }
55
55
 
56
+ scope :members_with_category, -> (categories) {
57
+ raise('expected an EffectiveMemberships.Category') unless Array(categories).all? { |cat| cat.kind_of?(EffectiveMemberships.Category) }
58
+
59
+ membership_categories = Effective::MembershipCategory.where(category: categories)
60
+ memberships = Effective::Membership.where(id: membership_categories.select(:membership_id))
61
+
62
+ where(id: memberships.where(owner_type: name).select(:owner_id))
63
+ }
64
+
56
65
  end
57
66
 
58
67
  def assign_member_role
@@ -34,7 +34,7 @@ module Effective
34
34
  validates :position, presence: true
35
35
  validates :employer, presence: true
36
36
  validates :start_on, presence: true
37
- validates :end_on, presence: true
37
+ validates :end_on, presence: true, unless: -> { still_work_here? }
38
38
  validates :level, presence: true, inclusion: { in: LEVELS }
39
39
  validates :months, presence: true
40
40
 
@@ -1,54 +1 @@
1
- = tabs do
2
- - # Done applicants have the Applicant tab first. In progress ones the Status tab
3
- - if applicant.done?
4
- = tab 'Applicant' do
5
- .mb-4= render 'effective/applicants/summary', applicant: applicant, namespace: :admin
6
- = render 'effective/applicants/applicant', applicant: applicant, namespace: :admin
7
-
8
- = tab 'Status' do
9
- = render 'admin/applicants/status', applicant: applicant, namespace: :admin
10
-
11
- - if applicant.in_progress?
12
- = tab 'Status' do
13
- = render 'admin/applicants/status', applicant: applicant, namespace: :admin
14
-
15
- = tab 'Applicant' do
16
- .mb-4= render 'effective/applicants/summary', applicant: applicant, namespace: :admin
17
- = render 'effective/applicants/applicant', applicant: applicant, namespace: :admin
18
-
19
- - # Just normal tabs now
20
- - if applicant.was_submitted? && !applicant.was_approved?
21
- = tab 'Process' do
22
- = render 'admin/applicants/form_process', applicant: applicant
23
-
24
- - if applicant.applicant_references.present?
25
- = tab 'References' do
26
- .mb-4= render_inline_datatable(Admin::EffectiveApplicantReferencesDatatable.new(applicant: applicant))
27
-
28
- - if applicant.applicant_endorsements.present?
29
- = tab 'Endorsements' do
30
- .mb-4= render_inline_datatable(Admin::EffectiveApplicantEndorsementsDatatable.new(applicant: applicant))
31
-
32
- - if applicant.transcripts_required?
33
- = tab 'Transcripts' do
34
- = render 'admin/applicants/form_transcripts', applicant: applicant
35
-
36
- - if applicant.fees.present? || applicant.orders.present?
37
- = tab 'Fees' do
38
- .mb-4
39
- %h2 Fees
40
- - datatable = Admin::EffectiveFeesDatatable.new(applicant: applicant, total: false)
41
- = render_datatable(datatable, simple: true, inline: true)
42
-
43
- .mb-4
44
- %h2 Orders
45
- - datatable = Admin::EffectiveOrdersDatatable.new(parent: applicant, owner: applicant.owner, user: applicant.owner, total: false)
46
- = render_datatable(datatable, simple: true)
47
-
48
- - if applicant.owner.applicants.any? { |other| other.was_submitted? && other.id != applicant.id }
49
- = tab 'Other Applications' do
50
- = render_datatable(Admin::EffectiveApplicantsDatatable.new(owner: applicant.owner, except_id: applicant.id))
51
-
52
- - if applicant.persisted? && applicant.respond_to?(:log_changes_datatable)
53
- = tab 'Logs' do
54
- = render_inline_datatable(applicant.log_changes_datatable)
1
+ = render('admin/applicants/form_applicant', applicant: applicant)
@@ -0,0 +1,56 @@
1
+ = tabs do
2
+ - # Done applicants have the Applicant tab first. In progress ones the Status tab
3
+ - if applicant.done?
4
+ = tab 'Applicant' do
5
+ .mb-4= render 'effective/applicants/summary', applicant: applicant, namespace: :admin
6
+ = render 'effective/applicants/applicant', applicant: applicant, namespace: :admin
7
+
8
+ = tab 'Status' do
9
+ = render 'admin/applicants/status', applicant: applicant, namespace: :admin
10
+
11
+ - if applicant.in_progress?
12
+ = tab 'Status' do
13
+ = render 'admin/applicants/status', applicant: applicant, namespace: :admin
14
+
15
+ = tab 'Applicant' do
16
+ .mb-4= render 'effective/applicants/summary', applicant: applicant, namespace: :admin
17
+ = render 'effective/applicants/applicant', applicant: applicant, namespace: :admin
18
+
19
+ - # Just normal tabs now
20
+ - if applicant.was_submitted? && !applicant.was_approved?
21
+ = tab 'Process' do
22
+ = render 'admin/applicants/form_process', applicant: applicant
23
+
24
+ - if applicant.applicant_references.present?
25
+ = tab 'References' do
26
+ .mb-4= render_inline_datatable(Admin::EffectiveApplicantReferencesDatatable.new(applicant: applicant))
27
+
28
+ - if applicant.applicant_endorsements.present?
29
+ = tab 'Endorsements' do
30
+ .mb-4= render_inline_datatable(Admin::EffectiveApplicantEndorsementsDatatable.new(applicant: applicant))
31
+
32
+ - if applicant.transcripts_required?
33
+ = tab 'Transcripts' do
34
+ = render 'admin/applicants/form_transcripts', applicant: applicant
35
+
36
+ = yield
37
+
38
+ - if applicant.fees.present? || applicant.orders.present?
39
+ = tab 'Fees' do
40
+ .mb-4
41
+ %h2 Fees
42
+ - datatable = Admin::EffectiveFeesDatatable.new(applicant: applicant, total: false)
43
+ = render_datatable(datatable, simple: true, inline: true)
44
+
45
+ .mb-4
46
+ %h2 Orders
47
+ - datatable = Admin::EffectiveOrdersDatatable.new(parent: applicant, owner: applicant.owner, user: applicant.owner, total: false)
48
+ = render_datatable(datatable, simple: true)
49
+
50
+ - if applicant.owner.applicants.any? { |other| other.was_submitted? && other.id != applicant.id }
51
+ = tab 'Other Applications' do
52
+ = render_datatable(Admin::EffectiveApplicantsDatatable.new(owner: applicant.owner, except_id: applicant.id))
53
+
54
+ - if applicant.persisted? && applicant.respond_to?(:log_changes_datatable)
55
+ = tab 'Logs' do
56
+ = render_inline_datatable(applicant.log_changes_datatable)
@@ -19,7 +19,7 @@
19
19
  = aef.hidden_field :endorser_type
20
20
 
21
21
  = aef.select :endorser_id, endorders_collection, required: false,
22
- ajax_url: effective_memberships.select2_ajax_endorser_applicant_endorsement_path(applicant_id: resource)
22
+ ajax_url: (effective_memberships.select2_ajax_endorser_applicant_endorsement_path(applicant_id: resource) unless Rails.env.test?)
23
23
 
24
24
  = aef.check_box :unknown_member, label: 'I cant find my endorser in the above list'
25
25
 
@@ -3,6 +3,9 @@
3
3
 
4
4
  = card do
5
5
  - if resource.min_applicant_educations > 0
6
+ %p You must include #{resource.min_applicant_educations} or more work experiences.
7
+
8
+ - if resource.min_applicant_experiences_months > 0
6
9
  %p You must include #{resource.min_applicant_experiences_months} or more months of experience.
7
10
 
8
11
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
@@ -16,6 +16,7 @@
16
16
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
17
17
  = f.hidden_field :id
18
18
 
19
+ = f.hidden_field :stream, value: nil
19
20
  = f.hidden_field :organization_id, value: nil
20
21
  = f.hidden_field :organization_type, value: nil
21
22
  = f.hidden_field :category_type, value: EffectiveMemberships.Category.name
@@ -1,3 +1,3 @@
1
1
  module EffectiveMemberships
2
- VERSION = '0.4.15'
2
+ VERSION = '0.4.18'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_memberships
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.15
4
+ version: 0.4.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-06 00:00:00.000000000 Z
11
+ date: 2022-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -337,6 +337,7 @@ files:
337
337
  - app/views/admin/applicant_endorsements/_applicant_endorsement.html.haml
338
338
  - app/views/admin/applicant_references/_applicant_reference.html.haml
339
339
  - app/views/admin/applicants/_form.html.haml
340
+ - app/views/admin/applicants/_form_applicant.html.haml
340
341
  - app/views/admin/applicants/_form_approve.html.haml
341
342
  - app/views/admin/applicants/_form_complete.html.haml
342
343
  - app/views/admin/applicants/_form_decline.html.haml