-
Notifications
You must be signed in to change notification settings - Fork 67
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
Authors and editors can edit funder metadata #4061
Conversation
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.
Nice changes overall but I have a fundamental comment on the data model, that could imply further changes on the interface.
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.
Nice, thanks for the refactor, less tech debt moving forward
I added a minor suggestion on the print statement you have on the migration
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.
Overall this is really good, and I think people will really appreciate the flexibility. I especially love the status indicator while the user is waiting for search results to return from the API.
As for changes that need to be made, I found one server error and a handful of accessibility and consistency fixes we can make.
…with article from 1-2-m
…nd change the modal and form element IDs
1cb54e0
to
1d3d71d
Compare
Good catch on the error, I totally missed that (as a result of making changes to the model after adding the view). I've made some updates and cut down on the JS used by cloning the modal then updating the ID and FOR attributes. I was going to suggest opening a new issue to refactor this as its I think its beyond the scope of this issue but I gave it a go and got sucked down the rabbit hole. |
FYI haven't re-requested review as I'm going to take a look at refactoring the first block of JS also. Might as well keep it consistent. |
In the end I was able to cut the JS in half. |
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.
In the end I was able to cut the JS in half.
Nice. I tried to test it out but I got a migration conflict:
CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0075_auto_20240312_0922, 0077_auto_20240402_1326 in submission).
To fix them run 'python manage.py makemigrations --merge'
I've added a merge for this. |
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.
Nice to have all the forms loading the same way.
The buttons weren't working in one of the places I tested, unfortunately. More inline about that.
Also, can the following line be removed for clarity or is something depending on it, like the custom submission fields? I am asking mainly because I want to make sure I know where all the "Add funder" buttons are so I can test them with the new JS.
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.
It is now fully working for me! And the refactor is also much cleaner.
</script> | ||
}); | ||
|
||
// Clear the HTML, display the table and reinitialize foundation |
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 get rid of this comment as it's outdated, right?
Oh one last thing @ajrbyers . Did you see my question above? |
Thanks @joemull agreed, much cleaner. The include is perhaps a bit confusing given its extension is .html, its actually including this file: https://github.com/BirkbeckCTP/janeway/blob/deadd395261775624680530816ce05938d7d8988/src/templates/admin/elements/fundref/fundref.html I think because he wanted to use Django template tags Martin gave it the .html extension. For clarity maybe we should change it to .js? |
@ajrbyers I'm not talking about the file extension but that I don't think it should be here at all. This is the Seems to me that the only places we need it are these two: Am I missing something? |
Nah you're not missing anything, I am though. Its not required on submit_info at all. |
…be include no longer needed.
Closes #3164 (sort of)
funders
will return a queryset for backwards compatibility.Screen recording: https://github.com/BirkbeckCTP/janeway/assets/8321378/bdf5bc3c-d78a-439e-81a2-e98a3ad679c8