Uploaded image for project: 'ERM Platform'
  1. ERM Platform
  2. ERM-2634

If an agreement or license has >10 contacts they do not all display correctly



    • ERM Sprint 159
    • Bienenvolk
    • Orchid (R1 2023)
    • Data related (ex. Can be detected with large dataset only)


      If an agreement or license has >10 internal contacts, then when viewing or editing the agreement or license only 10 of the contacts display information (name/phone/email).

      This is because we do not fetch using the correct syntax using a limit parameter etc.

      Steps to Reproduce:

      1. Create an agreement
      2. Add more than 10 "internal contacts" to the agreement or license
      3. Save the agreement or license
      4. View or edit the agreement or license
      5. View the internal contacts

      Expected Results:
      All internal contacts display correctly with full details

      Actual Results:
      A maximum of 10 internal contacts display correctly with full details

      Additional Information:
      There is a fetch to `/users` with a query listing the user UUIDs, but no "limit" parameter is included so only 10 are returned. We can specify a limit parameter=1000 to get more (as we do for example to populate the internal contact filter.

      Note that the query when viewing a single agreement also differs in the query syntax used using only a single `=` in the query:
      rather than
      }}used when we fetch for the filter


      Dev task breakdown

      We should add a limit=1000 to the useUsers hook in  stripes-erm-components, as this will affect multiple places in our codebase.

      Changing this line to something like:

        const query = userIds.map(uid => `id==${uid}`).join(' or ') ?? [];
        if (query.length) {
          query += "&limit=1000"

      This code change has not been checked, needs testing against network tabs output and payload chekcing to make sure query is as expected and returned values are as expected.

      The code is a little odd at the minute. If no ids are passed then query is an empty array, and behaviour expects this. This could be neatened as part of this work to make sure query is an empty string instead if no ids are present, and if that's done it is important to check that it works both when no ids are passed and when some are, for example while the list of relevant ids loads in the implementing code.

      Also make sure the equivalence operator in the query is `==` as this is CQL exact match operator which should be used in this case

      TestRail: Results


          Issue Links



                ostephens Owen Stephens
                ostephens Owen Stephens
                0 Vote for this issue
                1 Start watching this issue



                  TestRail: Runs

                    TestRail: Cases