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

Compare commits

...

5 commits

Author SHA1 Message Date
Matt Jankowski
e1c63adfa2
Merge 3a365176aa into a50c8e951f 2024-07-31 14:07:11 +00:00
Claire
a50c8e951f
Fix issue with grouped notifications UI due to recent API change (#31224) 2024-07-31 13:23:08 +00:00
Claire
2c1e75727d
Change filtered notification banner design to take up less space (#31222) 2024-07-31 12:36:08 +00:00
Matt Jankowski
3a365176aa Opt in to create table with timestamps 2024-06-25 13:36:31 -04:00
Matt Jankowski
d92b3e4468 Fix Rails/CreateTableWithTimestamps cop 2024-06-25 12:10:17 -04:00
14 changed files with 22 additions and 41 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,21 +49,14 @@ 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>
<FormattedMessage
id='filtered_notifications_banner.mentions'
defaultMessage='{count, plural, one {mention} other {mentions}}'
values={{ count: policy.summary.pending_notifications_count }}
/>
</div> </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

@ -10171,25 +10171,10 @@ noscript {
} }
&__badge { &__badge {
display: flex; background: $ui-button-background-color;
align-items: center; color: $white;
border-radius: 999px; border-radius: 100px;
background: var(--background-border-color); padding: 2px 8px;
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;
border-radius: 100px;
padding: 2px 8px;
}
} }
} }

View file

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

View file

@ -2,7 +2,7 @@
class CreateConversationMutes < ActiveRecord::Migration[5.0] class CreateConversationMutes < ActiveRecord::Migration[5.0]
def change def change
create_table :conversation_mutes do |t| create_table :conversation_mutes do |t| # rubocop:disable Rails/CreateTableWithTimestamps
t.integer :account_id, null: false t.integer :account_id, null: false
t.bigint :conversation_id, null: false t.bigint :conversation_id, null: false
end end

View file

@ -2,7 +2,7 @@
class CreateStatusPins < ActiveRecord::Migration[5.1] class CreateStatusPins < ActiveRecord::Migration[5.1]
def change def change
create_table :status_pins do |t| create_table :status_pins do |t| # rubocop:disable Rails/CreateTableWithTimestamps
t.belongs_to :account, foreign_key: { on_delete: :cascade }, null: false t.belongs_to :account, foreign_key: { on_delete: :cascade }, null: false
t.belongs_to :status, foreign_key: { on_delete: :cascade }, null: false t.belongs_to :status, foreign_key: { on_delete: :cascade }, null: false
end end

View file

@ -2,7 +2,7 @@
class CreateListAccounts < ActiveRecord::Migration[5.2] class CreateListAccounts < ActiveRecord::Migration[5.2]
def change def change
create_table :list_accounts do |t| create_table :list_accounts do |t| # rubocop:disable Rails/CreateTableWithTimestamps
t.belongs_to :list, foreign_key: { on_delete: :cascade }, null: false t.belongs_to :list, foreign_key: { on_delete: :cascade }, null: false
t.belongs_to :account, foreign_key: { on_delete: :cascade }, null: false t.belongs_to :account, foreign_key: { on_delete: :cascade }, null: false
t.belongs_to :follow, foreign_key: { on_delete: :cascade }, null: false t.belongs_to :follow, foreign_key: { on_delete: :cascade }, null: false

View file

@ -2,7 +2,7 @@
class CreateAccountConversations < ActiveRecord::Migration[5.2] class CreateAccountConversations < ActiveRecord::Migration[5.2]
def change def change
create_table :account_conversations do |t| create_table :account_conversations do |t| # rubocop:disable Rails/CreateTableWithTimestamps
t.belongs_to :account, foreign_key: { on_delete: :cascade } t.belongs_to :account, foreign_key: { on_delete: :cascade }
t.belongs_to :conversation, foreign_key: { on_delete: :cascade } t.belongs_to :conversation, foreign_key: { on_delete: :cascade }
t.bigint :participant_account_ids, array: true, null: false, default: [] t.bigint :participant_account_ids, array: true, null: false, default: []

View file

@ -2,7 +2,7 @@
class CreatePgheroSpaceStats < ActiveRecord::Migration[5.2] class CreatePgheroSpaceStats < ActiveRecord::Migration[5.2]
def change def change
create_table :pghero_space_stats do |t| create_table :pghero_space_stats do |t| # rubocop:disable Rails/CreateTableWithTimestamps
t.text :database t.text :database
t.text :schema t.text :schema
t.text :relation t.text :relation

View file

@ -2,7 +2,7 @@
class CreateScheduledStatuses < ActiveRecord::Migration[5.2] class CreateScheduledStatuses < ActiveRecord::Migration[5.2]
def change def change
create_table :scheduled_statuses do |t| create_table :scheduled_statuses do |t| # rubocop:disable Rails/CreateTableWithTimestamps
t.belongs_to :account, foreign_key: { on_delete: :cascade } t.belongs_to :account, foreign_key: { on_delete: :cascade }
t.datetime :scheduled_at, index: true t.datetime :scheduled_at, index: true
t.jsonb :params t.jsonb :params

View file

@ -2,7 +2,7 @@
class CreateStatusTrends < ActiveRecord::Migration[6.1] class CreateStatusTrends < ActiveRecord::Migration[6.1]
def change def change
create_table :status_trends do |t| create_table :status_trends do |t| # rubocop:disable Rails/CreateTableWithTimestamps
t.references :status, null: false, foreign_key: { on_delete: :cascade }, index: { unique: true } t.references :status, null: false, foreign_key: { on_delete: :cascade }, index: { unique: true }
t.references :account, null: false, foreign_key: { on_delete: :cascade } t.references :account, null: false, foreign_key: { on_delete: :cascade }
t.float :score, null: false, default: 0 t.float :score, null: false, default: 0

View file

@ -2,7 +2,7 @@
class CreatePreviewCardTrends < ActiveRecord::Migration[6.1] class CreatePreviewCardTrends < ActiveRecord::Migration[6.1]
def change def change
create_table :preview_card_trends do |t| create_table :preview_card_trends do |t| # rubocop:disable Rails/CreateTableWithTimestamps
t.references :preview_card, null: false, foreign_key: { on_delete: :cascade }, index: { unique: true } t.references :preview_card, null: false, foreign_key: { on_delete: :cascade }, index: { unique: true }
t.float :score, null: false, default: 0 t.float :score, null: false, default: 0
t.integer :rank, null: false, default: 0 t.integer :rank, null: false, default: 0