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 { interface NotificationGroupWithStatusJSON extends BaseNotificationGroupJSON {
type: NotificationWithStatusType; type: NotificationWithStatusType;
status: ApiStatusJSON; status_id: string;
} }
interface NotificationWithStatusJSON extends BaseNotificationJSON { interface NotificationWithStatusJSON extends BaseNotificationJSON {

View file

@ -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>
); );
}; };

View file

@ -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",

View file

@ -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,
}; };

View file

@ -10170,27 +10170,12 @@ 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;
border-radius: 100px; border-radius: 100px;
padding: 2px 8px; padding: 2px 8px;
} }
}
} }
.notification-request { .notification-request {

View file

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

View file

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

View file

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

View file

@ -2,6 +2,6 @@
class AddRejectMediaToDomainBlocks < ActiveRecord::Migration[5.0] class AddRejectMediaToDomainBlocks < ActiveRecord::Migration[5.0]
def change def change
add_column :domain_blocks, :reject_media, :boolean add_column :domain_blocks, :reject_media, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end end
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_iv, :string
t.column :encrypted_otp_secret_salt, :string t.column :encrypted_otp_secret_salt, :string
t.column :consumed_timestep, :integer 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 end
end end

View file

@ -2,7 +2,7 @@
class AddReplyToStatuses < ActiveRecord::Migration[5.0] class AddReplyToStatuses < ActiveRecord::Migration[5.0]
def up 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)') Status.unscoped.update_all('reply = (in_reply_to_id IS NOT NULL)')
end end

View file

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

View file

@ -2,6 +2,6 @@
class AddLocalToStatuses < ActiveRecord::Migration[5.1] class AddLocalToStatuses < ActiveRecord::Migration[5.1]
def change 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
end end

View file

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

View file

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

View file

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

View file

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

View file

@ -2,6 +2,6 @@
class AddForwardedToReports < ActiveRecord::Migration[5.2] class AddForwardedToReports < ActiveRecord::Migration[5.2]
def change def change
add_column :reports, :forwarded, :boolean add_column :reports, :forwarded, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end end
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.belongs_to :user, null: false, foreign_key: { on_delete: :cascade }
t.string :authentication_method t.string :authentication_method
t.string :provider t.string :provider
t.boolean :success t.boolean :success # rubocop:disable Rails/ThreeStateBooleanColumn
t.string :failure_reason t.string :failure_reason
t.inet :ip t.inet :ip
t.string :user_agent t.string :user_agent

View file

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

View file

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

View file

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

View file

@ -4,7 +4,7 @@ class AddTrendableToAccounts < ActiveRecord::Migration[6.1]
def change def change
safety_assured do safety_assured do
change_table(:accounts, bulk: true) do |t| 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 :reviewed_at, :datetime
t.column :requested_review_at, :datetime t.column :requested_review_at, :datetime
end end

View file

@ -2,6 +2,6 @@
class AddTrendableToStatuses < ActiveRecord::Migration[6.1] class AddTrendableToStatuses < ActiveRecord::Migration[6.1]
def change def change
add_column :statuses, :trendable, :boolean add_column :statuses, :trendable, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end end
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 :ordered_media_attachment_ids, :bigint, array: true
t.column :media_descriptions, :text, array: true t.column :media_descriptions, :text, array: true
t.column :poll_options, :string, array: true t.column :poll_options, :string, array: true
t.column :sensitive, :boolean t.column :sensitive, :boolean # rubocop:disable Rails/ThreeStateBooleanColumn
end end
end end
end end

View file

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