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

Hot fix that marks uswds components as false, fixes for these compone… #28643

Merged
merged 12 commits into from
Mar 20, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
setMessageBody('');
}
},
[recipients, draft],

Check warning on line 165 in src/applications/mhv/secure-messaging/components/ComposeForm/ComposeForm.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/mhv/secure-messaging/components/ComposeForm/ComposeForm.jsx:165:5:React Hook useEffect has a missing dependency: 'defaultRecipientsList'. Either include it or remove the dependency array.
);

useEffect(() => {
Expand Down Expand Up @@ -197,7 +197,7 @@
}

// The Blocked Triage Group alert should stay visible until the draft is sent or user navigates away
}, []);

Check warning on line 200 in src/applications/mhv/secure-messaging/components/ComposeForm/ComposeForm.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/mhv/secure-messaging/components/ComposeForm/ComposeForm.jsx:200:6:React Hook useEffect has missing dependencies: 'draft' and 'recipients'. Either include them or remove the dependency array.

useEffect(
() => {
Expand Down Expand Up @@ -228,7 +228,7 @@
.catch(setSendMessageFlag(false));
}
},
[sendMessageFlag, isSaving],

Check warning on line 231 in src/applications/mhv/secure-messaging/components/ComposeForm/ComposeForm.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/mhv/secure-messaging/components/ComposeForm/ComposeForm.jsx:231:5:React Hook useEffect has missing dependencies: 'attachments', 'category', 'currentFolder?.folderId', 'dispatch', 'draft?.messageId', 'history', 'messageBody', 'selectedRecipient', and 'subject'. Either include them or remove the dependency array.
);

useEffect(
Expand All @@ -246,7 +246,7 @@
focusElement(lastFocusableElement);
}
},
[alertStatus],

Check warning on line 249 in src/applications/mhv/secure-messaging/components/ComposeForm/ComposeForm.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/mhv/secure-messaging/components/ComposeForm/ComposeForm.jsx:249:5:React Hook useEffect has a missing dependency: 'lastFocusableElement'. Either include it or remove the dependency array.
);

const recipientExists = recipientId => {
Expand Down Expand Up @@ -442,7 +442,7 @@
}
}
},
[

Check warning on line 445 in src/applications/mhv/secure-messaging/components/ComposeForm/ComposeForm.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/mhv/secure-messaging/components/ComposeForm/ComposeForm.jsx:445:5:React Hook useEffect has missing dependencies: 'draft?.body' and 'savedDraft'. Either include them or remove the dependency array.
attachments,
category,
checkMessageValidity,
Expand Down Expand Up @@ -521,7 +521,7 @@
noTimeout();
}
},
[

Check warning on line 524 in src/applications/mhv/secure-messaging/components/ComposeForm/ComposeForm.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/mhv/secure-messaging/components/ComposeForm/ComposeForm.jsx:524:5:React Hook useCallback has missing dependencies: 'noTimeout' and 'signOutMessage'. Either include them or remove the dependency array.
draft,
selectedRecipient,
category,
Expand All @@ -541,7 +541,7 @@
noTimeout();
};
},
[beforeUnloadHandler],

Check warning on line 544 in src/applications/mhv/secure-messaging/components/ComposeForm/ComposeForm.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/mhv/secure-messaging/components/ComposeForm/ComposeForm.jsx:544:5:React Hook useEffect has a missing dependency: 'noTimeout'. Either include it or remove the dependency array.
);

