Skip to content

Commit

Permalink
Merge f7549bb into 90def2a
Browse files Browse the repository at this point in the history
  • Loading branch information
garethrees committed Mar 11, 2024
2 parents 90def2a + f7549bb commit 2480b7f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion app/models/project/export/info_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def data
latest_status_contributor: status_contributor,
status: described_state,
dataset_contributor: dataset_contributor
}.merge(extracted_values_as_hash)
}.merge(dataset_values)
end

private
Expand Down Expand Up @@ -53,6 +53,12 @@ def dataset_contributor
extraction_submission.user.name
end

def dataset_values
project.key_set.keys.pluck(:title).each_with_object({}) do |key, memo|
memo[key] = extracted_values_as_hash[key]
end
end

def extracted_values
return unless extraction_submission

Expand Down
1 change: 1 addition & 0 deletions doc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Highlighted Features

* Fix missing headers when exporting Project data (Gareth Rees)
* Reduce amount of storage related background jobs (Graeme Porteous)
* Add automatic parsing of emails contain Excel spreadsheets (Graeme Porteous)
* Improve rendering of admin hidden request prominence and explanations (Graeme
Expand Down
7 changes: 6 additions & 1 deletion spec/models/project/export/info_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
include LinkToHelper

let(:project) { FactoryBot.build(:project) }

let(:key_set) { FactoryBot.build(:dataset_key_set, resource: project) }
let!(:dataset_key) { FactoryBot.create(:dataset_key, key_set: key_set) }

let(:contributor) { FactoryBot.build(:user) }

let(:public_body) { FactoryBot.build(:public_body) }
Expand Down Expand Up @@ -71,7 +75,8 @@
request_owner: info_request.user.name,
latest_status_contributor: contributor.name,
status: info_request.described_state,
dataset_contributor: nil
:dataset_contributor => nil,
'Were there any errors?' => nil
)
end
end
Expand Down

0 comments on commit 2480b7f

Please sign in to comment.