-
Notifications
You must be signed in to change notification settings - Fork 22
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
#9493 Add Image Button to Rich Text Editor #9513
Conversation
# Conflicts: # applications/browser-extension/package.json # applications/browser-extension/src/components/richTextEditor/RichTextEditor.tsx # applications/browser-extension/src/components/richTextEditor/toolbar/Toolbar.tsx
...ations/browser-extension/src/components/richTextEditor/toolbar/ImageButton/useUploadAsset.ts
Outdated
Show resolved
Hide resolved
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.
This and similar changes was required due to updating the swagger.ts
…xiebrix/pixiebrix-extension into feature/9493_add_image_button merge grahams changes
axiosMock.onPost(API_PATHS.ASSET_PRE_UPLOAD(databaseId)).reply(200, { | ||
asset: { | ||
id: assetId, | ||
download_url: mockDownloadUrl.href, | ||
filename: file.name, | ||
is_uploaded: false, | ||
updated_at: new Date().toISOString(), | ||
created_at: new Date().toISOString(), | ||
}, | ||
upload_url: mockUploadUrl.href, | ||
fields: { | ||
key: "test-key", | ||
policy: "test-policy", | ||
}, | ||
}); | ||
|
||
axiosMock.onPost(mockUploadUrl.href).reply(200); | ||
|
||
// Mock the asset update request | ||
axiosMock.onPatch(API_PATHS.ASSET(databaseId, assetId)).reply(200, { | ||
id: assetId, | ||
download_url: mockDownloadUrl.href, | ||
filename: file.name, | ||
is_uploaded: true, | ||
updated_at: new Date().toISOString(), | ||
created_at: new Date().toISOString(), | ||
}); |
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:
axiosMock.onPost(API_PATHS.ASSET_PRE_UPLOAD(databaseId)).reply(200, { | |
asset: { | |
id: assetId, | |
download_url: mockDownloadUrl.href, | |
filename: file.name, | |
is_uploaded: false, | |
updated_at: new Date().toISOString(), | |
created_at: new Date().toISOString(), | |
}, | |
upload_url: mockUploadUrl.href, | |
fields: { | |
key: "test-key", | |
policy: "test-policy", | |
}, | |
}); | |
axiosMock.onPost(mockUploadUrl.href).reply(200); | |
// Mock the asset update request | |
axiosMock.onPatch(API_PATHS.ASSET(databaseId, assetId)).reply(200, { | |
id: assetId, | |
download_url: mockDownloadUrl.href, | |
filename: file.name, | |
is_uploaded: true, | |
updated_at: new Date().toISOString(), | |
created_at: new Date().toISOString(), | |
}); | |
axiosMock.onPost(API_PATHS.ASSET_PRE_UPLOAD(databaseId)).reply(200, { | |
asset: { | |
id: assetId, | |
download_url: mockDownloadUrl.href, | |
filename: file.name, | |
is_uploaded: false, | |
updated_at: new Date().toISOString(), | |
created_at: new Date().toISOString(), | |
}, | |
upload_url: mockUploadUrl.href, | |
fields: { | |
key: "test-key", | |
policy: "test-policy", | |
}, | |
}).onPost(mockUploadUrl.href) | |
.reply(200) | |
// Mock the asset update request | |
.onPatch(API_PATHS.ASSET(databaseId, assetId)).reply(200, { | |
id: assetId, | |
download_url: mockDownloadUrl.href, | |
filename: file.name, | |
is_uploaded: true, | |
updated_at: new Date().toISOString(), | |
created_at: new Date().toISOString(), | |
}); |
When the PR is merged, the first loom link found on this PR will be posted to |
…xiebrix/pixiebrix-extension into feature/9493_add_image_button merge origin
What does this PR do?
Discussion
Demo
https://www.loom.com/share/e0761bba8c0244dd98223f02a346f86b