effective_cpd 1.4.7 → 1.5.0

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: 9543132d5f9889e73a0bd2955ea38fef007d229503aa25229721e6b8e7a14907
4
- data.tar.gz: 30940ca9dc3eac1898b3293eacad456cfc490895d2e21edd7a47a9e9a0adc3ce
3
+ metadata.gz: 11af477a097aa90f61b028c9cbcabc827735acb2dc3192b6c915fa5a251421bb
4
+ data.tar.gz: ad2b6f62f0b13062541405298a2a2e4f23505956ffd691b636046bc9aa49ccba
5
5
  SHA512:
6
- metadata.gz: c3761c3654663e4fe88124f03fc5d01c12039013b47a44f5b30290798c78ade7d1efbd0fa4b1be4badac1d01680c255fc8f160b31964e0bd124664201d98de8d
7
- data.tar.gz: 56e597a9beffaafd3adb6d553c083beceb83fa4cf11e194c622e3612566f85b2c4602317efd7e9150783d7879d8a1b227293b31f4c624371f9131f1b671c657a
6
+ metadata.gz: a5440290e1d0f2001235f7de576210bf7ca5362010ea82b1d092aae3eb36dd304d449c60598fc5d8f3b2a09687289a98cb2b70086949b9379ba33968c335d774
7
+ data.tar.gz: 8e1fcee7bf7ff52437817fa535e265b92a418a9971599992c281368065c99a7d28df396c63026e3d14f4f00797492770f5281c9d7c441e46781bd796806dff1c
@@ -19,3 +19,9 @@
19
19
  }
20
20
 
21
21
  }
22
+
23
+ .table-cpd-audit-review-statements {
24
+ .cpd-statement-activity {
25
+ .float-right { display: none; }
26
+ }
27
+ }
@@ -582,6 +582,7 @@ module EffectiveCpdAudit
582
582
  return false unless was_submitted?
583
583
  return false unless completed?
584
584
  return false unless cpd_audit_reviews.present? && cpd_audit_reviews.all?(&:completed?)
585
+ return false if was_missing_info?
585
586
 
586
587
  review!
587
588
  end
@@ -636,9 +637,11 @@ module EffectiveCpdAudit
636
637
  end
637
638
 
638
639
  def deadline_to_submit
640
+ return extension_date if extension_date.present?
641
+
639
642
  return nil unless cpd_audit_level&.days_to_submit.present?
640
643
 
641
- date = (extension_date || notification_date || created_at || Time.zone.now)
644
+ date = (notification_date || created_at || Time.zone.now)
642
645
  EffectiveResources.advance_date(date, business_days: cpd_audit_level.days_to_submit)
643
646
  end
644
647
 
@@ -1,10 +1,9 @@
1
- = card('Determination') do
2
- = effective_form_with(model: [:admin, cpd_audit], engine: true) do |f|
3
- %p This action will <strong>close</strong> this #{cpd_audit_label} with the following determination:
1
+ = effective_form_with(model: [:admin, cpd_audit], engine: true) do |f|
2
+ %p This action will <strong>close</strong> this #{cpd_audit_label} with the following determination:
4
3
 
5
- = f.select :determination, cpd_audit.cpd_audit_level.determinations
4
+ = f.select :determination, cpd_audit.cpd_audit_level.determinations
6
5
 
7
- %h2 Email to Send
8
- = email_form_fields(f, :cpd_audit_closed)
6
+ %h2 Email to Send
7
+ = email_form_fields(f, :cpd_audit_closed)
9
8
 
10
- = f.submit 'Close', center: true, 'data-confirm': "Really close #{cpd_audit}?"
9
+ = f.submit 'Close', center: true, 'data-confirm': "Really close #{cpd_audit}?"
@@ -43,7 +43,7 @@
43
43
  = render 'admin/cpd_audits/form_files', cpd_audit: cpd_audit
44
44
 
45
45
  - if cpd_audit.user_cpd_required?
46
- = tab(cpd_audit.cpd_audit_reviews) do
46
+ = tab(cpd_audit.user.cpd_statements) do
47
47
  - datatable = Admin::EffectiveCpdStatementsDatatable.new(user: cpd_audit.user)
48
48
  = render_datatable(datatable, inline: true, simple: true)
49
49
 
@@ -55,6 +55,6 @@
55
55
  = tab(cpd_audit.chats) do
56
56
  = render 'admin/cpd_audits/form_chat', cpd_audit: cpd_audit
57
57
 
58
- - if cpd_audit.respond_to?(:log_changes_datatable)
58
+ - if cpd_audit.respond_to?(:logs_datatable)
59
59
  = tab 'Logs' do
