From 473fed2cdf67031f12cad7b2355cbafcd281022d Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 18 Jan 2023 16:28:18 +0100 Subject: [Glitch] Fix /api/v1/admin/trends/tags using wrong serializer Port b034dc42be2250f9b754fb88c9163b62d41f78f5 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/components/admin/Trends.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/components/admin/Trends.js b/app/javascript/flavours/glitch/components/admin/Trends.js index 4c17b69a0..774bf36e6 100644 --- a/app/javascript/flavours/glitch/components/admin/Trends.js +++ b/app/javascript/flavours/glitch/components/admin/Trends.js @@ -50,7 +50,7 @@ export default class Trends extends React.PureComponent { day.uses)} -- cgit From c87b1a20c750bb9166a5ede3ad9ab8d01f97913e Mon Sep 17 00:00:00 2001 From: Jeong Arm Date: Thu, 19 Jan 2023 00:29:07 +0900 Subject: [Glitch] Make visible change for new post notification setting icon Port 1b2ef60cec381e69384c208589c3dcf0ca2661db to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/features/account/components/header.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/features/account/components/header.js b/app/javascript/flavours/glitch/features/account/components/header.js index ec4a192bc..2f1800259 100644 --- a/app/javascript/flavours/glitch/features/account/components/header.js +++ b/app/javascript/flavours/glitch/features/account/components/header.js @@ -188,7 +188,7 @@ class Header extends ImmutablePureComponent { } if (account.getIn(['relationship', 'requested']) || account.getIn(['relationship', 'following'])) { - bellBtn = ; + bellBtn = ; } if (me !== account.get('id')) { -- cgit From 9205b4e32f2fdeca8f3d8076f5e60542aed1665f Mon Sep 17 00:00:00 2001 From: Peter Simonsson Date: Wed, 18 Jan 2023 15:30:46 +0000 Subject: [Glitch] Add checkmark symbol to checkbox Port 7e6ffa085f97dc4688e2655fe2447743ab807e44 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/styles/components/compose_form.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/styles/components/compose_form.scss b/app/javascript/flavours/glitch/styles/components/compose_form.scss index aa2d52ed0..40adf28c9 100644 --- a/app/javascript/flavours/glitch/styles/components/compose_form.scss +++ b/app/javascript/flavours/glitch/styles/components/compose_form.scss @@ -118,7 +118,7 @@ &.active { border-color: $highlight-text-color; - background: $highlight-text-color; + background: $highlight-text-color url("data:image/svg+xml;utf8,") center center no-repeat; } } } -- cgit From 9b4afb320a55761259a6e467cb1b4b6b5fb447f0 Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 18 Jan 2023 16:32:23 +0100 Subject: [Glitch] Change account moderation notes to make links clickable Port 9b3e22c40d5a24ddfa0df42d8fe6e96a273e8afd to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/styles/admin.scss | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/styles/admin.scss b/app/javascript/flavours/glitch/styles/admin.scss index 8ddf815c3..9aa2318ce 100644 --- a/app/javascript/flavours/glitch/styles/admin.scss +++ b/app/javascript/flavours/glitch/styles/admin.scss @@ -1588,6 +1588,15 @@ a.sparkline { margin-bottom: 0; } } + + a { + color: $highlight-text-color; + text-decoration: none; + + &:hover { + text-decoration: underline; + } + } } &__actions { -- cgit From b5c6a116a765ba2d336ff1c3ec4acd66bb41a3fb Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 18 Jan 2023 16:33:55 +0100 Subject: [Glitch] Add support for editing media description and focus point of already-posted statuses Port 4b92e59f4fea4486ee6e5af7421e7945d5f7f998 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/actions/compose.js | 46 +++++++++++++++++++--- .../glitch/features/compose/components/upload.js | 8 ++-- .../features/ui/components/focal_point_modal.js | 2 +- app/javascript/flavours/glitch/reducers/compose.js | 2 +- 4 files changed, 46 insertions(+), 12 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/actions/compose.js b/app/javascript/flavours/glitch/actions/compose.js index 7a4af4cda..267cff563 100644 --- a/app/javascript/flavours/glitch/actions/compose.js +++ b/app/javascript/flavours/glitch/actions/compose.js @@ -181,6 +181,18 @@ export function submitCompose(routerHistory) { dispatch(submitComposeRequest()); + // If we're editing a post with media attachments, those have not + // necessarily been changed on the server. Do it now in the same + // API call. + let media_attributes; + if (statusId !== null) { + media_attributes = media.map(item => ({ + id: item.get('id'), + description: item.get('description'), + focus: item.get('focus'), + })); + } + api(getState).request({ url: statusId === null ? '/api/v1/statuses' : `/api/v1/statuses/${statusId}`, method: statusId === null ? 'post' : 'put', @@ -189,6 +201,7 @@ export function submitCompose(routerHistory) { content_type: getState().getIn(['compose', 'content_type']), in_reply_to_id: getState().getIn(['compose', 'in_reply_to'], null), media_ids: media.map(item => item.get('id')), + media_attributes, sensitive: getState().getIn(['compose', 'sensitive']) || (spoilerText.length > 0 && media.size !== 0), spoiler_text: spoilerText, visibility: getState().getIn(['compose', 'privacy']), @@ -415,11 +428,31 @@ export function changeUploadCompose(id, params) { return (dispatch, getState) => { dispatch(changeUploadComposeRequest()); - api(getState).put(`/api/v1/media/${id}`, params).then(response => { - dispatch(changeUploadComposeSuccess(response.data)); - }).catch(error => { - dispatch(changeUploadComposeFail(id, error)); - }); + let media = getState().getIn(['compose', 'media_attachments']).find((item) => item.get('id') === id); + + // Editing already-attached media is deferred to editing the post itself. + // For simplicity's sake, fake an API reply. + if (media && !media.get('unattached')) { + let { description, focus } = params; + const data = media.toJS(); + + if (description) { + data.description = description; + } + + if (focus) { + focus = focus.split(','); + data.meta = { focus: { x: parseFloat(focus[0]), y: parseFloat(focus[1]) } }; + } + + dispatch(changeUploadComposeSuccess(data, true)); + } else { + api(getState).put(`/api/v1/media/${id}`, params).then(response => { + dispatch(changeUploadComposeSuccess(response.data, false)); + }).catch(error => { + dispatch(changeUploadComposeFail(id, error)); + }); + } }; }; @@ -430,10 +463,11 @@ export function changeUploadComposeRequest() { }; }; -export function changeUploadComposeSuccess(media) { +export function changeUploadComposeSuccess(media, attached) { return { type: COMPOSE_UPLOAD_CHANGE_SUCCESS, media: media, + attached: attached, skipLoading: true, }; }; diff --git a/app/javascript/flavours/glitch/features/compose/components/upload.js b/app/javascript/flavours/glitch/features/compose/components/upload.js index 6528bbc84..cd4524540 100644 --- a/app/javascript/flavours/glitch/features/compose/components/upload.js +++ b/app/javascript/flavours/glitch/features/compose/components/upload.js @@ -43,13 +43,13 @@ export default class Upload extends ImmutablePureComponent { {({ scale }) => (
- - {!!media.get('unattached') && ()} + +
- {(media.get('description') || '').length === 0 && !!media.get('unattached') && ( + {(media.get('description') || '').length === 0 && (
- +
)}
diff --git a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js index 0dd07fb76..fb432cf9c 100644 --- a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js @@ -320,7 +320,7 @@ class FocalPointModal extends ImmutablePureComponent { -