-
Notifications
You must be signed in to change notification settings - Fork 9
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
Sorted filter checkboxes in alphabet order in materials page #516
Sorted filter checkboxes in alphabet order in materials page #516
Conversation
sortBy: string | undefined = 'name', | ||
): IDirection[] => { | ||
return array?.sort((prev, current) => { | ||
if (prev[sortBy] > current[sortBy]) { |
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.
if (prev[sortBy] > current[sortBy]) { | |
return prev[sortBy] - current[sortBy] |
}; | ||
const translatedOrigin = { ...origin }; | ||
translatedOrigin.name = translations[origin.id] || origin.name; | ||
return translatedOrigin; |
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.
This block of code is completely unreadable. Using let
and do a conditional assignment is an antipattern.
I suggest at least leaving a comment describing what this does and leaving a @TODO
comment for future refactoring.
} | ||
const postTypes = useSelector(selectPostTypes); | ||
const postTypesInPlural: IPostType[] = []; | ||
let postTypesInPlural: IPostType[] = []; |
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.
Same here
} | ||
|
||
const directions = useSelector(selectDirections); | ||
let directionsInPlural: IDirection[] = []; |
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.
And here
Kudos, SonarCloud Quality Gate passed! |
* fixed soring to material card (#498) * fixed soring to material card * fixTestSuite * create error message (#499) * bugFix #145 fix Authors cards are displayed on the 'Автори' page when all checkboxes are unmarked (#501) * fix bug with items size and accord. arrow color (#500) * bug fixed * bugfix * Fix items width acc to diff breakpoints * bug fixed * Update ScrollToTop component * Fix responsiveness of the Main View page (#511) * Move Pages directory (#512) * Fix app crash in create video component (#517) * Fixed formatDate * fixed formatDate * Sorted filter checkboxes in alphabet order in materials page (#516) * bug fix * removed sorting from origins and post types * fixed according to comments in review * Fix Materials page responsiveness (#513) * fix: poslist responsiveness * chore: move thene into new directory * bugFix#171 changed link on TranslationPostPreviewCard.tsx (#515) * bugFix#171 changed link on TranslationPostPreviewCard.tsx * bugFix#171 changed link on TranslationPostPreviewCard.tsx * bugFix#171 changed link on TranslationPostPreviewCard.tsx * Bugfix #153 and #154 Fix filters on the author`s profile page when no materials is added by the user (#507) * Fix filters when no materials is added by the user * Refactor bugfix#153 and #154 Co-authored-by: 0shar0 <71778107+0shar0@users.noreply.github.com> Co-authored-by: Valentyna Chudik <valentyna_chudik@ukr.net> Co-authored-by: shedanny <shedanny23@gmail.com> Co-authored-by: Danylo Shevchenko <60629098+shedanny@users.noreply.github.com> Co-authored-by: michalenr <42828375+michalenr@users.noreply.github.com>
* Develop to release * Fix bug with posts by important image sort * Fix origins, post types label names order, correct the post type label name * fixed response with setPage * Fixed styles in PostView component * bugFix #157 Change copyright-text which dispayed on the footer * change Footer.tsx allRightsReserved field * add Link to ExpertPhotoDataCard (#495) * #489 / remove text fields from carousel & link with post (#493) * Implemented task * fixed eslint warning * removed obsolete tests * Add ScrollToTop component (#492) * changed variable materialLink (#491) * Bugfix #155 redirecting in material's card (#490) * created redirection in Material's card * code optimization * debugger removed * fixed formatting * fixed linter errors * Fix Accordion component dispay (#488) * Fix missing posts in MaterialView after navigating to it back. (#487) * Fix missing posts in MaterialView after navigating to it back. * Update src/old/modules/materials/components/MaterialsView.tsx Co-authored-by: michalenr <42828375+michalenr@users.noreply.github.com> * Changed back src/old/modules/materials/components/MaterialsView.tsx because that changes broke code Co-authored-by: michalenr <42828375+michalenr@users.noreply.github.com> * Develop to Release (#521) * fixed soring to material card (#498) * fixed soring to material card * fixTestSuite * create error message (#499) * bugFix #145 fix Authors cards are displayed on the 'Автори' page when all checkboxes are unmarked (#501) * fix bug with items size and accord. arrow color (#500) * bug fixed * bugfix * Fix items width acc to diff breakpoints * bug fixed * Update ScrollToTop component * Fix responsiveness of the Main View page (#511) * Move Pages directory (#512) * Fix app crash in create video component (#517) * Fixed formatDate * fixed formatDate * Sorted filter checkboxes in alphabet order in materials page (#516) * bug fix * removed sorting from origins and post types * fixed according to comments in review * Fix Materials page responsiveness (#513) * fix: poslist responsiveness * chore: move thene into new directory * bugFix#171 changed link on TranslationPostPreviewCard.tsx (#515) * bugFix#171 changed link on TranslationPostPreviewCard.tsx * bugFix#171 changed link on TranslationPostPreviewCard.tsx * bugFix#171 changed link on TranslationPostPreviewCard.tsx * Bugfix #153 and #154 Fix filters on the author`s profile page when no materials is added by the user (#507) * Fix filters when no materials is added by the user * Refactor bugfix#153 and #154 Co-authored-by: 0shar0 <71778107+0shar0@users.noreply.github.com> Co-authored-by: Valentyna Chudik <valentyna_chudik@ukr.net> Co-authored-by: shedanny <shedanny23@gmail.com> Co-authored-by: Danylo Shevchenko <60629098+shedanny@users.noreply.github.com> Co-authored-by: michalenr <42828375+michalenr@users.noreply.github.com> Co-authored-by: Valentyna-Chudik <valentyna_chudik@ukr.net> Co-authored-by: Bohdan <bodiasharko@gmail.com> Co-authored-by: 0shar0 <71778107+0shar0@users.noreply.github.com> Co-authored-by: Danylo Shevchenko <60629098+shedanny@users.noreply.github.com> Co-authored-by: michalenr <42828375+michalenr@users.noreply.github.com> Co-authored-by: shedanny <shedanny23@gmail.com>
No description provided.