60
- = render_inline_datatable(cpd_audit.log_changes_datatable)
60
+ = render_inline_datatable(cpd_audit.logs_datatable)
@@ -1,5 +1,5 @@
1
1
  = wizard_card(cpd_audit_review) do
2
- %table.table.table-hover
2
+ %table.table.table-hover.table-cpd-audit-review-statements
3
3
  %thead
4
4
  %th #{cpd_audit_review.cpd_audit.name}'s #{cpd_statement}
5
5
  %th #{cpd_audit_review.name}'s Review
@@ -21,8 +21,7 @@
21
21
  = link_to(cpd_audit_review.user, url)
22
22
  %br
23
23
  %small= mail_to cpd_audit_review.user.email
24
-
25
- - if cpd_audit_review.anonymous? == false
24
+ - elsif cpd_audit_review.anonymous? == false
26
25
  %p
27
26
  = cpd_audit_review.user
28
27
  %br
@@ -40,8 +39,7 @@
40
39
  = link_to(cpd_audit.user, url)
41
40
  %br
42
41
  %small= mail_to cpd_audit.user.email
43
-
44
- - if cpd_audit.anonymous? == false
42
+ - elsif cpd_audit.anonymous? == false
45
43
  %p
46
44
  = cpd_audit.user
47
45
  %br
@@ -13,7 +13,7 @@
13
13
  %h2 Review Activities
14
14
  %p Please review the following activities:
15
15
 
16
- %table.table.table-hover
16
+ %table.table.table-hover.table-cpd-audit-review-statements
17
17
  %thead
18
18
  %th #{resource.cpd_audit.user}'s #{cpd_statement}
19
19
  %th #{resource.user}'s Review
@@ -13,8 +13,7 @@
13
13
  = link_to(cpd_audit.user, url)
14
14
  %br
15
15
  %small= mail_to cpd_audit.user.email
16
-
17
- - if cpd_audit.anonymous? == false
16
+ - elsif cpd_audit.anonymous? == false
18
17
  %p
19
18
  = cpd_audit.user
20
19
  %br
@@ -33,8 +32,7 @@
33
32
  = link_to(cpd_audit_review.user, url)
34
33
  %br
35
34
  %small= mail_to cpd_audit_review.user.email
36
-
37
- - if cpd_audit_review.anonymous? == false
35
+ - elsif cpd_audit_review.anonymous? == false
38
36
  %p
39
37
  = cpd_audit_review.user
40
38
  %br
@@ -3,7 +3,7 @@
3
3
 
4
4
  - raise('expected a submitted cpd_statement') unless resource.submitted_at.present?
5
5
 
6
- .alert.alert-warning.mb-4
6
+ .alert.alert-success.mb-4
7
7
  Successfully submitted on #{resource.submitted_at.strftime('%F')}.
8
8
 
9
9
  - if resource.cpd_cycle.all_steps_content.present?
@@ -9,11 +9,11 @@ en:
9
9
  activerecord:
10
10
  models:
11
11
  # These ones might be app level
12
- app/cpd_audit: 'CPD Audit'
13
- app/cpd_audit_level: 'CPD Audit Level'
14
- app/cpd_audit_review: 'CPD Audit Review'
15
- app/cpd_bulk_audit: 'Bulk Create CPD Audit Review'
16
- app/cpd_statement: 'CPD Statement'
12
+ cpd_audit: 'CPD Audit'
13
+ cpd_audit_level: 'CPD Audit Level'
14
+ cpd_audit_review: 'CPD Audit Review'
15
+ cpd_bulk_audit: 'Bulk Create CPD Audit Review'
16
+ cpd_statement: 'CPD Statement'
17
17
 
18
18
  # These ones should stay effective
19
19
  effective/cpd_cycle: 'CPD Period'
@@ -23,10 +23,10 @@ en:
23
23
 
24
24
  attributes:
25
25
  # These ones might be app level
26
- app/cpd_audit:
26
+ cpd_audit:
27
27
  user: 'Auditee'
28
28
  cpd_audit_comments: 'Reviewer Notes'
29
29
 
30
- app/cpd_audit_review:
30
+ cpd_audit_review:
31
31
  user: 'Reviewer'
32
32
  comments: 'Reviewer Notes'
@@ -21,7 +21,7 @@ class CreateEffectiveCpd < ActiveRecord::Migration[6.0]
21
21
  end
22
22
 
23
23
  create_table <%= @cpd_activities_table_name %> do |t|
24
- t.references :cpd_category
24
+ t.integer :cpd_category_id
25
25
 
