Skip to content

issue #2189 #2211

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

Merged
merged 25 commits into from
Jun 15, 2017
Merged

issue #2189 #2211

merged 25 commits into from
Jun 15, 2017

Conversation

muhammadbilal19
Copy link
Collaborator

@muhammadbilal19 muhammadbilal19 commented Jun 9, 2017

Add Pagination code for IncomingPhoneNumber API and UI. Please review and let me know with your feedback.

Add pagination changes for IncomingPhoneNumbers API
Add pagination changes on number-incoming.html
Change pagination footer like 1 to 10 of 1000
RestComm#2189
Copy link
Contributor

@gvagenas gvagenas left a comment

Choose a reason for hiding this comment

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

Hi @muhammadbilal19, thanks for your contribution, great job.
Here are my comments:

  • You need to provide a Mybatis mapper for MySQL along with the one you provided for HSQLDB. The MySQL mapper have to be at restcomm.application/src/main/webapp/WEB-INF/scripts/mariadb/sql
  • You have to make test with a live MySQL DB to make sure the mapper and the DAO are working fine with MySQL
  • You have to provide test cases in the testsuite for the IncomingPhoneNumber pagination feature. Check how it is done for the Calls API org.restcomm.connect.testsuite.http.CallsEndpointTest

Thanks
George

@muhammadbilal19
Copy link
Collaborator Author

Thanks @gvagenas i will complete requested changes.

@@ -68,7 +68,21 @@
<if test="phoneNumber != null">
AND "n"."phone_number" like #{phoneNumber}
</if>
LIMIT #{limit} OFFSET #{offset}
Copy link
Contributor

Choose a reason for hiding this comment

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

pagination filtering done at DB level should provide better performance, good!!


int limit = Integer.parseInt(pageSize);
int offset = (page == "0") ? 0
: (((Integer.parseInt(page) - 1) * Integer.parseInt(pageSize)) + Integer.parseInt(pageSize));
Copy link
Contributor

Choose a reason for hiding this comment

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

can we reduce the number of times we convert incoming queryString params into proper type for validation?? For performance and error handling point of view good be much better...

Copy link
Collaborator Author

@muhammadbilal19 muhammadbilal19 Jun 12, 2017

Choose a reason for hiding this comment

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

Thanks @jaimecasero very nice point, changes are now available 7957dff
Feel free to comment if you have any other point :)

otsakir and others added 19 commits June 9, 2017 13:22
- null is returned and the error is treated as a weak-password case
  since AccountsEndpoint:469 mutes all errors

Fixes RestComm#2175
…validation_error_logging

Issue2175 js password validation error logging
Add pagination changes for IncomingPhoneNumbers API
Add pagination changes on number-incoming.html
Change pagination footer like 1 to 10 of 1000
RestComm#2189
…nbound call before MS has send respond to CRCX

This close RestComm#2180
Add RestComm tools class to remove some repeating code.
Replace System.out to logger.info IncomingPhoneNumbersEndpointTest 
RestComm#2189
…ne Add RestComm tools class to remove some repeating code. Replace System.out to logger.info IncomingPhoneNumbersEndpointTest RestComm#2189"

This reverts commit ccf03b6.
Add RestCommIncomingPhone tools class to remove some repeating code.
Replace System.out to logger.info IncomingPhoneNumbersEndpointTest 
RestComm#2189
Add pagination changes for IncomingPhoneNumbers API
Add pagination changes on number-incoming.html
Change pagination footer like 1 to 10 of 1000
RestComm#2189
Add RestComm tools class to remove some repeating code.
Replace System.out to logger.info IncomingPhoneNumbersEndpointTest 
RestComm#2189
…ne Add RestComm tools class to remove some repeating code. Replace System.out to logger.info IncomingPhoneNumbersEndpointTest RestComm#2189"

This reverts commit ccf03b6.
Add RestCommIncomingPhone tools class to remove some repeating code.
Replace System.out to logger.info IncomingPhoneNumbersEndpointTest 
RestComm#2189
@ammendonca ammendonca self-requested a review June 13, 2017 15:41
Copy link
Contributor

@ammendonca ammendonca left a comment

Choose a reason for hiding this comment

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

@muhammadbilal19 I ahve found a couple of issues with the UI:

  • When clicking on the items per page, the selected option doesn't show as selected after clicking somewhere else on the page, only if clicked twice on the same option:

    • Clicking on 25 and then somewhere else on the page:
      image
    • After clicking again on 25 and then somewhere else on the page:
      image
  • Sorting only works at first, after changing the number of items per page, it stops working:
    sort-after-items-per-page

