Skip to content

Conversation

@colbyallenc
Copy link
Contributor

@colbyallenc colbyallenc commented Jul 11, 2019

/project add supports multi-word labels for links
addLinkToProjectAction can can recognize a multi-word label and store it as so
PBOT-103

};
if (parsedUserInput.length >= 4) {
linkParams = {
label: parsedUserInput.slice(1, 3).join(' '),

Choose a reason for hiding this comment

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

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.

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants