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

Bulk option upload option visible for the post which contains only single attachement. #9

Open
AayushChaudhary0001 opened this issue Jul 12, 2024 · 5 comments
Assignees

Comments

@AayushChaudhary0001
Copy link

AayushChaudhary0001 commented Jul 12, 2024

The option for uploading all the files to the drive is open for the post where only single attachment is present.

Steps to reproduce:-

  • Post a message which consist single attachment.
  • Open the action menu.
  • Click on upload all the files to drive.

Since the post contain single attachment, this option should not be visible(or can be disabled) in such case

@darkLord19
Copy link
Contributor

@wiggin77 do you have any example of conditionally attaching post menu option?

@darkLord19
Copy link
Contributor

@fmartingr can you help with above question?

@fmartingr
Copy link

@darkLord19 I believe the registerPostDropdownMenuAction has a filter argument to check when it can be displayed or not: https://developers.mattermost.com/integrate/reference/webapp/webapp-reference/#registerPostDropdownMenuAction

I believe the signature for it is (postID: string) -> bool, so it receives the post ID and you check with that if the menu item should display or not.

@darkLord19
Copy link
Contributor

@fmartingr right but I need to fetch the number of attachments in a post and it's async operation when I added that it was complaining about not meeting the type spec.

@fmartingr
Copy link

@fmartingr right but I need to fetch the number of attachments in a post and it's async operation when I added that it was complaining about not meeting the type spec.

I'm not sure about your specifics, but you should be able to retrieve the post and check the data, right?

If helps, you can find some example usages using Github Code Search: https://github.com/search?type=code&auto_enroll=true&q=registerPostDropdownMenuAction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants