-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(storage-browser): add custom actions #6210
Conversation
|
examples/next/pages/ui/components/storage/storage-browser/custom-actions/index.page.tsx
Fixed
Show fixed
Hide fixed
examples/next/pages/ui/components/storage/storage-browser/custom-actions/index.page.tsx
Fixed
Show fixed
Hide fixed
examples/next/pages/ui/components/storage/storage-browser/custom-actions/index.page.tsx
Fixed
Show fixed
Hide fixed
examples/next/pages/ui/components/storage/storage-browser/default-auth/index.page.tsx
Fixed
Show fixed
Hide fixed
@@ -108,6 +77,5 @@ export const isDefaultActionViewType = ( | |||
|
|||
export const defaultActionConfigs = { | |||
...defaultActionViewConfigs, | |||
listLocationItems: listLocationItemsActionConfig, | |||
listLocations: listLocationsActionConfig, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
listLocations
is no longer a default action?
packages/react-storage/src/components/StorageBrowser/actions/configs/types.ts
Outdated
Show resolved
Hide resolved
packages/react-storage/src/components/StorageBrowser/actions/configs/types.ts
Outdated
Show resolved
Hide resolved
<dialog open={!!query.actionType}> | ||
<dialog | ||
open={!!query.actionType} | ||
style={{ width: '50vw', position: 'absolute', zIndex: 1000 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sanity check: intended inline css?
packages/react-storage/src/components/StorageBrowser/actions/configs/__tests__/context.spec.tsx
Outdated
Show resolved
Hide resolved
packages/react-storage/src/components/StorageBrowser/actions/handlers/delete.ts
Outdated
Show resolved
Hide resolved
const isListActionViewType = (value: unknown): value is ListActionType => | ||
Object.keys(LIST_ACTION_HOOKS).includes(value as ListActionType); | ||
|
||
// @ts-expect-error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sanity check: intended error suppressing?
@@ -4,8 +4,6 @@ import { | |||
createAmplifyAuthAdapter, | |||
createStorageBrowser, | |||
} from '@aws-amplify/ui-react-storage/browser'; | |||
import '@aws-amplify/ui-react-storage/styles.css'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be kept?
@@ -1,19 +1,104 @@ | |||
import React from 'react'; | |||
import { getUrl } from '@aws-amplify/storage/internals'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not specific to this PR but we need to make sure we don't recommend this in our public doc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking but I think this file is not used anywhere and can be cleared.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're probably right. We can do that separately for sure
Description of changes
Add custom actions support for
StorageBrowser
useHandler
,useAction
anduseList
hooksuseView
useAction
anduseList
hooks in toStorageBrowser
viewsUsage:
Issue #, if available
Description of how you validated changes
Checklist
yarn test
passes and tests are updated/addeddocs
,e2e
,examples
, or other private packages.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.