Add task notes first attempt#72
Conversation
| }, | ||
| dueDate: DataTypes.DATE, | ||
| scheduledMessageId: DataTypes.STRING, | ||
| // Unsure if this is necessary |
There was a problem hiding this comment.
You definitely need this
| Blocks.Input({ label: 'Notes', blockId: 'taskNotes', optional: true }).element( | ||
| Elements.TextInput({ | ||
| actionId: 'taskNotes', | ||
| maxLength: 300, |
There was a problem hiding this comment.
Did you pick 300 at random or was their a specific reason for it?
| }; | ||
| if (task.dueDate) { | ||
| option.description = `Due ${DateTime.fromJSDate(task.dueDate).toRelativeCalendar()}`; | ||
| option.description = `:spiral_calendar_pad:Due ${DateTime.fromJSDate(task.dueDate).toRelativeCalendar()}`; |
There was a problem hiding this comment.
is :spiral_calendar_pad: part of the standard emoji set? e.g. does it render on all workspaces?
There was a problem hiding this comment.
| option.description = `:spiral_calendar_pad:Due ${DateTime.fromJSDate(task.dueDate).toRelativeCalendar()}`; | |
| option.description = `:spiral_calendar_pad: Due ${DateTime.fromJSDate(task.dueDate).toRelativeCalendar()}`; |
| } | ||
| // Tried adding this line with some hardcoded text for each element but that didn't work either. | ||
| // I don't think TextInput can be passed in .elements but if that's the case documentation does not show how add mrkdwn elements to a Context block? | ||
| // Context().elements([Elements.TextInput({text:`something`})],[Elements.TextInput({text:`something else`})]) |
There was a problem hiding this comment.
There's two things here, which maybe because you haven't fully written out your thoughts, but as written
- There's nothing happening with the
Context(). You're not assigning it to anything, or trying to embed it into anything. It's like a fragment of a sentence in the middle of a story. - I don't think you can use a
Contextblock as an option inside an input block. You'd need to have it after the input block, which will make the list render funny.
There was a problem hiding this comment.
Here's the relevant docs on our side - https://api.slack.com/reference/block-kit/composition-objects#option
There was a problem hiding this comment.
Ok, I did some digging in the BlockBuilder source code and I think I have it.
Context({}).elements(['Foo', 'Bar']),
| // LEAVING THIS UNTOUCHED FOR NOW | ||
|
|
||
| // for (start, end; start < end; start += maxOptionsLength) { | ||
| // holdingArray = openTasks.slice(start, start + maxOptionsLength); | ||
| // tasksInputsArray.push( | ||
| // Input({ label: ' ', blockId: `open-task-status-change-${start}` }).dispatchAction().element(Elements.Checkboxes({ actionId: 'blockOpenTaskCheckboxClicked' }).options(holdingArray.map((task) => { | ||
| // const option = { | ||
| // text: `*${task.title}*`, | ||
| // value: `open-task-${task.id}`, | ||
| // }; | ||
| // if (task.dueDate) { | ||
| // option.description = `Due ${DateTime.fromJSDate(task.dueDate).toRelativeCalendar()}`; | ||
| // } | ||
| // return Bits.Option(option); | ||
| // }))), | ||
| // ); | ||
| // } | ||
|
|
||
| // SANDRA TESTING |
There was a problem hiding this comment.
I'm assuming this is just the old code, so not looking at it.
Summary
Describe the goal of this PR. Mention any related Issue numbers.
Requirements (place an
xin each[ ])