]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-18652 Drop usages of deprecated paging mechanism in the frontend API response
author7PH <benjamin.raymond@sonarsource.com>
Fri, 5 May 2023 14:25:59 +0000 (16:25 +0200)
committersonartech <sonartech@sonarsource.com>
Fri, 5 May 2023 20:03:00 +0000 (20:03 +0000)
21 files changed:
server/sonar-web/src/main/js/api/mocks/CodingRulesMock.ts
server/sonar-web/src/main/js/api/mocks/GroupsServiceMock.ts
server/sonar-web/src/main/js/api/mocks/IssuesServiceMock.ts
server/sonar-web/src/main/js/api/mocks/QualityProfilesServiceMock.ts
server/sonar-web/src/main/js/api/quality-profiles.ts
server/sonar-web/src/main/js/api/user_groups.ts
server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaQualityProfiles.tsx
server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/MetaQualityProfiles-test.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/CodingRulesApp.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/CodingRulesApp-test.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/__snapshots__/CodingRulesApp-test.tsx.snap
server/sonar-web/src/main/js/apps/groups/components/EditMembersModal.tsx
server/sonar-web/src/main/js/apps/groups/components/ViewMembersModal.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/RuleFacet.tsx
server/sonar-web/src/main/js/apps/quality-profiles/__tests__/QualityProfilesApp-it.tsx
server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangelogContainer.tsx
server/sonar-web/src/main/js/apps/quality-profiles/changelog/__tests__/ChangelogContainer-test.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfileRules-test.tsx
server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx
server/sonar-web/src/main/js/types/coding-rules.ts

index 689828eba6191d54c7682d7c3d4bbfe2fd89b5c6..312b864de7a8cfa77224f4a1121a5a226ddf3260 100644 (file)
@@ -21,11 +21,12 @@ import { cloneDeep, countBy, pick, trim } from 'lodash';
 import { RuleDescriptionSections } from '../../apps/coding-rules/rule';
 import {
   mockCurrentUser,
+  mockPaging,
   mockQualityProfile,
   mockRuleDetails,
   mockRuleRepository,
 } from '../../helpers/testMocks';
-import { RuleRepository } from '../../types/coding-rules';
+import { RuleRepository, SearchRulesResponse } from '../../types/coding-rules';
 import { RawIssuesResponse } from '../../types/issues';
 import { SearchRulesQuery } from '../../types/rules';
 import { Rule, RuleActivation, RuleDetails, RulesUpdateRequest } from '../../types/types';
