Skip to content

Set provider prefix on creation and when editing a provider with no topics#676

Open
FionaLMcLaren wants to merge 1 commit intomainfrom
set-file-name-prefix-on-form
Open

Set provider prefix on creation and when editing a provider with no topics#676
FionaLMcLaren wants to merge 1 commit intomainfrom
set-file-name-prefix-on-form

Conversation

@FionaLMcLaren
Copy link
Copy Markdown
Contributor

@FionaLMcLaren FionaLMcLaren commented May 7, 2026

What Issue Does This PR Cover, If Any?

Resolves #607

What Changed? And Why Did It Change?

Each provider has a file_name_prefix. This value is added to the file name
when the provider uploads a file. This file_name_prefix is necessary
to coordinate between our file storage and Azure's. However, if a provider
was to change their file_name_prefix when they had uploaded files,
it would break management of those existing uploaded files.

Before, we got around this by simply removing the field from the provider's
form. This meant that users could not set the value of file_name_prefix
when making a new provider or when editing a provider who had no uploaded
files.

This PR adds the ability to set the file_name_prefix value on the
provider form. The field will show on the form when the provider
is...

  • A new instance
  • One who has no topics, and no uploaded files

How Has This Been Tested?

RSpec and by verifying these test cases by hand...

  • When I am creating a new provider, I can see and set
    the file_name_prefix field
  • When I am editing a provider without topics, I can see
    and set the file_name_prefix field
  • When I am editing a provider with topics, I cannot see
    and set the file_name_prefix field

Please Provide Screenshots

The provider form, with the `file_name_prefix`, for a new instance

The provider form, with the file_name_prefix, for a new instance

The provider form, with the `file_name_prefix`, for editing an instance with no topics

The provider form, with the file_name_prefix, for editing an instance with no topics

Additional Comments

Some questions...

  • In the form, the file_name_prefix field is not required. Should it
    be required?
  • When the file_name_prefix was unavailable to set on the form,
    what was its value set to for a new Provider? Was it empty? Was
    it some default value?
  • If file_name_prefix values were empty because of our
    past workaround, was this behaviour we wanted, or a tradeoff
    to avoid the issue?
  • I have a provider with uploaded files, but their
    file_name_prefix is empty. Should we give the option to set
    the file_name_prefix here?
  • Should we list providers’ topic in their show view to make it clearer
    why the file_name_prefix does not appear on their edit form and cannot
    be changed? Would we like to make it more explicit, too? - could we have a
    disabled field so we can still show the field on the form, but with a note
    why it isn’t editable?
The current provider Show view - their topics are not listed

The current provider Show view - their topics are not listed

…opics

Resolves #607

Each provider has a `file_name_prefix`. This value is added to the file name
when the provider uploads a file. This `file_name_prefix` is necessary
to coordinate between our file storage and Azure's. However, if a provider
was to change their `file_name_prefix` when they had uploaded files,
it would break management of those existing uploaded files.

Before, we got around this by simply removing the field from the provider's
form. This meant that users could not set the value of `file_name_prefix`
when making a new provider or when editing a provider who had no uploaded
files.

This PR adds the ability to set the `file_name_prefix` value on the
provider form. The field will show on the form when the provider
is...
- A new instance
- One who has no topics, and no uploaded files
@FionaLMcLaren FionaLMcLaren force-pushed the set-file-name-prefix-on-form branch from a5f8785 to cc33849 Compare May 7, 2026 12:30
<% end %>
<%= form.text_field :name,
placeholder: "Enter provider name (e.g., Johns Hopkins, Mayo Clinic)",
placeholder: "e.g., Johns Hopkins, Mayo Clinic",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed the placeholder here to be consistent with the rest of them. I think it is sufficient to have the placeholder give examples, as our help text says what the input should be

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.

Allow editing of provider prefix on creation and when the provider has no topics

1 participant