Skip to content

Comments

Add state params when uploading CSV#37

Open
aapomm wants to merge 1 commit intomainfrom
fix/states
Open

Add state params when uploading CSV#37
aapomm wants to merge 1 commit intomainfrom
fix/states

Conversation

@aapomm
Copy link
Collaborator

@aapomm aapomm commented Feb 6, 2026

Spec

When uploading a CSV file, a user is able to choose the state. However, currently, this state isn't used in the backend at all.

Proposed solution

  • Pass the chosen state to the uploads#new view
  • From there, pass the state again when the mapping is submitted
  • Update the Importer call to also pass the state

Check List

  • Added a CHANGELOG entry
  • Added specs

end
end

context 'uploading file with special characters in the filename' do
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed case as it doesn't actually work


def state
@state ||=
Issue.states.keys.include?(params[:state]) ? params[:state] : 'draft'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Issue.states.keys.include?(params[:state]) ? params[:state] : 'draft'
Issue.states.key?(params[:state]) ? params[:state] : 'draft'

end
end
end

Copy link
Contributor

@gcelanji gcelanji Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a test case for handling invalid states (which defaults to draft in the controller)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants