Skip to content

Chore/SOF-6991 #80

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Chore/SOF-6991 #80

wants to merge 6 commits into from

Conversation

azech-hqs
Copy link
Contributor

This PR concerns:

  • adding a new isDefault property to entity filter objects
  • set default entity as first element in filtered entity array

@azech-hqs azech-hqs marked this pull request as ready for review October 23, 2023 18:02
const defaultIndex = pathObjects.findIndex((pathObj) => {
return isPathSupported(pathObj, [defaultFilter]);
});
if (defaultIndex < 0 || pathObjects.length < 2) return pathObjects;
Copy link
Member

Choose a reason for hiding this comment

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

What's the magic number 2? Let's explain the logic

});
if (defaultIndex < 0 || pathObjects.length < 2) return pathObjects;

const tmp = pathObjects[1];
Copy link
Member

Choose a reason for hiding this comment

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

Same as above for the indices

Copy link
Contributor Author

Choose a reason for hiding this comment

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

corrected the error and added explanatory comment

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