forked from mastodon/mastodon
-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit '7742f440fa2a1541cd71512cadfec1762f16cdc9' into kbtopic-…
…follow-9.0-to-patch
Showing
862 changed files
with
28,955 additions
and
21,624 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
public/system | ||
public/assets | ||
public/packs | ||
public/packs-test | ||
node_modules | ||
neo4j | ||
vendor/bundle | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: 'Setup Javascript' | ||
description: 'Setup a Javascript environment ready to run the Mastodon code' | ||
inputs: | ||
onlyProduction: | ||
description: Only install production dependencies | ||
default: 'false' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
|
||
# The following is needed because we can not use `cache: true` for `setup-node`, as it does not support Corepack yet and mess up with the cache location if ran after Node is installed | ||
- name: Enable corepack | ||
shell: bash | ||
run: corepack enable | ||
|
||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
shell: bash | ||
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT | ||
|
||
- uses: actions/cache@v3 | ||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install all yarn packages | ||
shell: bash | ||
run: yarn install --immutable | ||
if: inputs.onlyProduction == 'false' | ||
|
||
- name: Install all production yarn packages | ||
shell: bash | ||
run: yarn workspaces focus --production | ||
if: inputs.onlyProduction != 'false' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: 'Setup RUby' | ||
description: 'Setup a Ruby environment ready to run the Mastodon code' | ||
inputs: | ||
ruby-version: | ||
description: The Ruby version to install | ||
default: '.ruby-version' | ||
additional-system-dependencies: | ||
description: 'Additional packages to install' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Install system dependencies | ||
shell: bash | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libicu-dev libidn11-dev ${{ inputs.additional-system-dependencies }} | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ inputs.ruby-version }} | ||
bundler-cache: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,5 @@ linters: | |
enabled: true | ||
MiddleDot: | ||
enabled: true | ||
LineLength: | ||
max: 320 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,45 @@ | ||
# This configuration was generated by | ||
# `haml-lint --auto-gen-config` | ||
# on 2023-10-11 11:31:24 -0400 using Haml-Lint version 0.51.0. | ||
# on 2023-10-26 09:32:34 -0400 using Haml-Lint version 0.51.0. | ||
# The point is for the user to remove these configuration records | ||
# one by one as the lints are removed from the code base. | ||
# Note that changes in the inspected code, or installation of new | ||
# versions of Haml-Lint, may require this file to be generated again. | ||
|
||
linters: | ||
# Offense count: 946 | ||
# Offense count: 16 | ||
LineLength: | ||
enabled: false | ||
|
||
# Offense count: 22 | ||
UnnecessaryStringOutput: | ||
enabled: false | ||
exclude: | ||
- 'app/views/admin/account_actions/new.html.haml' | ||
- 'app/views/admin/accounts/index.html.haml' | ||
- 'app/views/admin/ip_blocks/new.html.haml' | ||
- 'app/views/admin/roles/_form.html.haml' | ||
- 'app/views/admin/settings/discovery/show.html.haml' | ||
- 'app/views/auth/registrations/edit.html.haml' | ||
- 'app/views/auth/registrations/new.html.haml' | ||
- 'app/views/filters/_filter_fields.html.haml' | ||
- 'app/views/media/player.html.haml' | ||
- 'app/views/settings/applications/_fields.html.haml' | ||
- 'app/views/settings/imports/index.html.haml' | ||
- 'app/views/settings/preferences/appearance/show.html.haml' | ||
- 'app/views/settings/preferences/notifications/show.html.haml' | ||
- 'app/views/settings/preferences/other/show.html.haml' | ||
- 'app/views/settings/preferences/reaching/show.html.haml' | ||
- 'app/views/settings/profiles/show.html.haml' | ||
- 'app/views/settings/privacy_extra/show.html.haml' | ||
|
||
# Offense count: 44 | ||
# Offense count: 9 | ||
RuboCop: | ||
enabled: false | ||
exclude: | ||
- 'app/views/admin/accounts/_buttons.html.haml' | ||
- 'app/views/admin/accounts/_local_account.html.haml' | ||
- 'app/views/admin/roles/_form.html.haml' | ||
- 'app/views/home/index.html.haml' | ||
|
||
# Offense count: 3 | ||
ViewLength: | ||
exclude: | ||
- 'app/views/admin/accounts/show.html.haml' | ||
- 'app/views/admin/instances/show.html.haml' | ||
- 'app/views/admin/reports/show.html.haml' | ||
- 'app/views/disputes/strikes/show.html.haml' | ||
|
||
# Offense count: 15 | ||
InstanceVariables: | ||
exclude: | ||
- 'app/views/application/_sidebar.html.haml' | ||
|
||
# Offense count: 2 | ||
IdNames: | ||
exclude: | ||
- 'app/views/oauth/authorizations/error.html.haml' | ||
- 'app/views/shared/_error_messages.html.haml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
20.8 | ||
20.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
13 changes: 13 additions & 0 deletions
13
.yarn/patches/babel-plugin-lodash-npm-3.3.4-c7161075b6.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/lib/index.js b/lib/index.js | ||
index 16ed6be8be8f555cc99096c2ff60954b42dc313d..d009c069770d066ad0db7ad02de1ea473a29334e 100644 | ||
--- a/lib/index.js | ||
+++ b/lib/index.js | ||
@@ -99,7 +99,7 @@ function lodash(_ref) { | ||
|
||
var node = _ref3; | ||
|
||
- if ((0, _types.isModuleDeclaration)(node)) { | ||
+ if ((0, _types.isImportDeclaration)(node) || (0, _types.isExportDeclaration)(node)) { | ||
isModule = true; | ||
break; | ||
} |
22 changes: 22 additions & 0 deletions
22
.yarn/patches/compression-webpack-plugin-npm-6.1.1-3a2a65987e.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
diff --git a/dist/index.js b/dist/index.js | ||
index 57e375592d984e9a429bcd9f800fa2d15cd662e4..0c47d96df3608e23adfd77d887a8f72abbd501c0 100644 | ||
--- a/dist/index.js | ||
+++ b/dist/index.js | ||
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
|
||
-var _crypto = _interopRequireDefault(require("crypto")); | ||
+var _createHash = _interopRequireDefault(require("webpack/lib/util/createHash")); | ||
|
||
var _path = _interopRequireDefault(require("path")); | ||
|
||
@@ -227,7 +227,7 @@ class CompressionPlugin { | ||
originalAlgorithm: this.options.algorithm, | ||
compressionOptions: this.options.compressionOptions, | ||
name, | ||
- contentHash: _crypto.default.createHash("md4").update(input).digest("hex") | ||
+ contentHash: _createHash.default("md4").update(input).digest("hex") | ||
}; | ||
} else { | ||
cacheData.name = (0, _serializeJavascript.default)({ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nodeLinker: node-modules |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
class Api::V1::Apps::CredentialsController < Api::BaseController | ||
before_action -> { doorkeeper_authorize! :read } | ||
|
||
def show | ||
render json: doorkeeper_token.application, serializer: REST::ApplicationSerializer, fields: %i(name website vapid_key) | ||
return doorkeeper_render_error unless valid_doorkeeper_token? | ||
|
||
render json: doorkeeper_token.application, serializer: REST::ApplicationSerializer, fields: %i(name website vapid_key client_id scopes) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# frozen_string_literal: true | ||
|
||
class Api::V1::Instances::BaseController < Api::BaseController | ||
skip_before_action :require_authenticated_user!, | ||
unless: :limited_federation_mode? | ||
|
||
vary_by '' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 1 addition & 4 deletions
5
app/controllers/api/v1/instances/extended_descriptions_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 1 addition & 5 deletions
6
app/controllers/api/v1/instances/privacy_policies_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 1 addition & 5 deletions
6
app/controllers/api/v1/instances/translation_languages_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# frozen_string_literal: true | ||
|
||
module Admin | ||
module DisputesHelper | ||
def strike_action_label(appeal) | ||
t(key_for_action(appeal), | ||
scope: 'admin.strikes.actions', | ||
name: content_tag(:span, appeal.strike.account.username, class: 'username'), | ||
target: content_tag(:span, appeal.account.username, class: 'target')) | ||
.html_safe | ||
end | ||
|
||
private | ||
|
||
def key_for_action(appeal) | ||
AccountWarning.actions.slice(appeal.strike.action).keys.first | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
module DtlHelper | ||
DTL_ENABLED = ENV.fetch('DTL_ENABLED', 'false') == 'true' | ||
DTL_TAG = ENV.fetch('DTL_TAG', 'kmyblue') | ||
def dtl_enabled? | ||
ENV.fetch('DTL_ENABLED', 'false') == 'true' | ||
end | ||
|
||
def dtl_tag_name | ||
ENV.fetch('DTL_TAG', 'kmyblue') | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
module SelfDestructHelper | ||
def self.self_destruct? | ||
value = ENV.fetch('SELF_DESTRUCT', nil) | ||
value.present? && Rails.application.message_verifier('self-destruct').verify(value) == ENV['LOCAL_DOMAIN'] | ||
rescue ActiveSupport::MessageVerifier::InvalidSignature | ||
false | ||
end | ||
|
||
def self_destruct? | ||
SelfDestructHelper.self_destruct? | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// eslint-disable-next-line import/no-anonymous-default-export | ||
export default 'SvgrURL'; | ||
export const ReactComponent = 'div'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import { createAction } from '@reduxjs/toolkit'; | ||
|
||
import type { ApiAccountJSON } from 'mastodon/api_types/accounts'; | ||
import type { ApiRelationshipJSON } from 'mastodon/api_types/relationships'; | ||
|
||
export const revealAccount = createAction<{ | ||
id: string; | ||
}>('accounts/revealAccount'); | ||
|
||
export const importAccounts = createAction<{ accounts: ApiAccountJSON[] }>( | ||
'accounts/importAccounts', | ||
); | ||
|
||
function actionWithSkipLoadingTrue<Args extends object>(args: Args) { | ||
return { | ||
payload: { | ||
...args, | ||
skipLoading: true, | ||
}, | ||
}; | ||
} | ||
|
||
export const followAccountSuccess = createAction( | ||
'accounts/followAccountSuccess', | ||
actionWithSkipLoadingTrue<{ | ||
relationship: ApiRelationshipJSON; | ||
alreadyFollowing: boolean; | ||
}>, | ||
); | ||
|
||
export const unfollowAccountSuccess = createAction( | ||
'accounts/unfollowAccountSuccess', | ||
actionWithSkipLoadingTrue<{ | ||
relationship: ApiRelationshipJSON; | ||
statuses: unknown; | ||
alreadyFollowing?: boolean; | ||
}>, | ||
); | ||
|
||
export const authorizeFollowRequestSuccess = createAction<{ id: string }>( | ||
'accounts/followRequestAuthorizeSuccess', | ||
); | ||
|
||
export const rejectFollowRequestSuccess = createAction<{ id: string }>( | ||
'accounts/followRequestRejectSuccess', | ||
); | ||
|
||
export const followAccountRequest = createAction( | ||
'accounts/followRequest', | ||
actionWithSkipLoadingTrue<{ id: string; locked: boolean }>, | ||
); | ||
|
||
export const followAccountFail = createAction( | ||
'accounts/followFail', | ||
actionWithSkipLoadingTrue<{ id: string; error: string; locked: boolean }>, | ||
); | ||
|
||
export const unfollowAccountRequest = createAction( | ||
'accounts/unfollowRequest', | ||
actionWithSkipLoadingTrue<{ id: string }>, | ||
); | ||
|
||
export const unfollowAccountFail = createAction( | ||
'accounts/unfollowFail', | ||
actionWithSkipLoadingTrue<{ id: string; error: string }>, | ||
); | ||
|
||
export const blockAccountSuccess = createAction<{ | ||
relationship: ApiRelationshipJSON; | ||
statuses: unknown; | ||
}>('accounts/blockSuccess'); | ||
|
||
export const unblockAccountSuccess = createAction<{ | ||
relationship: ApiRelationshipJSON; | ||
}>('accounts/unblockSuccess'); | ||
|
||
export const muteAccountSuccess = createAction<{ | ||
relationship: ApiRelationshipJSON; | ||
statuses: unknown; | ||
}>('accounts/muteSuccess'); | ||
|
||
export const unmuteAccountSuccess = createAction<{ | ||
relationship: ApiRelationshipJSON; | ||
}>('accounts/unmuteSuccess'); | ||
|
||
export const pinAccountSuccess = createAction<{ | ||
relationship: ApiRelationshipJSON; | ||
}>('accounts/pinSuccess'); | ||
|
||
export const unpinAccountSuccess = createAction<{ | ||
relationship: ApiRelationshipJSON; | ||
}>('accounts/unpinSuccess'); | ||
|
||
export const fetchRelationshipsSuccess = createAction( | ||
'relationships/fetchSuccess', | ||
actionWithSkipLoadingTrue<{ relationships: ApiRelationshipJSON[] }>, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { createAction } from '@reduxjs/toolkit'; | ||
|
||
import type { Account } from 'mastodon/models/account'; | ||
|
||
export const blockDomainSuccess = createAction<{ | ||
domain: string; | ||
accounts: Account[]; | ||
}>('domain_blocks/blockSuccess'); | ||
|
||
export const unblockDomainSuccess = createAction<{ | ||
domain: string; | ||
accounts: Account[]; | ||
}>('domain_blocks/unblockSuccess'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { createAction } from '@reduxjs/toolkit'; | ||
|
||
import type { ApiAccountJSON } from '../api_types/accounts'; | ||
// To be replaced once ApiNotificationJSON type exists | ||
interface FakeApiNotificationJSON { | ||
type: string; | ||
account: ApiAccountJSON; | ||
} | ||
|
||
export const notificationsUpdate = createAction( | ||
'notifications/update', | ||
({ | ||
playSound, | ||
...args | ||
}: { | ||
notification: FakeApiNotificationJSON; | ||
usePendingItems: boolean; | ||
playSound: boolean; | ||
}) => ({ | ||
payload: args, | ||
meta: { playSound: playSound ? { sound: 'boop' } : undefined }, | ||
}), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { useCallback } from 'react'; | ||
|
||
import classNames from 'classnames'; | ||
|
||
interface BaseProps extends React.ButtonHTMLAttributes<HTMLButtonElement> { | ||
block?: boolean; | ||
secondary?: boolean; | ||
text?: JSX.Element; | ||
} | ||
|
||
interface PropsWithChildren extends BaseProps { | ||
text?: never; | ||
} | ||
|
||
interface PropsWithText extends BaseProps { | ||
text: JSX.Element; | ||
children: never; | ||
} | ||
|
||
type Props = PropsWithText | PropsWithChildren; | ||
|
||
export const Button: React.FC<Props> = ({ | ||
text, | ||
type = 'button', | ||
onClick, | ||
disabled, | ||
block, | ||
secondary, | ||
className, | ||
title, | ||
children, | ||
...props | ||
}) => { | ||
const handleClick = useCallback<React.MouseEventHandler<HTMLButtonElement>>( | ||
(e) => { | ||
if (!disabled && onClick) { | ||
onClick(e); | ||
} | ||
}, | ||
[disabled, onClick], | ||
); | ||
|
||
return ( | ||
<button | ||
className={classNames('button', className, { | ||
'button-secondary': secondary, | ||
'button--block': block, | ||
})} | ||
disabled={disabled} | ||
onClick={handleClick} | ||
title={title} | ||
type={type} | ||
{...props} | ||
> | ||
{text ?? children} | ||
</button> | ||
); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.