Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/next-release/main' into fix-au…
Browse files Browse the repository at this point in the history
…th-links
  • Loading branch information
josefaidt committed May 2, 2024
2 parents 160a8aa + b5fb912 commit 1b9cfc1
Show file tree
Hide file tree
Showing 82 changed files with 1,625 additions and 2,551 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
/src/themes @aws-amplify/documentation-team
/src/utils @aws-amplify/documentation-team
/tasks @aws-amplify/documentation-team
.github @aws-amplify/documentation-team

#Protected Content
/src/protected @reesscot @srquinn21 @Milan-Shah @swaminator
38 changes: 38 additions & 0 deletions .github/workflows/check_for_console_errors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CheckConsoleErrors
on:
pull_request:
branches: [main]
types: [opened, synchronize]
permissions:
contents: read
jobs:
CheckConsoleErrors:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.2 https://github.com/actions/checkout/commit/b4ffde65f46336ab88eb53be808477a3936bae11
- name: Setup Node.js 20.x
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0 https://github.com/actions/setup-node/commit/e33196f7422957bea03ed53f6fbb155025ffc7b8
with:
node-version: 20.x
- name: Install Dependencies
run: yarn
- name: Run Build
run: yarn build:release
env:
NODE_OPTIONS: --max_old_space_size=4096
- name: Run Server
run: |
python -m http.server 3000 -d ${{ vars.BUILD_DIR }} &
sleep 5
- name: Run Console Errors
id: consoleErrors
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 https://github.com/actions/github-script/commit/d7906e4ad0b1822421a7e6a35d5ca353c962f410
with:
result-encoding: string
script: |
const { consoleErrors } = require('./tasks/console-errors.js');
return await consoleErrors();
- name: Fail if console errors have been found
if: ${{ steps.consoleErrors.outputs.result }}
run: exit 1
2 changes: 1 addition & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,7 @@
"privatesaccess",
"menudetaileditors",
"editorgroupaccess",
"publicauthreadonly",
"authreadonly",
"envs",
"Onetoone",
"onetomany",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
"@adobe/css-tools": "4.3.2",
"follow-redirects": "^1.15.6",
"ip": "2.0.1",
"sharp": "0.32.6"
"sharp": "0.32.6",
"ejs": "3.1.10"
},
"scripts": {
"clean": "rm -rf node_modules yarn.lock",
Expand Down
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/components/BlockSwitcher/__tests__/BlockSwitcher.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ describe('BlockSwitcher', () => {
const blockSwitcher = await screen.findByText(blockAContent);
expect(blockSwitcher).toBeInTheDocument();
});

it('should have more than one Block', async () => {
render(component);
expect(component.props.children.length).toBeGreaterThan(1);
});

it('should show the first Block as default', async () => {
render(component);
const tabs = await screen.getAllByRole('tab');
Expand All @@ -39,7 +39,7 @@ describe('BlockSwitcher', () => {
expect(panels[1]).not.toHaveClass('amplify-tabs__panel--active');
expect(panels[2]).not.toHaveClass('amplify-tabs__panel--active');
});

it('should load all Blocks to the DOM', async () => {
render(component);
const blockA = await screen.findByText(blockAContent);
Expand All @@ -49,7 +49,7 @@ describe('BlockSwitcher', () => {
expect(blockB).toBeInTheDocument();
expect(blockC).toBeInTheDocument();
});

it('should switch tabs upon click', async () => {
render(component);
const tabs = await screen.getAllByRole('tab');
Expand Down
6 changes: 6 additions & 0 deletions src/directory/directory.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ export const directory = {
{
path: 'src/pages/[platform]/build-a-backend/auth/multi-step-sign-in/index.mdx'
},
{
path: 'src/pages/[platform]/build-a-backend/auth/sign-in-with-web-ui/index.mdx'
},
{
path: 'src/pages/[platform]/build-a-backend/auth/app-uninstall/index.mdx'
},
Expand All @@ -158,6 +161,9 @@ export const directory = {
},
{
path: 'src/pages/[platform]/build-a-backend/auth/moving-to-production/index.mdx'
},
{
path: 'src/pages/[platform]/build-a-backend/auth/advanced-workflows/index.mdx'
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Note that before you can add an AWS resource to your application, the applicatio
</InlineFilter>

<InlineFilter filters={['swift']}>
Existing Amazon Pinpoint resources can be used with the Amplify Libraries by referencing your **Application ID** and **Region** in your `amplifyconfiguration.json` file.
Existing Amazon Pinpoint resources can be used with the Amplify Libraries by referencing your **Application ID** and **Region** in your `amplify_outputs.json` file.

```json
{
Expand All @@ -139,7 +139,7 @@ Note that before you can add an AWS resource to your application, the applicatio
</InlineFilter>

<InlineFilter filters={['android']}>
Existing Amazon Pinpoint resources can be used with the Amplify Libraries by referencing your **Application ID** and **Region** in your `amplifyconfiguration.json` file.
Existing Amazon Pinpoint resources can be used with the Amplify Libraries by referencing your **Application ID** and **Region** in your `amplify_outputs.json` file.

```json
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ However, it can take upwards of 30 minutes for the event to display in the Filte

## Flush events

Events have a default configuration to flush out to the network every 30 seconds. If you would like to change this, update `amplifyconfiguration.json` with the value in milliseconds you would like for `autoFlushEventsInterval`. This configuration will flush events every 10 seconds:
Events have a default configuration to flush out to the network every 30 seconds. If you would like to change this, update `amplify_outputs.json` with the value in milliseconds you would like for `autoFlushEventsInterval`. This configuration will flush events every 10 seconds:

```json
{
Expand Down Expand Up @@ -157,7 +157,7 @@ You can report authentication events by doing either of the following:

- Managing user sign-up and sign-in with Amazon Cognito user pools.

Cognito user pools are user directories that make it easier to add sign-up and sign-in to your app. As users authenticate with your app, Cognito reports authentication events to Pinpoint. For more information, see [Using Amazon Pinpoint Analytics with Amazon Cognito User Pools](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-pinpoint-integration.html) in the _Amazon Cognito Developer Guide_. Also update **amplifyconfiguration.json** by adding the `PinpointAppId` key under `CognitoUserPool`.
Cognito user pools are user directories that make it easier to add sign-up and sign-in to your app. As users authenticate with your app, Cognito reports authentication events to Pinpoint. For more information, see [Using Amazon Pinpoint Analytics with Amazon Cognito User Pools](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-pinpoint-integration.html) in the _Amazon Cognito Developer Guide_. Also update **amplify_outputs.json** by adding the `PinpointAppId` key under `CognitoUserPool`.

```json
"CognitoUserPool": {
Expand Down Expand Up @@ -416,7 +416,7 @@ However, it can take upwards of 30 minutes for the event to display in the Filte

By default, events are automatically flushed out to the network every 60 seconds.

If you would like to change this, update `amplifyconfiguration.json` and set the value you would prefer under `autoFlushEventsInterval`, expressed in seconds:
If you would like to change this, update `amplify_outputs.json` and set the value you would prefer under `autoFlushEventsInterval`, expressed in seconds:

```json
{
Expand Down Expand Up @@ -463,7 +463,7 @@ You can report authentication events by doing either of the following:

- Managing user sign-up and sign-in with Amazon Cognito user pools.

Cognito user pools are user directories that make it easier to add sign-up and sign-in to your app. As users authenticate with your app, Cognito reports authentication events to Pinpoint. For more information, see [Using Amazon Pinpoint Analytics with Amazon Cognito User Pools](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-pinpoint-integration.html) in the _Amazon Cognito Developer Guide_. Also update **amplifyconfiguration.json** by adding the `PinpointAppId` key under `CognitoUserPool`.
Cognito user pools are user directories that make it easier to add sign-up and sign-in to your app. As users authenticate with your app, Cognito reports authentication events to Pinpoint. For more information, see [Using Amazon Pinpoint Analytics with Amazon Cognito User Pools](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-pinpoint-integration.html) in the _Amazon Cognito Developer Guide_. Also update **amplify_outputs.json** by adding the `PinpointAppId` key under `CognitoUserPool`.

```json
"CognitoUserPool": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ An application with Amplify libraries integrated and a minimum target of any of

<Callout>

visionOS support is currently in **preview** and can be used by targeting the [`visionos-preview`](https://github.com/aws-amplify/amplify-swift/tree/visionos-preview) branch.
visionOS support is currently in **preview** and can be used by targeting the [`visionos-preview`](https://github.com/aws-amplify/amplify-swift/tree/visionos-preview) branch.
As new Xcode 15 beta versions are released, the branch will be updated with any necessary fixes on a best effort basis.

For more information on how to use the `visionos-preview` branch, see [Platform Support](https://github.com/aws-amplify/amplify-swift/tree/visionos-preview#platform-support).
Expand Down Expand Up @@ -75,7 +75,7 @@ For more information on how to use the `visionos-preview` branch, see [Platform
</InlineFilter>
## Set up Analytics backend

Use the [AWS CDK](https://docs.aws.amazon.com/cdk/latest/guide/home.html) to create an analytics resource powered by [Amazon Pinpoint](https://aws.amazon.com/pinpoint/).
Use the [AWS CDK](https://docs.aws.amazon.com/cdk/latest/guide/home.html) to create an analytics resource powered by [Amazon Pinpoint](https://aws.amazon.com/pinpoint/).

```ts title="amplify/backend.ts"
import { auth } from "./auth/resource";
Expand All @@ -85,9 +85,9 @@ import { CfnApp } from "aws-cdk-lib/aws-pinpoint";
import { Stack } from "aws-cdk-lib/core";

const backend = defineBackend({
auth,
auth,
data,
// additional resources
// additional resources
});

const analyticsStack = backend.createStack("analytics-stack");
Expand Down Expand Up @@ -186,7 +186,7 @@ Import and load the configuration file in your app. It's recommended you add the
```js title="src/index.js"
import { Amplify } from 'aws-amplify';
import { record } from 'aws-amplify/analytics';
import amplifyconfig from '../amplifyconfiguration.json';
import outputs from '../amplify_outputs.json';

Amplify.configure({
...Amplify.getConfig(),
Expand All @@ -195,11 +195,11 @@ Amplify.configure({
```
</InlineFilter>

<InlineFilter filters={['nextjs']}>
<InlineFilter filters={['nextjs']}>
```js title="pages/_app.tsx"
import { Amplify } from 'aws-amplify';
import { record } from 'aws-amplify/analytics';
import amplifyconfig from '@/amplifyconfiguration.json';
import outputs from '@/amplify_outputs.json';

Amplify.configure({
...Amplify.getConfig(),
Expand Down Expand Up @@ -230,7 +230,7 @@ init() {
do {
try Amplify.add(plugin: AWSCognitoAuthPlugin())
try Amplify.add(plugin: AWSPinpointAnalyticsPlugin())
try Amplify.configure()
try Amplify.configure(with: .amplifyOutputs)
print("Amplify configured with Auth and Analytics plugins")
} catch {
print("Failed to initialize Amplify with \(error)")
Expand Down Expand Up @@ -260,7 +260,7 @@ func application(
do {
try Amplify.add(plugin: AWSCognitoAuthPlugin())
try Amplify.add(plugin: AWSPinpointAnalyticsPlugin())
try Amplify.configure()
try Amplify.configure(with: .amplifyOutputs)
print("Amplify configured with Auth and Analytics plugins")
} catch {
print("Failed to initialize Amplify with \(error)")
Expand Down Expand Up @@ -323,7 +323,7 @@ Future<void> _configureAmplify() async {
// Once Plugins are added, configure Amplify
// Note: Amplify can only be configured once.
try {
await Amplify.configure(amplifyconfig);
await Amplify.configure(outputs);
} on AmplifyAlreadyConfiguredException {
safePrint(
'Tried to reconfigure Amplify; this can occur when your app restarts on Android.',
Expand Down Expand Up @@ -351,7 +351,7 @@ Future<void> _configureAmplify() async {
// Once Plugins are added, configure Amplify
// Note: Amplify can only be configured once.
try {
await Amplify.configure(amplifyconfig);
await Amplify.configure(outputs);
} on AmplifyAlreadyConfiguredException {
safePrint(
'Tried to reconfigure Amplify; this can occur when your app restarts on Android.',
Expand All @@ -367,7 +367,7 @@ Future<void> main() async {
class MyApp extends StatefulWidget {
const MyApp({Key? key}): super(key: key);
// ...
}
```
Expand All @@ -378,6 +378,16 @@ To initialize the Amplify Auth and Analytics categories you call `Amplify.addPlu

Add the following code to your `onCreate()` method in your application class:

<Callout warning>
Before calling the `Amplify.configure` function, make sure to either download the `amplify_outputs.json` file from the console, or generate it with the following command:

```bash title="Terminal" showLineNumbers={false}
npx ampx generate outputs --app-id <app-id> --branch main --out-dir app/src/main/res/raw
```

Next, be sure the file you generated or downloaded is in the appropriate resource directory for your application (for example, `app/src/main/res/raw`) in your Android project. Otherwise, you will not be able to compile your application.
</Callout>

<BlockSwitcher>
<Block name="Java">

Expand All @@ -387,6 +397,8 @@ import com.amplifyframework.AmplifyException;
import com.amplifyframework.analytics.pinpoint.AWSPinpointAnalyticsPlugin;
import com.amplifyframework.auth.cognito.AWSCognitoAuthPlugin;
import com.amplifyframework.core.Amplify;
import com.amplifyframework.core.configuration.AmplifyOutputs;

```

```java
Expand All @@ -406,7 +418,7 @@ public class MyAmplifyApp extends Application {
// Add these lines to add the AWSCognitoAuthPlugin and AWSPinpointAnalyticsPlugin plugins
Amplify.addPlugin(new AWSCognitoAuthPlugin());
Amplify.addPlugin(new AWSPinpointAnalyticsPlugin());
Amplify.configure(getApplicationContext());
Amplify.configure(AmplifyOutputs.fromResource(R.raw.amplify_outputs), getApplicationContext());

Log.i("MyAmplifyApp", "Initialized Amplify");
} catch (AmplifyException error) {
Expand All @@ -425,7 +437,8 @@ import com.amplifyframework.AmplifyException
import com.amplifyframework.analytics.pinpoint.AWSPinpointAnalyticsPlugin
import com.amplifyframework.auth.cognito.AWSCognitoAuthPlugin
import com.amplifyframework.core.Amplify
```
import com.amplifyframework.core.configuration.AmplifyOutputs
```

```kotlin
Amplify.addPlugin(AWSCognitoAuthPlugin())
Expand All @@ -443,7 +456,7 @@ class MyAmplifyApp : Application() {
// Add these lines to add the AWSCognitoAuthPlugin and AWSPinpointAnalyticsPlugin plugins
Amplify.addPlugin(AWSCognitoAuthPlugin())
Amplify.addPlugin(AWSPinpointAnalyticsPlugin())
Amplify.configure(applicationContext)
Amplify.configure(AmplifyOutputs.fromResource(R.raw.amplify_outputs), applicationContext)

Log.i("MyAmplifyApp", "Initialized Amplify")
} catch (error: AmplifyException) {
Expand All @@ -461,6 +474,7 @@ import android.util.Log;
import com.amplifyframework.AmplifyException;
import com.amplifyframework.analytics.pinpoint.AWSPinpointAnalyticsPlugin;
import com.amplifyframework.auth.cognito.AWSCognitoAuthPlugin;
import com.amplifyframework.core.configuration.AmplifyOutputs;
import com.amplifyframework.rx.RxAmplify;
```

Expand All @@ -481,7 +495,7 @@ public class MyAmplifyApp extends Application {
// Add these lines to add the AWSCognitoAuthPlugin and AWSPinpointAnalyticsPlugin plugins
RxAmplify.addPlugin(new AWSCognitoAuthPlugin());
RxAmplify.addPlugin(new AWSPinpointAnalyticsPlugin());
RxAmplify.configure(getApplicationContext());
RxAmplify.configure(AmplifyOutputs.fromResource(R.raw.amplify_outputs), getApplicationContext());

Log.i("MyAmplifyApp", "Initialized Amplify");
} catch (AmplifyException error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ import {
LocationClient,
AssociateTrackerConsumerCommand
} from '@aws-sdk/client-location';
import amplifyconfig from '../amplifyconfiguration.json';
Amplify.configure(amplifyconfig);
import outputs from '../amplify_outputs.json';
Amplify.configure(outputs);

const createClient = async () => {
const session = await fetchAuthSession();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ export const meta = {
title: 'Configure a geofence collection',
description: 'Create and manage collections of Geofences',
platforms: [
'android',
'angular',
'javascript',
'nextjs',
'react',
'swift',
'vue'
]
};
Expand Down Expand Up @@ -100,7 +98,7 @@ backend.addOutput({

## Geofence Collection Pricing Plan

The pricing plan for the Geofence Collection will be set to `RequestBasedUsage`. We advice you to go through the [location service pricing](https://aws.amazon.com/location/pricing/) along with the [location service terms](https://aws.amazon.com/service-terms/) (_82.5 section_) to learn more about the pricing plan.
The pricing plan for the Geofence Collection will be set to `RequestBasedUsage`. We advice you to go through the [location service pricing](https://aws.amazon.com/location/pricing/) along with the [location service terms](https://aws.amazon.com/service-terms/) (_82.5 section_) to learn more about the pricing plan.

#### Group access

Expand Down
Loading

0 comments on commit 1b9cfc1

Please sign in to comment.