Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/release/RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Also was added sanitization on the server side by using the `Django-Bleach` libr
* [OSDEV-1803](https://opensupplyhub.atlassian.net/browse/OSDEV-1803) - Updated text from `Facility Type` to `Location Type` and `Facility Name` to `Location Name` on the SLC `Thank You for Your Submission` page.
* [OSDEV-1838](https://opensupplyhub.atlassian.net/browse/OSDEV-1838) - Fixed an issue where the router redirected to an unsupported page when the OS ID contained a forward slash. The fix was implemented by encoding the OS ID value using the `encodeURIComponent()` function before passing it as a URL parameter.
* [OSDEV-1840](https://opensupplyhub.atlassian.net/browse/OSDEV-1840) - Fixed the snapshot status checking procedure. This will prevent a crash when trying to restore a database from an inaccessible snapshot.
* [OSDEV-1831](https://opensupplyhub.atlassian.net/browse/OSDEV-1831) - Updated copies of tooltips on the “Thank you for adding data” pop-up. The texts vary depending on the claim status for a particular location.
* [OSDEV-1827](https://opensupplyhub.atlassian.net/browse/OSDEV-1827) - Fixed the condition logic for the email template when approving a contribution to an existing production location that has either been claimed or has a pending claim request.

### What's new
Expand Down
26 changes: 17 additions & 9 deletions src/react/src/components/Contribute/ProductionLocationDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,22 @@ const getStatusBadgeClass = (classes, status) => {
}
};

const getTooltipText = claimStatus => {
if (claimStatus === PRODUCTION_LOCATION_CLAIM_STATUSES_ENUM.CLAIMED) {
return 'Production location has been claimed already.';
}
if (claimStatus === PRODUCTION_LOCATION_CLAIM_STATUSES_ENUM.PENDING) {
return 'There is a pending claim for this production location.';
const getPendingTooltipText = claimStatus => {
if (claimStatus === PRODUCTION_LOCATION_CLAIM_STATUSES_ENUM.UNCLAIMED) {
return 'Your submission is under review. You will receive a notification once the production location is live on OS Hub. You can proceed to submit a claim while your request is pending.';
}
return 'Your submission is being reviewed. You will receive an email with your OS ID once the review is complete.';
};

return "You'll be able to claim the location after the moderation is done.";
const getClaimTooltipText = claimStatus => {
switch (claimStatus) {
case PRODUCTION_LOCATION_CLAIM_STATUSES_ENUM.CLAIMED:
return 'This location has already been claimed and therefore cannot be claimed again.';
case PRODUCTION_LOCATION_CLAIM_STATUSES_ENUM.PENDING:
return 'This location cannot be claimed because a pending claim already exists.';
default:
return 'You will be able to claim this location once the review is complete.';
}
};

const ProductionLocationDialog = ({
Expand Down Expand Up @@ -149,7 +156,8 @@ const ProductionLocationDialog = ({
const deleteIcon =
moderationStatus === MODERATION_STATUSES_ENUM.PENDING ? (
<DialogTooltip
text="Your submission is under review. You will receive a notification once the production location is live on OS Hub. You can proceed to submit a claim while your request is pending."
text={getPendingTooltipText(claimStatus)}
aria-label="Pending status tooltip"
childComponent={infoIcon(classes)}
/>
) : null;
Expand Down Expand Up @@ -300,7 +308,7 @@ const ProductionLocationDialog = ({
</>
) : (
<DialogTooltip
text={getTooltipText(claimStatus)}
text={getClaimTooltipText(claimStatus)}
aria-label="Claim button tooltip"
childComponent={claimButton({
classes,
Expand Down