Skip to content
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

Allocation: Approve button deletes description text #433

Closed
dsajdak opened this issue Jul 21, 2022 · 0 comments · Fixed by #455 or #484
Closed

Allocation: Approve button deletes description text #433

dsajdak opened this issue Jul 21, 2022 · 0 comments · Fixed by #455 or #484
Labels
bug Something isn't working

Comments

@dsajdak
Copy link
Contributor

dsajdak commented Jul 21, 2022

When an admin adds text into the description box on the allocation detail page it is wiped out if they click on the 'approve' or the 'deny' button. The 'update' button works as intended.

Task Tests:

  1. Sign into ColdFront as the admin user
  2. Create a new allocation request
  3. Navigate to the allocation requests list and click on the 'Details' button for the pending request
  4. Enter a description and click the 'Approve' or 'Deny' button
  5. Verify the description text remains and is unchanged.
@dsajdak dsajdak added the bug Something isn't working label Jul 21, 2022
aebruno added a commit that referenced this issue Nov 23, 2022
…t-bug

Description Bug when Approving an Allocation Request
aebruno added a commit that referenced this issue Feb 4, 2023
This commit refactors the allocation approval logic in the following
ways:

1. Removes the AllocationActivateRequestView and
   AllocationDenyRequestView. These views are currently handled via GET
   requests and because they modify the database they really should be
   POST requests. The logic in these views is also a duplicate of what
   is already contained in the AllocationDetailView.

2. Modify AllocationDetailView to handle the various actions of
   update, approve, auto-approve and deny allocations. These are defined
   as follows:

   - update = user clicks the "update" button on the allocation detail
     page with the intent of updating the allocation data.

   - approve = user clicks the "approve" button on the allocation detail
     page. In addition to updating the allocation data this will set the
     status to "Active" and set the end date equal to now + ALLOCATION_DEFAULT_ALLOCATION_LENGTH days
     This also properly fixes #433.

   - auto-approve = user clicks the "approve" button from the allocation
     request list page. This will set the status to "Active" and set the end date equal to
     now + ALLOCATION_DEFAULT_ALLOCATION_LENGTH days. It will not update
     any other data on the allocation.

   - deny = user clicks the "deny" button on the allocation detail page.
     This will set the status to "Denied" and remove the start/end
     dates.

3. On the allocation request list page, the "approve" button now submits
   a POST request instead of a get request to "auto-approve" the
   allocation (see above logic). Also the button label has been changed
   to "Approve" to be consistent with the allocation detail page.
claire-peters added a commit to fasrc/coldfront that referenced this issue May 22, 2023
…220)

* various minor bugfixes ( no longer says "removed 1 users", help button only appears if user adds center url, naming typo in xdmod, Fixed force_overwrite argument.)
* Remove test fixtures and replace with Factory-based testing
* Change ProjectUserMessage model to align more closely to AllocationUserNote
* documentation improvements

* allocation and resource attribute listings sorted CI alpha

* Tested Django querying and reverse related object lookup for revamp implementation

* child resources sorted CI

* email revamp

* Commit before to allow changes from master to be pulled and merged

* Updated attach allocation links to projects and when they are expiring

* Added resource parent name to each allocation that is expiring or expired. Finished implementation of sending emails for expired allocations

* First attempt at adding email notifications on expired allocations for center staff

* Updated admin emails

* Add partial match for attribute search ICM#306

* Add AccHr and Storage metrics import from XDMoD

* Add GPUh support for XDMOD synchronisation

* Arguments in signal def are obsolete

* allocation/ resource attribute lists sorted CI

* make migrations to sort lists

* migrations edited for sorting CI

* button now displays "Activate" without attributes

* Bump Django and other dependency versions

* Fix alignment

* Fix up center help url

* Serve css/js assets locally instead of cdn.

* Add ColdFront logo and branding
* sort lists CI on front end

* flatpickr added, formatting for form control fixed

* Switch to LDAP lookup for nsaccountlock in freeipa.

* delete extra commented portion

* deleted jqueryui,  BG color changed via common.css

* Changes to allocation attribute types, global config for admin emails, adjusted admin email template, and updated docs.

* grant funding agencies sorted alphabetically

* Include allocations in 'pending renewal' status.

Fixes #176

* Updates to admin email template and logic, reverted allocation attribute name change, performed final testing.

* Adjust email receiver for admin emails

* Removed unused imports

* Changes to expiring email subject and first line

* Fixed description not displaying when setting value before Approving allocation request.

* Fixed case where user could enter just start_date. Before the website would crash, now the dates are automatically applied instead.

* Refactor allocation emails.

- Move email helper functions to utils
- Remove uncessary checks for EMAIL_ENABLED
- Use fstrings instead .format

* Added warning and choice to run initial_setup script.

* Added sorting to username, first name, last name, email, and status for project detail page

* Added user sorting on allocation detail page

* Pin importlib-metadata

* Reconstructed PR#450

* Made adjustments according to PR review

* Adjusted adding project attributes scripts

* Added argument to force setup_script and adjusted logic of script.

* Put call_command into its own function

* Updates to how we handle inputted dates

* Updated color of deny button

* Updates to warning script and short cut for argument

* Update models.py

This was preventing edits in DjangoAdmin - its ok have unique attribute in form as long as it is the existing one.

* Fix bug in init script

* changes to __str__ methods in hopes of reducing load times

* Refactor allocation approval.

This commit refactors the allocation approval logic in the following
ways:

1. Removes the AllocationActivateRequestView and
   AllocationDenyRequestView. These views are currently handled via GET
   requests and because they modify the database they really should be
   POST requests. The logic in these views is also a duplicate of what
   is already contained in the AllocationDetailView.

2. Modify AllocationDetailView to handle the various actions of
   update, approve, auto-approve and deny allocations. These are defined
   as follows:

   - update = user clicks the "update" button on the allocation detail
     page with the intent of updating the allocation data.

   - approve = user clicks the "approve" button on the allocation detail
     page. In addition to updating the allocation data this will set the
     status to "Active" and set the end date equal to now + ALLOCATION_DEFAULT_ALLOCATION_LENGTH days
     This also properly fixes ubccr#433.

   - auto-approve = user clicks the "approve" button from the allocation
     request list page. This will set the status to "Active" and set the end date equal to
     now + ALLOCATION_DEFAULT_ALLOCATION_LENGTH days. It will not update
     any other data on the allocation.

   - deny = user clicks the "deny" button on the allocation detail page.
     This will set the status to "Denied" and remove the start/end
     dates.

3. On the allocation request list page, the "approve" button now submits
   a POST request instead of a get request to "auto-approve" the
   allocation (see above logic). Also the button label has been changed
   to "Approve" to be consistent with the allocation detail page.

* Bump dep versions

* Add mkdocstring plugin for generating API docs.

* Add coldfront

* Remove

* Add configs to install coldfront

* Remove

* set python version

* Adjust python version

* Add os back

* Add core model classes to api docs

* Fix version

* Fix logic in allocation change request flow.

- Remove activate/deny GET request views for change requests
- Fix bug when setting end_date_extension

* changes to signal and email logic for allocations

* Adjust first_name max length

* Update views.py

changed references to allocation_obj.status to allocation_obj.status.name

* Update allocation_revoked.txt

* started

* start

* Fix url not displaying in emails

* Formatting fix

* Allow configuration of session timeout.

Add config option for setting a session inactivity timeout. This value
sets the session cookie age. We also save the session on each request
which will update the session cookie age on each click. This commit
fixes ubccr#452.

* improved navigation (idea credit: @aebruno)

* resource and user models have base docs

* Update docs and add links to changelogs

* removed source code dropdown and added to user docs
* added field of science, grant, publication, and research output models

* Updates and reorganization to documentation

* Add docs on importing project/allocation users

* Minor code cleanup

* updated directory name of importing file

* reorg and update of documentation

* refactor complex list views

* refactor note sections on detail pages to use templates

* add notes to department models and views

* change allocation and project note creation to use generic template

* update testing suite for model changes; add Factory-based tests to Project

* fix button presentation for allocation_change_list

* add kwargs to refactored note create views

* add note update capability

* add more project tests, fix ProjectDetail template

* change allocationlist to display allocations user belongs to regardless of project membership

* move fasrc hook out of views file and into utils

* change fixtures in preparation for replacement, replace fixtures with factories in allocation tests

* fix list_view path url

* add user_cannot_access test_helper function

* add project title to projectlist search

* make project addition button visible only to admins

* make projectcreation accessible only to superusers

* make project invoice chart only visible if it contains data

* enable project_create_form visibility

* make presence of department menu options dependent on installation status of app

* minor linting/reformatting

* pi has project permission even if pi has no ProjectUser entry

* allocationuser has allocation viewing permission even if not a projectuser

* hide Add Attribute button from non-admin users including PIs

* change name of projectusermessage message in admin view

* update archived project list template

* change allocation request button text

* add tests for ProjectDetail and archived project Views

* add UI element permissions

* add warning about inactive/denied allocations

* remove clashing datatables css reference

* reduce length of Notification Enabled header text

* make single function for creation of test data, add more tests

* nese data processing

* start using Factories in Department tests

* remove commented-out code from templates

* correct logging path

* replace plugin test fixtures with factories

* replace fixtures with factory in sftocf; remove test fixtures

* add allocationchangestatuschoices to test data setup

* change path to look for subdirectory attr name instead of ID

---------

Co-authored-by: rg663 <74742605+rg663@users.noreply.github.com>
Co-authored-by: Andrew Stoltman <aestoltm@buffalo.edu>
Co-authored-by: mdzik <mdzik@icm.edu.pl>
Co-authored-by: Andrew E. Bruno <aebruno2@buffalo.edu>
Co-authored-by: mdzik <dziki01@gmail.com>
Co-authored-by: Dori Sajdak <djm29@buffalo.edu>
Co-authored-by: ShreyasSridhar24 <ss649@buffalo.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Completed
1 participant