return (
Expand All @@ -560,6 +560,7 @@
<form className="compose-form" id="sm-compose-form">
{saveError && (
<VaModal
uswds={false}
modalTitle={saveError.title}
onCloseEvent={() => {
setSaveError(null);
Expand All @@ -573,6 +574,7 @@
<p>{saveError.p1}</p>
{saveError.p2 && <p>{saveError.p2}</p>}
<va-button
uswds={false}
text="Continue editing"
onClick={() => setSaveError(null)}
/>
Expand Down Expand Up @@ -620,6 +622,7 @@
!allTriageGroupsBlocked && (
<>
<VaSelect
uswds={false}
enable-analytics
id="recipient-dropdown"
label="To"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
if (!folders) {
dispatch(getFolders());
}
}, []);

Check warning on line 42 in src/applications/mhv/secure-messaging/components/ManageFolderButtons.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/mhv/secure-messaging/components/ManageFolderButtons.jsx:42:6:React Hook useEffect has missing dependencies: 'dispatch' and 'folders'. Either include them or remove the dependency array.

useEffect(
() => {
Expand Down Expand Up @@ -123,7 +123,7 @@
// This container needs to be updated to USWDS v3 when the project updates. These buttons are to become a button group, segmented
<div className="manage-folder-container">
{/* TODO add GA event for both buttons */}
<button

Check warning on line 126 in src/applications/mhv/secure-messaging/components/ManageFolderButtons.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/mhv/secure-messaging/components/ManageFolderButtons.jsx:126:11:The <va-button> Web Component should be used instead of the button HTML element.
type="button"
className="left-button usa-button-secondary"
data-testid="edit-folder-button"
Expand All @@ -132,7 +132,7 @@
>
Edit folder name
</button>
<button

Check warning on line 135 in src/applications/mhv/secure-messaging/components/ManageFolderButtons.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/mhv/secure-messaging/components/ManageFolderButtons.jsx:135:11:The <va-button> Web Component should be used instead of the button HTML element.
type="button"
className="right-button usa-button-secondary"
data-testid="remove-folder-button"
Expand All @@ -144,6 +144,7 @@
)}
{isEmptyWarning && (
<VaModal
uswds={false}
className="modal"
data-testid="error-folder-not-empty"
visible={isEmptyWarning}
Expand All @@ -156,6 +157,7 @@
>
<p>{Alerts.Folder.DELETE_FOLDER_ERROR_NOT_EMPTY_BODY}</p>
<va-button
uswds={false}
ref={emptyFolderConfirmBtn}
text="Ok"
onClick={() => {
Expand Down Expand Up @@ -190,6 +192,7 @@
</VaModal>
)}
<VaModal
uswds={false}
className="modal"
data-testid="rename-folder-modal"
visible={renameModal}
Expand All @@ -215,11 +218,13 @@
charcount
/>
<va-button
uswds={false}
text="Save"
onClick={confirmRenameFolder}
data-dd-action-name="Save Rename Folder Button"
/>
<va-button
uswds={false}
secondary="true"
text="Cancel"
onClick={closeRenameModal}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const MoveMessageToFolderBtn = props => {
data-testid="message-actions-buttons-modal"
>
<VaModal
uswds={false}
id="move-to-modal"
data-testid="move-to-modal"
large
Expand Down Expand Up @@ -165,11 +166,13 @@ const MoveMessageToFolderBtn = props => {
<p /> {/* to create extra margin between radio and action buttons */}
{/* For creating a new folder and moving the thread */}
<va-button
uswds={false}
text="Confirm"
onClick={handleConfirmMoveFolderTo}
data-dd-action-name="Confirm Move to Button"
/>
<va-button
uswds={false}
secondary
text="Cancel"
onClick={closeModal}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const CreateFolderModal = props => {

return (
<VaModal
uswds={false}
className="modal"
visible={isCreateNewModalVisible}
large="true"
Expand All @@ -82,12 +83,14 @@ const CreateFolderModal = props => {
charcount
/>
<va-button
uswds={false}
text="Create"
onClick={confirmNewFolder}
data-testid="create-folder-button"
data-dd-action-name="Confirm Create New Folder Button"
/>
<va-button
uswds={false}
secondary="true"
text="Cancel"
onClick={closeNewModal}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,14 @@ const FilterBox = forwardRef((props, ref) => {
</VaModal>
)}

<va-accordion open-single>
<va-accordion-item id="additional-filter-accordion">
<va-accordion uswds={false} open-single>
<va-accordion-item uswds={false} id="additional-filter-accordion">
<h3 slot="headline" className="headline-text">
Add filters
</h3>
<div className="filter-content">
<VaSelect
uswds={false}
id="category-dropdown"
label="Category"
name="category"
Expand All @@ -114,6 +115,7 @@ const FilterBox = forwardRef((props, ref) => {
</VaSelect>

<VaSelect
uswds={false}
id="date-range-dropdown"
label="Date range"
name="dateRange"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const ThreadListSort = props => {
>
<h2 className="sr-only">Sort conversations</h2>
<VaSelect
uswds={false}
id="sort-order-dropdown"
data-dd-action-name="Sort Order Dropdown"
className="small-screen:vads-u-margin-right--1 vads-u-width--full small-screen:vads-u-flex--1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const RouteLeavingGuard = ({
<>
<Prompt when={when} message={handleBlockedNavigation} />
<VaModal
uswds={false}
modalTitle={title}
onCloseEvent={closeModal}
status="warning"
Expand All @@ -78,11 +79,13 @@ export const RouteLeavingGuard = ({
</p>
{p2 && <p>{p2}</p>}
<va-button
uswds={false}
text={confirmButtonText}
onClick={closeModal}
data-dd-action-name="Cancel Navigation Continue Editing Button"
/>
<va-button
uswds={false}
secondary
text={cancelButtonText}
onClick={handleConfirmNavigationClick}
Expand Down
4 changes: 2 additions & 2 deletions src/applications/mhv/secure-messaging/sass/search.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import "~@department-of-veterans-affairs/formation/sass/shared-variables";

.search-form {
background-color: var(--color-gray-lightest);
background-color: var(--uswds-system-color-gray-5);
padding: 10px 16px;
margin-top: 24px;

Expand Down Expand Up @@ -102,7 +102,7 @@
margin: 6px 0 6px;
}
.error-message {
color: var(--color-secondary-dark);
color: $color-secondary-dark;
padding-top: 0.8rem;
font-weight: 700;
margin-bottom: 1.2rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class FolderManagementPage {
.find('[class = "form-radio-buttons hydrated"]', {
includeShadowDom: true,
})
.find('[id = "radiobutton-Deleted"]', { includeShadowDom: true })
.find('[for = "radiobutton-Deletedinput"]', { includeShadowDom: true })
.click();
};

Expand Down Expand Up @@ -229,7 +229,7 @@ class FolderManagementPage {
{},
);
cy.get(Locators.BUTTONS.MOVE_BUTTON_TEXT).click({ force: true });
cy.get(`[data-testid="radiobutton-${folderName}"]`)
cy.get(`[for="radiobutton-${folderName}input"]`)
.should('exist')
.click();
cy.get(Locators.BUTTONS.TEXT_CONFIRM).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,7 @@ class PatientComposePage {
};

verifyAlertModal = () => {
cy.get(`[modaltitle="We can't save this message yet"]`)
.shadow()
.find('[class="usa-modal va-modal-alert"]')
.should('contain', Data.MESSAGE_CANNOT_SAVE_YET);
cy.get(`h1`).should('contain', "We can't save this message yet");
};

clickOnContinueEditingButton = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class PatientReplyPage {

verifyModalMessageDisplayAndBuddontsCantSaveDraft = () => {
cy.get(Locators.REPLY_FORM)
.find('h2')
.find('h1')
.should('have.text', "We can't save this message yet");

cy.contains('Continue editing').should('be.visible');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('recipients dropdown box', () => {
.find('select')
.find('option')
.its('length')
.should('equal', mockRecipients.data.length + 2);
.should('equal', mockRecipients.data.length + 1);
cy.get(Locators.ALERTS.MESS_CATAGO)
.first()
.click({ force: true });
Expand Down Expand Up @@ -51,7 +51,7 @@ describe('recipients dropdown box', () => {
.find('select')
.find('option')
.its('length')
.should('equal', mockBlockedRecipientsresponse.data.length + 1);
.should('equal', mockBlockedRecipientsresponse.data.length);
cy.get(Locators.ALERTS.REPT_SELECT)
.first()
.click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('Secure Messaging - Move Message with Attachment', () => {
.find('[class = "form-radio-buttons hydrated"]', {
includeShadowDom: true,
})
.find('[id = "radiobutton-Deleted"]', { includeShadowDom: true })
.find('[for = "radiobutton-Deletedinput"]', { includeShadowDom: true })
.click();
cy.get(Locators.ALERTS.MOVE_MODAL)
.find('va-button[text="Confirm"]')
Expand Down