forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2747 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes up to 58ace2e
- Loading branch information
Showing
38 changed files
with
438 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
app/javascript/flavours/glitch/actions/notification_policies.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { | ||
apiGetNotificationPolicy, | ||
apiUpdateNotificationsPolicy, | ||
} from 'flavours/glitch/api/notification_policies'; | ||
import type { NotificationPolicy } from 'flavours/glitch/models/notification_policy'; | ||
import { createDataLoadingThunk } from 'flavours/glitch/store/typed_functions'; | ||
|
||
export const fetchNotificationPolicy = createDataLoadingThunk( | ||
'notificationPolicy/fetch', | ||
() => apiGetNotificationPolicy(), | ||
); | ||
|
||
export const updateNotificationsPolicy = createDataLoadingThunk( | ||
'notificationPolicy/update', | ||
(policy: Partial<NotificationPolicy>) => apiUpdateNotificationsPolicy(policy), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
app/javascript/flavours/glitch/api/notification_policies.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { apiRequest } from 'flavours/glitch/api'; | ||
import type { NotificationPolicyJSON } from 'flavours/glitch/api_types/notification_policies'; | ||
|
||
export const apiGetNotificationPolicy = () => | ||
apiRequest<NotificationPolicyJSON>('GET', '/v1/notifications/policy'); | ||
|
||
export const apiUpdateNotificationsPolicy = ( | ||
policy: Partial<NotificationPolicyJSON>, | ||
) => | ||
apiRequest<NotificationPolicyJSON>('PUT', '/v1/notifications/policy', policy); |
12 changes: 12 additions & 0 deletions
12
app/javascript/flavours/glitch/api_types/notification_policies.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// See app/serializers/rest/notification_policy_serializer.rb | ||
|
||
export interface NotificationPolicyJSON { | ||
filter_not_following: boolean; | ||
filter_not_followers: boolean; | ||
filter_new_accounts: boolean; | ||
filter_private_mentions: boolean; | ||
summary: { | ||
pending_requests_count: number; | ||
pending_notifications_count: number; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 0 additions & 49 deletions
49
...cript/flavours/glitch/features/notifications/components/filtered_notifications_banner.jsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.