-
Notifications
You must be signed in to change notification settings - Fork 10
Set provider prefix on creation and when editing a provider with no topics #676
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,25 @@ | |
| <div class="space-y-6"> | ||
| <%= render "shared/errors", errors: provider.errors.full_messages, resource_name: provider.class.name %> | ||
|
|
||
| <!-- File name prefix uneditable notice --> | ||
| <% if @provider&.topics.any? %> | ||
| <div id="file-name-prefix-uneditable-notice" class="bg-blue-50 border border-blue-200 rounded-lg p-4"> | ||
| <div class="flex"> | ||
| <div class="flex-shrink-0"> | ||
| <svg class="h-5 w-5 text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"> | ||
| <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/> | ||
| </svg> | ||
| </div> | ||
| <div class="ml-3"> | ||
| <p class="text-sm text-blue-700 m-0"> | ||
| There are topics associated with this provider, so the file names are established and the file name prefix can't be edited. | ||
| </p> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <% end %> | ||
|
|
||
|
|
||
| <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"> | ||
|
|
||
| <!-- Provider Name --> | ||
|
|
@@ -11,7 +30,7 @@ | |
| <span class="text-red-500">*</span> | ||
| <% end %> | ||
| <%= form.text_field :name, | ||
| placeholder: "Enter provider name (e.g., Johns Hopkins, Mayo Clinic)", | ||
| placeholder: "e.g., Johns Hopkins, Mayo Clinic", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| autofocus: true, | ||
| class: "input-field bg-gray-50" %> | ||
| <p class="help-text">The official name of the healthcare provider or organization.</p> | ||
|
|
@@ -29,6 +48,31 @@ | |
| <p class="help-text">The type or category of healthcare provider.</p> | ||
| </div> | ||
|
|
||
| <!-- File name prefix --> | ||
| <% if @provider&.topics.any? %> | ||
| <div> | ||
| <%= form.label :file_name_prefix, class: "input-label" do %> | ||
| File name prefix | ||
| <% end %> | ||
| <%= form.text_field :file_name_prefix, | ||
| disabled: true, | ||
| value: @provider.file_name_prefix, | ||
| class: "input-field bg-gray-50" | ||
| %> | ||
| <p class="help-text">The prefix to use for this provider's uploads.</p> | ||
| </div> | ||
| <% else %> | ||
| <div> | ||
| <%= form.label :file_name_prefix, class: "input-label" do %> | ||
| File name prefix | ||
| <% end %> | ||
| <%= form.text_field :file_name_prefix, | ||
| placeholder: "e.g., 123_who_guidelines", | ||
| class: "input-field bg-gray-50" %> | ||
| <p class="help-text">The prefix to use for this provider's uploads.</p> | ||
| </div> | ||
| <% end %> | ||
|
|
||
| <!-- Regions --> | ||
| <div> | ||
| <%= form.label :region, class: "input-label" do %> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,7 +81,7 @@ | |
| </div> | ||
|
|
||
| <div class="card-body"> | ||
| <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8"> | ||
| <div class="grid grid-cols-1 md:grid-cols-2 gap-8"> | ||
|
|
||
| <div> | ||
| <label class="input-label">Provider Name</label> | ||
|
|
@@ -97,7 +97,7 @@ | |
| </div> | ||
| </div> | ||
|
|
||
| <div> | ||
| <div class="col-span-full"> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Before, an overly long
The Now, this has been updated so the
The |
||
| <label class="input-label">File Name Prefix</label> | ||
| <div class="bg-gray-50 p-4 rounded-lg border border-gray-200"> | ||
| <% if @provider.file_name_prefix.present? %> | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can reduce dots number here if you extract a method for provider model, then you can call it here and there