Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
njpreddy committed Dec 13, 2024
1 parent 2e3bee8 commit efa59d4
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 65 deletions.
6 changes: 5 additions & 1 deletion app/controllers/cases/ico_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ def record_late_team
params = record_late_team_params(@case.type_abbreviation)
if @case.update(params)
@case.respond(current_user)
redirect_to case_path
if case_type == Case::ICO::SAR
render "/cases/ico/record_sar_complaint_outcome"
else
redirect_to case_path
end
else
@team_collection = CaseTeamCollection.new(@case)
render "/cases/ico/late_team"
Expand Down
8 changes: 6 additions & 2 deletions app/controllers/cases/ico_sar_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@ def case_type
Case::ICO::SAR
end

def record_complaint_outcomes
def confirm_record_sar_complaint_outcome
authorize @case, :can_respond?
params = record_complaint_outcome_params
if @case.update(params)
redirect_to case_path(@case)
else
render "/cases/ico/sar_complaint_outcome"
render "/cases/ico/record_sar_complaint_outcome"
end
end

def require_record_sar_complaint_outcome
authorize @case, :can_respond?
render "/cases/ico/record_sar_complaint_outcome"
end
end
end
2 changes: 1 addition & 1 deletion app/controllers/concerns/ico_cases_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def record_late_team_ico_params
end

def record_complaint_outcome_params
params.require(:ico).permit(:complaint_outcome)
params.require(:ico).permit(:sar_complaint_outcome)
end

def process_new_linked_cases_for_params
Expand Down
6 changes: 2 additions & 4 deletions app/controllers/concerns/sar_cases_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ def create_sar_params
:third_party_relationship,
:reply_method,
:request_method,
uploaded_request_files: [],
:sar_complaint_outcome
uploaded_request_files: []
)
end

Expand All @@ -38,8 +37,7 @@ def edit_sar_params
:reply_method,
:request_method,
:email,
:postal_address,
:sar_complaint_outcome
:postal_address
)
end

Expand Down
114 changes: 57 additions & 57 deletions app/views/cases/data_requests/_form.html.slim
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
.data-request__single.js-data-request__form
h3.page-heading--secondary.data-request__position
.data-request__single.js-data-request__form
h3.page-heading--secondary.data-request__position

= f.text_field :location,
maxlength: 500,
class: 'contact_input',
disabled: true
= f.text_field :location,
maxlength: 500,
class: 'contact_input',
disabled: true

= f.hidden_field :contact_id, class: 'contact_id_input'
= render partial: 'contacts/open_search_dialogue_button', locals: { search_filters: "" }
= f.hidden_field :contact_id, class: 'contact_id_input'
= render partial: 'contacts/open_search_dialogue_button', locals: { search_filters: "" }

= f.radio_button_fieldset :request_type,
choices: DataRequest::request_types.keys do |fieldset|
- fieldset.radio_input('all_prison_records')
- fieldset.radio_input('bwcf')
= f.text_area :request_type_note, id: 'data_request_request_type_note_for_bwcf'
- fieldset.radio_input('cat_a')
- fieldset.radio_input('cctv')
= f.text_area :request_type_note, id: 'data_request_request_type_note_for_cctv'
- fieldset.radio_input('cross_borders')
- fieldset.radio_input('dps')
- fieldset.radio_input('mappa')
- fieldset.radio_input('ndelius')
- fieldset.radio_input('nomis_contact_logs')
- fieldset.radio_input('nomis_records')
- fieldset.radio_input('nomis_other')
= f.text_area :request_type_note, id: 'data_request_request_type_note_for_nomis'
- fieldset.radio_input('pdp')
- fieldset.radio_input('probation_archive')
- fieldset.radio_input('probation_records')
- fieldset.radio_input('security_records')
- fieldset.radio_input('telephone_recordings')
- fieldset.radio_input('other')
= f.text_area :request_type_note
= f.radio_button_fieldset :request_type,
choices: DataRequest::request_types.keys do |fieldset|
- fieldset.radio_input('all_prison_records')
- fieldset.radio_input('bwcf')
= f.text_area :request_type_note, id: 'data_request_request_type_note_for_bwcf'
- fieldset.radio_input('cat_a')
- fieldset.radio_input('cctv')
= f.text_area :request_type_note, id: 'data_request_request_type_note_for_cctv'
- fieldset.radio_input('cross_borders')
- fieldset.radio_input('dps')
- fieldset.radio_input('mappa')
- fieldset.radio_input('ndelius')
- fieldset.radio_input('nomis_contact_logs')
- fieldset.radio_input('nomis_records')
- fieldset.radio_input('nomis_other')
= f.text_area :request_type_note, id: 'data_request_request_type_note_for_nomis'
- fieldset.radio_input('pdp')
- fieldset.radio_input('probation_archive')
- fieldset.radio_input('probation_records')
- fieldset.radio_input('security_records')
- fieldset.radio_input('telephone_recordings')
- fieldset.radio_input('other')
= f.text_area :request_type_note

= f.gov_uk_date_field :date_requested, { \
legend_text: 'Date requested',
form_hint_text: t('helpers.hint.shared.date_example'),
today_button: { class: '' } \
}
= f.gov_uk_date_field :date_requested, { \
legend_text: 'Date requested',
form_hint_text: t('helpers.hint.shared.date_example'),
today_button: { class: '' } \
}

br
hr
br
hr

= f.gov_uk_date_field :date_from, { \
legend_text: 'Date from (optional)',
form_hint_text: t('cases.data_requests.new.date_from_copy'),
}
= f.gov_uk_date_field :date_from, { \
legend_text: 'Date from (optional)',
form_hint_text: t('cases.data_requests.new.date_from_copy'),
}

br
br

= f.gov_uk_date_field :date_to, { \
legend_text: 'Date to (optional)',
form_hint_text: t('cases.data_requests.new.date_to_copy'),
}
= f.gov_uk_date_field :date_to, { \
legend_text: 'Date to (optional)',
form_hint_text: t('cases.data_requests.new.date_to_copy'),
}

- if @data_request.persisted?
= f.text_field :cached_num_pages, class: 'form-control form-control-1-8'
= f.check_box_fieldset :completed, [:completed]
- if @data_request.persisted?
= f.text_field :cached_num_pages, class: 'form-control form-control-1-8'
= f.check_box_fieldset :completed, [:completed]

= f.gov_uk_date_field :cached_date_received, { \
legend_text: 'Date when data request is complete',
form_hint_text: t('helpers.hint.shared.date_example'),
today_button: { class: '' } \
}
= f.gov_uk_date_field :cached_date_received, { \
legend_text: 'Date when data request is complete',
form_hint_text: t('helpers.hint.shared.date_example'),
today_button: { class: '' } \
}

.button-holder
= f.submit t('.record_request'), { class: 'button', role: 'button' }
.button-holder
= f.submit t('.record_request'), { class: 'button', role: 'button' }
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@
patch "record_further_action", on: :member, to: "ico#confirm_record_further_action"
get "require_further_action", on: :member, to: "ico#require_further_action"
patch "require_further_action", on: :member, to: "ico#confirm_require_further_action"
get "record_sar_complaint_outcome", on: :member, to: "ico#require_record_sar_complaint_outcome"
patch "record_sar_complaint_outcome", on: :member, to: "ico#confirm_record_sar_complaint_outcome"
end

resources :overturned_ico_fois, only: [:create], controller: "overturned_ico_foi", as: :case_overturned_ico_fois do
Expand Down

0 comments on commit efa59d4

Please sign in to comment.