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] Send chat notification on submission review #445

Merged
merged 5 commits into from
Dec 17, 2020

Conversation

ggwadera
Copy link
Collaborator

@ggwadera ggwadera commented Dec 17, 2020

Closes #444

This PR will:

  • add a new SubmissionStatus enum to help avoid using strings for submission status;
  • add new Mattermost helper functions so the bot can send direct messages;
  • add a new sendChatNotification function in updateSubmission, to send a notification to the user when their submission has been accepted or rejected, including the review comment;
  • add and fix tests relevant to the mentioned functions.

image

@ggwadera ggwadera added the enhancement New feature or request label Dec 17, 2020
@ggwadera ggwadera self-assigned this Dec 17, 2020
@vercel
Copy link

vercel bot commented Dec 17, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/c0d3/c0d3-app/f0qqwg6mh
✅ Preview: https://c0d3-app-git-feat-chat-notifications.c0d3.vercel.app

@codecov
Copy link

codecov bot commented Dec 17, 2020

Codecov Report

Merging #445 (f91d268) into master (a54a975) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #445   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           87        87           
  Lines         1157      1184   +27     
  Branches       252       254    +2     
=========================================
+ Hits          1157      1184   +27     
Impacted Files Coverage Δ
helpers/controllers/submissionController.ts 100.00% <100.00%> (ø)
helpers/mattermost.ts 100.00% <100.00%> (ø)
helpers/updateSubmission.ts 100.00% <100.00%> (ø)

async (id: string): Promise<UserInfo> => {
try {
const response = await fetch(`${chatServiceUrl}/users/${id}`, { headers })
return await response.json()
Copy link
Contributor

Choose a reason for hiding this comment

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

you could do just return response.json() right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right! 👍

@ggwadera ggwadera merged commit 5fdb7aa into garageScript:master Dec 17, 2020
@ggwadera ggwadera deleted the feat/chat-notifications branch December 17, 2020 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Send chat notification for challenge submissions
3 participants