From 5d18840ab99fbb1ad42824ee566545aaf47fdd7d Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 8 May 2023 15:16:55 +0200 Subject: [PATCH] Fix more JS linting issues (#2212) * Fix uses of intl.formatMessages without default messages * Ignore lint issue for ColumnLink button --- .../features/compose/components/publisher.jsx | 15 +++++++++++++-- .../glitch/features/local_settings/page/index.jsx | 12 ++++++++---- .../glitch/features/ui/components/column_link.jsx | 1 + 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/app/javascript/flavours/glitch/features/compose/components/publisher.jsx b/app/javascript/flavours/glitch/features/compose/components/publisher.jsx index 3128303c62..a935e82e8e 100644 --- a/app/javascript/flavours/glitch/features/compose/components/publisher.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/publisher.jsx @@ -24,6 +24,10 @@ const messages = defineMessages({ id: 'compose_form.publish_loud', }, saveChanges: { id: 'compose_form.save_changes', defaultMessage: 'Save changes' }, + public: { id: 'privacy.public.short', defaultMessage: 'Public' }, + unlisted: { id: 'privacy.unlisted.short', defaultMessage: 'Unlisted' }, + private: { id: 'privacy.private.short', defaultMessage: 'Followers-only' }, + direct: { id: 'privacy.direct.short', defaultMessage: 'Mentioned people only' }, }); class Publisher extends ImmutablePureComponent { @@ -68,6 +72,13 @@ class Publisher extends ImmutablePureComponent { publishText = privacy !== 'unlisted' ? intl.formatMessage(messages.publishLoud, { publish: intl.formatMessage(messages.publish) }) : intl.formatMessage(messages.publish); } + const privacyNames = { + public: messages.public, + unlisted: messages.unlisted, + private: messages.private, + direct: messages.direct, + }; + return (
{sideArm && !isEditing && sideArm !== 'none' ? ( @@ -78,7 +89,7 @@ class Publisher extends ImmutablePureComponent { onClick={onSecondarySubmit} style={{ padding: null }} text={} - title={`${intl.formatMessage(messages.publish)}: ${intl.formatMessage({ id: `privacy.${sideArm}.short` })}`} + title={`${intl.formatMessage(messages.publish)}: ${intl.formatMessage(privacyNames[sideArm])}`} />
) : null} @@ -86,7 +97,7 @@ class Publisher extends ImmutablePureComponent {