Conversation
addLinkToProjectAction can accept multi worded label PBOT-103
| }; | ||
| if (parsedUserInput.length >= 4) { | ||
| linkParams = { | ||
| label: parsedUserInput.slice(1, 3).join(' '), |
There was a problem hiding this comment.
This method is on the right track, but will only work if 3 words are used for the label. If only 1 or 2 words are used for the label, then the slice() will end up including the URL. If 4+ words are used for the label, then only the first 3 will be included in the label.
This function would a great candidate for test-driven coding. Write your test cases first with multiple scenarios you would expect this to work with, then change your code to make the tests pass.
There was a problem hiding this comment.
I'm also concerned that his approach to accepting multiple words will cause future problems. What happens when you add a new parameter that can also be multiple words? How will you be able to distinguish between where one parameter ends and the other one starts?
Maybe you could support this method at first, then look at another method (ie. multi-word params in quotes) in the future.
/project add supports multi-word labels for links
addLinkToProjectAction can can recognize a multi-word label and store it as so
PBOT-103