-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix: Sort relationship by relationship types #3661
fix: Sort relationship by relationship types #3661
Conversation
Sort the array by relationshipType if relationshipType occours for first time, save it and display it else continue displaying other details when relationshipType changes, it won't be equal to curr_relationship and hence will display it
2f5c51e
to
09fdf1e
Compare
apparently it was happening due to file being included twice
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
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.
As I'm OK with the idea, the php code has no place in the bade template.
@@ -1,9 +1,25 @@ | |||
@php |
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 really don't like using @php
in Laravel.
In every case, it could be done in the Controller instead, and that's the place it has to be moved.
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.
can you point me in the right direction and tell me in which file should I place the sort function and where does the $relationships
array comes from, So I can sort them there itself and do the displaying here accordingly
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.
The relationships array comes from resources/views/people/relationship/index.blade.php
file, and the ContactsController@show
method. Each @include
use another list of relationships (which is not really optimized code btw...)
You can call the getLocalizedName
and store it in the relationship object using a map
method, and reorder the collection with sortByCollator
macro.
closing this after long non-activity time |
This pull request has been automatically locked since there |
FIX #2395
Sort the array by relationshipType
if relationshipType occours for first time, save it and display it
else continue displaying other details
when relationshipType changes, it won't be equal to curr_relationship and hence will display it
UI CHANGES: replace the silver badge with
@djaiss
NOTE: test are not written in cypress yet