effective_cpd 0.3.1 → 0.3.2

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: 86cc744bca079efc7c8980e61f35d8200c4b01efbc309481ad50bf9ffa8d885c
4
- data.tar.gz: bd79c194bc5b49fa01777fd43e7cd6a9efd029b17ca70793ce54059a26656ac1
3
+ metadata.gz: cf98009925976387ffeafade80664bc5b17f9790b7172d0be90b84ed0ee86707
4
+ data.tar.gz: 073aa23104da3dbbf673798f27a6ffe80ea999b34fdc6df9cd7d08b5765897ec
5
5
  SHA512:
6
- metadata.gz: b014a09d8642a8e61c82887ffd511883203b2c5bc06db5eaefd60765c17b2275b944e1d591dce8d0db2197c568f7f9ee4f276bcc7f175c99a0ced075542b07d7
7
- data.tar.gz: bfd0c5a9a54df1b62de4c9345da508a9126ca2271480677bb8304b32b5d79085eca22a0c0502d8d56e496b7c88b845c00b59f287a378a2940c1208a1cc6cdc05
6
+ metadata.gz: e0b842326dc273ea10fe3232bbaea3266dd3ca43f248e0798fb5cee1db386da08befaa56f8880fcc43b5558d039926a9823000ea293d2d71f06f2e4dee9fa978
7
+ data.tar.gz: efb3b2c91cbf7976156f8bc169fd7f483399f10894a335b0a936cfd75f0235350d6af3e79e846ee22f40c6b91ed3f3c891cefe931b7212057073c5fcec2d5055
@@ -76,6 +76,9 @@ module Effective
76
76
  # Final determination
77
77
  determination :string
78
78
 
79
+ # Override Deadlines
80
+ ignore_deadlines :boolean
81
+
79
82
  # Auditee response
80
83
  conflict_of_interest :boolean
81
84
  conflict_of_interest_reason :text
@@ -130,17 +133,17 @@ module Effective
130
133
  validates :extension_request_date, presence: true, if: -> { extension_request? }
131
134
  validates :extension_request_reason, presence: true, if: -> { extension_request? }
132
135
 
133
- validate(if: -> { current_step == :conflict && conflict_of_interest? }) do
136
+ validate(if: -> { current_step == :conflict && conflict_of_interest? && !ignore_deadlines? }) do
134
137
  deadline = deadline_to_conflict_of_interest()
135
138
  self.errors.add(:base, 'deadline to declare conflict of interest has already passed') if deadline && deadline < Time.zone.now
136
139
  end
137
140
 
138
- validate(if: -> { current_step == :exemption && exemption_request? }) do
141
+ validate(if: -> { current_step == :exemption && exemption_request? && !ignore_deadlines? }) do
139
142
  deadline = deadline_to_exemption()
140
143
  self.errors.add(:base, 'deadline to request exemption has already passed') if deadline && deadline < Time.zone.now
141
144
  end
142
145
 
143
- validate(if: -> { current_step == :extension && extension_request? }) do
146
+ validate(if: -> { current_step == :extension && extension_request? && !ignore_deadlines? }) do
144
147
  deadline = deadline_to_extension()
145
148
  self.errors.add(:base, 'deadline to request extension has already passed') if deadline && deadline < Time.zone.now
146
149
  end
@@ -17,6 +17,9 @@
17
17
  = tab 'Audit' do
18
18
  = render 'effective/cpd_audits/cpd_audit', cpd_audit: cpd_audit
19
19
 
20
+ = tab 'Deadlines' do
21
+ = render 'admin/cpd_audits/form_deadlines', cpd_audit: cpd_audit
22
+
20
23
  = tab 'Statements' do
21
24
  - datatable = Admin::EffectiveCpdStatementsDatatable.new(user_id: cpd_audit.user.id, user_type: cpd_audit.user.class.name)
22
25
  = render_datatable(datatable, inline: true, simple: true)
@@ -0,0 +1,12 @@
1
+ = card('Deadlines') do
2
+ = effective_form_with(model: [:admin, cpd_audit], engine: true) do |f|
3
+ %p The audittee has the following deadlines:
4
+
5
+ %ul
6
+ %li To declare conflict of interest: #{f.object.deadline_to_conflict_of_interest}
7
+ %li To request exemption: #{f.object.deadline_to_exemption}
8
+ %li To request extension: #{f.object.deadline_to_extension}
9
+
10
+ = f.check_box :ignore_deadlines, label: 'Yes, ignore audittee deadlines and allow these actions to be performed'
11
+
12
+ = f.submit 'Save', center: true
@@ -5,7 +5,7 @@
5
5
  - resource.cpd_audit_reviews.each do |cpd_audit_review|
6
6
  %li #{cpd_audit_review.user} <#{mail_to(cpd_audit_review.user.email)}>
7
7
 
8
- - if resource.deadline_to_conflict_of_interest.present?
8
+ - if resource.deadline_to_conflict_of_interest.present? && !resource.ignore_deadlines?
9
9
  %p The deadline to declare a conflict of interest is: #{resource.deadline_to_conflict_of_interest.strftime('%F')}.
10
10
 
11
11
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
@@ -2,7 +2,7 @@
2
2
  - if resource.was_exemption_requested?
3
3
  = render('effective/cpd_audits/exemption', cpd_audit: resource, step: :exemption)
4
4
 
5
- - if resource.deadline_to_exemption.present?
5
+ - if resource.deadline_to_exemption.present? && !resource.ignore_deadlines?
6
6
  %p The deadline to request an exemption is: #{resource.deadline_to_exemption.strftime('%F')}.
7
7
 
8
8
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
@@ -2,7 +2,7 @@
2
2
  - if resource.was_extension_requested?
3
3
  = render('effective/cpd_audits/extension', cpd_audit: resource, step: :extension)
4
4
 
5
- - if resource.deadline_to_extension.present?
5
+ - if resource.deadline_to_extension.present? && !resource.ignore_deadlines?
6
6
  %p The deadline to request an extension is: #{resource.deadline_to_extension.strftime('%F')}.
7
7
 
8
8
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
@@ -176,6 +176,8 @@ class CreateEffectiveCpd < ActiveRecord::Migration[6.0]
176
176
  t.date :notification_date
177
177
  t.date :extension_date
178
178
 
179
+ t.boolean :ignore_deadlines, default: false
180
+
179
181
  t.string :determination
180
182
 
181
183
  t.boolean :conflict_of_interest
@@ -1,3 +1,3 @@
1
1
  module EffectiveCpd
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
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: 0.3.1
4
+ version: 0.3.2
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-03-07 00:00:00.000000000 Z
11
+ date: 2022-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -246,6 +246,7 @@ files:
246
246
  - app/views/admin/cpd_audits/_auditee_fields.html.haml
247
247
  - app/views/admin/cpd_audits/_form.html.haml
248
248
  - app/views/admin/cpd_audits/_form_conflict.html.haml
249
+ - app/views/admin/cpd_audits/_form_deadlines.html.haml
249
250
  - app/views/admin/cpd_audits/_form_determination.html.haml
250
251
  - app/views/admin/cpd_audits/_form_exemption.html.haml
251
252
  - app/views/admin/cpd_audits/_form_extension.html.haml