-
Notifications
You must be signed in to change notification settings - Fork 99
Add an Allocation Attribute Edit Page #675
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?
Conversation
35975d0
to
426cfc5
Compare
@aebruno, I just wanted to ask if this was on the radar. |
@cecilialau6776 Sorry for the delay. Can you rebase this PR to main then we can review. Looks good otherwise, Thanks! |
b663cf4
to
670e89d
Compare
Rebased and added tests! |
c32996d
to
b1570a0
Compare
@cecilialau6776 Thanks! Can you squash to a single commit and force push. |
848b1f5
to
fac0e0c
Compare
@aebruno Yup! Squahsed and also rebased. |
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.
@cecilialau6776 one minor suggestion. Can you remove the "Confirm" button if an allocation has no attributes to edit? For example:

If you click the confirm button, it errors out with a csfr error:

So maybe just have a cancel button to take the user back to previous page?
Alternatively (or in addition) remove the "Edit Allocation Attributes" button from the allocations pages when no allocation attributes exist, for example here:

fac0e0c
to
8603863
Compare
@aebruno Thanks, I didn't catch that when I was testing. I've removed the edit button and the confirm button when there are no allocation attributes. |
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.
This is really great!
I am just leaving a bunch of code nitpicks for maintainability.
Otherwise I think this is fine to merge in. @aebruno looks like your requested changes have been completed.
Thanks for the feedback! I'd be happy to make the suggested changes. For several of them, I used examples from elsewhere in their respective files, but I can also update those if needed. |
8603863
to
125375d
Compare
Squashed commits: add allocation edit page add indicator for changed allocation attributes add allocation attribute change signals escape js for validation string fix errors and formatting add tests remove confirm and edit buttons when no attributes to edit improve code readability and maintainability Signed-off-by: Cecilia Lau <[email protected]>
125375d
to
ed76d6a
Compare
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.
Thanks for making these changes! It all looks great. Also I did not know that there was an HTTPStatus enum, I will have to use that myself!
I don't think it is necessary right now to go and change other code.
At this stage we are looking to start paying down some of the technical debt in ColdFront, and part of that is making sure new code that comes in is a bit more maintainable than what we had previously. However, the idea was to not be rewriting stuff just yet until we have enough testing to be confident that those changes don't break anything. Although I have not had a chance to get to this section of the codebase yet so maybe @aebruno would have more to comment on rewriting some of this.
@aebruno This looks good to merge.
This PR adds a page that allows admins to edit allocation attributes and a button on the Allocation Detail page to access this page, which would close #672.
This PR also adds a signal for allocation attribute changes, which is sent when Allocation Change Requests are approved and through this page, which should [help] close #293.