Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge upstream changes (stable-4.3) #2865

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
1b3472b
Use account display name for pretend blog example in attribution area…
mjankowski Oct 1, 2024
8ac0053
Fix follow notifications from streaming being grouped (#32179)
renchap Oct 1, 2024
1283c35
Avoid `id` duplication conflict with main navigation from settings pr…
mjankowski Oct 1, 2024
6398d7b
Update peter-evans/create-pull-request action to v7.0.5 (#32164)
renovate[bot] Oct 1, 2024
6734b65
Extract dashboard partial for admin instance page (#32189)
mjankowski Oct 1, 2024
c828e77
Improve alignment of icons on admin roles list (#32153)
mjankowski Oct 1, 2024
25e8a6e
Update dependency propshaft to v1.1.0 (#32192)
renovate[bot] Oct 1, 2024
e13453a
Update dependency webmock to v3.24.0 (#32190)
renovate[bot] Oct 1, 2024
bdceb1d
Add `date_range` view helper (#32187)
mjankowski Oct 1, 2024
efa74a6
Update RuboCop (non-major) to v1.22.1 (#31573)
renovate[bot] Oct 1, 2024
ce2481a
Move OTP secret length to configuration (#32125)
oneiros Oct 1, 2024
66ef4b9
Remove `WebfingerHelper` module & move usage inline (#31203)
mjankowski Oct 1, 2024
4ad1e95
Use `module: :users` in routes/admin section (#30767)
mjankowski Oct 1, 2024
a473988
Update dependency postcss-preset-env to v10.0.5 (#32019)
renovate[bot] Oct 1, 2024
53624b1
Remove explicit `put` action in settings forms (#32176)
mjankowski Oct 1, 2024
f517f0d
Fix nav item active highlight for some paths (#32159)
mjankowski Oct 1, 2024
4e6f13a
Only show email domain blocks MX table when some found (#32155)
mjankowski Oct 1, 2024
1e19242
Extract constants for header and avatar geometry (#32151)
mjankowski Oct 1, 2024
97db4bd
Wrap datetime in `time` element with attrs (#32177)
mjankowski Oct 1, 2024
f397550
Add detection and download of material_symbol icons in config/navigat…
ThisIsMissEm Oct 1, 2024
754b03d
Fix unneeded requests to blocked domains when receiving relayed signe…
ClearlyClaire Oct 1, 2024
784d1bf
Fix broken border on applications list (#32147)
mjankowski Oct 1, 2024
09cf617
Adjust spacing on setting sub-nav items when below mobile size (#32137)
mjankowski Oct 1, 2024
19d1392
Avoid repeated icon stack in settings sidebar (#32201)
mjankowski Oct 1, 2024
b2ce9bb
Show timestamp when the user deletes their account on admin dashboard…
tribela Oct 1, 2024
c91e06b
Fix `Rails/CreateTableWithTimestamps` cop (#30836)
mjankowski Oct 1, 2024
b8fdffe
Ignore error if mentioned account was not processable (#29215)
tribela Oct 2, 2024
cbf1349
Support /.well-known/host-meta.json (#32206)
c960657 Oct 2, 2024
243a85e
Expand coverage for `Export` utility class (#32212)
mjankowski Oct 2, 2024
9315538
Fix incorrect `'navigator'` check (#32219)
ClearlyClaire Oct 2, 2024
f07707a
Extract `WebPushRequest` from push notification worker and subscripti…
mjankowski Oct 2, 2024
74291df
Remove unneeded `reorder(nil)` conditions (#32200)
mjankowski Oct 2, 2024
7de8d5f
Add `relevant_params` to ReportFilter (matches account filter) (#32136)
mjankowski Oct 2, 2024
ceba0f0
Provide `use_path` to qr generator for svg data size reduction (#32127)
mjankowski Oct 2, 2024
4a2d392
Fix media uploads in composer appearing over search results in advanc…
ClearlyClaire Oct 2, 2024
404f467
Fix editing description of media uploads with custom thumbnails (#32221)
ClearlyClaire Oct 2, 2024
aa46348
Enable hostname config for all system specs (#32109)
mjankowski Oct 2, 2024
5c72b46
Clean up labels on development application form (#32116)
mjankowski Oct 2, 2024
d82ffdc
Add `copyable_input` helper method to wrap shared options (#32119)
mjankowski Oct 2, 2024
2e8b752
Move admin action log type list generation to helper (#32178)
mjankowski Oct 2, 2024
55b5364
Hide badges in media gallery when media are hidden (#32224)
ClearlyClaire Oct 2, 2024
81cd489
Fix Content-Security-Policy when using sso-redirect (#32241)
ClearlyClaire Oct 4, 2024
6d5aa58
Fix unsupported grouped notifications from streaming causing duplicat…
ClearlyClaire Oct 4, 2024
dfe851b
Merge branch 'stable-4.3' into glitch-soc/backports-4.3
ClearlyClaire Oct 5, 2024
1b6bd58
[Glitch] Fix follow notifications from streaming being grouped
renchap Oct 1, 2024
69c76fd
[Glitch] Improve alignment of icons on admin roles list
mjankowski Oct 1, 2024
e58d99a
[Glitch] Adjust spacing on setting sub-nav items when below mobile size
mjankowski Oct 1, 2024
3cad509
[Glitch] Fix incorrect `'navigator'` check
ClearlyClaire Oct 2, 2024
59a8066
[Glitch] Fix media uploads in composer appearing over search results …
ClearlyClaire Oct 2, 2024
a09a26d
[Glitch] Fix editing description of media uploads with custom thumbnails
ClearlyClaire Oct 2, 2024
4d611e9
[Glitch] Hide badges in media gallery when media are hidden
ClearlyClaire Oct 2, 2024
354f549
[Glitch] Fix unsupported grouped notifications from streaming causing…
ClearlyClaire Oct 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/crowdin-download-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

# Create or update the pull request
- name: Create Pull Request
uses: peter-evans/[email protected].1
uses: peter-evans/[email protected].5
with:
commit-message: 'New Crowdin translations'
title: 'New Crowdin Translations for ${{ github.base_ref || github.ref_name }} (automated)'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/crowdin-download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:

# Create or update the pull request
- name: Create Pull Request
uses: peter-evans/[email protected].1
uses: peter-evans/[email protected].5
with:
commit-message: 'New Crowdin translations'
title: 'New Crowdin Translations (automated)'
Expand Down
14 changes: 7 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ GEM
actionmailer (>= 3)
net-smtp
premailer (~> 1.7, >= 1.7.9)
propshaft (1.0.1)
propshaft (1.1.0)
actionpack (>= 7.0.0)
activesupport (>= 7.0.0)
rack
Expand Down Expand Up @@ -698,7 +698,7 @@ GEM
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
rexml (3.3.7)
rexml (3.3.8)
rotp (6.3.0)
rouge (4.3.0)
rpam2 (4.0.2)
Expand Down Expand Up @@ -748,15 +748,15 @@ GEM
parser (>= 3.3.1.0)
rubocop-capybara (2.21.0)
rubocop (~> 1.41)
rubocop-performance (1.21.1)
rubocop-performance (1.22.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rails (2.25.1)
rubocop-rails (2.26.2)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop (>= 1.52.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rspec (3.0.4)
rubocop-rspec (3.0.5)
rubocop (~> 1.61)
rubocop-rspec_rails (2.30.0)
rubocop (~> 1.61)
Expand Down Expand Up @@ -884,7 +884,7 @@ GEM
webfinger (1.2.0)
activesupport
httpclient (>= 2.4)
webmock (3.23.1)
webmock (3.24.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/concerns/web_app_controller_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module WebAppControllerConcern
policy = ContentSecurityPolicy.new

if policy.sso_host.present?
p.form_action policy.sso_host
p.form_action policy.sso_host, -> { "https://#{request.host}/auth/auth/" }
else
p.form_action :none
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def show
end

def create
session[:new_otp_secret] = User.generate_otp_secret(32)
session[:new_otp_secret] = User.generate_otp_secret

redirect_to new_settings_two_factor_authentication_confirmation_path
end
Expand Down
18 changes: 17 additions & 1 deletion app/controllers/well_known/host_meta_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,23 @@ class HostMetaController < ActionController::Base # rubocop:disable Rails/Applic
def show
@webfinger_template = "#{webfinger_url}?resource={uri}"
expires_in 3.days, public: true
render content_type: 'application/xrd+xml', formats: [:xml]

respond_to do |format|
format.any do
render content_type: 'application/xrd+xml', formats: [:xml]
end

format.json do
render json: {
links: [
{
rel: 'lrdd',
template: @webfinger_template,
},
],
}
end
end
end
end
end
7 changes: 7 additions & 0 deletions app/helpers/admin/action_logs_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,11 @@ def log_target(log)
end
end
end

def sorted_action_log_types
Admin::ActionLogFilter::ACTION_TYPE_MAP
.keys
.map { |key| [I18n.t("admin.action_logs.action_types.#{key}"), key] }
.sort_by(&:first)
end
end
7 changes: 7 additions & 0 deletions app/helpers/admin/dashboard_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,20 @@ def relevant_account_ip(account, ip_query)
end
end

def date_range(range)
[l(range.first), l(range.last)]
.join(' - ')
end

def relevant_account_timestamp(account)
timestamp, exact = if account.user_current_sign_in_at && account.user_current_sign_in_at < 24.hours.ago
[account.user_current_sign_in_at, true]
elsif account.user_current_sign_in_at
[account.user_current_sign_in_at, false]
elsif account.user_pending?
[account.user_created_at, true]
elsif account.suspended_at.present? && account.local? && account.user.nil?
[account.suspended_at, true]
elsif account.last_status_at.present?
[account.last_status_at, true]
else
Expand Down
17 changes: 9 additions & 8 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# frozen_string_literal: true

module ApplicationHelper
DANGEROUS_SCOPES = %w(
read
write
follow
).freeze

RTL_LOCALES = %i(
ar
ckb
Expand Down Expand Up @@ -95,8 +89,11 @@ def title
Rails.env.production? ? site_title : "#{site_title} (Dev)"
end

def class_for_scope(scope)
'scope-danger' if DANGEROUS_SCOPES.include?(scope.to_s)
def label_for_scope(scope)
safe_join [
tag.samp(scope, class: { 'scope-danger' => SessionActivation::DEFAULT_SCOPES.include?(scope.to_s) }),
tag.span(t("doorkeeper.scopes.#{scope}"), class: :hint),
]
end

def can?(action, record)
Expand Down Expand Up @@ -244,6 +241,10 @@ def mascot_url
full_asset_url(instance_presenter.mascot&.file&.url || frontend_asset_path('images/elephant_ui_plane.svg'))
end

def copyable_input(options = {})
tag.input(type: :text, maxlength: 999, spellcheck: false, readonly: true, **options)
end

# glitch-soc addition to handle the multiple flavors
def preload_locale_pack
supported_locales = Themes.instance.flavour(current_flavour)['locales']
Expand Down
7 changes: 0 additions & 7 deletions app/helpers/webfinger_helper.rb

This file was deleted.

3 changes: 1 addition & 2 deletions app/javascript/flavours/glitch/actions/markers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ export const synchronouslySubmitMarkers = createAppAsyncThunk(
});

return;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
} else if ('navigator' && 'sendBeacon' in navigator) {
} else if ('sendBeacon' in navigator) {
// Failing that, we can use sendBeacon, but we have to encode the data as
// FormData for DoorKeeper to recognize the token.
const formData = new FormData();
Expand Down
4 changes: 4 additions & 0 deletions app/javascript/flavours/glitch/actions/notification_groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ function dispatchAssociatedRecords(

const supportedGroupedNotificationTypes = ['favourite', 'reblog'];

export function shouldGroupNotificationType(type: string) {
return supportedGroupedNotificationTypes.includes(type);
}

export const fetchNotifications = createDataLoadingThunk(
'notificationGroups/fetch',
async (_params, { getState }) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class Item extends PureComponent {

{visible && thumbnail}

{badges && (
{visible && badges && (
<div className='media-gallery__item__badges'>
{badges}
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/flavours/glitch/reducers/compose.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ export default function compose(state = initialState, action) {
.set('isUploadingThumbnail', false)
.update('media_attachments', list => list.map(item => {
if (item.get('id') === action.media.id) {
return fromJS(action.media);
return fromJS(action.media).set('unattached', item.get('unattached'));
}

return item;
Expand Down
10 changes: 9 additions & 1 deletion app/javascript/flavours/glitch/reducers/notification_groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
unmountNotifications,
refreshStaleNotificationGroups,
pollRecentNotifications,
shouldGroupNotificationType,
} from 'flavours/glitch/actions/notification_groups';
import {
disconnectTimeline,
Expand Down Expand Up @@ -205,6 +206,13 @@ function processNewNotification(
groups: NotificationGroupsState['groups'],
notification: ApiNotificationJSON,
) {
if (!shouldGroupNotificationType(notification.type)) {
notification = {
...notification,
group_key: `ungrouped-${notification.id}`,
};
}

const existingGroupIndex = groups.findIndex(
(group) =>
group.type !== 'gap' && group.group_key === notification.group_key,
Expand Down Expand Up @@ -242,7 +250,7 @@ function processNewNotification(
groups.unshift(existingGroup);
}
} else {
// Create a new group
// We have not found an existing group, create a new one
groups.unshift(createNotificationGroupFromNotificationJSON(notification));
}
}
Expand Down
8 changes: 8 additions & 0 deletions app/javascript/flavours/glitch/styles/admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ $content-width: 840px;
gap: 5px;
white-space: nowrap;

@media screen and (max-width: $mobile-breakpoint) {
flex: 1 0 50%;
}

&:hover,
&:focus,
&:active {
Expand Down Expand Up @@ -1075,6 +1079,10 @@ a.name-tag,
}
}

.icon {
vertical-align: middle;
}

a.announcements-list__item__title {
&:hover,
&:focus,
Expand Down
1 change: 1 addition & 0 deletions app/javascript/flavours/glitch/styles/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3793,6 +3793,7 @@ $ui-header-logo-wordmark-width: 99px;
overflow-y: auto;
width: 100%;
height: 100%;
z-index: 0;
}

.drawer__inner__mastodon {
Expand Down
1 change: 1 addition & 0 deletions app/javascript/flavours/glitch/styles/tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ a.table-action-link {
padding: 0 10px;
color: $darker-text-color;
font-weight: 500;
white-space: nowrap;

&:hover {
color: $highlight-text-color;
Expand Down
3 changes: 1 addition & 2 deletions app/javascript/mastodon/actions/markers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ export const synchronouslySubmitMarkers = createAppAsyncThunk(
});

return;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
} else if ('navigator' && 'sendBeacon' in navigator) {
} else if ('sendBeacon' in navigator) {
// Failing that, we can use sendBeacon, but we have to encode the data as
// FormData for DoorKeeper to recognize the token.
const formData = new FormData();
Expand Down
4 changes: 4 additions & 0 deletions app/javascript/mastodon/actions/notification_groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ function dispatchAssociatedRecords(

const supportedGroupedNotificationTypes = ['favourite', 'reblog'];

export function shouldGroupNotificationType(type: string) {
return supportedGroupedNotificationTypes.includes(type);
}

export const fetchNotifications = createDataLoadingThunk(
'notificationGroups/fetch',
async (_params, { getState }) =>
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/mastodon/components/media_gallery.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class Item extends PureComponent {

{visible && thumbnail}

{badges && (
{visible && badges && (
<div className='media-gallery__item__badges'>
{badges}
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/mastodon/reducers/compose.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ export default function compose(state = initialState, action) {
.set('isUploadingThumbnail', false)
.update('media_attachments', list => list.map(item => {
if (item.get('id') === action.media.id) {
return fromJS(action.media);
return fromJS(action.media).set('unattached', item.get('unattached'));
}

return item;
Expand Down
10 changes: 9 additions & 1 deletion app/javascript/mastodon/reducers/notification_groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
unmountNotifications,
refreshStaleNotificationGroups,
pollRecentNotifications,
shouldGroupNotificationType,
} from 'mastodon/actions/notification_groups';
import {
disconnectTimeline,
Expand Down Expand Up @@ -205,6 +206,13 @@ function processNewNotification(
groups: NotificationGroupsState['groups'],
notification: ApiNotificationJSON,
) {
if (!shouldGroupNotificationType(notification.type)) {
notification = {
...notification,
group_key: `ungrouped-${notification.id}`,
};
}

const existingGroupIndex = groups.findIndex(
(group) =>
group.type !== 'gap' && group.group_key === notification.group_key,
Expand Down Expand Up @@ -242,7 +250,7 @@ function processNewNotification(
groups.unshift(existingGroup);
}
} else {
// Create a new group
// We have not found an existing group, create a new one
groups.unshift(createNotificationGroupFromNotificationJSON(notification));
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/javascript/material-icons/400-24px/breaking_news.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/javascript/material-icons/400-24px/captive_portal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/javascript/material-icons/400-24px/chat_bubble.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/javascript/material-icons/400-24px/cloud-fill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/javascript/material-icons/400-24px/cloud.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading