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

Fix Request-a-Copy grant form optional message not optional in form validation #2439

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

amgciadev
Copy link
Contributor

@amgciadev amgciadev commented Aug 16, 2023

Message is optional: remove req in [disabled]

References

Add references/links to any related issues or PRs. These may include:

Description

It removes the check for an empty message for the submit button [disabled] attribute

Instructions for Reviewers

Attempt to grant a request and confirm that now the message is optional

List of changes in this PR:

  • Very simple fix removing the message emptiness check

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using yarn lint
  • My PR doesn't introduce circular dependencies (verified via yarn check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

Message is optional: remove req in [disabled]
@tdonohue tdonohue added bug 1 APPROVAL pull request only requires a single approval to merge port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release labels Aug 16, 2023
@tdonohue tdonohue added this to the 7.6.1 milestone Aug 16, 2023
@tdonohue tdonohue changed the title Fix Rac grant form optional message not optional in form validation Fix Request-a-Copy grant form optional message not optional in form validation Aug 16, 2023
@tdonohue tdonohue requested a review from artlowel August 24, 2023 14:49
@pilasou
Copy link
Contributor

pilasou commented Sep 21, 2023

@amgciadev @tdonohue Hi! I tried to test, but the fix did not seem to correct the problem, if I do not put a text in the Message text box, the answer cannot be sent, no matter if the choice is to send or deny the request.
image

Just to let you now what i did to test:

  • I am testing using Docker as described in Testing DSpace 7 Pull Requests
  • Backend is on Main branch (I change config for SMTP and rebuild)
  • Frontend on PR branch (fix-rac-grant-b)
  • Rebuild the frontend then start the frontend.
  • Connect as admin, and change Demo Submitter email by mine
  • Connect as Demo Submitter and add a new item with bitsteam with embargo
  • As anonymous go to the new item and ask for a copy
  • Clic on the URL in the email received
  • Try to accept or deny, not possible if no text is entered in the Message field.

Copy link
Member

@artlowel artlowel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @amgciadev. It works for me

@pilasou check your network tab when you approve the request. Is it possible you're getting a 403 - Invalid CSRF token error response? I got that too at first. If so, that's a variant of #1486, and not related to this PR

@pilasou
Copy link
Contributor

pilasou commented Oct 12, 2023

@artlowel @tdonohue : long story short: my 2nd test failed, but without the 403 error (see below). After reinstalling completly DSpace with Docker, I face the same problem I reported initialy.
image

The test I made this morning before Dev meeting works but I am not able to know why.

@pilasou
Copy link
Contributor

pilasou commented Oct 19, 2023

Hi @amgciadev @tdonohue, retest this morning after a clean complete reinstall of Docker and it worked. I was able to respond to the copy request without entering any additionnal message. However, if no information in entered the email contains NULL text :
image

@tdonohue
Copy link
Member

I can verify this works. However, as @pilasou noted, the result is that the literal text "null" is now returned in the response email like this:

Date: Fri, 20 Oct 2023 19:25:56 +0000 (UTC)
From: [email protected]
To: [email protected]
Subject: Request for Copy of Restricted Document is Granted

Dear Tim Donohue:

Your request for a copy of the file(s) from the below document has been approved by Demo Site Administrator.  You may find the requested file(s) attached.

Automatic Generation of Headlines for Online Math Questions
http://localhost:4000/handle/123456789/1151

An additional message from Demo Site Administrator follows:

null

Best regards,
The DSpace Started with Docker Compose Team

So, this PR works fine. But, a minor fix to the backend is needed to handle the case where this message is not specified.

I'm going to merge this, and create a tiny PR to fix the backend issue. It's literally just a check to handle a possible "null" value for this optional message field.

@tdonohue
Copy link
Member

The "null" message bug is fixed in DSpace/DSpace#9136

Merging this as it is at +3 (I vote +1 as well).

@dspace-bot
Copy link
Contributor

@tdonohue tdonohue removed the port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release label Oct 20, 2023
@amgciadev
Copy link
Contributor Author

Thanks all!

@amgciadev amgciadev deleted the fix-rac-grant-b branch October 21, 2023 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 APPROVAL pull request only requires a single approval to merge bug
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Rac grant form: message field is still used in validation even though is optional
5 participants