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

My Account 2.0 QA round 4 #426

Merged
merged 4 commits into from
Jan 2, 2025
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
4 changes: 3 additions & 1 deletion __test__/pages/bib/bibPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,9 @@ describe("Bib Page Item Table", () => {
)
await userEvent.click(screen.getByText("View all 26 items").closest("a"))
expect(
screen.getByText("Loading all 26 items. This may take a few moments...")
screen.queryAllByText(
"Loading all 26 items. This may take a few moments..."
)[0]
).toBeInTheDocument()
})

Expand Down
4,476 changes: 1,650 additions & 2,826 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"coverage": "jest --coverage"
},
"dependencies": {
"@nypl/design-system-react-components": "3.4.0",
"@nypl/design-system-react-components": "3.5.1",
"@nypl/nypl-data-api-client": "1.0.5",
"@nypl/pickup-time-estimator": "^1.5.2",
"@nypl/sierra-wrapper": "1.1.0",
Expand Down
1 change: 1 addition & 0 deletions src/components/MyAccount/Settings/PasswordForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const PasswordFormField = forwardRef<TextInputRefType, PasswordFormFieldProps>(
onChange={handler}
invalidText="Pin/passwords do not match."
isInvalid={isInvalid}
isClearable
/>
</Flex>
)
Expand Down
13 changes: 11 additions & 2 deletions src/components/MyAccount/Settings/SettingsInputForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ const SettingsInputForm = ({
updatedInputs[index] = value
setTempInputs(updatedInputs)

const firstInputEmpty = index === 0
const firstInput = index === 0

if (firstInputEmpty && (!value || !validateInput(value, updatedInputs))) {
if (firstInput && (!value || !validateInput(value, updatedInputs))) {
setError(true)
} else {
const hasInvalidInput = updatedInputs.some(
Expand Down Expand Up @@ -127,6 +127,13 @@ const SettingsInputForm = ({
setError(hasInvalidInput)
}

const handleClearableCallback = (index) => {
const updatedInputs = [...tempInputs]
updatedInputs[index] = ""
setTempInputs(updatedInputs)
setError(true)
}

const cancelEditing = () => {
setTempInputs([...inputs])
setIsEditing(false)
Expand Down Expand Up @@ -224,6 +231,8 @@ const SettingsInputForm = ({
invalidText={formUtils.errorMessage}
onChange={(e) => handleInputChange(e, index)}
isRequired
isClearable
isClearableCallback={() => handleClearableCallback(index)}
/>
{index == 0 && <div style={{ width: "57px" }}> </div>}
{index !== 0 && (
Expand Down
1 change: 1 addition & 0 deletions src/components/MyAccount/Settings/SettingsSelectForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ const SettingsSelectForm = ({
sx={{
width: { base: "80%", sm: "320px" },
marginLeft: { base: "m", lg: "unset" },
marginTop: "-xxs",
}}
content="Please set a phone number or email address to choose a notification preference."
/>
Expand Down
2 changes: 2 additions & 0 deletions src/components/MyAccount/Settings/UsernameForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ const UsernameForm = ({ patron, usernameState }: UsernameFormProps) => {
isInvalid={error && !validateUsername(tempUsername)}
showHelperInvalidText={true}
onChange={handleInputChange}
isClearable
isClearableCallback={() => setError(true)}
/>
<Button
aria-label="Delete username from your account"
Expand Down
Loading