diff --git a/CHANGELOG.md b/CHANGELOG.md index 601ea3336..f4cd5a7ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ - Ability to configure prices for spaces by time slots different than the default hourly rate - Updated portuguese translation - Refactored the ReserveButton component to use the same user's data across all the component -- [TODO DEPLOY] `rails db:seed` +- First optimization the load time of the payment schedules list ## v5.1.13 2021 November 16 diff --git a/app/frontend/src/javascript/components/payment-schedule/payment-schedules-list.tsx b/app/frontend/src/javascript/components/payment-schedule/payment-schedules-list.tsx index 7288fba22..0bd68c330 100644 --- a/app/frontend/src/javascript/components/payment-schedule/payment-schedules-list.tsx +++ b/app/frontend/src/javascript/components/payment-schedule/payment-schedules-list.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react'; +import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { react2angular } from 'react2angular'; import { DocumentFilters } from '../document-filters'; @@ -38,13 +38,6 @@ const PaymentSchedulesList: React.FC = ({ currentUser // current filter, by date, for the schedules and the deadlines const [dateFilter, setDateFilter] = useState(null); - /** - * When the component is loaded first, refresh the list of schedules to fill the first page. - */ - useEffect(() => { - handleRefreshList(); - }, []); - /** * Fetch from the API the payments schedules matching the given filters and reset the results table with the new schedules. */ diff --git a/app/services/payment_schedule_service.rb b/app/services/payment_schedule_service.rb index 14dd6e078..4de55337e 100644 --- a/app/services/payment_schedule_service.rb +++ b/app/services/payment_schedule_service.rb @@ -127,7 +127,7 @@ class PaymentScheduleService # @param filters {Hash} allowed filters: reference, customer, date. ## def self.list(page, size, filters = {}) - ps = PaymentSchedule.includes(:invoicing_profile, :payment_schedule_items) + ps = PaymentSchedule.includes(:invoicing_profile, :payment_schedule_items, :payment_schedule_objects) .joins(:invoicing_profile) .order('payment_schedules.created_at DESC') .page(page)