Skip to content

Commit b6368aa

Browse files
dbanksdesignlawmichaJordan-NelsonjosefaidtHuiSF
authored
Updating next-release/main branch (#7862)
* Update versions.ts Android Amplify V2.19.1 (#7767) * chore(flutter): update android section of Amplify Flutter getting started guide (#7760) * chore: update android section of Flutter getting started guide * chore: update gen 2 flutter platform setup * chore: add info to enable network permissions on android * chore: update H3 headers to H2 * chore: update min Xcode version to 15 * chore: update xcode verison to 15.0 for macOS * chore: update ios and macos setup to be consistent with Android, add callout for missing podfile * update mobile quickstarts with link to fullstack branch deployment guide #7741 (#7746) * chore: add serverComponentsExternalPackages callout for Next.js (#7757) * chore: add serverComponentsExternalPackages callout for Next.js * Apply suggestions from code review Co-authored-by: Jim Blanchard <jim.l.blanchard@gmail.com> * Apply suggestions from code review * Update src/pages/gen1/[platform]/build-a-backend/server-side-rendering/nextjs/index.mdx Co-authored-by: Jim Blanchard <jim.l.blanchard@gmail.com> * Update src/pages/gen1/[platform]/build-a-backend/server-side-rendering/nextjs/index.mdx Co-authored-by: josef <josef.aidt@gmail.com> * Update src/pages/[platform]/build-a-backend/server-side-rendering/index.mdx Co-authored-by: josef <josef.aidt@gmail.com> --------- Co-authored-by: Jim Blanchard <jim.l.blanchard@gmail.com> Co-authored-by: josef <josef.aidt@gmail.com> * add warning callout to gen1 backend-config (#7773) * Revert "chore: add region to scrollable table (#7744)" (#7784) This reverts commit 67496c5. * chore: change outputs to amplifyConfig in flutter gen 2 docs (#7764) * chore: change outputs to amplifyConfig in flutter gen 2 docs * chore: change amplifyconfiguration.dart import to amplify_outputs.dart * chore: remove --outputs-version 0 and downgrade config file callout * chore: remove --outputs-version 0 from snippets * chore: remove gen 2 config conversion callout * chore: remove amplifyconfiguration.dart references from gen 2 * fix: heading order on gen1/prev subscribe-data page (#7790) * add warning regarding subscription and mutation redaction of relational fields (#7768) * add warning regarding subscription and mutation redaction of relational fields * replace authn with authz in warning * chore(api): Callout for field redaction on Swift Android relational models * Update src/pages/gen1/[platform]/build-a-backend/graphqlapi/relational-models/index.mdx * add feature flag to warning for gen 1 * Fix heading order in fragments affecting this page * add protected redaction message components * Add tests for redaction message Gen 1 and Gen 2 components * add snapshots for redaction Gen 1 and Gen 2 component tests * Adds ProtectedRedactionMessage components for Gen 1 and Gen2 * Render ProtectedRedactionGen1Message component on Gen 1 realtime page * Render ProtectedRedactionGen1Message component on Gen 2 data modeling page * Render ProtectedRedactionGen2Message component on Gen 2 realtime page * Render ProtectedRedactionGen1Message component on Gen 1 data modeling page * Render ProtectedRedactionGen1Message component on Gen 1 V5 realtime page * add subscriptionsInheritPrimaryAuth as a feature flag * correct version for subscriptionsInheritPrimaryAuth * remove commented code * fix heading order --------- Co-authored-by: Michael Law <1365977+lawmicha@users.noreply.github.com> Co-authored-by: Heather <hbuchel@gmail.com> Co-authored-by: katiegoines <katiegoines@gmail.com> * fix subscriptionsInheritPrimaryAuth default value (#7795) * change overview card titles from p to h2 (#7780) Co-authored-by: katiegoines <katiegoines@gmail.com> * remove conditional in aria-describedby={codeId} for MDXCopyCodeButton (#7779) Co-authored-by: katiegoines <katiegoines@gmail.com> * Update index.mdx to fix typo (#7798) Removed mention of create-vite-app * add workflow to validate redirects (#7726) * add workflow to validate redirects * change filename * removing testing errors * finding all invalid redirects * running validation to catch all issues * remove unneeded code --------- Co-authored-by: katiegoines <katiegoines@gmail.com> * update set up function guide with data example (#7759) * update set up function guide with data example * add mobile snippets * remove checkboxes and circle (#7783) * fix: heading order (#7803) * restore autoSignIn section for SignIn page, and Switching Authentication Flows page for js categories (#7769) Co-authored-by: JoonWon Choi <joonwonc@amazon.com> * replace `amplify` to `ampx` (#7804) * feat(js): list api subpathStrategy parameter (#7794) * feat(js): list api subpathStrategy parameter * fix: adds style guide suggestions * fix: adds result structure * fix: tried to delineate between recursive exploration of entire path and subpathStrategy option * Update src/pages/[platform]/build-a-backend/storage/list-files/index.mdx Co-authored-by: Harshita Daddala <harshita.d11@gmail.com> * Update src/pages/[platform]/build-a-backend/storage/list-files/index.mdx Co-authored-by: Harshita Daddala <harshita.d11@gmail.com> * Update src/pages/[platform]/build-a-backend/storage/list-files/index.mdx Co-authored-by: Harshita Daddala <harshita.d11@gmail.com> * Update src/pages/[platform]/build-a-backend/storage/list-files/index.mdx Co-authored-by: Harshita Daddala <harshita.d11@gmail.com> * Update src/pages/[platform]/build-a-backend/storage/list-files/index.mdx Co-authored-by: ashika112 <155593080+ashika112@users.noreply.github.com> * Update src/pages/[platform]/build-a-backend/storage/list-files/index.mdx Co-authored-by: josef <josef.aidt@gmail.com> * comments and prettier * undid prettier table change * Update src/pages/[platform]/build-a-backend/storage/list-files/index.mdx Co-authored-by: josef <josef.aidt@gmail.com> --------- Co-authored-by: haverchuck <dnnoyes@amazon.com> Co-authored-by: Harshita Daddala <harshita.d11@gmail.com> Co-authored-by: ashika112 <155593080+ashika112@users.noreply.github.com> Co-authored-by: josef <josef.aidt@gmail.com> * chore: update domains for proxy (#7808) * fix: typo on client code generation page (#7809) * Fix anchor link, add some scroll margin to h4 headings (#7810) * chore(deps): bump @aws-amplify/amplify-cli-core from 4.3.8 to 4.3.9 (#7788) Bumps [@aws-amplify/amplify-cli-core](https://github.com/aws-amplify/amplify-cli/tree/HEAD/packages/amplify-cli-core) from 4.3.8 to 4.3.9. - [Release notes](https://github.com/aws-amplify/amplify-cli/releases) - [Changelog](https://github.com/aws-amplify/amplify-cli/blob/dev/packages/amplify-cli-core/CHANGELOG.md) - [Commits](https://github.com/aws-amplify/amplify-cli/commits/@aws-amplify/amplify-cli-core@4.3.9/packages/amplify-cli-core) --- updated-dependencies: - dependency-name: "@aws-amplify/amplify-cli-core" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump aws-actions/aws-secretsmanager-get-secrets (#7792) Bumps [aws-actions/aws-secretsmanager-get-secrets](https://github.com/aws-actions/aws-secretsmanager-get-secrets) from 2.0.3 to 2.0.5. - [Release notes](https://github.com/aws-actions/aws-secretsmanager-get-secrets/releases) - [Commits](aws-actions/aws-secretsmanager-get-secrets@ff26a0a...98c2d6b) --- updated-dependencies: - dependency-name: aws-actions/aws-secretsmanager-get-secrets dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * storage(android): update getURL options (#7736) * storage(android): update getURL options * add more code examples * Add Gen 2 SDL docs (#7793) * add gen 2 SDL docs * Update src/pages/[platform]/build-a-backend/data/data-modeling/index.mdx Co-authored-by: josef <josef.aidt@gmail.com> * Update src/pages/[platform]/build-a-backend/data/data-modeling/index.mdx Co-authored-by: josef <josef.aidt@gmail.com> * move support callout to migration page * update doc to state ddb-backed sources only * made updates to the sdl explanation --------- Co-authored-by: josef <josef.aidt@gmail.com> Co-authored-by: Nikhil Swaminathan <nikhil@live.ca> * Cbonif/add-non-model-auth-section (#7817) * add callout for sql custom query/mutation return types with example * Merge branch 'main' of github.com:aws-amplify/docs * revert sql page change * revert change on gen 1 sql page * add auth permissions (#7796) * add auth permissions * fix accessibility error * fix heading * callout for mysql/postgres custom query return types (#7813) * add callout for sql custom query/mutation return types with example * add gen 1 example * shorten gen 2 example a bit * remove line breaks from gen 1 example * remove line break * Update index.mdx Co-authored-by: josef <josef.aidt@gmail.com> * Update src/pages/gen1/[platform]/build-a-backend/graphqlapi/connect-api-to-existing-database/index.mdx Co-authored-by: josef <josef.aidt@gmail.com> * remove ts import from bottom of page --------- Co-authored-by: josef <josef.aidt@gmail.com> * Clarify Manual Loading of Environment Variables in Sandbox Environments (#7822) * Clarify Manual Loading of Environment Variables in Sandbox Environments * Update src/pages/[platform]/deploy-and-host/fullstack-branching/secrets-and-vars/index.mdx Co-authored-by: josef <josef.aidt@gmail.com> --------- Co-authored-by: josef <josef.aidt@gmail.com> * fix data env name in function example, ref #7825 (#7826) * Update app id reference for CI/CD deployments (#7832) * fix(swift): updated concurrency in quickstart (#7828) * chore(android): Update versions.ts - Android SDK 2.76.0(#7833) * feat(Swift): Adding SubpathStrategy documentation for Storage.List (#7831) * Add Gen1 banner to getting started pages (#7839) * add Gen1 Banner to all gen 1 getting started pages * update link location and add banner to how amplify works --------- Co-authored-by: Jacob Logan <lognjc@amazon.com> * remove temporary disabling of copy-code button (#7835) Co-authored-by: katiegoines <katiegoines@gmail.com> * add streaming function logs docs (#7841) * add streaming function logs docs * Update src/pages/[platform]/build-a-backend/functions/streaming-logs/index.mdx Co-authored-by: Amplifiyer <51211245+Amplifiyer@users.noreply.github.com> * rm multiline log callout, added note for chaining --out-file * clarify log output in terminal where sandbox is running --------- Co-authored-by: Amplifiyer <51211245+Amplifiyer@users.noreply.github.com> * a11y-when closing accordion from bottom, focus back on summary element (#7837) * when closing accordion from bottom, focus back on summary element * add test * remove extra spaces --------- Co-authored-by: katiegoines <katiegoines@gmail.com> * a11y-remove alt text for decorative image (#7836) * remove alt text for decorative image * mark images as decorative --------- Co-authored-by: katiegoines <katiegoines@gmail.com> * Update index.mdx (#7840) * put feedback responses in aria-live (#7844) Co-authored-by: katiegoines <katiegoines@gmail.com> * when clicking on toc entry, focus on respective heading in content (#7845) Co-authored-by: katiegoines <katiegoines@gmail.com> * add scheduling functions docs (#7842) * add scheduling functions docs * fix path * Update src/pages/[platform]/build-a-backend/functions/scheduling-functions/index.mdx * add docs for auth custom attribute support (#7846) * add docs for auth custom attribute support * Update src/pages/[platform]/build-a-backend/auth/concepts/user-attributes/index.mdx * correct heading order * fix broken links * add mobile platform to concepts page for user attributes * remove studio reference in Amplify Gen 2 docs (#7860) * storage(android): update storage list with delimiter support (#7830) * feat(Swift): Adding SubpathStrategy documentation for Storage.List * storage(android): update storage list with delimiter support * feat(Swift): Adding SubpathStrategy documentation for Storage.List * chore: resolve review comments * chore: update per review comments * chore: resolve review comments * fix exclude subpath sample --------- Co-authored-by: Sebastian Villena <97059974+ruisebas@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Michael Law <1365977+lawmicha@users.noreply.github.com> Co-authored-by: Jordan Nelson <nejrd@amazon.com> Co-authored-by: josef <josef.aidt@gmail.com> Co-authored-by: Hui Zhao <10602282+HuiSF@users.noreply.github.com> Co-authored-by: Jim Blanchard <jim.l.blanchard@gmail.com> Co-authored-by: Heather Buchel <hbuchel@gmail.com> Co-authored-by: Kha Truong <64438356+khatruong2009@users.noreply.github.com> Co-authored-by: Chris Bonifacio <christopher.bonifacio@gmail.com> Co-authored-by: katiegoines <katiegoines@gmail.com> Co-authored-by: Dane Pilcher <dppilche@amazon.com> Co-authored-by: Katie Goines <30757403+katiegoines@users.noreply.github.com> Co-authored-by: Nikhil Swaminathan <2429410+swaminator@users.noreply.github.com> Co-authored-by: Kethan sai <ykethan@amazon.com> Co-authored-by: Joon Choi <requiemdeciel@gmail.com> Co-authored-by: JoonWon Choi <joonwonc@amazon.com> Co-authored-by: MURAKAMI Masahiko <fossamagna2@gmail.com> Co-authored-by: Dustin Noyes <dustin.noyes.dev@gmail.com> Co-authored-by: haverchuck <dnnoyes@amazon.com> Co-authored-by: Harshita Daddala <harshita.d11@gmail.com> Co-authored-by: ashika112 <155593080+ashika112@users.noreply.github.com> Co-authored-by: MJ Zhang <0618@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tuan Pham <103537251+phantumcode@users.noreply.github.com> Co-authored-by: Nikhil Swaminathan <nikhil@live.ca> Co-authored-by: Kazuki Hamasaki <ne.vivam.si.abis@gmail.com> Co-authored-by: Jay Raval <jay.ambrish.raval@gmail.com> Co-authored-by: Sébastien Stormacq <sebastien.stormacq@gmail.com> Co-authored-by: Sebastian Villena <97059974+ruisebas@users.noreply.github.com> Co-authored-by: jacoblogan <jacob.maiola.logan@gmail.com> Co-authored-by: Jacob Logan <lognjc@amazon.com> Co-authored-by: Amplifiyer <51211245+Amplifiyer@users.noreply.github.com> Co-authored-by: taka <106423245+takaya-okamoto@users.noreply.github.com>
1 parent 5c0932e commit b6368aa

File tree

82 files changed

+2763
-390
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+2763
-390
lines changed

.github/workflows/check_for_broken_links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
role-to-assume: arn:aws:iam::464149486631:role/github_action_read_slack_webhook_url
3333
aws-region: us-west-2
3434
- name: Read secrets from AWS Secrets Manager into environment variables
35-
uses: aws-actions/aws-secretsmanager-get-secrets@ff26a0aa6bd4dd5e51326b5afb3f5f6874c958c7 # v2.0.3
35+
uses: aws-actions/aws-secretsmanager-get-secrets@98c2d6bf1dd67c2575fa2bb14294aa64103d426c # v2.0.5
3636
with:
3737
secret-ids: |
3838
SLACK_WEBHOOK_URL
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
module.exports = {
2+
invalidRedirects: () => {
3+
const Ajv = require('ajv');
4+
const redirects = require('../../../redirects.json');
5+
const ajv = new Ajv();
6+
7+
const schema = {
8+
type: 'array',
9+
items: {
10+
type: 'object',
11+
required: ['source', 'target', 'status'],
12+
properties: {
13+
source: {
14+
description: 'The address the user requested.',
15+
type: 'string',
16+
pattern: '^/'
17+
},
18+
target: {
19+
description:
20+
'The address that actually serves the content that the user sees',
21+
type: 'string',
22+
pattern: '^[(https)(/)]'
23+
},
24+
status: {
25+
description:
26+
'Types include a permanent redirect (301), a temporary redirect (302), a rewrite (200), or not found (404).',
27+
type: 'string',
28+
pattern: '^[0-5-]+$'
29+
}
30+
}
31+
}
32+
};
33+
34+
const errors = [];
35+
const validate = ajv.compile(schema);
36+
37+
const validateEntries = (redirects) => {
38+
const valid = validate(redirects);
39+
40+
if (!valid) {
41+
const error = validate.errors[0];
42+
const invalidEntry =
43+
JSON.stringify(redirects[error.instancePath.slice(1, -7)]);
44+
const loc = error.schemaPath.slice(error.schemaPath.indexOf('properties') + 11, -8);
45+
const errorMessage = '\n\n' + 'INVALID ENTRY: Please correct the error in the "' + loc +'" property of the following entry: \n' + invalidEntry + '\n' + 'ERROR MESSAGE: ' + error.message;
46+
errors.push(errorMessage);
47+
48+
validateEntries(redirects.splice(parseInt(error.instancePath.slice(1, -7)) + 1));
49+
50+
}
51+
}
52+
validateEntries(redirects);
53+
54+
return errors;
55+
}
56+
}
57+
58+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Validate Redirects
2+
on:
3+
pull_request:
4+
branches: [main]
5+
types: [opened, synchronize]
6+
env:
7+
BUILD_DIR: 'client/www/next-build'
8+
permissions:
9+
contents: read
10+
jobs:
11+
ValidateRedirects:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
16+
- name: Setup Node.js 20.x
17+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
18+
with:
19+
node-version: 20.x
20+
- name: Install Dependencies
21+
run: yarn
22+
- name: Validate redirects
23+
id: redirects
24+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
25+
with:
26+
result-encoding: string
27+
script: |
28+
const { invalidRedirects } = require('./.github/workflows/scripts/validate-redirects.js');
29+
return await invalidRedirects();
30+
- name: Fail if any invalid redirects have been found
31+
if: ${{ steps.redirects.outputs.result }}
32+
run: exit 1 && echo ${{ steps.redirects.outputs.result }}

cspell.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,10 +532,12 @@
532532
"Didfinishlaunchingwithoptions",
533533
"displayMode",
534534
"displayOrder",
535+
"dists",
535536
"DocSet",
536537
"DocSets",
537538
"Donef",
538539
"Dont",
540+
"dotenvx",
539541
"downcasting",
540542
"dropdown",
541543
"dynamoDB",

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
"license": "Apache-2.0",
1010
"private": true,
1111
"dependencies": {
12-
"@aws-amplify/amplify-cli-core": "^4.3.8",
12+
"@aws-amplify/amplify-cli-core": "^4.3.9",
1313
"@aws-amplify/ui-react": "^6.1.12",
1414
"@docsearch/react": "3",
15+
"ajv": "^8.16.0",
1516
"aws-amplify": "^6.0.9",
1617
"next": "^14.2.3",
1718
"next-image-export-optimizer": "^1.8.3",

redirects.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3011,7 +3011,7 @@
30113011
},
30123012
{
30133013
"source": "/lib/client-configuration/configuring-amplify-categories/q/platform/react-native/",
3014-
"target": "react-native/tools/libraries/configure-categories/",
3014+
"target": "/react-native/tools/libraries/configure-categories/",
30153015
"status": "301"
30163016
},
30173017
{

src/components/Accordion/Accordion.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,12 @@ export const Accordion: React.FC<AccordionProps> = ({
6969

7070
const closeAccordion = () => {
7171
const details = detailsRef.current;
72+
const summary = summaryRef.current;
7273
if (details) {
7374
const scrollToLoc = details.offsetTop - 48 - 70 - 10; // account for nav heights and 10px buffer
7475
setDetailsOpen(false);
7576
details.animate(collapse, animationTiming);
77+
summary?.focus();
7678
window.scrollTo({
7779
left: 0,
7880
top: scrollToLoc,

src/components/Accordion/__tests__/Accordion.test.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,13 @@ describe('Accordion', () => {
6565
});
6666
});
6767

68-
it('should collapse Accordion when close button is clicked', async () => {
68+
it('should collapse Accordion and refocus on Accordion element when close button is clicked', async () => {
6969
render(component);
7070
const accordionHeading = screen.getByText('Accordion component example');
7171
userEvent.click(accordionHeading);
7272
const detailsEl = await screen.getByRole('group');
73+
const summaryEl = detailsEl.firstChild;
74+
7375
expect(detailsEl).toHaveAttribute('open');
7476

7577
const text = await screen.getByText(content);
@@ -79,6 +81,7 @@ describe('Accordion', () => {
7981
await waitFor(() => {
8082
expect(text).not.toBeVisible();
8183
expect(detailsEl).not.toHaveAttribute('open');
84+
expect(summaryEl).toHaveFocus();
8285
});
8386
});
8487

src/components/Callout/Callout.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,21 @@ import { Message, View } from '@aws-amplify/ui-react';
33
interface CalloutProps {
44
info?: boolean;
55
warning?: boolean;
6+
backgroundColor?: string;
67
children?: React.ReactNode;
78
}
89

9-
export const Callout = ({ warning, children }: CalloutProps) => {
10+
export const Callout = ({
11+
warning,
12+
backgroundColor,
13+
children
14+
}: CalloutProps) => {
1015
return (
11-
<Message variation="filled" colorTheme={warning ? 'warning' : 'info'}>
16+
<Message
17+
variation="filled"
18+
colorTheme={warning ? 'warning' : 'info'}
19+
backgroundColor={backgroundColor}
20+
>
1221
<View>{children}</View>
1322
</Message>
1423
);

src/components/Callout/__tests__/Callout.test.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,17 @@ describe('Callout', () => {
1919

2020
consoleErrorFn.mockRestore();
2121
});
22+
23+
it('should pass the backgroundColor through to the Message component', async () => {
24+
const child = <div>Callout Child</div>;
25+
const ele = render(
26+
<Callout info={true} backgroundColor={'red'}>
27+
{child}
28+
</Callout>
29+
);
30+
31+
const styles = getComputedStyle(ele.container.children[0]);
32+
console.log(styles);
33+
expect(styles.backgroundColor).toBe('red');
34+
});
2235
});

src/components/FeatureFlags/feature-flags.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,26 @@
371371
"defaultExistingProject": false
372372
}
373373
]
374+
},
375+
"subscriptionsInheritPrimaryAuth": {
376+
"description": "Toggles whether subscriptions will inherit related authorization when relational fields are set as required",
377+
"type": "Feature",
378+
"valueType": "Boolean",
379+
"versionAdded": "12.12.4",
380+
"values": [
381+
{
382+
"value": "true",
383+
"description": "Subscriptions will inherit the primary model authorization rules for the relational fields",
384+
"defaultNewProject": false,
385+
"defaultExistingProject": false
386+
},
387+
{
388+
"value": "false",
389+
"description": "Relational fields will be redacted in mutation response when there is a difference between auth rules between primary and related models.",
390+
"defaultNewProject": true,
391+
"defaultExistingProject": true
392+
}
393+
]
374394
}
375395
}
376396
},

src/components/Feedback/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,12 @@ const Feedback = function Feedback(router) {
189189

190190
return (
191191
<Flex className="feedback" key={router?.router?.asPath}>
192-
<div id="start-state" aria-labelledby="feedbackGroupTitle" role="group">
192+
<div
193+
id="start-state"
194+
aria-labelledby="feedbackGroupTitle"
195+
role="group"
196+
aria-live="polite"
197+
>
193198
<Text className="feedback-text" id="feedbackGroupTitle">
194199
{c.feedbackQuestion}
195200
</Text>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { Callout } from '@/components/Callout';
2+
import Link from 'next/link';
3+
import classNames from 'classnames';
4+
5+
export const Gen1Banner = ({ currentPlatform }) => {
6+
return (
7+
<Callout backgroundColor="background.error">
8+
For new Amplify apps, we recommend using Amplify Gen 2. You can learn more
9+
in our{' '}
10+
<Link
11+
href={`/${currentPlatform}/start/quickstart`}
12+
passHref
13+
className={classNames('amplify-link')}
14+
>
15+
Gen 2 Docs
16+
</Link>
17+
.
18+
</Callout>
19+
);
20+
};

src/components/Gen1Banner/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { Gen1Banner } from './Gen1Banner';

src/components/Layout/Layout.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import {
3535
NEXT_PREVIOUS_SECTIONS
3636
} from '@/components/NextPrevious';
3737
import { Modal } from '@/components/Modal';
38+
import { Gen1Banner } from '@/components/Gen1Banner';
3839

3940
export const Layout = ({
4041
children,
@@ -127,6 +128,13 @@ export const Layout = ({
127128
}
128129
}, 20);
129130

131+
const isGen1GettingStarted = /\/gen1\/\w+\/start\/getting-started\//.test(
132+
asPathWithNoHash
133+
);
134+
const isGen1HowAmplifyWorks = /\/gen1\/\w+\/how-amplify-works\//.test(
135+
asPathWithNoHash
136+
);
137+
130138
useEffect(() => {
131139
const headings: HeadingInterface[] = [];
132140

@@ -254,6 +262,9 @@ export const Layout = ({
254262
{useCustomTitle ? null : (
255263
<Heading level={1}>{pageTitle}</Heading>
256264
)}
265+
{(isGen1GettingStarted || isGen1HowAmplifyWorks) && (
266+
<Gen1Banner currentPlatform={currentPlatform} />
267+
)}
257268
{children}
258269
{showNextPrev && <NextPrevious />}
259270
</Flex>

src/components/MDXComponents/MDXCopyCodeButton.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ export const MDXCopyCodeButton = ({
3333
<Button
3434
size="small"
3535
variation="link"
36-
disabled={copied}
3736
className="code-copy"
3837
testId={testId}
39-
aria-describedby={title ? undefined : codeId}
38+
aria-describedby={codeId}
4039
>
4140
<IconClipboard /> {copied ? 'Copied!' : 'Copy'}
4241
<VisuallyHidden>

src/components/MDXComponents/MDXHeading.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const MDXHeading = (props) => {
55
const { level, children, id } = props;
66

77
return (
8-
<Heading level={level} id={id}>
8+
<Heading level={level} id={id} tabIndex={-1}>
99
{/* Only output heading links for h2 and h3 \ */}
1010
{level == 2 || level == 3 ? (
1111
<Link href={`#${id}`}>{children}</Link>

src/components/MDXComponents/MDXTable.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ export const MDXTable: React.FC<MDXTableProps> = ({ children, ...props }) => {
99
return (
1010
<ScrollView
1111
tabIndex={0}
12-
role="region"
1312
aria-label="Scrollable table"
1413
className="scrollview"
1514
>

src/components/MDXComponents/__tests__/MDXHeading.test.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { render, screen } from '@testing-library/react';
22
import { MDXHeading } from '../MDXHeading';
3+
import { TableOfContents } from '../../TableOfContents/index';
4+
import userEvent from '@testing-library/user-event';
35

46
describe('MDXHeading', () => {
57
it('should render H2 with string and anchor link', () => {
@@ -53,4 +55,28 @@ describe('MDXHeading', () => {
5355
expect(heading).toHaveTextContent(props.children);
5456
expect(link).not.toBeInTheDocument();
5557
});
58+
59+
it('should shift focus to in-content heading on TOC click', async () => {
60+
const props = {
61+
level: 2,
62+
children: 'Test heading',
63+
id: 'test-heading'
64+
};
65+
render(<MDXHeading {...props} />);
66+
67+
const heading = screen.queryByRole('heading', { level: 2 });
68+
const tocHeadings = [
69+
{ linkText: 'Test heading', hash: 'test-heading', level: 'h2' }
70+
];
71+
72+
const tableOfContents = <TableOfContents headers={tocHeadings} />;
73+
render(tableOfContents);
74+
75+
const tocEntry = await screen.findByRole('heading', {
76+
name: 'Test heading'
77+
});
78+
79+
userEvent.click(tocEntry);
80+
expect(heading).toHaveFocus();
81+
});
5682
});

src/components/Overview/Overview.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { PageNode } from '@/directory/directory';
2-
import { Card, Flex, View, Text } from '@aws-amplify/ui-react';
2+
import { Card, Flex, View, Heading } from '@aws-amplify/ui-react';
33
import Link from 'next/link';
44
import { useRouter } from 'next/router';
55
import { Platform } from '@/data/platforms';
@@ -40,9 +40,9 @@ export function Overview({ childPageNodes }: OverviewProps) {
4040
>
4141
<Card className="overview__link__card" variation="outlined">
4242
<Flex direction="column" gap="xs">
43-
<Text className="overview__link__card__title">
43+
<Heading level={2} className="overview__link__card__title">
4444
{node.title}
45-
</Text>
45+
</Heading>
4646
<View className="overview__link__card__description">
4747
{node.description}
4848
</View>

0 commit comments

Comments
 (0)