-
Notifications
You must be signed in to change notification settings - Fork 1
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
[G2M] Bday modal #46
[G2M] Bday modal #46
Conversation
// value standard: '[module] // param-1 // ...param-N' | ||
const [module, taskId, customFieldId, value] = action_value.split(' // ') | ||
if (module === 'vacay') { | ||
updateTask(taskId, { custom_fields: { [customFieldId]: value }}) | ||
.then(res => { | ||
const { assignee: { name }, start_on, due_on, custom_fields } = res | ||
const status = custom_fields.find(o => o.name === 'Status').enum_value.name | ||
const date = start_on ? `${start_on} - ${due_on}` : due_on | ||
axios.post(response_url, { | ||
text: `Updated *${name}'s* vacation on *${date}* to *${status}*`, | ||
mrkdwn: true, | ||
response_type: 'ephemeral', | ||
replace_original: false, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't find any command that was using this block and the /vacay
is not even working for me, lemme know if I missed something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually I just realized that there's a problem at worker. From lambda logs:
"errorType": "TypeError",
"errorMessage": "Cannot read property 'gid' of null",
"stack": [
"TypeError: Cannot read property 'gid' of null",
" at vacation.reduce.true (/var/task/modules/vacation.js:87:24)",
" at Array.reduce (<anonymous>)",
" at worker (/var/task/modules/vacation.js:84:16)",
" at async Runtime.module.exports.handler (/var/task/slack-worker.js:6:3)"
]
}
so I'm not sure if it was even using the interactive endpoint in the first place
I've been trying to use https://slack.dev/node-slack-sdk/interactive-messages middleware for but I thought that by including the the npm package for interactive-messages can generate its own server and another option would be if we should host just the interactive part separately from lambda. as a ref: |
if (type === 'block_actions' && action.block_id === 'manage_fields') { | ||
let updatedBlocks | ||
let _buttons | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seem like a repetitive code block except for a few params, maybe could extract as a common function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as it is a bit experimental, I'll leave it for now, but agree, could be transformed into a helper function.
999eff4
to
ae389e0
Compare
- send link to bday user by dm - announce bday celebration in #general channel
sign
andsend
options to account for multiple pplif
it is the first iteration > open modalif
more fields are required or removedif
modal has been submittedbut each of these
if
blocks have their own specificities.sign
sends a DM to everyone to sign. Looks like:send
looks like: