Skip to content

Commit 9a1759b

Browse files
committed
added notifySlack() to send a notification to our test Slack workspace when project is saved
1 parent 02f3c0e commit 9a1759b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/components/file_system_interface/SaveProjectComponent.vue

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,27 @@ export default {
110110
// console.log('saved ', fileName, 'to local forage')
111111
// console.log('result is', result)
112112
// })
113+
113114
// console.log('PROJECT SAVED AS A JSON OBJECT!')
115+
this.notifySlack()
114116
}
117+
},
118+
// creates a popup dialog box, where if you click on yes, it will send a message to our test Slack workspace
119+
// still must refactor to dynamically work with user's Slack
120+
notifySlack () {
121+
remote.dialog.showMessageBox({
122+
message: 'Save successful. Would you like to notify your team on Slack?',
123+
buttons: ['No', 'Yes']
124+
},
125+
response => {
126+
if (response === 1) {
127+
fetch('https://hooks.slack.com/services/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', {
128+
method: 'POST',
129+
body: JSON.stringify({ 'text': 'A team member saved an OverVue project file!' }),
130+
headers: { 'Content-Type': 'application/json' }
131+
})
132+
}
133+
})
115134
}
116135
},
117136
// on components creation these key presses will trigger save project

0 commit comments

Comments
 (0)