-
Notifications
You must be signed in to change notification settings - Fork 81
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
Prefill the resource name field with the filename #1393
Conversation
@seav Is the current simple implementation good enough or would you prefer using this function |
ping. |
@niharika1995 We are currently reviewing and merging other PR which fix higher priority issues. We will get to this PR soon. |
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.
@niharika1995 thanks for your contribution. The file-upload.js
script is currently used in three places in the platform:
ProjectAddDetails
form in the project creation wizard.ProjectEditDetails
form in the project creation wizard.ResourceForm
in the resources app.
We need to restrict this functionality toResource
uploads only. In the Project Wizard the user can upload a questionnaire. If the user is editing a project and uploads a questionnaire the project name will be replaced with the questionnaire name. Adding a new Project is not affected as thename
field is calleddetails-name
. One possible approach would be to inspect the value ofwindow.location.href
and if it ends with/resources/add/new
then go ahead and update thename
field.
5cb2677
to
5009eaa
Compare
@bjohare Please review. I addressed the issue you raised. |
Thanks @niharika1995 this looks good. You should rebase onto our latest master. We'll try to merge this once @oliverroick has had a chance to review. |
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.
Looks good thanks!
Proposed changes in this pull request
Fixes #1392
When should this PR be merged
Anytime.
Risks
None
Follow-up actions
Checklist (for reviewing)
General
migration
label if a new migration is added.Functionality
Code
Tests
Security
Documentation