26
26
  t.string :title
27
27
  t.integer :position
@@ -37,7 +37,8 @@ class CreateEffectiveCpd < ActiveRecord::Migration[6.0]
37
37
  end
38
38
 
39
39
  create_table <%= @cpd_rules_table_name %> do |t|
40
- t.references :cpd_cycle
40
+ t.integer :cpd_cycle_id
41
+
41
42
  t.integer :ruleable_id
42
43
  t.string :ruleable_type
43
44
 
@@ -53,7 +54,7 @@ class CreateEffectiveCpd < ActiveRecord::Migration[6.0]
53
54
  end
54
55
 
55
56
  create_table <%= @cpd_special_rules_table_name %> do |t|
56
- t.references :cpd_cycle
57
+ t.integer :cpd_cycle_id
57
58
 
58
59
  t.decimal :max_credits_per_cycle
59
60
  t.string :category
@@ -63,20 +64,22 @@ class CreateEffectiveCpd < ActiveRecord::Migration[6.0]
63
64
  end
64
65
 
65
66
  create_table <%= @cpd_special_rule_mates_table_name %> do |t|
66
- t.references :cpd_rule
67
- t.references :cpd_special_rule
67
+ t.integer :cpd_rule_id
68
+ t.integer :cpd_special_rule_id
68
69
 
69
70
  t.datetime :updated_at
70
71
  t.datetime :created_at
71
72
  end
72
73
 
73
74
  create_table <%= @cpd_statement_activities_table_name %> do |t|
74
- t.references :cpd_statement
75
- t.references :cpd_activity
76
- t.references :cpd_category
77
- t.references :original
75
+ t.integer :cpd_statement_id
76
+ t.string :cpd_statement_type
77
+
78
+ t.integer :cpd_activity_id
79
+ t.integer :cpd_category_id
80
+ t.integer :original_id
81
+ t.integer :cpd_cycle_id
78
82
 
79
- t.references :cpd_cycle
80
83
  t.integer :user_id
81
84
  t.string :user_type
82
85
 
@@ -97,7 +100,7 @@ class CreateEffectiveCpd < ActiveRecord::Migration[6.0]
97
100
  end
98
101
 
99
102
  create_table <%= @cpd_statements_table_name %> do |t|
100
- t.references :cpd_cycle
103
+ t.integer :cpd_cycle_id
101
104
 
102
105
  t.integer :user_id
103
106
  t.string :user_type
@@ -158,7 +161,7 @@ class CreateEffectiveCpd < ActiveRecord::Migration[6.0]
158
161
  t.integer :cpd_audit_level_id
159
162
  t.string :cpd_audit_level_type
160
163
 
161
- t.references :cpd_audit_level_section
164
+ t.integer :cpd_audit_level_section_id
162
165
 
163
166
  t.text :title
164
167
  t.string :category
@@ -171,7 +174,7 @@ class CreateEffectiveCpd < ActiveRecord::Migration[6.0]
171
174
  end
172
175
 
173
176
  create_table <%= @cpd_audit_level_question_options_table_name %> do |t|
174
- t.references :cpd_audit_level_question, index: false
177
+ t.integer :cpd_audit_level_question_id
175
178
 
176
179
  t.text :title
177
180
  t.integer :position
@@ -286,8 +289,8 @@ class CreateEffectiveCpd < ActiveRecord::Migration[6.0]
286
289
  t.integer :cpd_audit_id
287
290
  t.string :cpd_audit_type
288
291
 
289
- t.references :cpd_audit_level_question
290
- t.references :cpd_audit_level_section
292
+ t.integer :cpd_audit_level_question_id
293
+ t.integer :cpd_audit_level_section_id
291
294
 
292
295
  t.date :date
293
296
  t.string :email
@@ -300,8 +303,8 @@ class CreateEffectiveCpd < ActiveRecord::Migration[6.0]
300
303
  end
301
304
 
302
305
  create_table <%= @cpd_audit_response_options_table_name %> do |t|
303
- t.references :cpd_audit_response
304
- t.references :cpd_audit_level_question_option, index: false
306
+ t.integer :cpd_audit_response_id
307
+ t.integer :cpd_audit_level_question_option_id
305
308
 
306
309
  t.datetime :updated_at
307
310
  t.datetime :created_at
@@ -1,3 +1,3 @@
1
1
  module EffectiveCpd
2
- VERSION = '1.4.7'
2
+ VERSION = '1.5.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_cpd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.7
4
+ version: 1.5.0
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: 2023-03-24 00:00:00.000000000 Z
11
+ date: 2023-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails