Skip to content

Commit 56dbcb3

Browse files
committed
Merge branch 'main' of github.com:ykethan/docs into console-manager-pages
2 parents c956dff + dece79a commit 56dbcb3

File tree

70 files changed

+2049
-413
lines changed

Some content is hidden

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

70 files changed

+2049
-413
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

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ let mut a = String::from("a");
175175
Videos can be added using the `<Video />` component and referencing a path to the video file. The video should be an `.mp4` file and should exist in the `/public` directory
176176

177177
```jsx
178-
<Video src="/path/to/video.mp4" />
178+
<Video src="/path/to/video.mp4" description="Video - [video description]" />
179179
```
180180

181181
## Accessibility testing

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,7 @@
537537
"DocSets",
538538
"Donef",
539539
"Dont",
540+
"dotenvx",
540541
"downcasting",
541542
"dropdown",
542543
"dynamoDB",

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
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",
1515
"ajv": "^8.16.0",
@@ -89,7 +89,7 @@
8989
"loader-utils": "2.0.4",
9090
"minimatch": "3.1.2",
9191
"decode-uri-component": "0.2.1",
92-
"fast-xml-parser": "4.2.5",
92+
"**/fast-xml-parser": "4.4.1",
9393
"semver": "7.5.2",
9494
"tough-cookie": "4.1.3",
9595
"aws-cdk-lib": "2.80.0",

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/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+
};

0 commit comments

Comments
 (0)