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

[FEATURE] Create Issues from Messages with Action Buttons #88

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

henit-chobisa
Copy link
Contributor

Closes #87

Issue(s)

Many of the times, customers tend to share their queries directly in the chat, such as reporting a bug or something like a feature request, adding an action button in the list of actions beside a message that pops up a modal which helps in opening an issue can be a very good addition for a user convenience.

Acceptance Criteria fulfillment

  • Register the action button, in Command's Main Function.
  • Make Action Handler to the Button and check for auth.
  • Modify the New User Modal, for shared support for both SlashCommandContext and also with Action Button Context
  • Launch the Modal with message.text as data.template for the NewIssueModal

Shortcuts

  • Use your message text in the format to embed repository name in the modal as well <owner/repositor> | <issue>, this will take the repository name and pass it to modal with the issue text as well

Proposed changes

Issue Button

Hello

Issue without shortcut

NewIssueCreation

Issue with shortcut

NewIssueCreationShortcut

@henit-chobisa
Copy link
Contributor Author

Hey @samad-yar-khan, as we discussed, I have added an action button, for quickly opening issues from messages,
Please have a look, leading to some new improvement in this side such as attachment support ✌️

@henit-chobisa henit-chobisa changed the title Create issue action button [FEATURE] Create Issues from Messages with Action Buttons Mar 31, 2023
Comment on lines +30 to +53
// TODO We need to download and upload the files to github first, else rocket.chat won't allow accessing images like below
// const attachmentImageURLs: String[] = []
// const attachmentVideoURLs: String[] = []
// const settings = this.read.getEnvironmentReader().getServerSettings();
// const Site_Url = await settings.getValueById("Site_Url");
// if (message.attachments){
// message.attachments.map((attachment) => {
// if (attachment.imageUrl){
// attachmentImageURLs.push(`### ${attachment.description?.split("|").pop()}\n![image](${Site_Url}/${attachment.imageUrl})`)
// }
// if (attachment.videoUrl){
// attachmentVideoURLs.push(`### ${attachment.description?.split("|").pop()}\n` + `${Site_Url}/${attachment.videoUrl}`)
// }
// })
// }

// if (message.blocks){
// message.blocks.map((element) => {
// if (element.type === BlockType.IMAGE){
// element = element as IImageElement
// attachmentImageURLs.push(`### ${element.altText}\n![image](${element.imageUrl})`)
// }
// })
// }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@henit-chobisa These comments need to be fixed, either by code or removed completely.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure Samad, I am still on my way to find someway for the images to be processed, what should I do in that case remove these comments and make another PR for that ??

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

Successfully merging this pull request may close these issues.

[FEATURE-REQUEST] Create Issues from Messages with Action Buttons
2 participants