1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

Compare commits

...

4 commits

26 changed files with 36 additions and 51 deletions

View file

@ -60,7 +60,7 @@ export interface BaseNotificationGroupJSON {
interface NotificationGroupWithStatusJSON extends BaseNotificationGroupJSON {
type: NotificationWithStatusType;
status: ApiStatusJSON;
status_id: string;
}
interface NotificationWithStatusJSON extends BaseNotificationJSON {

View file

@ -49,22 +49,15 @@ export const FilteredNotificationsBanner: React.FC = () => {
<span>
<FormattedMessage
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 }}
/>
</span>
</div>
<div className='filtered-notifications-banner__badge'>
<div className='filtered-notifications-banner__badge__badge'>
{toCappedNumber(policy.summary.pending_notifications_count)}
</div>
<FormattedMessage
id='filtered_notifications_banner.mentions'
defaultMessage='{count, plural, one {mention} other {mentions}}'
values={{ count: policy.summary.pending_notifications_count }}
/>
</div>
</Link>
);
};

View file

@ -300,8 +300,7 @@
"filter_modal.select_filter.subtitle": "Use an existing category or create a new one",
"filter_modal.select_filter.title": "Filter this post",
"filter_modal.title.status": "Filter a post",
"filtered_notifications_banner.mentions": "{count, plural, one {mention} other {mentions}}",
"filtered_notifications_banner.pending_requests": "Notifications from {count, plural, =0 {no one} one {one person} other {# people}} you may know",
"filtered_notifications_banner.pending_requests": "From {count, plural, =0 {no one} one {one person} other {# people}} you may know",
"filtered_notifications_banner.title": "Filtered notifications",
"firehose.all": "All",
"firehose.local": "This server",

View file

