Closed samad-yar-khan closed 2 years ago
@RonLek @Sing-Li I have added the feature to fetch issue templates . I have also updated the slash command /github new-issue
to github issue
as it seemed it more intuitive, let me know if we should change back to the original slash command.
GitHubSDK
:
getIssueTemplates()
: This method uses the GitHub Content API
to fetch the files from .github/ISSUE_TEMPLATES
directory location. If the location does not exits, we set template_not_found
property of the response to true
,indicating that no issue templates exist.getIssueTemplateCode()
: This methods takes download_url
of a fille on GitHub and returns the code on that file./github issue
command, newIssueStarterModal
will be triggered, and user will be prompted to enter repository name.Next
, we call getIssueTemplates()
method. If templates exist, we trigger issueTemplateSelectionModal
to display all the issue templates available. Select
we use the getIssueTemplateCode()
fetches the code for the selected template and triggers newIssueModal
with the template code.newIssueModal
will be triggered with a blank template.I have tested this with repositories which have issue templates and those without issue templates and have tried to handle all the edge cases. This was the only work-around I could think of, since there are no Template API
as of now.
Changes LGTM. Merging this in.
Issue(s)
closes #10
Acceptance Criteria fulfillment
Proposed changes (including videos or screenshots)
/github new-issue
to display a modal which takes input needed to create a new issue.https://user-images.githubusercontent.com/70485812/179430347-0d3af688-ecbc-4aa9-8ed9-5d1c821f123a.mp4