mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
Compare commits
24 commits
6f13c94e6f
...
0e9fc17013
Author | SHA1 | Date | |
---|---|---|---|
|
0e9fc17013 | ||
|
a50c8e951f | ||
|
2c1e75727d | ||
|
9aa8e29758 | ||
|
f9f558da7f | ||
|
50bcdf5371 | ||
|
8a705c479e | ||
|
e133d908f1 | ||
|
ade3a65676 | ||
|
6b43a08902 | ||
|
6486f58ef4 | ||
|
8a5595eb8d | ||
|
519ec1c9da | ||
|
058a3d8467 | ||
|
41708456a1 | ||
|
7066147622 | ||
|
169e524f46 | ||
|
e29478ae69 | ||
|
d9f7780598 | ||
|
a8ccfd227b | ||
|
3f4c231186 | ||
|
db9f834f47 | ||
|
7e04f35373 | ||
|
c66942aa0a |
25 changed files with 53 additions and 58 deletions
|
@ -26,7 +26,7 @@ class Api::V1::Admin::AccountActionsController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def resource_params
|
def resource_params
|
||||||
params.permit(
|
params_slice(
|
||||||
:type,
|
:type,
|
||||||
:report_id,
|
:report_id,
|
||||||
:warning_preset_id,
|
:warning_preset_id,
|
||||||
|
|
|
@ -108,7 +108,7 @@ class Api::V1::Admin::AccountsController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def filter_params
|
def filter_params
|
||||||
params.permit(*FILTER_PARAMS)
|
params_slice(*FILTER_PARAMS)
|
||||||
end
|
end
|
||||||
|
|
||||||
def translated_filter_params
|
def translated_filter_params
|
||||||
|
|
|
@ -67,7 +67,7 @@ class Api::V1::Admin::DomainBlocksController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def domain_block_params
|
def domain_block_params
|
||||||
params.permit(:severity, :reject_media, :reject_reports, :private_comment, :public_comment, :obfuscate)
|
params_slice(:severity, :reject_media, :reject_reports, :private_comment, :public_comment, :obfuscate)
|
||||||
end
|
end
|
||||||
|
|
||||||
def next_path
|
def next_path
|
||||||
|
|
|
@ -56,7 +56,7 @@ class Api::V1::Admin::IpBlocksController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def resource_params
|
def resource_params
|
||||||
params.permit(:ip, :severity, :comment, :expires_in)
|
params_slice(:ip, :severity, :comment, :expires_in)
|
||||||
end
|
end
|
||||||
|
|
||||||
def next_path
|
def next_path
|
||||||
|
|
|
@ -82,11 +82,13 @@ class Api::V1::Admin::ReportsController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def report_params
|
def report_params
|
||||||
params.permit(:category, rule_ids: [])
|
params
|
||||||
|
.slice(:category, :rule_ids)
|
||||||
|
.permit(:category, rule_ids: [])
|
||||||
end
|
end
|
||||||
|
|
||||||
def filter_params
|
def filter_params
|
||||||
params.permit(*FILTER_PARAMS)
|
params_slice(*FILTER_PARAMS)
|
||||||
end
|
end
|
||||||
|
|
||||||
def next_path
|
def next_path
|
||||||
|
|
|
@ -20,10 +20,12 @@ class Api::V1::AppsController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def app_scopes_or_default
|
def app_scopes_or_default
|
||||||
app_params[:scopes] || Doorkeeper.configuration.default_scopes
|
Array(app_params[:scopes]).first || Doorkeeper.configuration.default_scopes
|
||||||
end
|
end
|
||||||
|
|
||||||
def app_params
|
def app_params
|
||||||
params.permit(:client_name, :scopes, :website, :redirect_uris, redirect_uris: [])
|
params
|
||||||
|
.slice(:client_name, :scopes, :website, :redirect_uris, :redirect_uris)
|
||||||
|
.permit(:client_name, :scopes, :website, :redirect_uris, redirect_uris: [], scopes: [])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -52,7 +52,9 @@ class Api::V1::FiltersController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def resource_params
|
def resource_params
|
||||||
params.permit(:phrase, :expires_in, :irreversible, :whole_word, context: [])
|
params
|
||||||
|
.slice(:phrase, :expires_in, :irreversible, :whole_word, :context)
|
||||||
|
.permit(:phrase, :expires_in, :irreversible, :whole_word, context: [])
|
||||||
end
|
end
|
||||||
|
|
||||||
def filter_params
|
def filter_params
|
||||||
|
|
|
@ -52,7 +52,7 @@ class Api::V1::Lists::AccountsController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def resource_params
|
def resource_params
|
||||||
params.permit(account_ids: [])
|
params.slice(:account_ids).permit(account_ids: [])
|
||||||
end
|
end
|
||||||
|
|
||||||
def next_path
|
def next_path
|
||||||
|
|
|
@ -42,6 +42,6 @@ class Api::V1::ListsController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def list_params
|
def list_params
|
||||||
params.permit(:title, :replies_policy, :exclusive)
|
params_slice(:title, :replies_policy, :exclusive)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -40,11 +40,11 @@ class Api::V1::MediaController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def media_attachment_params
|
def media_attachment_params
|
||||||
params.permit(:file, :thumbnail, :description, :focus)
|
params_slice(:file, :thumbnail, :description, :focus)
|
||||||
end
|
end
|
||||||
|
|
||||||
def updateable_media_attachment_params
|
def updateable_media_attachment_params
|
||||||
params.permit(:thumbnail, :description, :focus)
|
params_slice(:thumbnail, :description, :focus)
|
||||||
end
|
end
|
||||||
|
|
||||||
def file_type_error
|
def file_type_error
|
||||||
|
|
|
@ -85,7 +85,9 @@ class Api::V1::NotificationsController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def browserable_params
|
def browserable_params
|
||||||
params.permit(:account_id, :include_filtered, types: [], exclude_types: [])
|
params
|
||||||
|
.slice(:account_id, :include_filtered, :types, :exclude_types)
|
||||||
|
.permit(:account_id, :include_filtered, types: [], exclude_types: [])
|
||||||
end
|
end
|
||||||
|
|
||||||
def pagination_params(core_params)
|
def pagination_params(core_params)
|
||||||
|
|
|
@ -23,6 +23,8 @@ class Api::V1::ReportsController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def report_params
|
def report_params
|
||||||
params.permit(:account_id, :comment, :category, :forward, forward_to_domains: [], status_ids: [], rule_ids: [])
|
params
|
||||||
|
.slice(:account_id, :comment, :category, :forward, :forward_to_domains, :status_ids, :rule_ids)
|
||||||
|
.permit(:account_id, :comment, :category, :forward, :rule_ids, forward_to_domains: [], status_ids: [], rule_ids: [])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -50,6 +50,6 @@ class Api::V1::Statuses::ReblogsController < Api::V1::Statuses::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def reblog_params
|
def reblog_params
|
||||||
params.permit(:visibility)
|
params_slice(:visibility)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,6 +12,7 @@ class Api::V2::Admin::AccountsController < Api::V1::Admin::AccountsController
|
||||||
ip
|
ip
|
||||||
invited_by
|
invited_by
|
||||||
role_ids
|
role_ids
|
||||||
|
role_ids: []
|
||||||
).freeze
|
).freeze
|
||||||
|
|
||||||
PAGINATION_PARAMS = (%i(limit) + FILTER_PARAMS).freeze
|
PAGINATION_PARAMS = (%i(limit) + FILTER_PARAMS).freeze
|
||||||
|
@ -39,7 +40,7 @@ class Api::V2::Admin::AccountsController < Api::V1::Admin::AccountsController
|
||||||
end
|
end
|
||||||
|
|
||||||
def filter_params
|
def filter_params
|
||||||
params.permit(*FILTER_PARAMS, role_ids: [])
|
params_slice(*FILTER_PARAMS)
|
||||||
end
|
end
|
||||||
|
|
||||||
def pagination_params(core_params)
|
def pagination_params(core_params)
|
||||||
|
|
|
@ -45,6 +45,6 @@ class Api::V2::Filters::KeywordsController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def resource_params
|
def resource_params
|
||||||
params.permit(:keyword, :whole_word)
|
params_slice(:keyword, :whole_word)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -39,6 +39,6 @@ class Api::V2::Filters::StatusesController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def resource_params
|
def resource_params
|
||||||
params.permit(:status_id)
|
params_slice(:status_id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -43,6 +43,8 @@ class Api::V2::FiltersController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def resource_params
|
def resource_params
|
||||||
params.permit(:title, :expires_in, :filter_action, context: [], keywords_attributes: [:id, :keyword, :whole_word, :_destroy])
|
params
|
||||||
|
.slice(:title, :expires_in, :filter_action, :context, :keywords_attributes)
|
||||||
|
.permit(:title, :expires_in, :filter_action, context: [], keywords_attributes: [:id, :keyword, :whole_word, :_destroy])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -63,6 +63,6 @@ class Api::V2::SearchController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def search_params
|
def search_params
|
||||||
params.permit(:type, :offset, :min_id, :max_id, :account_id, :following)
|
params.permit(:q, :resolve, :type, :offset, :min_id, :max_id, :account_id, :following)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -125,10 +125,15 @@ class Api::V2Alpha::NotificationsController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def browserable_params
|
def browserable_params
|
||||||
params.permit(:include_filtered, types: [], exclude_types: [])
|
params
|
||||||
|
.slice(:include_filtered, :types, :exclude_types)
|
||||||
|
.permit(:include_filtered, types: [], exclude_types: [])
|
||||||
end
|
end
|
||||||
|
|
||||||
def pagination_params(core_params)
|
def pagination_params(core_params)
|
||||||
params.slice(:limit, :types, :exclude_types, :include_filtered).permit(:limit, :include_filtered, types: [], exclude_types: []).merge(core_params)
|
params
|
||||||
|
.slice(:limit, :types, :exclude_types, :include_filtered)
|
||||||
|
.permit(:limit, :include_filtered, types: [], exclude_types: [])
|
||||||
|
.merge(core_params)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,7 +15,7 @@ module Admin::FilterHelper
|
||||||
AnnouncementFilter::KEYS,
|
AnnouncementFilter::KEYS,
|
||||||
Admin::ActionLogFilter::KEYS,
|
Admin::ActionLogFilter::KEYS,
|
||||||
Admin::StatusFilter::KEYS,
|
Admin::StatusFilter::KEYS,
|
||||||
].flatten.freeze
|
].flatten.uniq.freeze
|
||||||
|
|
||||||
def filter_link_to(text, link_to_params, link_class_params = link_to_params)
|
def filter_link_to(text, link_to_params, link_class_params = link_to_params)
|
||||||
new_url = filtered_url_for(link_to_params)
|
new_url = filtered_url_for(link_to_params)
|
||||||
|
@ -48,6 +48,6 @@ module Admin::FilterHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def controller_request_params
|
def controller_request_params
|
||||||
params.permit(FILTERS)
|
params.slice(FILTERS).permit(FILTERS)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -60,7 +60,7 @@ export interface BaseNotificationGroupJSON {
|
||||||
|
|
||||||
interface NotificationGroupWithStatusJSON extends BaseNotificationGroupJSON {
|
interface NotificationGroupWithStatusJSON extends BaseNotificationGroupJSON {
|
||||||
type: NotificationWithStatusType;
|
type: NotificationWithStatusType;
|
||||||
status: ApiStatusJSON;
|
status_id: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface NotificationWithStatusJSON extends BaseNotificationJSON {
|
interface NotificationWithStatusJSON extends BaseNotificationJSON {
|
||||||
|
|
|
@ -49,22 +49,15 @@ export const FilteredNotificationsBanner: React.FC = () => {
|
||||||
<span>
|
<span>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='filtered_notifications_banner.pending_requests'
|
id='filtered_notifications_banner.pending_requests'
|
||||||
defaultMessage='Notifications from {count, plural, =0 {no one} one {one person} other {# people}} you may know'
|
defaultMessage='From {count, plural, =0 {no one} one {one person} other {# people}} you may know'
|
||||||
values={{ count: policy.summary.pending_requests_count }}
|
values={{ count: policy.summary.pending_requests_count }}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='filtered-notifications-banner__badge'>
|
<div className='filtered-notifications-banner__badge'>
|
||||||
<div className='filtered-notifications-banner__badge__badge'>
|
|
||||||
{toCappedNumber(policy.summary.pending_notifications_count)}
|
{toCappedNumber(policy.summary.pending_notifications_count)}
|
||||||
</div>
|
</div>
|
||||||
<FormattedMessage
|
|
||||||
id='filtered_notifications_banner.mentions'
|
|
||||||
defaultMessage='{count, plural, one {mention} other {mentions}}'
|
|
||||||
values={{ count: policy.summary.pending_notifications_count }}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</Link>
|
</Link>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -300,8 +300,7 @@
|
||||||
"filter_modal.select_filter.subtitle": "Use an existing category or create a new one",
|
"filter_modal.select_filter.subtitle": "Use an existing category or create a new one",
|
||||||
"filter_modal.select_filter.title": "Filter this post",
|
"filter_modal.select_filter.title": "Filter this post",
|
||||||
"filter_modal.title.status": "Filter a post",
|
"filter_modal.title.status": "Filter a post",
|
||||||
"filtered_notifications_banner.mentions": "{count, plural, one {mention} other {mentions}}",
|
"filtered_notifications_banner.pending_requests": "From {count, plural, =0 {no one} one {one person} other {# people}} you may know",
|
||||||
"filtered_notifications_banner.pending_requests": "Notifications from {count, plural, =0 {no one} one {one person} other {# people}} you may know",
|
|
||||||
"filtered_notifications_banner.title": "Filtered notifications",
|
"filtered_notifications_banner.title": "Filtered notifications",
|
||||||
"firehose.all": "All",
|
"firehose.all": "All",
|
||||||
"firehose.local": "This server",
|
"firehose.local": "This server",
|
||||||
|
|
|
@ -124,9 +124,9 @@ export function createNotificationGroupFromJSON(
|
||||||
case 'mention':
|
case 'mention':
|
||||||
case 'poll':
|
case 'poll':
|
||||||
case 'update': {
|
case 'update': {
|
||||||
const { status, ...groupWithoutStatus } = group;
|
const { status_id: statusId, ...groupWithoutStatus } = group;
|
||||||
return {
|
return {
|
||||||
statusId: status.id,
|
statusId,
|
||||||
sampleAccountIds,
|
sampleAccountIds,
|
||||||
...groupWithoutStatus,
|
...groupWithoutStatus,
|
||||||
};
|
};
|
||||||
|
|
|
@ -10170,20 +10170,6 @@ noscript {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__badge {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
border-radius: 999px;
|
|
||||||
background: var(--background-border-color);
|
|
||||||
color: $darker-text-color;
|
|
||||||
padding: 4px;
|
|
||||||
padding-inline-end: 8px;
|
|
||||||
gap: 6px;
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 11px;
|
|
||||||
line-height: 16px;
|
|
||||||
word-break: keep-all;
|
|
||||||
|
|
||||||
&__badge {
|
&__badge {
|
||||||
background: $ui-button-background-color;
|
background: $ui-button-background-color;
|
||||||
color: $white;
|
color: $white;
|
||||||
|
@ -10191,7 +10177,6 @@ noscript {
|
||||||
padding: 2px 8px;
|
padding: 2px 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.notification-request {
|
.notification-request {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
Loading…
Reference in a new issue