-
Notifications
You must be signed in to change notification settings - Fork 324
feat(storage-manager): add metadata #3788
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
Conversation
🦋 Changeset detectedLatest commit: 548b05b The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
docs/src/pages/[platform]/connected-components/storage/storagemanager/props.ts
Outdated
Show resolved
Hide resolved
examples/next/pages/ui/components/storage/storage-manager/metadata/index.page.tsx
Outdated
Show resolved
Hide resolved
@@ -32,6 +32,12 @@ export type StorageFiles = StorageFile[]; | |||
|
|||
export type DefaultFile = Pick<StorageFile, 'key'>; | |||
|
|||
type ProcessFileProps = Required<Pick<StorageFile, 'file' | 'key'>> & { |
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.
Prefer Props
for component props, Params
for function params
packages/react-storage/src/components/StorageManager/utils/uploadFile.ts
Outdated
Show resolved
Hide resolved
@@ -12,7 +12,8 @@ type BaseDropZoneTokens<OutputType> = DesignTokenProperties< | |||
|
|||
export interface FileUploaderTokens<OutputType extends OutputVariantKey> { | |||
dropzone?: DesignTokenProperties< | |||
'gap' | 'paddingBlock' | 'paddingInline' | 'textAlign' | |||
'gap' | 'paddingBlock' | 'paddingInline' | 'textAlign', | |||
OutputType |
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.
Note: this is a bug because with the 2nd arg all these properties become required
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.
Did you already fix this in StorageManager, or did you mean to fix this in FileUploader?
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.
StorageManger basically just extends this type so it is fixed in both :)
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.
So do we need to rename this type? When we delete the FileUploader tokens in next release, won't StorageManager break?
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.
When we do that breaking change we will inline that type into the storagemanager type
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.
LGTM! Left some suggestions, lmk what you think 😅
docs/src/pages/[platform]/connected-components/storage/storagemanager/props.ts
Outdated
Show resolved
Hide resolved
packages/react-storage/src/components/StorageManager/utils/uploadFile.ts
Outdated
Show resolved
Hide resolved
packages/react-storage/src/components/StorageManager/utils/uploadFile.ts
Outdated
Show resolved
Hide resolved
packages/react-storage/src/components/StorageManager/utils/uploadFile.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Caleb Pollman <cpollman@amazon.com>
…manager/props.ts Co-authored-by: Caleb Pollman <cpollman@amazon.com>
…oadFile.ts Co-authored-by: Caleb Pollman <cpollman@amazon.com>
…oadFile.ts Co-authored-by: Caleb Pollman <cpollman@amazon.com>
…oadFile.ts Co-authored-by: Caleb Pollman <cpollman@amazon.com>
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.
🚢
@@ -32,6 +32,12 @@ export type StorageFiles = StorageFile[]; | |||
|
|||
export type DefaultFile = Pick<StorageFile, 'key'>; | |||
|
|||
type ProcessFileParams = Required<Pick<StorageFile, 'file' | 'key'>>; | |||
|
|||
type ProcessFile = ( |
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 don't know the answer, but will this be exported since the interface below is exported?
Description of changes
Adding
metadata
prop to StorageManager and to theprocessFile
function so users can add metadata per-session and per-file.Issue #, if available
#3683
Description of how you validated changes
Added an example
Checklist
yarn test
passes and tests are updated/addedsideEffects
field updatedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.