@ -124,9 +124,9 @@ export function createNotificationGroupFromJSON(
case 'mention':
case 'poll':
case 'update': {
const { status, ...groupWithoutStatus } = group;
const { status_id: statusId, ...groupWithoutStatus } = group;
return {
statusId: status.id,
statusId,
sampleAccountIds,
...groupWithoutStatus,
};

View file

@ -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 {
background: $ui-button-background-color;
color: $white;
@ -10191,7 +10177,6 @@ noscript {
padding: 2px 8px;
}
}
}
.notification-request {
display: flex;

View file

@ -2,3 +2,7 @@ inherit_from: ../../.rubocop.yml
Naming/VariableNumber:
CheckSymbols: false
Rails/ThreeStateBooleanColumn:
Include:
- '*.rb'

View file

@ -2,6 +2,6 @@
class AddAdminToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :admin, :boolean, default: false
add_column :users, :admin, :boolean, default: false # rubocop:disable Rails/ThreeStateBooleanColumn
end
end

View file

@ -2,6 +2,6 @@
class AddSensitiveToStatuses < ActiveRecord::Migration[5.0]
def change
add_column :statuses, :sensitive, :boolean, default: false
add_column :statuses, :sensitive, :boolean, default: false # rubocop:disable Rails/ThreeStateBooleanColumn
end
end

View file

@ -2,6 +2,6 @@
class AddRejectMediaToDomainBlocks < ActiveRecord::Migration[5.0]
def change
add_column :domain_blocks, :reject_media, :boolean
add_column :domain_blocks, :reject_media, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end
end

View file

@ -7,7 +7,7 @@ class AddDeviseTwoFactorToUsers < ActiveRecord::Migration[5.0]
t.column :encrypted_otp_secret_iv, :string
t.column :encrypted_otp_secret_salt, :string
t.column :consumed_timestep, :integer
t.column :otp_required_for_login, :boolean
t.column :otp_required_for_login, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end
end
end

View file

@ -2,7 +2,7 @@
class AddReplyToStatuses < ActiveRecord::Migration[5.0]
def up
add_column :statuses, :reply, :boolean, nil: false, default: false
add_column :statuses, :reply, :boolean, default: false # rubocop:disable Rails/ThreeStateBooleanColumn
Status.unscoped.update_all('reply = (in_reply_to_id IS NOT NULL)')
end

View file

@ -5,7 +5,7 @@ class CreateImports < ActiveRecord::Migration[5.0]
create_table :imports do |t|
t.integer :account_id, null: false
t.integer :type, null: false
t.boolean :approved
t.boolean :approved # rubocop:disable Rails/ThreeStateBooleanColumn
t.timestamps
end

View file

@ -2,6 +2,6 @@
class AddLocalToStatuses < ActiveRecord::Migration[5.1]
def change
add_column :statuses, :local, :boolean, null: true, default: nil
add_column :statuses, :local, :boolean, null: true, default: nil # rubocop:disable Rails/ThreeStateBooleanColumn
end
end

View file

@ -2,6 +2,6 @@
class AddDiscoverableToAccounts < ActiveRecord::Migration[5.2]
def change
add_column :accounts, :discoverable, :boolean
add_column :accounts, :discoverable, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end
end

View file

@ -2,6 +2,6 @@
class AddByModeratorToTombstone < ActiveRecord::Migration[5.2]
def change
add_column :tombstones, :by_moderator, :boolean
add_column :tombstones, :by_moderator, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end
end

View file

@ -4,9 +4,11 @@ class AddCapabilitiesToTags < ActiveRecord::Migration[5.2]
def change
safety_assured do
change_table(:tags, bulk: true) do |t|
# rubocop:disable Rails/ThreeStateBooleanColumn
t.column :usable, :boolean
t.column :trendable, :boolean
t.column :listable, :boolean
# rubocop:enable Rails/ThreeStateBooleanColumn
t.column :reviewed_at, :datetime
t.column :requested_review_at, :datetime
end

View file

@ -2,6 +2,6 @@
class AddHideCollectionsToAccounts < ActiveRecord::Migration[5.2]
def change
add_column :accounts, :hide_collections, :boolean
add_column :accounts, :hide_collections, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end
end

View file

@ -2,6 +2,6 @@
class AddForwardedToReports < ActiveRecord::Migration[5.2]
def change
add_column :reports, :forwarded, :boolean
add_column :reports, :forwarded, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end
end

View file

@ -6,7 +6,7 @@ class CreateLoginActivities < ActiveRecord::Migration[6.1]
t.belongs_to :user, null: false, foreign_key: { on_delete: :cascade }
t.string :authentication_method
t.string :provider
t.boolean :success
t.boolean :success # rubocop:disable Rails/ThreeStateBooleanColumn
t.string :failure_reason
t.inet :ip
t.string :user_agent

View file

@ -2,6 +2,6 @@
class AddSkipSignInTokenToUsers < ActiveRecord::Migration[6.1]
def change
add_column :users, :skip_sign_in_token, :boolean
add_column :users, :skip_sign_in_token, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end
end

View file

@ -5,7 +5,7 @@ class CreatePreviewCardProviders < ActiveRecord::Migration[6.1]
create_table :preview_card_providers do |t|
t.string :domain, null: false, default: '', index: { unique: true }
t.attachment :icon
t.boolean :trendable
t.boolean :trendable # rubocop:disable Rails/ThreeStateBooleanColumn
t.datetime :reviewed_at
t.datetime :requested_review_at
t.timestamps

View file

@ -2,6 +2,6 @@
class AddTrendableToPreviewCards < ActiveRecord::Migration[6.1]
def change
add_column :preview_cards, :trendable, :boolean
add_column :preview_cards, :trendable, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end
end

View file

@ -4,7 +4,7 @@ class AddTrendableToAccounts < ActiveRecord::Migration[6.1]
def change
safety_assured do
change_table(:accounts, bulk: true) do |t|
t.column :trendable, :boolean
t.column :trendable, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
t.column :reviewed_at, :datetime
t.column :requested_review_at, :datetime
end

View file

@ -2,6 +2,6 @@
class AddTrendableToStatuses < ActiveRecord::Migration[6.1]
def change
add_column :statuses, :trendable, :boolean
add_column :statuses, :trendable, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end
end

View file

@ -7,7 +7,7 @@ class AddOrderedMediaAttachmentIdsToStatusEdits < ActiveRecord::Migration[6.1]
t.column :ordered_media_attachment_ids, :bigint, array: true
t.column :media_descriptions, :text, array: true
t.column :poll_options, :string, array: true
t.column :sensitive, :boolean
t.column :sensitive, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end
end
end

View file

@ -14,8 +14,10 @@ class CreateSeveredRelationships < ActiveRecord::Migration[7.0]
t.integer :direction, null: false
# Those attributes are carried over from the `follows` table
# rubocop:disable Rails/ThreeStateBooleanColumn
t.boolean :show_reblogs
t.boolean :notify
# rubocop:enable Rails/ThreeStateBooleanColumn
t.string :languages, array: true
t.timestamps