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

Feature #9514, Feature #9378 Unaccepted Assets Report Actions, Fixed [ch16410] #9529

Conversation

dampfklon
Copy link
Contributor

@dampfklon dampfklon commented May 3, 2021

Description

Added unaccepted Assets Report Actions (send reminder, delete) added, this allows to resend the Asset acceptence notification to the user and to delete a unaccepted entry.
Fixed unaccepted Assets Export, report is currently broken, this error also occurs on the demo instance https://demo.snipeitapp.com/reports/export/unaccepted_assets

Adds #9378
Adds #9514

EDIT: This should also Fixes #2294 as this is the last missing feature in this request.

This is my first bigger PR, I am not sure the functions sentAssetAcceptanceReminder and deleteAssetAcceptance are at the right place. There are also no added tests for the functions as I am not sure how to implement them.

Feedback would be appreciated.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test Unaccepted Assets Report Action
  • Open Unaccepted Assets Report
  • Actions send reminder, delete are displayed
  • click send reminder
  • "Asset delivery confirmation" mail is sent to user, same mail as on checkout
  • Unaccepted Assets Report is displayed with the success banner
  • click delete
  • confirmation modal is displayed
  • confirm
  • Unaccepted Assets Report is displayed with the success banner and deleted entry not longer in list
  • Test Fix Unaccepted Assets Export
  • Open Unaccepted Assets Report
  • click the "Download All" Button in the top right
  • download CSV file
  • contents "match" Unaccepted Assets Report

Test Configuration:

  • Alpine Dockerimage

Checklist:

@dampfklon dampfklon requested a review from snipe as a code owner May 3, 2021 19:41
@snipe snipe requested review from inietov and uberbrady May 5, 2021 05:33
@snipe snipe changed the title Feature #9514, Feature #9378 Unaccepted Assets Report Actions Feature #9514, Feature #9378 Unaccepted Assets Report Actions, Fixed [ch16410] May 5, 2021
@dampfklon
Copy link
Contributor Author

different approach to #9508

@inietov
Copy link
Collaborator

inietov commented May 5, 2021

It works as described, only have a couple observations. Which is why I would like @uberbrady and @snipe input.

  • I'm not sure we need to delete the Acceptance Requests?. I can think of a couple scenarios where deleting them could cause some kind of dispute in the organization using the feature.
  • When a user with pending acceptance is deleted, it appears in the report as 'deleted user'. I think we need to define what we want to happen in that case, the acceptance request doesn't need to appear at all? or putting this label is the correct and expected behaviour?

Otherwise I think it's a solid PR and I'm willing to accept it once these subjects are clarified. Thanks for your work on this @dampfklon!!

@dampfklon
Copy link
Contributor Author

I'm not sure we need to delete the Acceptance Requests?. I can think of a couple scenarios where deleting them could cause some kind of dispute in the organization using the feature.

Good point, i think it would be at least necessary to have a dedicated permission to this function.

When a user with pending acceptance is deleted, it appears in the report as 'deleted user'. I think we need to define what we want to happen in that case, the acceptance request doesn't need to appear at all? or putting this label is the correct and expected behavior?

I think this should actually never happen. A user can't be deleted as long as assets are still checked out to him and I would think the pending acceptance should be removed when a asset get checked in.
Then there wouldn't be any pending acceptance for deleted users.

@snipe
Copy link
Owner

snipe commented May 26, 2021

Good point, i think it would be at least necessary to have a dedicated permission to this function.

I'm kinda loathe to add more permissions, tbh. Perhaps something more like we don't show deleted ones by default, but there's an option to show deleted, as we do for Users?

When a user with pending acceptance is deleted, it appears in the report as 'deleted user'. I think we need to define what we want to happen in that case, the acceptance request doesn't need to appear at all? or putting this label is the correct and expected behavior?

I think in the activity report, we should show the user's name with a strikethrough, as we do elsewhere in the system. If the user has been deleted and purged, we show "deleted user", again, as we do elsewhere in the system.

Agreed that if the item has been checked out to a user, they never accepted it, and they were subsequently checkin-and-deleted (so, a user got something checked out, never accepted it, and was fired), we probably want to keep track of that information, I'm just not exactly sure where that makes the most sense. If legal action needed to be taken against the employee, for example, we wouldn't want to lose the fact that they never accepted that item, even though it was checked out to them.

@snipe
Copy link
Owner

snipe commented Jun 23, 2021

Hey there - just following up on this - any additional thoughts on the last part of our convo?

@dampfklon
Copy link
Contributor Author

I'm kinda loathe to add more permissions, tbh. Perhaps something more like we don't show deleted ones by default, but there's an option to show deleted, as we do for Users?

So, no new permissions 😄 I think it should be a valid solution to have the option to show deleted requests.

I think in the activity report, we should show the user's name with a strikethrough, as we do elsewhere in the system. If the user has been deleted and purged, we show "deleted user", again, as we do elsewhere in the system.

I will change the display as suggested. Do you have a place where I could look for this solution?

Agreed that if the item has been checked out to a user, they never accepted it, and they were subsequently checkin-and-deleted (so, a user got something checked out, never accepted it, and was fired), we probably want to keep track of that information, I'm just not exactly sure where that makes the most sense. If legal action needed to be taken against the employee, for example, we wouldn't want to lose the fact that they never accepted that item, even though it was checked out to them.

Currently it’s not possible to delete a user who as checked out assets. In the case the user who did not accept the asset and also did not return the asset could not be deleted. This results in no unaccepted requests with deleted users except for deleted requests where the rendering as described above is in place.

@dampfklon dampfklon force-pushed the Feature_#9514_Asset_Acceptance,_resend_mail/_send_remainder branch from 1b99361 to e1c4eb7 Compare July 16, 2021 21:47
@dampfklon
Copy link
Contributor Author

Suggested Changes are done.

@inietov
Copy link
Collaborator

inietov commented Jul 29, 2021

I think it's ok to merge this, the new changes made sense, only observation:

- [x]  Test Fix Unaccepted Assets Export

Call http://example.com/reports/export/unaccepted_assets
download CSV file
contents "match" Unaccepted Assets Report

The route described in that use case doesn't exist anymore, which I don't find problematic, since the report is downloadable on other route without the Asset::unaccepted() method. Just wanted to mention as the test case still appears in your description, great job!!

@dampfklon
Copy link
Contributor Author

Thanks for the heads-up, you are right in the refactoring i changed the route to match the activity report.
Reviewing the changes i notices i accedentialy commited chnages to the docker.env and migrations which should be in the PR.

I will push a update wihtout those changes.

@dampfklon dampfklon force-pushed the Feature_#9514_Asset_Acceptance,_resend_mail/_send_remainder branch 2 times, most recently from 4144688 to ef10845 Compare July 29, 2021 22:01
@dampfklon dampfklon force-pushed the Feature_#9514_Asset_Acceptance,_resend_mail/_send_remainder branch from ef10845 to ab4a234 Compare October 7, 2021 19:34
@dampfklon
Copy link
Contributor Author

Updated the PR to fix the merge conflicts from the v6 merge to develop.
Would be nice if this could be merged.

@snipe
Copy link
Owner

snipe commented Oct 7, 2021

I'll approve this PR, but man is this going to be ugly when we merge to master. :( We've done a lot of hot fixes on master for asset acceptance and stuff.

@snipe snipe merged commit 5f52ee5 into snipe:develop Oct 7, 2021
@dampfklon dampfklon deleted the Feature_#9514_Asset_Acceptance,_resend_mail/_send_remainder branch October 7, 2021 21:37
@dampfklon
Copy link
Contributor Author

That sucks :( Thanks for merging nevertheless, I will happily test the changes on RC when it drops.

@AlexanderWPapyrus
Copy link
Contributor

Can't wait for a resend and delete unaccapted asset funcionality 😍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants