-
Notifications
You must be signed in to change notification settings - Fork 83
Add type filter for feed based on ap_object_type taxonomy #2510
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
Merged
Merged
Changes from 13 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
901a259
Add type filter for feed based on ap_object_type taxonomy
pfefferle 5e71752
Merge branch 'add/reader' into add/feed-type-filter
pfefferle 025afc9
Refactor: Use native DataViews filter for ap_object_type
pfefferle 9f0d504
Merge branch 'add/reader' into add/feed-type-filter
pfefferle d115b05
Add ActivityPub object type filter to feed
pfefferle f0023e5
Update src/social-web/routes/feed/stage.tsx
pfefferle 2dc2b77
Update src/social-web/routes/feed/stage.tsx
pfefferle f8680c8
Update src/social-web/routes/feed/stage.tsx
pfefferle 2f9880f
Fix comment date display in Social Web feed inspector
pfefferle 712b69c
Merge branch 'add/reader' into add/feed-type-filter
pfefferle 641af28
Refactor feed-stage.js for improved filter handling
pfefferle dc57fda
Remove per_page param from ap_object_type taxonomy fetch
pfefferle 005364f
Add object type filter to feed view
pfefferle bbfe23d
Refactor: Use native DataViews filter for ap_object_type
obenland 8fe6614
class-post-types.php aktualisieren
pfefferle b2d41d2
Update object type filter with user-friendly labels
obenland 195640f
Expand object type labels and options
pfefferle 8d953ed
Add minimum value to ActivityPub object type filter
pfefferle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| <?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-warning'), 'version' => '658866a5e77c1bf57d37'); | ||
| <?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-warning'), 'version' => '1896c8458ee5edc6becb'); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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,32 @@ | ||
| import { __ } from '@wordpress/i18n'; | ||
| import type { Field } from '@wordpress/dataviews'; | ||
| import type { FeedPost } from '../../../types'; | ||
|
|
||
| /** | ||
| * Object type filter field | ||
| * | ||
| * @param apObjectTypes - Array of taxonomy terms from ap_object_type | ||
| * @return Field configuration for object type filtering | ||
| */ | ||
| export function objectTypeField( apObjectTypes?: any[] ): Field< FeedPost > { | ||
| return { | ||
| id: 'ap_object_type', | ||
| label: __( 'Type', 'activitypub' ), | ||
| enableHiding: false, | ||
| enableSorting: false, | ||
| elements: | ||
| apObjectTypes?.map( ( term ) => ( { | ||
| value: term.id, | ||
| label: term.name, | ||
| } ) ) || [], | ||
| getValue: ( { item } ) => item.ap_object_type?.[ 0 ], | ||
| render: ( { item } ) => { | ||
| const termId = item.ap_object_type?.[ 0 ]; | ||
| const term = apObjectTypes?.find( ( t ) => t.id === termId ); | ||
| return <span>{ term?.name || '—' }</span>; | ||
| }, | ||
| filterBy: { | ||
| operators: [ 'isAny' ], | ||
| }, | ||
| }; | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.