Skip to content
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-4356 reverse slack modal sort #990

Merged
merged 13 commits into from
Feb 8, 2024
Merged

DOP-4356 reverse slack modal sort #990

merged 13 commits into from
Feb 8, 2024

Conversation

anabellabuckvar
Copy link
Contributor

@anabellabuckvar anabellabuckvar commented Feb 8, 2024

Context

DOP-4356

This is a quick fix for content writers who are having issues deploying some branches due to having too many entitlements for slack's limit of 100 things per dropdown

With sorting, inactive branches will now be sorted to the bottom of the slack modal and therefore will be the first to be truncated if a deployer has >100 entitlements. I've also taken the opportunity to correctly sort the versions in the modal such that 4.1 < 4.2 < 4.11

Changes were tested in preprd, and screenshots below are from preprd test-deploy slack modal

Screenshot 2024-02-08 at 3 28 18 PM Screenshot 2024-02-08 at 3 25 46 PM

Copy link

github-actions bot commented Feb 8, 2024

Your feature branch infrastructure has been deployed!

Your webhook URL is: https://165kcc42d5.execute-api.us-east-2.amazonaws.com/prod/webhook/githubEndpoint/trigger/build

For more information on how to use this endpoint, follow these instructions.

@anabellabuckvar anabellabuckvar marked this pull request as ready for review February 8, 2024 20:16
@@ -191,13 +191,23 @@ export class SlackConnector implements ISlackConnector {
};
reposToShow.push(opt);
});

// THis is the limitation enforced by slack as no more 100 items are allowd in the dropdown
Copy link
Contributor

Choose a reason for hiding this comment

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

I know you didn't write this line, but lol can you pls fix the extra capitalization? <3

//'[ERROR] no more than 100 items allowed [json-pointer:/view/blocks/0/element/options]'

if (reposToShow.length > 100) {
reposToShow = reposToShow.splice(0, 100);
reposToShow = reposToShow.sort().reverse().splice(0, 100);
Copy link
Contributor

Choose a reason for hiding this comment

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

Normally using a sort method without a compare function makes me sweat but simply because Github enforces rules on owner names and repo names in respect to symbols, this is safe to me. I'm 99.99% sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm ok, do you think I should add a sort function of some ~sort?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is going to be the very rare time when I say you don't have to 😆

@@ -53,6 +53,7 @@ jest.mock('../../../src/repositories/docsetsRepository', () => ({
jest.mock('config');

describe('Slack API Controller Tests', () => {
console.log('hello');
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove! :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OOps.. Thanks for catching.. sorry..

@anabellabuckvar anabellabuckvar merged commit 88fc4de into main Feb 8, 2024
9 checks passed
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.

2 participants