Skip to content
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

text should not be an obligatory property in MentionFeedObjectItem type #13550

Closed
Dumluregn opened this issue Feb 24, 2023 · 1 comment · Fixed by #13558
Closed

text should not be an obligatory property in MentionFeedObjectItem type #13550

Dumluregn opened this issue Feb 24, 2023 · 1 comment · Fixed by #13558
Assignees
Labels
domain:ts package:mention squad:features Issue to be handled by the Features team. type:task This issue reports a chore (non-production change) and other types of "todos".

Comments

@Dumluregn
Copy link
Contributor

📝 Details

In https://github.com/ckeditor/ckeditor5/blob/dd8827aac5e53fcd311982fbff70fc83fb0a4c3b/packages/ckeditor5-mention/src/mentionconfig.ts#L281, text is defined as an obligatory property in MentionFeedObjectItem type. If you use a custom ItemRenderer, it isn't necessary though - you can use other properties to derive the output HTML element. This is done e.g. in the manual test.

This is a soft blocker for the feature customisation written in TS. It requires using double casting the callbacks through type unknown when passing mention.feeds.feed and mentions.feeds.itemRenderer properties:

config.push( {
	marker: '/',
	feed: ( searchString: string ) => getMatchingCustomFeedObjects( searchString ) as unknown as Array<MentionFeedItem>,
	itemRenderer: this._customItemRenderer.bind( this ) as unknown as ItemRenderer
} );
@Dumluregn Dumluregn added type:task This issue reports a chore (non-production change) and other types of "todos". package:mention domain:ts labels Feb 24, 2023
@Dumluregn
Copy link
Contributor Author

Changing the text field to optional was accepted by the Core team, we can proceed with the change.

@CKEditorBot CKEditorBot added the status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. label Feb 27, 2023
@Dumluregn Dumluregn added the squad:features Issue to be handled by the Features team. label Feb 27, 2023
@CKEditorBot CKEditorBot added status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. and removed status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. labels Feb 27, 2023
niegowski added a commit that referenced this issue Feb 27, 2023
…ty-in-mentions

Fix (mention): Make a text property optional in `MentionFeedObjectItem` type. Closes #13550.
@CKEditorBot CKEditorBot removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Feb 27, 2023
@CKEditorBot CKEditorBot added this to the iteration 61 milestone Feb 27, 2023
pomek pushed a commit that referenced this issue Feb 28, 2023
…ty-in-mentions

Fix (mention): Make a text property optional in `MentionFeedObjectItem` type. Closes #13550.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:ts package:mention squad:features Issue to be handled by the Features team. type:task This issue reports a chore (non-production change) and other types of "todos".
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants