generated from RealDevSquad/website-template
-
Notifications
You must be signed in to change notification settings - Fork 166
[My Site Migration] Addition Extension Status button to status site #1347
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
Merged
iamitprakash
merged 19 commits into
RealDevSquad:develop
from
RishiChaubey31:extensionFeature
May 27, 2025
Merged
Changes from 15 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
1997125
initial commit for ER button
RishiChaubey31 39a54a5
removed unnecessary chnages pt1
RishiChaubey31 c11768f
refactor changes
RishiChaubey31 af49758
Merge branch 'extensionFeature' of https://github.com/RishiChaubey31/…
RishiChaubey31 f4d85dd
fixed spinner and toast
RishiChaubey31 262688c
fixed loading spinner and ETA in form
RishiChaubey31 445761e
breaking pr
RishiChaubey31 3bfeb7e
fix build fail
RishiChaubey31 18b1770
removed taskid from cardprops
RishiChaubey31 cc5e07a
added reponsiveness
RishiChaubey31 2ae8453
refactored modal component and variable name change
RishiChaubey31 c6a2878
hook name changed
RishiChaubey31 4f712a1
added test id for testing
RishiChaubey31 6556f32
updated tiemstamp function
RishiChaubey31 cca8c8f
seperated into two components
RishiChaubey31 30e5e3a
added types
RishiChaubey31 2c48eaf
small import refactor
RishiChaubey31 959291b
small type refactor
RishiChaubey31 71ef856
added test id
RishiChaubey31 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
src/components/ExtensionRequest/ExtensionRequestDetails.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| import React from 'react'; | ||
| import { formatToRelativeTime } from './ExtensionStatusModal'; | ||
|
|
||
| type ExtensionRequestDetailsProps = { | ||
| extensionRequests: any[]; | ||
| styles: any; | ||
| getExtensionRequestDetails: (request: any, styles: any) => any[]; | ||
RishiChaubey31 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }; | ||
|
|
||
| export const ExtensionRequestDetails: React.FC<ExtensionRequestDetailsProps> = | ||
| ({ extensionRequests, styles, getExtensionRequestDetails }) => { | ||
| if (extensionRequests.length === 0) { | ||
| return ( | ||
| <div | ||
| className={styles.extensionNoRequests} | ||
| data-testid="no-requests-message" | ||
| > | ||
| <p> | ||
| No extension requests found for this task, want to | ||
| create one? | ||
| </p> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| return ( | ||
| <> | ||
| {extensionRequests.map((request) => ( | ||
| <div | ||
| key={request.id} | ||
| className={styles.extensionExtensionRequest} | ||
| data-testid={`extension-request-${request.id}`} | ||
| > | ||
| {getExtensionRequestDetails(request, styles).map( | ||
| (item, idx) => ( | ||
| <div | ||
| key={idx} | ||
| className={styles.extensionDetailRow} | ||
| data-testid={`detail-row-${idx}`} | ||
| > | ||
| <span | ||
| className={styles.extensionLabel} | ||
| data-testid={`label-${item.testId}`} | ||
| > | ||
| {item.label} | ||
| </span> | ||
| <span | ||
| className={`${styles.extensionValue} ${ | ||
| item.className || '' | ||
| }`} | ||
| data-testid={`value-${item.testId}`} | ||
| > | ||
| {item.value} | ||
| </span> | ||
| </div> | ||
| ) | ||
| )} | ||
|
|
||
| {request.reviewedBy && | ||
| (request.status === 'APPROVED' || | ||
| request.status === 'DENIED') && ( | ||
| <div | ||
| className={ | ||
| request.status === 'APPROVED' | ||
| ? styles.extensionApprovalInfo | ||
| : styles.extensionRejectionInfo | ||
| } | ||
| data-testid={ | ||
| request.status === 'APPROVED' | ||
| ? 'approval-info' | ||
| : 'denied-info' | ||
| } | ||
| > | ||
| Your request was{' '} | ||
| {request.status.toLowerCase()} by{' '} | ||
| {request.reviewedBy}{' '} | ||
| {request.reviewedAt | ||
| ? formatToRelativeTime( | ||
| request.reviewedAt | ||
| ) | ||
| : ''} | ||
| </div> | ||
| )} | ||
| </div> | ||
| ))} | ||
| </> | ||
| ); | ||
| }; | ||
127 changes: 127 additions & 0 deletions
127
src/components/ExtensionRequest/ExtensionStatusModal.module.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| @import '../../styles/variables.scss'; | ||
|
|
||
| .extensionModalOverlay { | ||
| position: fixed; | ||
| top: 0; | ||
| left: 0; | ||
| right: 0; | ||
| bottom: 0; | ||
| background-color: rgba($black, 0.7); | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| z-index: 1000; | ||
| } | ||
|
|
||
| .extensionModal { | ||
| background-color: $white; | ||
| padding: 1.9rem; | ||
| border-radius: 0.6rem; | ||
| width: 90%; | ||
| max-width: 48rem; | ||
| max-height: 90vh; | ||
| overflow-y: auto; | ||
| box-shadow: 0 1.3rem 3.1rem rgba($black, 0.7); | ||
| font-family: 'Segoe UI', sans-serif; | ||
| font-size: 1rem; | ||
| } | ||
|
|
||
| .extensionModal h2 { | ||
| text-align: center; | ||
| margin-bottom: 1.9rem; | ||
| font-size: 2rem; | ||
| font-weight: 500; | ||
| color: rgba($black, 0.9); | ||
| } | ||
|
|
||
| .extensionDetailRow { | ||
| display: flex; | ||
| flex-wrap: wrap; | ||
| margin-bottom: 1rem; | ||
| line-height: 1.5; | ||
| } | ||
|
|
||
| .extensionLabel { | ||
| font-weight: bold; | ||
| width: 10rem; | ||
| color: rgba($black, 0.9); | ||
| flex-shrink: 0; | ||
| } | ||
|
|
||
| .extensionValue { | ||
| flex: 1; | ||
| color: rgba($black, 0.9); | ||
| overflow-wrap: break-word; | ||
| word-wrap: break-word; | ||
| word-break: break-word; | ||
| } | ||
|
|
||
| .extensionApprovalInfo, | ||
| .extensionRejectionInfo { | ||
| margin-top: 0.6rem; | ||
| font-style: italic; | ||
| color: $black; | ||
| text-align: center; | ||
| } | ||
|
|
||
| .extensionButtonContainer { | ||
| display: flex; | ||
| justify-content: center; | ||
| gap: 1rem; | ||
| margin-top: 1.9rem; | ||
| } | ||
|
|
||
| .extensionCloseButton, | ||
| .extensionRequestButton { | ||
| padding: 0.8rem 0; | ||
| border: none; | ||
| border-radius: 0.4rem; | ||
| cursor: pointer; | ||
| width: 40%; | ||
| font-weight: bold; | ||
| font-size: 1rem; | ||
| } | ||
|
|
||
| .extensionCloseButton { | ||
| background-color: $red; | ||
| color: $white; | ||
| } | ||
|
|
||
| .extensionRequestButton { | ||
| background-color: $green; | ||
| color: $white; | ||
| } | ||
|
|
||
| .extensionApproved { | ||
| font-weight: bold; | ||
| color: $green; | ||
| } | ||
|
|
||
| .extensionPending, | ||
| .extensionDenied { | ||
| font-weight: bold; | ||
| color: $orange; | ||
| } | ||
|
|
||
| .extensionModalLoading { | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| justify-content: center; | ||
| z-index: 1100; | ||
| background-color: $white; | ||
| padding: 1.5rem; | ||
| border-radius: 0.5rem; | ||
| max-width: 18.8rem; | ||
| } | ||
|
|
||
| .extensionNoRequests { | ||
| text-align: center; | ||
| } | ||
|
|
||
| .spinnerContainer { | ||
| display: flex; | ||
| justify-content: center; | ||
| width: 100%; | ||
| margin: 1rem 0; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.