-
Notifications
You must be signed in to change notification settings - Fork 149
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
[INTEG-1417] Update aiig create upload function to handle latest upload function for both spaceId and environmentId #5324
Conversation
✅ Deploy Preview for ecommerce-app-base-components ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…or both spaceId and environmentId
9a9fa4d
to
e3052ce
Compare
Currently blocked during testing by https://github.com/contentful/app-upload-to-delivery/pull/269 |
Currently blocked by contentful/node-apps-toolkit#461 |
@@ -26,6 +26,8 @@ | |||
"@types/sinon-chai": "^3.2.9", | |||
"chai": "^4.3.7", | |||
"mocha": "^10.2.0", | |||
"node-addon-api": "^7.0.0", | |||
"node-gyp": "^10.0.1", |
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.
These two are required by sharp 0.33 for our installation to work locally
); | ||
}); | ||
|
||
describe('when environment id not present in upload response', () => { |
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.
Keep an explicit test that ensures correct behavior if for some reason the old upload (without environment id) is created.
@@ -10,11 +11,17 @@ const UPLOAD_DOMAIN: Record<string, URL> = { | |||
), | |||
}; | |||
|
|||
type UploadPropsWithEnvironment = { | |||
// TODO: use upstream UplpadProps directly once environment id has been added |
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.
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.
Looks good! 🎊
@@ -10,11 +11,17 @@ const UPLOAD_DOMAIN: Record<string, URL> = { | |||
), | |||
}; | |||
|
|||
type UploadPropsWithEnvironment = { | |||
// TODO: use upstream UplpadProps directly once environment id has been added |
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.
nit: typo in this comment, UplpadProps
should be UploadProps
😄
Purpose
The create asset upload function has been changed to take both spaceId and the environmentId, therefore we need to adjust accordingly to the new api params.
Approach
Testing steps
Testing results on sandbox:
Correct images:
Using environment scoped upload URLs:
Dependencies and/or References
Will require latest contentful-management.js package version or else merging this PR will break the backend