@muhammadbilal19
Copy link
Collaborator Author

@ammendonca i will try to fix these issues today

@muhammadbilal19
Copy link
Collaborator Author

@ammendonca items per page button and sorting issue is fixed for this PR. Please have a look and let me know your comments

@ammendonca
Copy link
Contributor

Thanks @muhammadbilal19, the mentioned issues are now fixed. A (new?) minor issue seems to be present tho, having 12 numbers, with the list with 10 per page, on the page 2 it shows "3 to 4 of 12 Numbers". Not sure this was present before and I haven't noticed.

image

@scottbarstow
Copy link
Contributor

scottbarstow commented Jun 14, 2017 via email

@muhammadbilal19
Copy link
Collaborator Author

@ammendonca Thanks for the update. I just tried to reproduce that minor issue which you mentioned but i am unable to reproduced it. Not sure why it is happening on your side.
screen shot 2017-06-15 at 8 38 15 am

@ammendonca
Copy link
Contributor

@muhammadbilal19 I just checked and you need to sort by numbers ascending for it to show. Actually looking at the sorted list, it doesn't seem to be properly sorted:

image

@scottbarstow for me it's fine, I've approved the PR already. The issue I've found about record numbering is minor and not blocking.. the fact that the list isn't correctly sorted might be more relevant in cases where we have long list of numbers.

@muhammadbilal19
Copy link
Collaborator Author

@ammendonca yes i am able to see that issue now. I am not a really good UI developer and tester so bear with me :) I guess it would be good if we create another issue for sorting issue and once @gvagenas completed the review and approved that PR merge pagination changes only.
If we need to fix sorting issue with this PR i am working on it and will commit it once it is fixed.
@scottbarstow @deruelle thoughts??

@scottbarstow
Copy link
Contributor

scottbarstow commented Jun 15, 2017 via email

@ammendonca
Copy link
Contributor

@muhammadbilal19 Just tested and you can fix the sort issue by replacing sort in <tr class="number-row" ng-repeat="pn in filtered = (numbersList | filter:query| orderBy:sort:reverse)"> by predicate which is the actual variable containing the field to sort by.

As per the "3 to 4 of 12 Numbers", the issue is with page_size returned when the Reverse=true is used. With Reverse=false the page_size (even for the last page, which has 2 entries) is 10. But if we pass Reverse=true the page_size returned is 2. That page_size is also used to generate the returned start and end params which are used to show that text.

Hope it helps!

@scottbarstow I'm OK to go with current status, but just provided the solution to the most critical UI issue, so that should likely make it in.

<th class="width-10pc">&nbsp;</th>
</thead>
<tbody>
<tr class="number-row" ng-repeat="pn in filtered = (numbersList | filter:query)">
<tr class="number-row" ng-repeat="pn in filtered = (numbersList | filter:query| orderBy:sort:reverse)">
Copy link
Contributor

Choose a reason for hiding this comment

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

Replace sort by predicate which is where the field to sort is stored at (from https://github.com/RestComm/Restcomm-Connect/pull/2211/files#diff-b0cba56bc32531ce8ec4f5174dcd4fe6R97)

@muhammadbilal19
Copy link
Collaborator Author

Thanks @ammendonca for writing the solution I committed my latest changes i made some other changes as well so please have and look and let me know if looks good to you now.Sorting issue and other minor issue both are now fixed

@gvagenas
Copy link
Contributor

Great work @muhammadbilal19, thanks!

@gvagenas gvagenas closed this Jun 15, 2017
@gvagenas gvagenas reopened this Jun 15, 2017
@gvagenas gvagenas merged commit bbaf3f6 into RestComm:master Jun 15, 2017
@muhammadbilal19 muhammadbilal19 deleted the issue-2189 branch June 15, 2017 10:38
@gvagenas
Copy link
Contributor

@muhammadbilal19 can you please create a new pull request for the same issue since there was a problem during the merge and I had to revert ?

@muhammadbilal19 muhammadbilal19 restored the issue-2189 branch June 15, 2017 13:47
@muhammadbilal19
Copy link
Collaborator Author

@gvagenas sure i am creating new PR give me few minutes

@gvagenas
Copy link
Contributor

Great, thanks @muhammadbilal19 . Make sure you merge master into your branch to have the latest changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants