Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Project filter search#345

Merged
vipulnsward merged 17 commits intodevelopfrom
project-filter-search
May 23, 2022
Merged

Project filter search#345
vipulnsward merged 17 commits intodevelopfrom
project-filter-search

Conversation

@aniketkaushik
Copy link
Contributor

@aniketkaushik aniketkaushik commented Apr 27, 2022

Notion card

https://saeloun.notion.site/Filter-on-Projects-list-Page-7437280cf75d4a6ab33dd51221443fb9

Added Search for projects
Added Client filter for projects
Added User filter for projects

Optimised project index page query, previously we were making 11 DB request, reduced it to 2

API : http://127.0.0.1:3000/internal_api/v1/projects?search=Project_1_Client_1_saeloun_India&user_id[]=1&client_id[]=1&billable=false

{
    "projects": [
        {
            "id": 1,
            "name": "Project_1_Client_1_saeloun_India",
            "clientName": "client_1_saeloun_India",
            "isBillable": false,
            "minutesSpent": 10560.0
        }
    ],
    "clients": [
        {
            "id": 1,
            "name": "client_1_saeloun_India"
        },
        {
            "id": 2,
            "name": "client_2_saeloun_India"
        },
        {
            "id": 5,
            "name": "mMicrosoft"
        }
    ],
    "teamMembers": [
        {
            "id": 1,
            "userName": "Vipul A M"
        },
        {
            "id": 4,
            "userName": "Keshav Biswa"
        },
        {
            "id": 5,
            "userName": "Rohit Joshi"
        },
        {
            "id": 3,
            "userName": "Akhil G Krishnan"
        },
        {
            "id": 2,
            "userName": "Supriya Agarwal"
        }
    ]
}

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have manually tested all workflows
  • I have performed a self-review of my own code
  • I have added automated tests for my code

@github-actions
Copy link

github-actions bot commented May 6, 2022

Current Code Coverage Percent of this PR:

83.86 %

Files having coverage below 100%

Impacted Files Coverage
/app/controllers/subscriptions_controller.rb 66.67 %
/app/controllers/invoices_controller.rb 63.64 %
/app/models/invoice.rb 96.3 %
/app/models/client.rb 92.68 %
/app/policies/timezone_policy.rb 66.67 %
/app/policies/subscriptions_policy.rb 66.67 %
/app/controllers/invoices/payments_controller.rb 61.11 %
/app/services/report/filters.rb 87.88 %
/app/services/invoice_payment/checkout.rb 43.48 %
/app/services/invoice_payment/pdf_generation.rb 65.38 %
/app/controllers/internal_api/v1/timezones_controller.rb 37.5 %
/lib/benchmarking/benchmarker.rb 0.0 %
/lib/countries_info.rb 0.0 %

@supriya3105 supriya3105 requested review from sudeeptarlekar and removed request for akhilgkrishnan and keshavbiswa May 10, 2022 13:11

context "when no filters or search are applied" do
it "returns list of all projects" do
user_id, client_id, billable, search = nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use let for these assignments, you can then tweak single value in context based on requirement.
e.g. you can only tweak search in next context. This way it will become much more cleaner.
Thoughts?

Please follow same comments for another method added

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, but in one of the examples, we have all the filters, which means we will have 11 lets, which rubocop doesn't allows, so keshav suggested this way.

@vipulnsward vipulnsward merged commit 7f8fc4e into develop May 23, 2022
@vipulnsward vipulnsward deleted the project-filter-search branch May 23, 2022 17:36
vipulnsward pushed a commit that referenced this pull request Feb 15, 2026
* project filter

* project search

* added current_company clients_list and users_list

* minor fix

* removed the repeated code

* alignment

* revert few file

* minutes spent fixed

* updated company specs and index_spec of projects

* temp camelcase ruby variables

* removed non imp files

* revert timesheet.rb and schema

* update git ignore

* added line to gitignore

* updated few test cases for company.rb

* test for project filter project_list_query method

* removed comments from project controller
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.

3 participants