From 6df9d388e7cb3d90a6d1fb0a920c1ce16db60822 Mon Sep 17 00:00:00 2001 From: atsuchan <83960488+atsu1125@users.noreply.github.com> Date: Fri, 11 Nov 2022 01:26:28 +0900 Subject: Update Flavour 'ja' Translation (#1911) --- app/javascript/flavours/glitch/names.yml | 9 +++++++++ app/javascript/flavours/vanilla/names.yml | 9 +++++++++ 2 files changed, 18 insertions(+) (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/names.yml b/app/javascript/flavours/glitch/names.yml index 0d56fd3cc..68db3a73e 100644 --- a/app/javascript/flavours/glitch/names.yml +++ b/app/javascript/flavours/glitch/names.yml @@ -21,3 +21,12 @@ es: skins: glitch: default: Predeterminado + +ja: + flavours: + glitch: + description: GlitchSocインスタンスのデフォルトフレーバーです。 + name: Glitch Edition + skins: + glitch: + default: デフォルト diff --git a/app/javascript/flavours/vanilla/names.yml b/app/javascript/flavours/vanilla/names.yml index 8749f2eda..0e3f43ed0 100644 --- a/app/javascript/flavours/vanilla/names.yml +++ b/app/javascript/flavours/vanilla/names.yml @@ -22,3 +22,12 @@ es: skins: vanilla: default: Predeterminado + +ja: + flavours: + vanilla: + description: バニラのMastodonインスタンスで使われるテーマです。このテーマはGlitchSocのすべての機能をサポートしない可能性があります。 + name: Vanilla Mastodon + skins: + vanilla: + default: デフォルト -- cgit From 73b68fcabbbf607d2c1d1021f6063d070edbca26 Mon Sep 17 00:00:00 2001 From: Claire Date: Sat, 12 Nov 2022 09:59:28 +0100 Subject: Fix styling of advanced options dropdown (#1916) Fixes #1914 --- app/javascript/flavours/glitch/features/compose/components/options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/features/compose/components/options.js b/app/javascript/flavours/glitch/features/compose/components/options.js index 47bd9b056..c6278f4cb 100644 --- a/app/javascript/flavours/glitch/features/compose/components/options.js +++ b/app/javascript/flavours/glitch/features/compose/components/options.js @@ -103,7 +103,7 @@ class ToggleOption extends ImmutablePureComponent { -
+
{text} {meta}
-- cgit From 1ce29aeabfed586868cd32a1dfd480bdd5efa3d2 Mon Sep 17 00:00:00 2001 From: Claire Date: Sat, 12 Nov 2022 10:17:22 +0100 Subject: Change "Allow trends without prior review' setting to include statuses Port SCSS changes from 546672e292dc3218e996048464c4c52e5d00f766 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/styles/accounts.scss | 9 ++++++++- app/javascript/flavours/glitch/styles/forms.scss | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/styles/accounts.scss b/app/javascript/flavours/glitch/styles/accounts.scss index 3d8b761e6..ffe5de262 100644 --- a/app/javascript/flavours/glitch/styles/accounts.scss +++ b/app/javascript/flavours/glitch/styles/accounts.scss @@ -204,7 +204,8 @@ } .account-role, -.simple_form .recommended { +.simple_form .recommended, +.simple_form .not_recommended { display: inline-block; padding: 4px 6px; cursor: default; @@ -229,6 +230,12 @@ } } +.simple_form .not_recommended { + color: lighten($error-red, 12%); + background-color: rgba(lighten($error-red, 12%), 0.1); + border-color: rgba(lighten($error-red, 12%), 0.5); +} + .account__header__fields { max-width: 100vw; padding: 0; diff --git a/app/javascript/flavours/glitch/styles/forms.scss b/app/javascript/flavours/glitch/styles/forms.scss index ef0ca1fcd..cddf42dac 100644 --- a/app/javascript/flavours/glitch/styles/forms.scss +++ b/app/javascript/flavours/glitch/styles/forms.scss @@ -103,7 +103,8 @@ code { } } - .recommended { + .recommended, + .not_recommended { position: absolute; margin: 0 4px; margin-top: -2px; -- cgit From 6a96b17a2de3fe6d7e24014d1dcc1ad5f54050d8 Mon Sep 17 00:00:00 2001 From: Claire Date: Sat, 12 Nov 2022 10:09:27 +0100 Subject: Add “Glitch-only” label to glitch-specific settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/javascript/flavours/glitch/styles/accounts.scss | 9 ++++++++- app/javascript/flavours/glitch/styles/forms.scss | 3 ++- app/views/admin/settings/discovery/show.html.haml | 2 +- app/views/admin/settings/registrations/show.html.haml | 2 +- app/views/settings/preferences/appearance/show.html.haml | 4 ++-- app/views/settings/preferences/other/show.html.haml | 4 ++-- config/initializers/simple_form.rb | 10 ++++++++++ config/locales-glitch/simple_form.en.yml | 1 + 8 files changed, 27 insertions(+), 8 deletions(-) (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/styles/accounts.scss b/app/javascript/flavours/glitch/styles/accounts.scss index ffe5de262..cdc506cf4 100644 --- a/app/javascript/flavours/glitch/styles/accounts.scss +++ b/app/javascript/flavours/glitch/styles/accounts.scss @@ -205,7 +205,8 @@ .account-role, .simple_form .recommended, -.simple_form .not_recommended { +.simple_form .not_recommended, +.simple_form .glitch_only { display: inline-block; padding: 4px 6px; cursor: default; @@ -236,6 +237,12 @@ border-color: rgba(lighten($error-red, 12%), 0.5); } +.simple_form .glitch_only { + color: lighten($warning-red, 12%); + background-color: rgba(lighten($warning-red, 12%), 0.1); + border-color: rgba(lighten($warning-red, 12%), 0.5); +} + .account__header__fields { max-width: 100vw; padding: 0; diff --git a/app/javascript/flavours/glitch/styles/forms.scss b/app/javascript/flavours/glitch/styles/forms.scss index cddf42dac..8eecee4e9 100644 --- a/app/javascript/flavours/glitch/styles/forms.scss +++ b/app/javascript/flavours/glitch/styles/forms.scss @@ -104,7 +104,8 @@ code { } .recommended, - .not_recommended { + .not_recommended, + .glitch_only { position: absolute; margin: 0 4px; margin-top: -2px; diff --git a/app/views/admin/settings/discovery/show.html.haml b/app/views/admin/settings/discovery/show.html.haml index 9b6424c79..3983b563b 100644 --- a/app/views/admin/settings/discovery/show.html.haml +++ b/app/views/admin/settings/discovery/show.html.haml @@ -19,7 +19,7 @@ = f.input :trendable_by_default, as: :boolean, wrapper: :with_label, recommended: :not_recommended .fields-group - = f.input :trending_status_cw, as: :boolean, wrapper: :with_label, label: t('admin.settings.trending_status_cw.title'), hint: t('admin.settings.trending_status_cw.desc_html') + = f.input :trending_status_cw, as: :boolean, wrapper: :with_label, label: t('admin.settings.trending_status_cw.title'), hint: t('admin.settings.trending_status_cw.desc_html'), glitch_only: true %h4= t('admin.settings.discovery.public_timelines') diff --git a/app/views/admin/settings/registrations/show.html.haml b/app/views/admin/settings/registrations/show.html.haml index f5e448125..0d7d49dc8 100644 --- a/app/views/admin/settings/registrations/show.html.haml +++ b/app/views/admin/settings/registrations/show.html.haml @@ -19,7 +19,7 @@ - if captcha_available? .fields-group - = f.input :captcha_enabled, as: :boolean, wrapper: :with_label, label: t('admin.settings.captcha_enabled.title'), hint: t('admin.settings.captcha_enabled.desc_html') + = f.input :captcha_enabled, as: :boolean, wrapper: :with_label, label: t('admin.settings.captcha_enabled.title'), hint: t('admin.settings.captcha_enabled.desc_html'), glitch_only: true .fields-group = f.input :closed_registrations_message, as: :text, wrapper: :with_block_label, input_html: { rows: 2 } diff --git a/app/views/settings/preferences/appearance/show.html.haml b/app/views/settings/preferences/appearance/show.html.haml index 89bd4f459..a252289b0 100644 --- a/app/views/settings/preferences/appearance/show.html.haml +++ b/app/views/settings/preferences/appearance/show.html.haml @@ -29,7 +29,7 @@ = f.input :setting_reduce_motion, as: :boolean, wrapper: :with_label = f.input :setting_disable_swiping, as: :boolean, wrapper: :with_label = f.input :setting_system_font_ui, as: :boolean, wrapper: :with_label - = f.input :setting_system_emoji_font, as: :boolean, wrapper: :with_label + = f.input :setting_system_emoji_font, as: :boolean, wrapper: :with_label, glitch_only: true %h4= t 'appearance.toot_layout' @@ -46,7 +46,7 @@ .fields-group = f.input :setting_unfollow_modal, as: :boolean, wrapper: :with_label = f.input :setting_boost_modal, as: :boolean, wrapper: :with_label - = f.input :setting_favourite_modal, as: :boolean, wrapper: :with_label + = f.input :setting_favourite_modal, as: :boolean, wrapper: :with_label, glitch_only: true = f.input :setting_delete_modal, as: :boolean, wrapper: :with_label %h4= t 'appearance.sensitive_content' diff --git a/app/views/settings/preferences/other/show.html.haml b/app/views/settings/preferences/other/show.html.haml index cf604d043..fb3d21060 100644 --- a/app/views/settings/preferences/other/show.html.haml +++ b/app/views/settings/preferences/other/show.html.haml @@ -15,7 +15,7 @@ - unless Setting.hide_followers_count .fields-group - = f.input :setting_hide_followers_count, as: :boolean, wrapper: :with_label + = f.input :setting_hide_followers_count, as: :boolean, wrapper: :with_label, glitch_only: true %h4= t 'preferences.posting_defaults' @@ -33,7 +33,7 @@ = f.input :setting_show_application, as: :boolean, wrapper: :with_label, recommended: true .fields-group - = f.input :setting_default_content_type, collection: ['text/plain', 'text/markdown', 'text/html'], wrapper: :with_label, include_blank: false, label_method: lambda { |item| safe_join([t("simple_form.labels.defaults.setting_default_content_type_#{item.split('/')[1]}"), content_tag(:span, t("simple_form.hints.defaults.setting_default_content_type_#{item.split('/')[1]}"), class: 'hint')]) }, required: false, as: :radio_buttons, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li' + = f.input :setting_default_content_type, collection: ['text/plain', 'text/markdown', 'text/html'], wrapper: :with_label, include_blank: false, label_method: lambda { |item| safe_join([t("simple_form.labels.defaults.setting_default_content_type_#{item.split('/')[1]}"), content_tag(:span, t("simple_form.hints.defaults.setting_default_content_type_#{item.split('/')[1]}"), class: 'hint')]) }, required: false, as: :radio_buttons, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li', glitch_only: true %h4= t 'preferences.public_timelines' diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb index 92cffc5a2..d167a1600 100644 --- a/config/initializers/simple_form.rb +++ b/config/initializers/simple_form.rb @@ -19,8 +19,17 @@ module RecommendedComponent end end +module GlitchOnlyComponent + def glitch_only(_wrapper_options = nil) + return unless options[:glitch_only] + options[:label_text] = ->(raw_label_text, _required_label_text, _label_present) { safe_join([raw_label_text, ' ', content_tag(:span, I18n.t('simple_form.glitch_only'), class: 'glitch_only')]) } + nil + end +end + SimpleForm.include_component(AppendComponent) SimpleForm.include_component(RecommendedComponent) +SimpleForm.include_component(GlitchOnlyComponent) SimpleForm.setup do |config| # Wrappers are used by the form builder to generate a @@ -78,6 +87,7 @@ SimpleForm.setup do |config| b.wrapper tag: :div, class: :label_input do |ba| ba.optional :recommended + ba.optional :glitch_only ba.use :label ba.wrapper tag: :div, class: :label_input__wrapper do |bb| diff --git a/config/locales-glitch/simple_form.en.yml b/config/locales-glitch/simple_form.en.yml index fd1c64bbb..0ad39886f 100644 --- a/config/locales-glitch/simple_form.en.yml +++ b/config/locales-glitch/simple_form.en.yml @@ -1,6 +1,7 @@ --- en: simple_form: + glitch_only: glitch-soc hints: defaults: fields: You can have up to %{count} items displayed as a table on your profile -- cgit From 3fa6c603badeb0ce8f74f21b12cfab2bb214e8e0 Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 10 Nov 2022 14:21:31 +0100 Subject: [Glitch] Fix color of the “No description added“ media upload warning on light theme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port 89a6b76f999635e077e9469efd9d94cd6c6d6222 to glitch-soc Signed-off-by: Claire --- .../flavours/glitch/styles/mastodon-light/diff.scss | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/styles/mastodon-light/diff.scss b/app/javascript/flavours/glitch/styles/mastodon-light/diff.scss index 22828c7d1..6489c2f80 100644 --- a/app/javascript/flavours/glitch/styles/mastodon-light/diff.scss +++ b/app/javascript/flavours/glitch/styles/mastodon-light/diff.scss @@ -203,7 +203,8 @@ html { // Change the colors used in compose-form .compose-form { .compose-form__modifiers { - .compose-form__upload__actions .icon-button { + .compose-form__upload__actions .icon-button, + .compose-form__upload__warning .icon-button { color: lighten($white, 7%); &:active, @@ -212,14 +213,6 @@ html { color: $white; } } - - .compose-form__upload-description input { - color: lighten($white, 7%); - - &::placeholder { - color: lighten($white, 7%); - } - } } .compose-form__buttons-wrapper { -- cgit From 487689f062877c49f5eb7cc75695f676c8db80cc Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 10 Nov 2022 19:36:12 +0100 Subject: [Glitch] Remove preview cards from fav and boost notifications Port 99734ac9367eb8af705aecca423c998aadddbd59 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/components/status.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/components/status.js b/app/javascript/flavours/glitch/components/status.js index 366a98d82..800832dc8 100644 --- a/app/javascript/flavours/glitch/components/status.js +++ b/app/javascript/flavours/glitch/components/status.js @@ -687,7 +687,7 @@ class Status extends ImmutablePureComponent { if (!status.get('sensitive') && !(status.get('spoiler_text').length > 0) && settings.getIn(['collapsed', 'backgrounds', 'preview_images'])) { background = attachments.getIn([0, 'preview_url']); } - } else if (status.get('card') && settings.get('inline_preview_cards')) { + } else if (status.get('card') && settings.get('inline_preview_cards') && !this.props.muted) { media.push( Date: Thu, 10 Nov 2022 20:26:04 +0100 Subject: [Glitch] Fix unnecessary service worker registration and preloading when logged out Port 894ce3726a38733ea7b8c880658b962f92d021ae to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/main.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/main.js b/app/javascript/flavours/glitch/main.js index f1e10df34..b8095f819 100644 --- a/app/javascript/flavours/glitch/main.js +++ b/app/javascript/flavours/glitch/main.js @@ -25,17 +25,17 @@ function main() { import('flavours/glitch/initial_state'), ]); - const wb = new Workbox('/sw.js'); + if (me) { + const wb = new Workbox('/sw.js'); - try { - await wb.register(); - } catch (err) { - console.error(err); + try { + await wb.register(); + } catch (err) { + console.error(err); - return; - } + return; + } - if (me) { const registerPushNotifications = await import('flavours/glitch/actions/push_notifications'); store.dispatch(registerPushNotifications.register()); -- cgit From 0071582c6d425f7f8fdbef692906d7cc778fa35c Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Fri, 11 Nov 2022 09:33:59 +0900 Subject: [Glitch] Delay workbox import Port 53d26cfc1cc2779f699f3d3d56696484faefe87c to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/main.js | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/main.js b/app/javascript/flavours/glitch/main.js index b8095f819..14a6effbb 100644 --- a/app/javascript/flavours/glitch/main.js +++ b/app/javascript/flavours/glitch/main.js @@ -2,6 +2,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { setupBrowserNotifications } from 'flavours/glitch/actions/notifications'; import Mastodon, { store } from 'flavours/glitch/containers/mastodon'; +import { me } from 'flavours/glitch/initial_state'; import ready from 'flavours/glitch/ready'; const perf = require('flavours/glitch/performance'); @@ -19,23 +20,19 @@ function main() { ReactDOM.render(, mountNode); store.dispatch(setupBrowserNotifications()); - if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { - const [{ Workbox }, { me }] = await Promise.all([ - import('workbox-window'), - import('flavours/glitch/initial_state'), - ]); + if (process.env.NODE_ENV === 'production' && me && 'serviceWorker' in navigator) { + const { Workbox } = await import('workbox-window'); + const wb = new Workbox('/sw.js'); + /** @type {ServiceWorkerRegistration} */ + let registration; - if (me) { - const wb = new Workbox('/sw.js'); - - try { - await wb.register(); - } catch (err) { - console.error(err); - - return; - } + try { + registration = await wb.register(); + } catch (err) { + console.error(err); + } + if (registration) { const registerPushNotifications = await import('flavours/glitch/actions/push_notifications'); store.dispatch(registerPushNotifications.register()); -- cgit From d525ae4bdd0325815b2b4937754bb4938f6d08c3 Mon Sep 17 00:00:00 2001 From: Connor Shea Date: Thu, 10 Nov 2022 18:55:20 -0700 Subject: [Glitch] Only remove padding when listing applications Port cf4992c918459187962a9e2f389f9ccb4f1b825d to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/styles/forms.scss | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/styles/forms.scss b/app/javascript/flavours/glitch/styles/forms.scss index 8eecee4e9..01b7a11e9 100644 --- a/app/javascript/flavours/glitch/styles/forms.scss +++ b/app/javascript/flavours/glitch/styles/forms.scss @@ -1060,11 +1060,18 @@ code { &:last-child { border-bottom: 0; - padding-bottom: 0; } } } +// Only remove padding when listing applications, to prevent styling issues on +// the Authorization page. +.applications-list { + .permissions-list__item:last-child { + padding-bottom: 0; + } +} + .keywords-table { thead { th { -- cgit From 400d1683102c6645c948a823b6108300c178f7d7 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 11 Nov 2022 08:26:58 +0100 Subject: [Glitch] Fix domain blocks on about page not working well on small screens in web UI Port 6774c339b2e22fc9cadcb466139745661d0b3c83 to glitch-soc Signed-off-by: Claire --- .../flavours/glitch/features/about/index.js | 31 +++++-------- .../flavours/glitch/styles/components/about.scss | 51 ++++++++++++++-------- 2 files changed, 46 insertions(+), 36 deletions(-) (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/features/about/index.js b/app/javascript/flavours/glitch/features/about/index.js index 4129c8236..f97eb64b4 100644 --- a/app/javascript/flavours/glitch/features/about/index.js +++ b/app/javascript/flavours/glitch/features/about/index.js @@ -183,25 +183,18 @@ class About extends React.PureComponent { <>

- - - - - - - - - - - {domainBlocks.get('items').map(block => ( - - - - - - ))} - -
{block.get('domain')}{intl.formatMessage(severityMessages[block.get('severity')].title)}{block.get('comment')}
+
+ {domainBlocks.get('items').map(block => ( +
+
+
{block.get('domain')}
+ {intl.formatMessage(severityMessages[block.get('severity')].title)} +
+ +

{block.get('comment').length > 0 ? block.get('comment') : }

+
+ ))} +
) : (

diff --git a/app/javascript/flavours/glitch/styles/components/about.scss b/app/javascript/flavours/glitch/styles/components/about.scss index c6cc6c615..6664a5756 100644 --- a/app/javascript/flavours/glitch/styles/components/about.scss +++ b/app/javascript/flavours/glitch/styles/components/about.scss @@ -247,28 +247,45 @@ &__domain-blocks { margin-top: 30px; - width: 100%; - border-collapse: collapse; - break-inside: auto; + background: darken($ui-base-color, 4%); + border: 1px solid lighten($ui-base-color, 4%); + border-radius: 4px; - th { - text-align: left; - font-weight: 500; + &__domain { + border-bottom: 1px solid lighten($ui-base-color, 4%); + padding: 10px; + font-size: 15px; color: $darker-text-color; - } - thead tr, - tbody tr { - border-bottom: 1px solid lighten($ui-base-color, 8%); - } + &:nth-child(2n) { + background: darken($ui-base-color, 2%); + } - tbody tr:last-child { - border-bottom: 0; - } + &:last-child { + border-bottom: 0; + } + + &__header { + display: flex; + gap: 10px; + justify-content: space-between; + font-weight: 500; + margin-bottom: 4px; + } - th, - td { - padding: 8px; + h6 { + color: $secondary-text-color; + font-size: inherit; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + p { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } } } } -- cgit From 8ac4165c721cf1c70d1d682e183b169230326f36 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 11 Nov 2022 09:20:24 +0100 Subject: [Glitch] Remove “No description added” media warning in edit mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port 5e796dc6f85b37c8378fe01cfd8ac23222c89eea to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/features/compose/components/upload.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/features/compose/components/upload.js b/app/javascript/flavours/glitch/features/compose/components/upload.js index 94ac6c499..c276d339d 100644 --- a/app/javascript/flavours/glitch/features/compose/components/upload.js +++ b/app/javascript/flavours/glitch/features/compose/components/upload.js @@ -48,7 +48,7 @@ export default class Upload extends ImmutablePureComponent { {!isEditingStatus && ()}
- {(media.get('description') || '').length === 0 && ( + {(media.get('description') || '').length === 0 && !isEditingStatus && (
-- cgit From e2315876f4c7bf591c535f10628fe6e145505a84 Mon Sep 17 00:00:00 2001 From: Cutls Date: Sat, 12 Nov 2022 05:19:48 +0900 Subject: [Glitch] Do not show drag&drop dialog when not logined Port 553b169d483e9b2f28007e130a494aec08a1720a to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/features/ui/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/features/ui/index.js b/app/javascript/flavours/glitch/features/ui/index.js index 3d385eee2..72e13d9d6 100644 --- a/app/javascript/flavours/glitch/features/ui/index.js +++ b/app/javascript/flavours/glitch/features/ui/index.js @@ -303,7 +303,7 @@ class UI extends React.Component { this.dragTargets.push(e.target); } - if (e.dataTransfer && e.dataTransfer.types.includes('Files') && this.props.canUploadMore) { + if (e.dataTransfer && e.dataTransfer.types.includes('Files') && this.props.canUploadMore && this.context.identity.signedIn) { this.setState({ draggingOver: true }); } } @@ -330,7 +330,7 @@ class UI extends React.Component { this.setState({ draggingOver: false }); this.dragTargets = []; - if (e.dataTransfer && e.dataTransfer.files.length >= 1 && this.props.canUploadMore) { + if (e.dataTransfer && e.dataTransfer.files.length >= 1 && this.props.canUploadMore && this.context.identity.signedIn) { this.props.dispatch(uploadCompose(e.dataTransfer.files)); } } -- cgit From 9255bfb908f660889f54d4fd5ea92279b09d8cd1 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 11 Nov 2022 21:22:17 +0100 Subject: [Glitch] Add the ability to edit media attachment metadata for any unattached media Port 31005aad12c6a915a00501765a6dab25878326cb to glitch-soc Signed-off-by: Claire --- .../flavours/glitch/features/compose/components/upload.js | 7 +++---- .../glitch/features/compose/containers/upload_container.js | 1 - app/javascript/flavours/glitch/reducers/compose.js | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/features/compose/components/upload.js b/app/javascript/flavours/glitch/features/compose/components/upload.js index c276d339d..6528bbc84 100644 --- a/app/javascript/flavours/glitch/features/compose/components/upload.js +++ b/app/javascript/flavours/glitch/features/compose/components/upload.js @@ -18,7 +18,6 @@ export default class Upload extends ImmutablePureComponent { media: ImmutablePropTypes.map.isRequired, onUndo: PropTypes.func.isRequired, onOpenFocalPoint: PropTypes.func.isRequired, - isEditingStatus: PropTypes.bool.isRequired, }; handleUndoClick = e => { @@ -32,7 +31,7 @@ export default class Upload extends ImmutablePureComponent { } render () { - const { intl, media, isEditingStatus } = this.props; + const { media } = this.props; const focusX = media.getIn(['meta', 'focus', 'x']); const focusY = media.getIn(['meta', 'focus', 'y']); const x = ((focusX / 2) + .5) * 100; @@ -45,10 +44,10 @@ export default class Upload extends ImmutablePureComponent {
- {!isEditingStatus && ()} + {!!media.get('unattached') && ()}
- {(media.get('description') || '').length === 0 && !isEditingStatus && ( + {(media.get('description') || '').length === 0 && !!media.get('unattached') && (
diff --git a/app/javascript/flavours/glitch/features/compose/containers/upload_container.js b/app/javascript/flavours/glitch/features/compose/containers/upload_container.js index d6256fe96..f3ca4ce7b 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/upload_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/upload_container.js @@ -5,7 +5,6 @@ import { submitCompose } from 'flavours/glitch/actions/compose'; const mapStateToProps = (state, { id }) => ({ media: state.getIn(['compose', 'media_attachments']).find(item => item.get('id') === id), - isEditingStatus: state.getIn(['compose', 'id']) !== null, }); const mapDispatchToProps = dispatch => ({ diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js index 460af3955..18e437bbc 100644 --- a/app/javascript/flavours/glitch/reducers/compose.js +++ b/app/javascript/flavours/glitch/reducers/compose.js @@ -222,7 +222,7 @@ function appendMedia(state, media, file) { if (media.get('type') === 'image') { media = media.set('file', file); } - map.update('media_attachments', list => list.push(media)); + map.update('media_attachments', list => list.push(media.set('unattached', true))); map.set('is_uploading', false); map.set('is_processing', false); map.set('resetFileKey', Math.floor((Math.random() * 0x10000))); @@ -563,7 +563,7 @@ export default function compose(state = initialState, action) { map.set('content_type', action.content_type || 'text/plain'); map.set('in_reply_to', action.status.get('in_reply_to_id')); map.set('privacy', action.status.get('visibility')); - map.set('media_attachments', action.status.get('media_attachments')); + map.set('media_attachments', action.status.get('media_attachments').map((media) => media.set('unattached', true))); map.set('focusDate', new Date()); map.set('caretPosition', null); map.set('idempotencyKey', uuid()); -- cgit From a808ac1fd8d4a42ee930bbb30cb6b58c810f828b Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 11 Nov 2022 21:23:03 +0100 Subject: [Glitch] Fix WebUI crash when listing server blocks and rationale is not available Port 93a6ebc83d4bc6647d1eafce509a29aa3642c87c to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/features/about/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/features/about/index.js b/app/javascript/flavours/glitch/features/about/index.js index f97eb64b4..57f295ea9 100644 --- a/app/javascript/flavours/glitch/features/about/index.js +++ b/app/javascript/flavours/glitch/features/about/index.js @@ -191,7 +191,7 @@ class About extends React.PureComponent { {intl.formatMessage(severityMessages[block.get('severity')].title)}
-

{block.get('comment').length > 0 ? block.get('comment') : }

+

{(block.get('comment') || '').length > 0 ? block.get('comment') : }

))} -- cgit