@@ -328,7 +329,7 @@ export default class CodingRulesMock {
     ps,
     available_since,
     rule_key,
-  }: SearchRulesQuery) => {
+  }: SearchRulesQuery): Promise<SearchRulesResponse> => {
     const countFacet = (facets || '').split(',').map((facet: keyof Rule) => {
       const facetCount = countBy(
         this.rules.map((r) => r[FACET_RULE_MAP[facet] || facet] as string)
@@ -348,11 +349,13 @@ export default class CodingRulesMock {
     }
     const responseRules = filteredRules.slice((currentP - 1) * currentPs, currentP * currentPs);
     return this.reply({
-      total: filteredRules.length,
-      p: currentP,
-      ps: currentPs,
       rules: responseRules,
       facets: countFacet,
+      paging: mockPaging({
+        total: filteredRules.length,
+        pageIndex: currentP,
+        pageSize: currentPs,
+      }),
     });
   };
 
index 523f59c2237d5e303943acba8ddc35fdea99be7d..1c65862e41b9373919567e63ae1ddbdb0cdfd6f5 100644 (file)
@@ -146,9 +146,8 @@ export default class GroupsServiceMock {
     ps?: number;
     q?: string;
     selected?: string;
-  }): Promise<Paging & { users: UserGroupMember[] }> => {
+  }): Promise<{ paging: Paging; users: UserGroupMember[] }> => {
     return this.reply({
-      ...this.paging,
       users: this.users
         .filter((u) => u.name.includes(data.q ?? ''))
         .filter((u) => {
@@ -161,6 +160,7 @@ export default class GroupsServiceMock {
               return true;
           }
         }),
+      paging: { ...this.paging },
     });
   };
 
index 42eb29d92e23e4fd5b96bb311b494db55b287b0c..1a7c78136c6a2b7e516e4cbd5e8b229f122958df 100644 (file)
@@ -30,6 +30,7 @@ import {
   mockRule,
   mockRuleDetails,
 } from '../../helpers/testMocks';
+import { SearchRulesResponse } from '../../types/coding-rules';
 import {
   ASSIGNEE_ME,
   IssueActions,
@@ -546,7 +547,7 @@ export default class IssuesServiceMock {
     return this.reply(issue.snippets);
   };
 
-  handleSearchRules = (req: SearchRulesQuery) => {
+  handleSearchRules = (req: SearchRulesQuery): Promise<SearchRulesResponse> => {
     const rules = this.rulesList.filter((rule) => {
       const query = req.q?.toLowerCase() || '';
       const nameMatches = rule.name.toLowerCase().includes(query);
@@ -555,10 +556,12 @@ export default class IssuesServiceMock {
       return isTypeRight && (nameMatches || keyMatches);
     });
     return this.reply({
-      p: 1,
-      ps: 30,
       rules,
-      total: rules.length,
+      paging: mockPaging({
+        total: rules.length,
+        pageIndex: 1,
+        pageSize: 30,
+      }),
     });
   };
 
index b26903edf06b225d5729c799e53a5608a5411062..372d7afe6665df256a1d3eac4d022c3c7c395cd5 100644 (file)
  */
 import { cloneDeep } from 'lodash';
 import { RequestData } from '../../helpers/request';
-import { mockCompareResult, mockQualityProfile, mockRuleDetails } from '../../helpers/testMocks';
+import {
+  mockCompareResult,
+  mockPaging,
+  mockQualityProfile,
+  mockRuleDetails,
+} from '../../helpers/testMocks';
 import { SearchRulesResponse } from '../../types/coding-rules';
 import { Dict, Paging, ProfileInheritanceDetails, RuleDetails } from '../../types/types';
 import {
+  CompareResponse,
+  Profile,
+  ProfileProject,
+  SearchQualityProfilesParameters,
+  SearchQualityProfilesResponse,
   activateRule,
   changeProfileParent,
   compareProfiles,
-  CompareResponse,
   copyProfile,
   createQualityProfile,
   getImporters,
   getProfileInheritance,
   getProfileProjects,
-  Profile,
-  ProfileProject,
   searchQualityProfiles,
-  SearchQualityProfilesParameters,
-  SearchQualityProfilesResponse,
 } from '../quality-profiles';
 import { getRuleDetails, searchRules } from '../rules';
 
@@ -49,10 +54,8 @@ export default class QualityProfilesServiceMock {
 
   comparisonResult: CompareResponse = mockCompareResult();
   searchRulesResponse: SearchRulesResponse = {
-    p: 0,
-    ps: 500,
-    total: 0,
     rules: [],
+    paging: mockPaging(),
   };
 
   constructor() {
@@ -107,10 +110,12 @@ export default class QualityProfilesServiceMock {
 
   resetSearchRulesResponse() {
     this.searchRulesResponse = {
-      p: 0,
-      ps: 500,
-      total: 0,
       rules: [],
+      paging: {
+        pageIndex: 1,
+        pageSize: 500,
+        total: 0,
+      },
     };
   }
 
index afc4856741889555cf37085dfa86f2a300dfccae..5f1d0090082189e058bcea264fe1c730ed03377c 100644 (file)
@@ -21,7 +21,7 @@ import { map } from 'lodash';
 import { Exporter, ProfileChangelogEvent } from '../apps/quality-profiles/types';
 import { csvEscape } from '../helpers/csv';
 import { throwGlobalError } from '../helpers/error';
-import { getJSON, post, postJSON, RequestData } from '../helpers/request';
+import { RequestData, getJSON, post, postJSON } from '../helpers/request';
 import { Dict, Paging, ProfileInheritanceDetails, UserSelected } from '../types/types';
 
 export interface ProfileActions {
@@ -171,17 +171,17 @@ export function getExporters(): Promise<any> {
   return getJSON('/api/qualityprofiles/exporters').then((r) => r.exporters);
 }
 
+export interface ChangelogResponse {
+  events: ProfileChangelogEvent[];
+  paging: Paging;
+}
+
 export function getProfileChangelog(
   since: any,
   to: any,
   { language, name: qualityProfile }: Profile,
   page?: number
-): Promise<{
-  events: ProfileChangelogEvent[];
-  p: number;
-  ps: number;
-  total: number;
-}> {
+): Promise<ChangelogResponse> {
   return getJSON('/api/qualityprofiles/changelog', {
     since,
     to,
index 0e7fd144827bbfa86a454a2f74358680daf29b8a..247a2f259f939f76ebaf9c48068d9050b3ccf22c 100644 (file)
@@ -37,11 +37,10 @@ export function getUsersInGroup(data: {
   ps?: number;
   q?: string;
   selected?: string;
-}): Promise<
-  Paging & {
-    users: UserGroupMember[];
-  }
-> {
+}): Promise<{
+  paging: Paging;
+  users: UserGroupMember[];
+}> {
   return getJSON('/api/user_groups/users', data).catch(throwGlobalError);
 }
 
index 4ca1ea191ac675b49ee1197a81468c2e792ecebd..514218f0fc5a3f25dd9308ed8212a65911318163 100644 (file)
@@ -77,7 +77,7 @@ export class MetaQualityProfiles extends React.PureComponent<Props, State> {
       qprofile: profileKey,
       statuses: 'DEPRECATED',
     };
-    return searchRules(data).then((r) => r.total);
+    return searchRules(data).then((r) => r.paging.total);
   }
 
   getDeprecatedRulesCount(profile: { key: string }) {
index 1a5cb143bcebd6e7cf41e435eae4aad4d749f939..5d6b2e7574cd4eda38bf385cb785733de03458b4 100644 (file)
 import { screen } from '@testing-library/react';
 import * as React from 'react';
 import { searchRules } from '../../../../../../../api/rules';
-import { mockLanguage, mockQualityProfile } from '../../../../../../../helpers/testMocks';
+import {
+  mockLanguage,
+  mockPaging,
+  mockQualityProfile,
+} from '../../../../../../../helpers/testMocks';
 import { renderComponent } from '../../../../../../../helpers/testReactTestingUtils';
 import { SearchRulesResponse } from '../../../../../../../types/coding-rules';
 import { Dict } from '../../../../../../../types/types';
@@ -40,9 +44,16 @@ it('should render correctly', async () => {
     ts: 10,
     css: 0,
   };
-  jest.mocked(searchRules).mockImplementation(({ qprofile }: { qprofile: string }) => {
-    return Promise.resolve({ total: totals[qprofile] } as SearchRulesResponse);
-  });
+  jest
+    .mocked(searchRules)
+    .mockImplementation(({ qprofile }: { qprofile: string }): Promise<SearchRulesResponse> => {
+      return Promise.resolve({
+        rules: [],
+        paging: mockPaging({
+          total: totals[qprofile],
+        }),
+      });
+    });
 
   renderMetaQualityprofiles();
 
index 94202b9a1ef9a4e969e7662bc2b19ed284e1b9cd..b44b63dbf86c5244dff05e2470f7cca01f59aadd 100644 (file)
@@ -252,10 +252,9 @@ export class CodingRulesApp extends React.PureComponent<Props, State> {
 
   makeFetchRequest = (query?: RawQuery) =>
     searchRules({ ...this.getSearchParameters(), ...query }).then(
-      ({ actives: rawActives, facets: rawFacets, p, ps, rules, total }) => {
+      ({ actives: rawActives, facets: rawFacets, rules, paging }) => {
         const actives = rawActives && parseActives(rawActives);
         const facets = rawFacets && parseFacets(rawFacets);
-        const paging = { pageIndex: p, pageSize: ps, total };
         return { actives, facets, paging, rules };
       }
     );
index 09ccc3496a57449eceacdfe32a0019ca21b9fb23..85eb36809c6c6803d42fccae3ff2c8d518279f3b 100644 (file)
@@ -34,7 +34,7 @@ import { CodingRulesApp } from '../CodingRulesApp';
 jest.mock('../../../../components/common/ScreenPositionHelper');
 
 jest.mock('../../../../api/rules', () => {
-  const { mockRule } = jest.requireActual('../../../../helpers/testMocks');
+  const { mockRule, mockPaging } = jest.requireActual('../../../../helpers/testMocks');
   return {
     getRulesApp: jest.fn().mockResolvedValue({ canWrite: true, repositories: [] }),
     searchRules: jest.fn().mockResolvedValue({
@@ -42,10 +42,12 @@ jest.mock('../../../../api/rules', () => {
       rawActives: [],
       facets: [],
       rawFacets: [],
-      p: 0,
-      ps: 100,
       rules: [mockRule(), mockRule()],
-      total: 0,
+      paging: mockPaging({
+        total: 0,
+        pageIndex: 1,
+        pageSize: 100,
+      }),
     }),
   };
 });
index 9a9f3631fce4de375d936a0a65df39bdd1e060cf..4521ea5515eb2eb328fbd240396fe57a110b3b0f 100644 (file)
@@ -250,7 +250,7 @@ exports[`should render correctly: loaded 1`] = `
               <PageActions
                 paging={
                   {
-                    "pageIndex": 0,
+                    "pageIndex": 1,
                     "pageSize": 100,
                     "total": 0,
                   }
index 016e04c619f8c039b480546efdc5d90fa6df25a3..da97a115279961ea159f1485e139ccb5d53589a6 100644 (file)
 import { find, without } from 'lodash';
 import * as React from 'react';
 import { addUserToGroup, getUsersInGroup, removeUserFromGroup } from '../../../api/user_groups';
-import { ResetButtonLink } from '../../../components/controls/buttons';
 import Modal from '../../../components/controls/Modal';
 import SelectList, {
   SelectListFilter,
   SelectListSearchParams,
 } from '../../../components/controls/SelectList';
+import { ResetButtonLink } from '../../../components/controls/buttons';
 import { translate } from '../../../helpers/l10n';
 import { Group, UserSelected } from '../../../types/types';
 
@@ -88,7 +88,7 @@ export default class EditMembersModal extends React.PureComponent<Props, State>
             lastSearchParams: searchParams,
             loading: false,
             users,
-            usersTotalCount: data.total,
+            usersTotalCount: data.paging.total,
             selectedUsers,
           };
         });
index 799dc108c9f7fecdfb3edb0ae8bf9c9b809f4caf..76d326fad4950536dd0ef4974e0f49fa799ea3e4 100644 (file)
 import { DeferredSpinner } from 'design-system/lib';
 import * as React from 'react';
 import { getUsersInGroup } from '../../../api/user_groups';
-import { ResetButtonLink } from '../../../components/controls/buttons';
 import ListFooter from '../../../components/controls/ListFooter';
 import Modal from '../../../components/controls/Modal';
 import SearchBox from '../../../components/controls/SearchBox';
 import { SelectListFilter } from '../../../components/controls/SelectList';
+import { ResetButtonLink } from '../../../components/controls/buttons';
 import { translate } from '../../../helpers/l10n';
 import { Group, UserGroupMember } from '../../../types/types';
 
@@ -57,7 +57,7 @@ export default function ViewMembersModal(props: Props) {
       } else {
         setUsers(data.users);
       }
-      setTotal(data.total);
+      setTotal(data.paging.total);
       setLoading(false);
     })();
   }, [query, page]);
index 1da206faff1930b5603b4cc829e9127105f2129c..2a0256818f421be012df063db8c0331bb0a7036c 100644 (file)
@@ -52,9 +52,9 @@ export default class RuleFacet extends React.PureComponent<Props> {
         : ISSUE_TYPES.filter((type) => type !== IssueType.SecurityHotspot).join(),
       s: 'name',
       include_external: true,
-    }).then((response) => ({
-      paging: { pageIndex: response.p, pageSize: response.ps, total: response.total },
-      results: response.rules,
+    }).then(({ rules, paging }) => ({
+      results: rules,
+      paging,
     }));
   };
 
index 95352a39b97c561883fedef1c894ebc597bc198a..4ada7aae19b2e7af350d929e4bed6acd864c2d96 100644 (file)
@@ -22,7 +22,7 @@ import userEvent from '@testing-library/user-event';
 import selectEvent from 'react-select-event';
 import { byRole } from 'testing-library-selector';
 import QualityProfilesServiceMock from '../../../api/mocks/QualityProfilesServiceMock';
-import { mockRule } from '../../../helpers/testMocks';
+import { mockPaging, mockRule } from '../../../helpers/testMocks';
 import { renderAppRoutes } from '../../../helpers/testReactTestingUtils';
 import routes from '../routes';
 
@@ -119,7 +119,9 @@ it('should list recently added rules', async () => {
   serviceMock.setAdmin();
   serviceMock.setRulesSearchResponse({
     rules: [mockRule({ name: 'Recently Added Rule' })],
-    total: 20,
+    paging: mockPaging({
+      total: 20,
+    }),
   });
 
   renderQualityProfiles();
index 1930cd4ad096ed012cdb19ecd366a6dc8b127915..61b0b3d4ef50603514097167383afcdaaea6aba4 100644 (file)
@@ -18,7 +18,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
-import { getProfileChangelog } from '../../../api/quality-profiles';
+import { ChangelogResponse, getProfileChangelog } from '../../../api/quality-profiles';
 import { Location, Router, withRouter } from '../../../components/hoc/withRouter';
 import DeferredSpinner from '../../../components/ui/DeferredSpinner';
 import { parseDate, toISO8601WithOffsetString } from '../../../helpers/dates';
@@ -76,12 +76,12 @@ export class ChangelogContainer extends React.PureComponent<Props, State> {
     } = this.props;
 
     getProfileChangelog(query.since, query.to, profile)
-      .then((r: any) => {
+      .then((r: ChangelogResponse) => {
         if (this.mounted) {
           this.setState({
             events: r.events,
-            total: r.total,
-            page: r.p,
+            total: r.paging.total,
+            page: r.paging.pageIndex,
             loading: false,
           });
         }
@@ -101,12 +101,12 @@ export class ChangelogContainer extends React.PureComponent<Props, State> {
       } = this.props;
 
       getProfileChangelog(query.since, query.to, profile, this.state.page + 1)
-        .then((r: any) => {
+        .then((r: ChangelogResponse) => {
           if (this.mounted && this.state.events) {
             this.setState(({ events = [] }) => ({
               events: [...events, ...r.events],
-              total: r.total,
-              page: r.p,
+              total: r.paging.total,
+              page: r.paging.pageIndex,
               loading: false,
             }));
           }
index f81f1ab97a6f876571a874ee9073ad93f19ad558..2e94f5d342a10ca6b1ff2f4008ea9ec1d8512a0e 100644 (file)
 import { shallow } from 'enzyme';
 import * as React from 'react';
 import { getProfileChangelog } from '../../../../api/quality-profiles';
-import { mockLocation, mockQualityProfile, mockRouter } from '../../../../helpers/testMocks';
+import {
+  mockLocation,
+  mockPaging,
+  mockQualityProfile,
+  mockRouter,
+} from '../../../../helpers/testMocks';
 import { mockEvent, waitAndUpdate } from '../../../../helpers/testUtils';
 import { ChangelogContainer } from '../ChangelogContainer';
 
 beforeEach(() => jest.clearAllMocks());
 
 jest.mock('../../../../api/quality-profiles', () => {
-  const { mockQualityProfileChangelogEvent } = jest.requireActual('../../../../helpers/testMocks');
+  const { mockQualityProfileChangelogEvent, mockPaging } = jest.requireActual(
+    '../../../../helpers/testMocks'
+  );
   return {
     getProfileChangelog: jest.fn().mockResolvedValue({
       events: [
@@ -35,14 +42,19 @@ jest.mock('../../../../api/quality-profiles', () => {
         mockQualityProfileChangelogEvent(),
         mockQualityProfileChangelogEvent(),
       ],
-      total: 6,
-      p: 1,
+      paging: mockPaging({
+        total: 6,
+        pageIndex: 1,
+      }),
     }),
   };
 });
 
 it('should render correctly without events', async () => {
-  (getProfileChangelog as jest.Mock).mockResolvedValueOnce({ events: [] });
+  (getProfileChangelog as jest.Mock).mockResolvedValueOnce({
+    events: [],
+    paging: mockPaging({ total: 0 }),
+  });
   const wrapper = shallowRender();
   await waitAndUpdate(wrapper);
   expect(wrapper).toMatchSnapshot();
index da7731bb34f03bb2bdeed13602a0631fea13d101..b58616490dfe79c9384f0c04d7c2f876f885bec5 100644 (file)
@@ -22,8 +22,8 @@ import * as React from 'react';
 import { getQualityProfile } from '../../../api/quality-profiles';
 import { searchRules, takeFacet } from '../../../api/rules';
 import Link from '../../../components/common/Link';
-import { Button } from '../../../components/controls/buttons';
 import Tooltip from '../../../components/controls/Tooltip';
+import { Button } from '../../../components/controls/buttons';
 import { translate } from '../../../helpers/l10n';
 import { getRulesUrl } from '../../../helpers/urls';
 import { Dict } from '../../../types/types';
@@ -117,11 +117,11 @@ export default class ProfileRules extends React.PureComponent<Props, State> {
         if (this.mounted) {
           const [allRules, activatedRules, showProfile] = responses;
           this.setState({
-            activatedTotal: activatedRules.total,
+            activatedTotal: activatedRules.paging.total,
             allByType: keyBy<ByType>(takeFacet(allRules, 'types'), 'val'),
             activatedByType: keyBy<ByType>(takeFacet(activatedRules, 'types'), 'val'),
             compareToSonarWay: showProfile && showProfile.compareToSonarWay,
-            total: allRules.total,
+            total: allRules.paging.total,
           });
         }
       }
index 3b9eda6fca03f445d7c7391db04e1459dc54a4d1..005c1a58f6b8fb97197c189f0d9898a6d8786da8 100644 (file)
@@ -20,7 +20,7 @@
 import { shallow } from 'enzyme';
 import * as React from 'react';
 import { getQualityProfile } from '../../../../api/quality-profiles';
-import { mockQualityProfile } from '../../../../helpers/testMocks';
+import { mockPaging, mockQualityProfile } from '../../../../helpers/testMocks';
 import { waitAndUpdate } from '../../../../helpers/testUtils';
 import ProfileRules from '../ProfileRules';
 
@@ -35,7 +35,6 @@ const PROFILE = mockQualityProfile({
 const EDITABLE_PROFILE = { ...PROFILE, actions: { edit: true } };
 
 const apiResponseAll = {
-  total: 253,
   facets: [
     {
       property: 'types',
@@ -47,10 +46,12 @@ const apiResponseAll = {
       ],
     },
   ],
+  paging: mockPaging({
+    total: 253,
+  }),
 };
 
 const apiResponseActive = {
-  total: 68,
   facets: [
     {
       property: 'types',
@@ -62,6 +63,9 @@ const apiResponseActive = {
       ],
     },
   ],
+  paging: mockPaging({
+    total: 68,
+  }),
 };
 
 jest.mock('../../../../api/rules', () => ({
@@ -90,7 +94,7 @@ beforeEach(jest.clearAllMocks);
 
 it('should render the quality profiles rules with sonarway comparison', async () => {
   const wrapper = shallow(<ProfileRules profile={PROFILE} />);
-  const instance = wrapper.instance() as any;
+  const instance = wrapper.instance() as ProfileRules;
   instance.mounted = true;
   instance.loadRules();
   await waitAndUpdate(wrapper);
index a087612cbe6a09e741ef3d8afb78c614f76beb06..d45a5ebb11b449261e15726a2e0b6dd776eec3ab 100644 (file)
@@ -76,7 +76,7 @@ export default class EvolutionRules extends React.PureComponent<{}, State> {
     };
 
     searchRules(data).then(
-      ({ actives, rules, total }) => {
+      ({ actives, rules, paging: { total } }) => {
         if (this.mounted) {
           this.setState({
             latestRules: sortBy(parseRules(rules, actives), 'langName'),
index 6094dc2faf7895c02119e0adcaf8fc320ec5b8ba..e5cecd36c8e1b4835a2ef4ca97b42905e9516ac2 100644 (file)
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
-import { Dict, Rule, RuleActivation } from './types';
+import { Dict, Paging, Rule, RuleActivation } from './types';
 
 export interface RuleRepository {
   key: string;
@@ -33,8 +33,6 @@ export interface GetRulesAppResponse {
 export interface SearchRulesResponse {
   actives?: Dict<RuleActivation[]>;
   facets?: { property: string; values: { count: number; val: string }[] }[];
-  p: number;
-  ps: number;
   rules: Rule[];
-  total: number;
+  paging: Paging;
 }