Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Title to staff csv #798

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/models/air_table_staff/staff_directory_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def fields
{ airtable_field: :'pul:Department', our_field: :division },
{ airtable_field: :'pul:Unit', our_field: :unit },
{ airtable_field: :'pul:Team', our_field: :team },
{ airtable_field: :Title, our_field: :title },
{ airtable_field: :'Area of Study', our_field: :areasOfStudy, transformer: ->(areas) { areas&.join('//') } }
]
end
Expand Down
1 change: 1 addition & 0 deletions spec/fixtures/files/air_table/records_no_offset.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"pul:Building": "Stokes",
"Last Name": "Librarian",
"First Name": "Phillip",
"Title": "Library Collections Specialist V",
"University ID": "123",
"netid": "ab123",
"University Phone": "(123) 123-1234",
Expand Down
4 changes: 2 additions & 2 deletions spec/models/air_table_staff/csv_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
end
it 'creates a CSV object with data from the HTTP API' do
expected = <<~END_CSV
puid,netid,phone,name,lastName,firstName,email,address,building,department,division,unit,team,areasOfStudy
123,ab123,(123) 123-1234,Phillip Librarian,Librarian,Phillip,[email protected],123 Stokes,Stokes,Stokes,,,,Virtual Reality
puid,netid,phone,name,lastName,firstName,email,address,building,department,division,unit,team,title,areasOfStudy
123,ab123,(123) 123-1234,Phillip Librarian,Librarian,Phillip,[email protected],123 Stokes,Stokes,Stokes,,,,Library Collections Specialist V,Virtual Reality
END_CSV
directory = described_class.new
expect(directory.to_csv).to eq(expected)
Expand Down
2 changes: 2 additions & 0 deletions spec/models/air_table_staff/staff_directory_person_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
'pul:Department': 'Cataloging and Metadata Services',
'pul:Unit': 'Rare Books Cataloging Team',
'pul:Team': 'IT, Discovery and Access Services',
'Title': 'Library Software Engineer',
'Area of Study': ['Chemistry', 'African American Studies']
}
expected = [
Expand All @@ -34,6 +35,7 @@
'Cataloging and Metadata Services', # division
'Rare Books Cataloging Team', # unit
'IT, Discovery and Access Services', # team
'Library Software Engineer', # title
'Chemistry//African American Studies' # areasOfStudy
]

Expand Down
3 changes: 2 additions & 1 deletion spec/models/air_table_staff/staff_list_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
let(:file_path) { Pathname.new(Rails.root.join('tmp', "airtable_staff.csv")) }
let(:first_row) do
[
'123', 'ab123', '(123) 123-1234', 'Phillip Librarian', 'Librarian', 'Phillip', '[email protected]', '123 Stokes', 'Stokes', 'Stokes', nil, nil, nil, 'Virtual Reality'
'123', 'ab123', '(123) 123-1234', 'Phillip Librarian', 'Librarian', 'Phillip', '[email protected]',
'123 Stokes', 'Stokes', 'Stokes', nil, nil, nil, 'Library Collections Specialist V', 'Virtual Reality'
]
end

Expand Down
Loading