Skip to content

Commit

Permalink
chore(mv): clean up before merge to main (#4708)
Browse files Browse the repository at this point in the history
  • Loading branch information
calebpollman authored Nov 14, 2023
1 parent 164ad9d commit b4f205c
Show file tree
Hide file tree
Showing 38 changed files with 310 additions and 612 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/reusable-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ jobs:
include:
- example: angular
package: angular
tags: '@angular and not @todo-angular and not @todo-migration'
tags: '@angular and not @todo-angular'

- example: next
package: react
tags: '@react and not @todo-react and not @todo-migration'
tags: '@react and not @todo-react'

- example: vue
package: vue
tags: '@vue and not @todo-vue and not @todo-migration'
tags: '@vue and not @todo-vue'

steps:
- name: Checkout Amplify UI
Expand Down
1 change: 0 additions & 1 deletion docs/src/components/SocialProviderDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { translations } from '@aws-amplify/ui';
import { Authenticator } from '@aws-amplify/ui-react';

// @todo-migration fix import
import { I18n } from 'aws-amplify/utils';
import * as React from 'react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
View,
} from '@aws-amplify/ui-react';

// @todo-migration fix import
import { I18n } from 'aws-amplify/utils';
import * as React from 'react';

Expand Down
2 changes: 0 additions & 2 deletions examples/angular/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
"lib": ["es2020", "dom", "dom.iterable"],
"esModuleInterop": true,
"strict": true,
// @todo-migration remove
"skipLibCheck": true,
"paths": {
"@aws-amplify/ui-angular": ["../../packages/angular/dist/ui-angular"],
"@aws-amplify/ui-angular/*": ["../../packages/angular/dist/ui-angular/*"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ import Layout from '../components/Layout';

Amplify.configure({
...awsExports,
// @todo-migration re-enable
// Analytics: {
// autoSessionRecord: false,
// },
// Analytics: { autoSessionRecord: false },
});

const App = () => {
Expand Down
5 changes: 1 addition & 4 deletions examples/next/pages/ui/components/liveness/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ import Layout from './components/Layout';

Amplify.configure({
...awsExports,
// @todo-migration re-enable
// Analytics: {
// autoSessionRecord: false,
// },
// Analytics: { autoSessionRecord: false },
});

const App = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import awsExports from './aws-exports';

Amplify.configure({
...awsExports,
// @todo-migration re-enable
// Analytics: {
// autoSessionRecord: false,
// },
// Analytics: { autoSessionRecord: false },
});

const App = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import { Alert, Card, Heading, View, Text } from '@aws-amplify/ui-react';

Amplify.configure({
...awsExports,
// @todo-migration re-enable
// Analytics: {
// autoSessionRecord: false,
// },
// Analytics: { autoSessionRecord: false },
});

const App = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as React from 'react';
import { Amplify } from 'aws-amplify';
import { withAuthenticator } from '@aws-amplify/ui-react';
// @todo-migration remove

import { Field } from '@aws-amplify/ui-react/internal';
import { StorageManager } from '@aws-amplify/ui-react-storage';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Amplify } from 'aws-amplify';
import { withAuthenticator } from '@aws-amplify/ui-react';
// @todo-migration remove

import {
StorageManager,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
StorageManagerProps,
} from '@aws-amplify/ui-react-storage';
import '@aws-amplify/ui-react/styles.css';
// @todo-migration remove

import awsExports from './aws-exports';
Amplify.configure(awsExports);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Button } from 'react-native';

import { Authenticator, useAuthenticator } from '@aws-amplify/ui-react-native';
import { Amplify } from 'aws-amplify';
import { signUp } from 'aws-amplify/auth';
import { SignUpInput, signUp } from 'aws-amplify/auth';

import awsconfig from './aws-exports';

Expand All @@ -19,26 +19,18 @@ function App() {
<Authenticator.Provider>
<Authenticator
services={{
handleSignUp: (formData) => {
let { username, password, attributes = {} } = formData;
// custom username
username = username.toLowerCase();
// @todo-migration clean up
attributes.email = attributes.email
? attributes?.email.toLowerCase()
: undefined;
return signUp({
username,
handleSignUp: ({ username, password, options }: SignUpInput) =>
signUp({
username: username.toLowerCase(),
password,
options: {
userAttributes: attributes,
...options,
userAttributes: {
...options?.userAttributes,
email: options?.userAttributes?.email?.toLowerCase(),
},
},
// @todo-migration re-enable
// autoSignIn: {
// enabled: true,
// },
});
},
}),
}}
>
<SignOutButton />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ UI is not rendered in the DOM tree.
Background:
Given I'm running the example "/ui/components/authenticator/auth-status"

@@todo-migration @angular @react @vue
@angular @react @vue
Scenario: Sign in with confirmed credentials, reload, sign out, and reload
Then I see "unauthenticated"
When I type my "username" with status "CONFIRMED"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Feature: Headless Usage
Background:
Given I'm running the example "/ui/components/authenticator/useAuthenticator"

@@todo-migration @angular @react @vue
@angular @react @vue
Scenario: Conditionally render Login and Logout component

/useAuthenticator example uses headless API to get access to conditionally render
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@ Feature: Map with LocationSearch
Given I'm running the example "ui/components/geo/map-with-location-search"
Then my default search results is 5

@todo-migration @react
@react
Scenario: Map markers for search results
When I search for "Amazon Go"
Then I press the enter key
Then I see markers equal to my default search results

@todo-migration @react
@react
Scenario: Single map marker
When I search for "Amazon Go"
Then I select the first search result
Then I see one marker

@todo-migration @react
@react
Scenario: Marker information popup
When I search for "Amazon Go"
Then I press the enter key
Then I click on a map marker
Then I see an information popup

@todo-migration @react
@react
Scenario: Clear search results
When I search for "Amazon Go"
Then I clear the search results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Feature: Map with Marker Popup
Background:
Given I'm running the example "ui/components/geo/map-with-marker-popup"

@todo-migration @react
@react
Scenario: Popup Appears when Marker Is Clicked
When I click on a map marker
Then I see a popup about the marker appear
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Feature: Map with Moving Marker
Background:
Given I'm running the example "ui/components/geo/map-with-moving-marker"

@todo-migration @react
@react
Scenario: Marker position updates
When I see the position of a map marker
Then I click a button to move the map marker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: Native Map Method

Using the native maplibre-gl methods.

@todo-migration @react
@react
Scenario Outline: Native "flyTo" method should change map viewport
Given I'm running the example "ui/components/geo/<example>"
When I see the map load
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ Feature: Standalone LocationSearch
Given I'm running the example "ui/components/geo/standalone-location-search"
Then my default search results is 5

@todo-migration @react
@react
Scenario: Shows results while typing
When I search for "Amazon Go"
Then I see results equal to my default search results

@todo-migration @react
@react
Scenario: Select a single result
When I search for "Amazon Go"
Then I select the first search result
Then I see no search results
Then the search input is not empty

@todo-migration @react
@react
Scenario: Clear search results
When I search for "Amazon Go"
Then I clear the search results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ Feature: Disable Start Screen
Background:
Given I'm running the example "ui/components/liveness/disable-start-screen/"

@todo-migration @react
@react
Scenario: See camera module and close with the close icon
Then I see "Loading"

@todo-migration @react
@react
Scenario: See camera module and instructions
Then I see "liveness-detector" element
Then I see "connecting"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ Feature: Liveness Detector
Background:
Given I'm running the example "ui/components/liveness"

@todo-migration @react
@react
Scenario: Navigate with keyboard only
Then I hit the "enter" key on "Begin check" button
Then I click the "close-icon"
# TODO: Change this to use keyboard navigation, at this time it doesnt work the same way begin check does
Then I see the "Begin check" button

@todo-migration @react
@react
Scenario: See camera module and close with the close icon
Then I click the "Begin check" button
Then I click the "close-icon"
Then I see the "Begin check" button

@todo-migration @react
@react
Scenario: See camera module and instructions
Then I click the "Begin check" button
Then I see "liveness-detector" element
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Feature: Liveness Start Screen
Background:
Given I'm running the example "ui/components/liveness"

@todo-migration @react
@react
Scenario: The Start Screen has all the elements
Then I see "SessionId:"
Then I see "Photosensitivity warning"
Expand All @@ -14,12 +14,12 @@ Feature: Liveness Start Screen
Then I see "This check displays colored lights. Use caution if you are photosensitive."
Then I see the "Begin check" button

@todo-migration @react
@react
Scenario: Click the pop-over icon and see the notes
Then I click the "popover-icon"
Then I see "A small percentage of individuals may experience epileptic seizures when exposed to colored lights. Use caution if you, or anyone in your family, have an epileptic condition."

@todo-migration @react
@react
Scenario: The start Screen has the instructions
Then I see "Follow the instructions to complete the check:"
Then I see "Make sure your face is not covered with sunglasses or a mask."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ Liveness component supports using a custom credential provider.
Background:
Given I'm running the example "ui/components/liveness/with-credential-provider/"

@todo-migration @react
@react
Scenario: See camera module and close with the close icon
Then I click the "Begin check" button
Then I click the "close-icon"
Then I see the "Begin check" button

@todo-migration @react
@react
Scenario: See camera module and instructions
Then I click the "Begin check" button
Then I see "liveness-detector" element
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Feature: Liveness with Custom Components
Background:
Given I'm running the example "ui/components/liveness/with-custom-components/"

@todo-migration @react
@react
Scenario: The Start Screen has all the elements
Then I see "SessionId:"
Then I see "Face liveness check"
Expand All @@ -14,7 +14,7 @@ Feature: Liveness with Custom Components
Then I see "This check displays colored lights. Use caution if you are photosensitive."
Then I see the "Begin check" button

@todo-migration @react
@react
Scenario: The start Screen has the instructions
Then I see "Instructions to follow to use liveness face detector"
Then I see "Make sure your face is not covered with sunglasses or a mask."
Expand Down
25 changes: 1 addition & 24 deletions packages/ui/src/helpers/authenticator/defaultAuthHubHandler.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Hub } from 'aws-amplify/utils';

import { groupLog, isFunction } from '../../utils';
import { isFunction } from '../../utils';

import { AuthInterpreter, AuthMachineHubHandler } from './types';

Expand All @@ -14,33 +14,10 @@ export const defaultAuthHubHandler: AuthMachineHubHandler = async (
options
) => {
const { event } = payload;
groupLog('+++defaultAuthHubHandler', payload);
const { send } = service;
// const state = service.getSnapshot(); // this is just a getter and is not expensive
const { onSignIn, onSignOut } = options ?? {};

switch (event) {
case 'signInWithRedirect_failure':
break;
// TODO: We can add more cases here, according to
// https://docs.amplify.aws/lib/auth/auth-events/q/platform/js/
// case 'tokenRefresh': {
// if (state.matches('authenticated.idle')) {
// // just call getCurrentUser here
// send('TOKEN_REFRESH');
// }
// break;
// }
case 'signInWithRedirect': {
// if (isFunction(onSignInWithRedirect)) {
// // getCurrentUser()
// // .then('onSignInWithRedirect')
// // .catch((e) => {
// // return;
// // });
// }
break;
}
case 'signedIn': {
if (isFunction(onSignIn)) {
onSignIn(payload);
Expand Down
Loading

0 comments on commit b4f205c

Please sign in to comment.