Skip to content

Commit

Permalink
chore(next-release/main): update next-release/main with latest from m…
Browse files Browse the repository at this point in the history
…ain (#6956)

* Minor edits to Vite + React quickstart (#6926)

* Updates to Vite + React quickstart

* Update src/fragments/gen2/quickstart/build-a-backend.mdx

Co-authored-by: Kevin Old <kevold@amazon.com>

* Update build-a-backend.mdx

* Update build-a-backend.mdx

* Update build-a-backend.mdx

---------

Co-authored-by: Kevin Old <kevold@amazon.com>

* fix: Fix incorrect auth import path in migration guide. (#6934)

* fix: Update incorrect `updateMFAPreference` parameter in JS v6 migration guide. (#6935)

* Amplify Android Release 2.14.11 (#6933)

* chore: refactor .layout-header into separate component (#6826)

* platform typed as optional

* refactor init

* remove commented code

* remove angry useEffect

* fix typing

* added layoutcontext so mobile menu closes on navigation

* move import

---------

Co-authored-by: katiegoines <katiegoines@gmail.com>

* fix: Nesting of auth cli templates (#6932)

* fix: change config variable name (#6923)

* Guide to support Amplify v2 with AWS Android SDK (#6927)

* Update puppeteer (#6949)

* Update index.mdx (#6950)

* Update CODEOWNERS with correct PM alignment (#6951)

* fix(flutter, js): scope "connect existing cdk" guide to respective platform (#6947)

Co-authored-by: Tim Nguyen <54393192+timngyn@users.noreply.github.com>

* Revert "fix(flutter, js): scope "connect existing cdk" guide to respective pl…" (#6955)

This reverts commit 5998b22.

* chore: remove duplicated logic between Layout and LayoutHeader (#6954)

* chore: more layout refactoring

* remove unused prop, alphabetize props

---------

Co-authored-by: Jim Eagan <84857865+hibler13@users.noreply.github.com>
Co-authored-by: Kevin Old <kevold@amazon.com>
Co-authored-by: Jim Blanchard <jim.l.blanchard@gmail.com>
Co-authored-by: Ankit Shah <22114629+ankpshah@users.noreply.github.com>
Co-authored-by: Katie Goines <30757403+katiegoines@users.noreply.github.com>
Co-authored-by: katiegoines <katiegoines@gmail.com>
Co-authored-by: Dan Kiuna <dankiuna@gmail.com>
Co-authored-by: Kihara, Takuya <gray@tacck.net>
Co-authored-by: Tyler Roach <tjroach@amazon.com>
Co-authored-by: Tim Nguyen <54393192+timngyn@users.noreply.github.com>
Co-authored-by: Rene Brandel <4989523+renebrandel@users.noreply.github.com>
Co-authored-by: Elijah Quartey <Equartey@users.noreply.github.com>
  • Loading branch information
13 people committed Feb 23, 2024
1 parent 3857959 commit ff8b0b1
Show file tree
Hide file tree
Showing 10 changed files with 415 additions and 177 deletions.
62 changes: 31 additions & 31 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -9,80 +9,80 @@
/src/pages/console/ @dbanksdesign @aws-amplify/documentation-team

#Analytics
/src/**/**/analytics @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/**/**/analytics @hdworld11 @dbanksdesign @aws-amplify/documentation-team

#Auth
/src/**/**/auth @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/**/**/authz @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/**/**/authentication @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/**/**/auth @josefaidt @aws-amplify/documentation-team
/src/**/**/authz @josefaidt @renebrandel @aws-amplify/documentation-team
/src/**/**/authentication @renebrandel @josefaidt @aws-amplify/documentation-team

#Client Configuration
/src/**/**/client-configuration @renebrandel @dbanksdesign @hdworld11 @aws-amplify/documentation-team
/src/**/**/configuration @renebrandel @dbanksdesign @hdworld11 @aws-amplify/documentation-team
/src/**/**/client-configuration @renebrandel @josefaidt @hdworld11 @aws-amplify/documentation-team
/src/**/**/configuration @renebrandel @josefaidt @hdworld11 @aws-amplify/documentation-team

#Common
/src/fragments/common @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/fragments/lib/common @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/fragments/common @renebrandel @hdworld11 @josefaidt @dbanksdesign @aws-amplify/documentation-team
/src/fragments/lib/common @renebrandel @hdworld11 @josefaidt @dbanksdesign @aws-amplify/documentation-team

#Data
/src/**/**/datastore @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/**/**/data @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/**/**/datastore @renebrandel @aws-amplify/documentation-team
/src/**/**/data @renebrandel @aws-amplify/documentation-team

#Debugging
/src/fragments/**/debugging @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/fragments/**/debugging @josefaidt @aws-amplify/documentation-team

#Geo
/src/**/**/geo @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/**/**/geo @hdworld11 @aws-amplify/documentation-team

#Getting Started
/src/**/start @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/**/start @renebrandel @hdworld11 @josefaidt @dbanksdesign @aws-amplify/documentation-team

#GraphQL API
/src/**/**/api-graphql @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/**/**/graphqlapi @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/**/cli-legacy/graphql-transformer @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/fragments/sdk/api/**/graphql.mdx @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/**/**/api-graphql @renebrandel @aws-amplify/documentation-team
/src/**/**/graphqlapi @renebrandel @aws-amplify/documentation-team
/src/**/cli-legacy/graphql-transformer @renebrandel @aws-amplify/documentation-team
/src/fragments/sdk/api/**/graphql.mdx @renebrandel @aws-amplify/documentation-team

#In-App Messaging
/src/**/**/in-app-messaging @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/**/**/in-app-messaging @hdworld11 @aws-amplify/documentation-team

#Info
/src/fragments/**/info @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/fragments/**/info @renebrandel @hdworld11 @josefaidt @dbanksdesign @aws-amplify/documentation-team

#Interactions
/src/**/**/interactions @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/**/**/interactions @josefaidt @aws-amplify/documentation-team

#Logging
/src/fragments/lib/logging @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/fragments/lib/logging @hdworld11 @aws-amplify/documentation-team

#Predictions
/src/**/**/predictions @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/**/**/predictions @hdworld11 @dbanksdesign @aws-amplify/documentation-team

#Project Setup
/src/**/**/project-setup @renebrandel @dbanksdesign @hdworld11 @aws-amplify/documentation-team
/src/**/**/project-setup @renebrandel @josefaidt @dbanksdesign @hdworld11 @aws-amplify/documentation-team

#PubSub
/src/**/**/pubsub @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/**/**/pubsub @renebrandel @aws-amplify/documentation-team

#Push Notifications
/src/**/**/push-notifications @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/**/**/push-notifications @hdworld11 @dbanksdesign @aws-amplify/documentation-team

#Rest API
/src/**/**/api-rest @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/**/**/restapi @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/fragments/sdk/api/**/rest.mdx @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/**/**/api-rest @josefaidt @aws-amplify/documentation-team
/src/**/**/restapi @josefaidt @aws-amplify/documentation-team
/src/fragments/sdk/api/**/rest.mdx @josefaidt @aws-amplify/documentation-team

#SSR
/src/fragments/lib/ssr @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/fragments/lib/ssr @renebrandel @josefaidt @dbanksdesign @aws-amplify/documentation-team

#Storage
/src/**/**/storage @hdworld11 @aws-amplify/documentation-team

#Troubleshooting
/src/fragments/lib/troubleshooting @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/fragments/lib/troubleshooting @josefaidt @aws-amplify/documentation-team

#Utilities
/src/**/**/utilities @renebrandel @dbanksdesign @aws-amplify/documentation-team
/src/**/**/utilities @josefaidt @aws-amplify/documentation-team

#Docs Engineering
/src/components @aws-amplify/documentation-team
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"lint-staged": "^14.0.0",
"next-bundle-analyzer": "^0.6.7",
"prettier": "^3.0.3",
"puppeteer": "^20.8.2",
"puppeteer": "^22.2.0",
"rehype": "^11.0.0",
"rehype-img-size": "^1.0.1",
"rehype-mdx-code-props": "^2.0.0",
Expand Down Expand Up @@ -91,7 +91,7 @@
"follow-redirects": "^1.15.4",
"ip": "2.0.1",
"sharp": "0.32.6"
},
},
"scripts": {
"clean": "rm -rf node_modules yarn.lock",
"refresh": "yarn clean && yarn",
Expand Down
6 changes: 3 additions & 3 deletions src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@ export const Layout = ({
mainId={mainId}
/>
<LayoutHeader
hasTOC={hasTOC}
tocHeadings={tocHeadings}
showTOC={showTOC}
isGen2={isGen2}
currentPlatform={currentPlatform}
pageType={pageType}
platform={platform}
showLastUpdatedDate={showLastUpdatedDate}
></LayoutHeader>
<View key={asPathWithNoHash} className="layout-main">
Expand Down
35 changes: 8 additions & 27 deletions src/components/Layout/LayoutHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useContext, useRef } from 'react';
import { useRouter } from 'next/router';
import { Button, Flex, View, VisuallyHidden } from '@aws-amplify/ui-react';
import classNames from 'classnames';
import { DEFAULT_PLATFORM, PLATFORMS, Platform } from '@/data/platforms';
import { Platform } from '@/data/platforms';
import {
ALGOLIA_API_KEY,
ALGOLIA_INDEX_NAME,
Expand All @@ -11,7 +11,6 @@ import {
import { IconMenu, IconDoubleChevron } from '@/components/Icons';
import { Menu } from '@/components/Menu';
import { LayoutContext } from '@/components/Layout';
import type { HeadingInterface } from '@/components/TableOfContents/TableOfContents';
import { PlatformNavigator } from '@/components/PlatformNavigator';
import flatDirectory from 'src/directory/flatDirectory.json';
import { DocSearch } from '@docsearch/react';
Expand All @@ -22,43 +21,25 @@ import RepoActions from '../Menu/RepoActions';
import { usePathWithoutHash } from '@/utils/usePathWithoutHash';

export const LayoutHeader = ({
hasTOC = true,
tocHeadings,
currentPlatform,
isGen2,
pageType = 'inner',
platform,
showLastUpdatedDate = true
showLastUpdatedDate = true,
showTOC
}: {
hasTOC?: boolean;
tocHeadings: HeadingInterface[];
currentPlatform?: Platform | undefined;
isGen2?: boolean;
pageType?: 'home' | 'inner';
platform?: Platform;
showLastUpdatedDate: boolean;
showTOC?: boolean;
}) => {
const { menuOpen, toggleMenuOpen } = useContext(LayoutContext);
const menuButtonRef = useRef<HTMLButtonElement>(null);
const sidebarMenuButtonRef = useRef<HTMLButtonElement>(null);
const showTOC = hasTOC && tocHeadings.length > 0;
const router = useRouter();
const asPathWithNoHash = usePathWithoutHash();
const isGen2 = asPathWithNoHash.split('/')[1] === 'gen2';
let currentPlatform = isGen2 ? undefined : DEFAULT_PLATFORM;
const isPrev = asPathWithNoHash.split('/')[2] === 'prev';

if (!isGen2) {
// [platform] will always be the very first subpath right?
// when using `router.asPath` it returns a string that starts with a '/'
// To get the "platform" the client was trying to visit, we have to get the string at index 1
// Doing this because when visiting a 404 page, there is no `router.query.platform`, so we have
// to check where the user was trying to visit from
const asPathPlatform = asPathWithNoHash.split('/')[1] as Platform;

currentPlatform = platform
? platform
: PLATFORMS.includes(asPathPlatform)
? asPathPlatform
: DEFAULT_PLATFORM;
}

const handleMenuToggle = () => {
if (!menuOpen) {
toggleMenuOpen(true);
Expand Down
3 changes: 3 additions & 0 deletions src/directory/directory.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2182,6 +2182,9 @@ export const directory = {
children: [
{
path: 'src/pages/gen1/[platform]/sdk/configuration/setup-options/index.mdx'
},
{
path: 'src/pages/gen1/[platform]/sdk/configuration/amplify-compatibility/index.mdx'
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ If you want to grant a set of users access to a record, you use the `multipleOwn
```ts
export const schema = a.schema({
Todo: a.model({
content: a.string()
content: a.string(),
}).authorization([
a.allow.multipleOwners()
])
a.allow.multipleOwners(),
]),
})
```

Expand All @@ -52,10 +52,10 @@ You can override the `inField` to a list of owners. Use this if you want a dynam
```ts
export const schema = a.schema({
Todo: a.model({
content: a.string()
authors: a.string().array() // record owner information now stored in "authors" field
content: a.string(),
authors: a.string().array(), // record owner information now stored in "authors" field
}).authorization([
a.allow.multipleOwners().inField("authors")
])
a.allow.multipleOwners().inField("authors"),
]),
})
```
6 changes: 3 additions & 3 deletions src/pages/gen1/[platform]/build-ui/uibuilder/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getCustomStaticPath } from '@/utils/getCustomStaticPath';

export const meta = {
title: 'Figma-to-Code',
description: 'Generate clean React code from Figma design files with Amplify Studio.',
Expand Down Expand Up @@ -30,7 +30,7 @@ export function getStaticProps(context) {
}
};
}


Amplify Studio offers an integration with Figma, allowing you to generate clean React code by importing your Figma design file. [Figma](https://figma.com/) is a browser-based UI and UX design application that is used to build high-fidelity designs. In the standard product development lifecycle, UI or UX designers build mockups that get implemented as code by developers. Amplify Studio automatically converts any [Figma component](https://help.figma.com/hc/en-us/articles/360038662654-Guide-to-Components-in-Figma) in your Figma file to a [React component](https://reactjs.org/docs/components-and-props.html) that is then usable in your app.

Expand Down Expand Up @@ -83,7 +83,7 @@ import amplifyconfig from './amplifyconfiguration.json';
import "@aws-amplify/ui-react/styles.css";
import studioTheme from './ui-components/studioTheme';

Amplify.configure(awsconfig);
Amplify.configure(amplifyconfig);
```
3. In your application's entrypoint file (e.g. `src/index.js` for create-react-app or `src/main.jsx` for Vite), wrap the `<App />` with the following:

Expand Down
Loading

0 comments on commit ff8b0b1

Please sign in to comment.