-
Notifications
You must be signed in to change notification settings - Fork 4
Fix: sponsor media upload text preview #1045
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -178,3 +178,60 @@ export const removeFileForSponsorMU = | |
| dispatch(stopLoading()); | ||
| }); | ||
| }; | ||
|
|
||
| export const uploadTextForSponsorMU = | ||
| (pageId, moduleId, text) => async (dispatch, getState) => { | ||
| const { currentSummitState, currentSponsorState } = getState(); | ||
| const { currentSummit } = currentSummitState; | ||
| const { entity: sponsor } = currentSponsorState; | ||
| const accessToken = await getAccessTokenSafely(); | ||
|
|
||
| dispatch(startLoading()); | ||
|
|
||
| const params = { | ||
| access_token: accessToken | ||
| }; | ||
|
|
||
| return putRequest( | ||
| null, | ||
| createAction("DUMMY_ACTION"), | ||
| `${window.SPONSOR_PAGES_API_URL}/api/v1/summits/${currentSummit.id}/sponsors/${sponsor.id}/available-pages/${pageId}/modules/${moduleId}/text`, | ||
| { value: text }, | ||
| snackbarErrorHandler | ||
| )(params)(dispatch) | ||
| .then(({ response }) => { | ||
| dispatch( | ||
| createAction(SPONSOR_MEDIA_UPLOAD_FILE_UPLOADED)({ | ||
| ...response, | ||
| moduleId | ||
| }) | ||
| ); | ||
| }) | ||
| .finally(() => { | ||
| dispatch(stopLoading()); | ||
| }); | ||
| }; | ||
|
|
||
| export const removeTextForSponsorMU = | ||
| (pageId, moduleId) => async (dispatch, getState) => { | ||
| const { currentSummitState, currentSponsorState } = getState(); | ||
| const { currentSummit } = currentSummitState; | ||
| const { entity: sponsor } = currentSponsorState; | ||
| const accessToken = await getAccessTokenSafely(); | ||
|
|
||
| dispatch(startLoading()); | ||
|
|
||
| const params = { | ||
| access_token: accessToken | ||
| }; | ||
|
|
||
| return deleteRequest( | ||
| null, | ||
| createAction(SPONSOR_MEDIA_UPLOAD_FILE_DELETED)({ moduleId }), | ||
| `${window.SPONSOR_PAGES_API_URL}/api/v1/summits/${currentSummit.id}/sponsors/${sponsor.id}/available-pages/${pageId}/modules/${moduleId}/text`, | ||
| null, | ||
| snackbarErrorHandler | ||
| )(params)(dispatch).finally(() => { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @santipalenque )(params)(dispatch)
.catch(() => {})
.finally(() => {
dispatch(stopLoading());
});
|
||
| dispatch(stopLoading()); | ||
| }); | ||
| }; | ||
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.
@santipalenque Hold the merge on OpenStackweb/openstack-uicore-foundation#319:
5.0.50-beta.1'sCustomDialogwrapschildrenin its ownDialogContent(src/components/mui/CustomDialog/index.js:77there), soPreviewModal,UploadDialogandTextPreviewModalcurrently renderDialogContent > DialogContent + DialogActions(footer buttons inside the scrollable body,PreviewModal'sp: 0defeated), whileTextValueDialoghas noDialogContentof its own. The locally installed5.0.50-beta.0does not wrap children, which is why it did not show during development. Once #319 lands, bump to the release and align the four dialogs to whichever contract shipped — one of the two groups needs a small change either way, the bump alone does not cover it.