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

feat(react): AccountSettings component preview release #3108

Merged
merged 37 commits into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
caaaa81
ci: setup tests on `account-settings/main` feature branch (#2796)
wlee221 Oct 25, 2022
ea95272
Merge remote-tracking branch 'origin/main' into account-settings/main
wlee221 Nov 1, 2022
035ab96
feat(hooks): update `useAuth` to handle more auth hub events (#2795)
wlee221 Nov 1, 2022
62e5a2d
feat(environments): add `optional-totp-and-sms-mfa` environment (#2872)
wlee221 Nov 2, 2022
4735d10
feat(account-settings): ChangePassword component (#2885)
wlee221 Nov 4, 2022
bde841e
refactor(account-settings): share `<ValidationErrors />` (#2908)
wlee221 Nov 8, 2022
28d1c62
feat(account-settings): add DeleteUser component (#2927)
wlee221 Nov 10, 2022
7b05d8e
feat: add password validation to `ConfirmPassword` (#2900)
wlee221 Nov 14, 2022
3b0916f
chore(ci): Enable publish (#2984)
wlee221 Nov 15, 2022
8a65f82
feat(account-settings): Add ConfigureTOTP component (#2969)
wlee221 Nov 15, 2022
654b7f4
Merge branch 'main' into account-settings/main
wlee221 Nov 16, 2022
b29a47b
Merge remote-tracking branch 'origin/main' into account-settings/main
wlee221 Nov 22, 2022
bb7e250
docs(account-settings): starting docs (#3084)
wlee221 Nov 29, 2022
3b1b8a8
Merge remote-tracking branch 'origin/main' into account-settings/main
wlee221 Nov 30, 2022
d839d84
Revert "feat(account-settings): Add ConfigureTOTP component" (#3083)
wlee221 Nov 30, 2022
08e42db
fix(ci): add storage secrets to account settings workflows (#3115)
wlee221 Dec 1, 2022
ec3c007
feat(account-settings): enable component override for <ChangePassword…
wlee221 Dec 1, 2022
e85e3fa
feat(account-settings): Enable component override for <DeleteUser /> …
wlee221 Dec 2, 2022
5daab1b
feat(account-settings): namespace account settings components (#3118)
wlee221 Dec 2, 2022
26bb3b1
Merge branch 'main' into account-settings/main
wlee221 Dec 2, 2022
95cf672
Fix incorrect merge conflict resolve
wlee221 Dec 2, 2022
1377dc7
Merge branch 'account-settings/main' of github.com:aws-amplify/amplif…
wlee221 Dec 2, 2022
ecb2b3e
feat(account-settings): align classnames (#3128)
wlee221 Dec 2, 2022
a53d79f
Merge branch 'main' into account-settings/main
wlee221 Dec 2, 2022
ab10467
chore(account-settings): overrides cleanup (#3131)
wlee221 Dec 2, 2022
6b30ffa
docs(account-settings): Account Settings intro docs (#3127)
wlee221 Dec 5, 2022
a19b117
chore(AccountSettings): update subcomponent names and types (#3134)
calebpollman Dec 5, 2022
e616b95
Merge branch 'main' into account-settings/main
wlee221 Dec 5, 2022
04538bd
Merge branch 'main' into account-settings/main
wlee221 Dec 5, 2022
6aa8a18
feat(account-settings): use new button variants (#3137)
wlee221 Dec 5, 2022
956a2b0
docs(account-settings): delete user docs (#3087)
wlee221 Dec 6, 2022
1ee427f
fix(account-settings): early return if isPending is true (#3141)
wlee221 Dec 6, 2022
d7f0acf
chore(account-settings): add changeset (#3142)
wlee221 Dec 6, 2022
f5c4cb5
Merge branch 'main' into account-settings/main
wlee221 Dec 6, 2022
af97cf5
Fix typos (#3143)
wlee221 Dec 6, 2022
4af0a1e
e2e concurrency group
wlee221 Dec 6, 2022
346c2d4
Merge branch 'account-settings/main' of github.com:aws-amplify/amplif…
wlee221 Dec 6, 2022
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
8 changes: 8 additions & 0 deletions .changeset/cold-hats-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@aws-amplify/ui-react': minor
'@aws-amplify/ui': minor
---

Adds `ChangePassword` and `DeleteUser` Account Settings components. These components are standalone components that add account management flows after users authenticate.

These components are in developer preview. Please see https://ui.docs.amplify.aws/react/connected-components/account-settings to learn more.
46 changes: 46 additions & 0 deletions .github/workflows/publish-account-settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Description: This workflow runs unit + e2e tests on `account-settings/main`.
#
# Triggered by: merge to `account-settings/main` branch

name: Test / Account Settings

on:
push:
branches: [account-settings/main]

jobs:
test:
uses: aws-amplify/amplify-ui/.github/workflows/reusable-e2e.yml@account-settings/main
with:
commit: ${{ github.sha }}
repository: ${{ github.repository }}
secrets:
# TODO: migrate away from this account once tfn is migrated
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# TODO: migrate away from this account once tfn is migrated
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID_AUTH: ${{ secrets.AWS_ACCESS_KEY_ID_AUTH }}
AWS_SECRET_ACCESS_KEY_AUTH: ${{ secrets.AWS_SECRET_ACCESS_KEY_AUTH }}
AWS_ACCESS_KEY_ID_DATASTORE: ${{ secrets.AWS_ACCESS_KEY_ID_DATASTORE }}
AWS_SECRET_ACCESS_KEY_DATASTORE: ${{ secrets.AWS_SECRET_ACCESS_KEY_DATASTORE }}
AWS_ACCESS_KEY_ID_GEO: ${{ secrets.AWS_ACCESS_KEY_ID_GEO }}
AWS_SECRET_ACCESS_KEY_GEO: ${{ secrets.AWS_SECRET_ACCESS_KEY_GEO }}
AWS_ACCESS_KEY_ID_STORAGE: ${{ secrets.AWS_ACCESS_KEY_ID_STORAGE }}
AWS_SECRET_ACCESS_KEY_STORAGE: ${{ secrets.AWS_SECRET_ACCESS_KEY_STORAGE }}
DOMAIN: ${{ secrets.DOMAIN }}
PHONE_NUMBER: ${{ secrets.PHONE_NUMBER }}
USERNAME: ${{ secrets.USERNAME }}
NEW_PASSWORD: ${{ secrets.NEW_PASSWORD }}
VALID_PASSWORD: ${{ secrets.VALID_PASSWORD }}
SITE_URL: ${{ secrets.SITE_URL }}
DOCSEARCH_DOCS_APP_ID: ${{ secrets.DOCSEARCH_DOCS_APP_ID }}
DOCSEARCH_DOCS_API_KEY: ${{ secrets.DOCSEARCH_DOCS_API_KEY }}
DOCSEARCH_DOCS_INDEX_NAME: ${{ secrets.DOCSEARCH_DOCS_INDEX_NAME }}

publish:
needs: test
uses: ./.github/workflows/reusable-tagged-publish.yml
with:
dist-tag: account-settings
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
43 changes: 43 additions & 0 deletions .github/workflows/test-account-settings-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Description: This workflow runs unit + e2e tests on PRs
# targeting `account-settings/main`.
#
# Triggered by:
# (1) maintainer pushes a commit to PRs targeting those branches.

name: Test / Account Settings / PRs

concurrency:
group: e2e-accountsettings-${{ github.event.pull_request.id }}
cancel-in-progress: true

on:
pull_request:
branches: [account-settings/main]
types: [opened, synchronize]

jobs:
test:
uses: aws-amplify/amplify-ui/.github/workflows/reusable-e2e.yml@account-settings/main
with:
commit: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} # TODO: Remove this
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} #TODO: Remove this
AWS_ACCESS_KEY_ID_AUTH: ${{ secrets.AWS_ACCESS_KEY_ID_AUTH }}
AWS_SECRET_ACCESS_KEY_AUTH: ${{ secrets.AWS_SECRET_ACCESS_KEY_AUTH }}
AWS_ACCESS_KEY_ID_DATASTORE: ${{ secrets.AWS_ACCESS_KEY_ID_DATASTORE }}
AWS_SECRET_ACCESS_KEY_DATASTORE: ${{ secrets.AWS_SECRET_ACCESS_KEY_DATASTORE }}
AWS_ACCESS_KEY_ID_GEO: ${{ secrets.AWS_ACCESS_KEY_ID_GEO }}
AWS_SECRET_ACCESS_KEY_GEO: ${{ secrets.AWS_SECRET_ACCESS_KEY_GEO }}
AWS_ACCESS_KEY_ID_STORAGE: ${{ secrets.AWS_ACCESS_KEY_ID_STORAGE }}
AWS_SECRET_ACCESS_KEY_STORAGE: ${{ secrets.AWS_SECRET_ACCESS_KEY_STORAGE }}
DOMAIN: ${{ secrets.DOMAIN }}
PHONE_NUMBER: ${{ secrets.PHONE_NUMBER }}
USERNAME: ${{ secrets.USERNAME }}
NEW_PASSWORD: ${{ secrets.NEW_PASSWORD }}
VALID_PASSWORD: ${{ secrets.VALID_PASSWORD }}
SITE_URL: ${{ secrets.SITE_URL }}
DOCSEARCH_DOCS_APP_ID: ${{ secrets.DOCSEARCH_DOCS_APP_ID }}
DOCSEARCH_DOCS_API_KEY: ${{ secrets.DOCSEARCH_DOCS_API_KEY }}
DOCSEARCH_DOCS_INDEX_NAME: ${{ secrets.DOCSEARCH_DOCS_INDEX_NAME }}
17 changes: 17 additions & 0 deletions docs/src/data/links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,23 @@ export const connectedComponents: ComponentNavItem[] = [
platforms: ['react', 'vue', 'angular', 'react-native'],
tertiary: true,
},
{
href: '/connected-components/account-settings',
label: 'Account Settings',
platforms: ['react'],
},
{
href: '/connected-components/account-settings/change-password',
label: 'Change Password',
platforms: ['react'],
tertiary: true,
},
{
href: '/connected-components/account-settings/delete-user',
label: 'Delete User',
platforms: ['react'],
tertiary: true,
},
{
href: '/connected-components/geo',
label: 'Geo',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Alert } from '@aws-amplify/ui-react';
import { useRouter } from 'next/router';

export const DeveloperPreview = () => {
const {
query: { platform = 'react' },
} = useRouter();
if (platform !== 'react') return null;

return (
<Alert variation="info" heading="Developer Preview">
Account Settings components are currently in developer preview.
</Alert>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: ChangePassword
metaTitle: ChangePassword
description: ChangePassword component enables end users to change their password.
supportedFrameworks: react
---

import { Fragment } from '@/components/Fragment';
import { DeveloperPreview } from '../DeveloperPreview';

<DeveloperPreview />

<Fragment>{({ platform }) => import(`./${platform}.mdx`)}</Fragment>
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
export const CHANGE_PASSWORD = [
{
name: `onSuccess?`,
description:
'Callback function triggered when password is successfully updated',
type: `() => void`,
},
{
name: `onError?`,
description: 'Callback function triggered when change password fails',
type: `(error: Error) => void`,
},
{
name: `validators?`,
description: 'Custom password validations',
type: `ValidatorOptions[]`,
},
{
name: `components?`,
description: 'Submit button',
type: `ChangePasswordComponents`,
},
];

export const OVERRIDES = [
{
name: `CurrentPasswordField?`,
description: 'Password field for current password',
type: `PasswordFieldProps`,
},
{
name: `NewPasswordField?`,
description: 'Password field for new password',
type: `PasswordFieldProps`,
},
{
name: `ConfirmPasswordField?`,
description: 'Password field for confirm password',
type: `PasswordFieldProps`,
},
{
name: `ErrorMessage?`,
description: 'Error alert that displays on delete user errors',
type: `ErrorMessageComponentProps`,
},
{
name: `SubmitButton?`,
description: 'Submit button',
type: `SubmitButtonProps`,
},
];

export const PASSWORD_FIELDS = [
{
name: `onBlur`,
description:
'Blur handler for the input. This must be passed to your input element.',
type: `React.FocusEventHandler<HTMLInputElement>`,
},
{
name: `onChange`,
description:
'Change handler for the input. This must be passed to your input element.',
type: `React.ChangeEventHandler<HTMLInputElement>`,
},
{
name: `name`,
description:
'HTML name for the input. This must be passed to your input element.',
type: `React.ChangeEventHandler<HTMLInputElement>`,
},
{
name: `fieldValidationErrors?`,
description: 'List of validation errors for the password field.',
type: `string[]`,
},
];

export const SUBMIT_BUTTON = [
{
name: `isDisabled`,
description:
'Boolean representing whether account deletion is in progress. Your delete button should be disabled if this is set to true.',
type: `boolean`,
},
];
Loading