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

Adds #366 sorting contact list by last activity date #775

Merged
merged 21 commits into from
Jan 9, 2018

Conversation

turtles2
Copy link

@turtles2 turtles2 commented Jan 8, 2018

This will fix #366. It allows sorting by Oldest or Newest. Currently being null makes it the oldest value. I believe that this is the proper approach if not we can can change it.

turtles2 and others added 20 commits December 25, 2017 19:27
Change to git clone URL as the git@ will not work without a granted private key.
…icahq#731)

When the current day of the month is greater than the number of days in
the month, the date class was rolling forward to March.
…ahq#735)

This will allow a user to search there contacts by there contact information. It is done by entering the field they are searching by followed by a : then the search term. For example to find a contact with the email example@example.com you would enter email:example@example.com. 

Fixes monicahq#729
Revert "Fix URL::forceSchema to forceScheme (monicahq#730)" (monicahq#744)
@@ -74,6 +82,18 @@ public function index(Request $request)
$contacts = $user->account->contacts()->real()->sortedBy($sort)->get();
}

if ($date_flag) {
foreach ($contacts as $contact) {
$contact['sort_date'] = $contact->getLastActivityDate();
Copy link
Member

Choose a reason for hiding this comment

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

MINOR Define a constant instead of duplicating this literal "sort_date" 3 times. rule

@turtles2
Copy link
Author

turtles2 commented Jan 8, 2018

@djaiss Please advise on how you would like me to address the sonarqube issues. I disagree with the minor one. But with the major one I am not sure on the best approach to refactor.

@djaiss
Copy link
Member

djaiss commented Jan 8, 2018

@turtles2 yeah this bot is a test right now. I strongly believe it can help us tremendously but it definitely needs tuning :-D

@turtles2
Copy link
Author

turtles2 commented Jan 8, 2018

I figured as much. @djaiss Were do we stand with the PR would you like me to attempt to simplify index by breaking it up a bit or do think we are good to merge it in? Looking at the function I think that breaking it up would make it slightly harder to keep track of the different sorting and tag features. But I am open to breaking it up.

@turtles2 turtles2 changed the title Adds #366 Adds #366 sorting contact list by last activity date Jan 8, 2018
@asbiin
Copy link
Member

asbiin commented Jan 9, 2018

SonarQube analysis reported 2 issues

  • CRITICAL 1 critical
  • MINOR 1 minor

Watch the comments in this conversation to review them.

1 extra issue

Note: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:

  1. CRITICAL ContactsController.php#L23: Refactor this function to reduce its Cognitive Complexity from 20 to the 15 allowed. rule

@djaiss djaiss merged commit 495ff6f into monicahq:master Jan 9, 2018
@djaiss
Copy link
Member

djaiss commented Jan 9, 2018

Close #366

turtles2 added a commit to turtles2/monica that referenced this pull request Jan 9, 2018
@turtles2 turtles2 deleted the 366 branch January 9, 2018 16:25
@github-actions
Copy link

This pull request has been automatically locked since there
has not been any recent activity after it was closed.
Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add sorting contact list by last activity date
5 participants