-
Notifications
You must be signed in to change notification settings - Fork 72
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
DOP-4549: Branches and repos in separate dropdowns in slack deploy dialog #1029
Conversation
Your feature branch infrastructure has been deployed! Your webhook URL is: https://es3go1ktj7.execute-api.us-east-2.amazonaws.com/prod/webhook/githubEndpoint/trigger/build For more information on how to use this endpoint, follow these instructions. |
e797daf
to
061e849
Compare
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'm confused at how this solves the >100 choices in the dropdown list. At first glance, it seems to actually bring the problem back? Because the inactive branches now are sorted only by their repoName rather than all the way to the bottom. I feel like I'm missing something, though!
api/handlers/slack.ts
Outdated
//sort the options by version number | ||
const repoOption = { | ||
label: { | ||
type: 'plain_text', | ||
text: repoName, | ||
}, | ||
options: options.sort((branchOne, branchTwo) => { | ||
return branchTwo.text.text |
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.
nit: could you move the comment down to the options line?
Fair question!! Each group can have 100 choices, so now we are only limited to 100 versions per repo as opposed to 100 versions total in the dialog. |
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.
Hey Anabella! This looks really good! Just a few small comments
options: options.sort((branchOne, branchTwo) => { | ||
return branchTwo.text.text | ||
.toString() | ||
.replace(/\d+/g, (n) => +n + 100000) |
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.
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.
You're right for those examples! Unfortunately, when we are sorting versions like v7.18 and v7.2, if we don't use the .replace
statement localeCompare
will sort the versions as if v7.2 is greater than v7.18, which we don't want
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.
Ah, gotcha! That makes sense
api/handlers/slack.ts
Outdated
} | ||
return entitledBranches.sort(); | ||
return repoOptions.sort((repoOne, repoTwo) => { |
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.
NIT: This can be simplified to
return repoOptions.sort((repoOne, repoTwo) => repoOne.label.text.localeCompare(repoTwo.label.text);
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.
Hey Anabella! Aside from the small nit, this looks good to me.
Stories/Links:
DOP-4549
Notes
This PR:
Example Build
README updates