Skip to content

Conversation

@rmathew1011
Copy link

@rmathew1011 rmathew1011 commented Sep 10, 2025

Description

  • Added totalPeopleCount variable to template

  • Wrapped page subscription in this.subscriptions.push() to update totalPeopleCount from SdrPage (which extends Page).

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Testing Procedures

Tested this new feature on local set up - here is a snapshot:
Screenshot 2025-09-12 at 9 23 07 AM

@rmathew1011 rmathew1011 marked this pull request as ready for review September 10, 2025 22:37
@rmathew1011 rmathew1011 requested a review from a team September 10, 2025 22:43
@rmathew1011 rmathew1011 linked an issue Sep 12, 2025 that may be closed by this pull request
@rmathew1011 rmathew1011 merged commit 9eefdfe into sprint11-staging Sep 12, 2025
@tamu-sad-iii
Copy link

tamu-sad-iii commented Sep 13, 2025

This isn't the correct approach. You do not need to subscribe to the observable in the component and there is no need for an additional component public variable. It is not a good practice to manage subscriptions in the components. This is common throughout and should be refactored where possible.

Use async pipe and create scope local variable page and get the totalElements from the local scope page object.

Like this.

        <span id="sidebar-title" class="h4 text-primary" *ngIf="page | async; let page">
          <span>{{discoveryView.name}}</span>
          <span>{{page.totalElements}} {{discoveryView.name}}</span>
          <span *ngIf="query | async; let query">
            <span> {{ 'DISCOVERY.RESULTS' | translate }}:</span>
            <span> {{query}}</span>
          </span>
        </span>

I believe there is a new syntax for assigning scope local variables in the template and the conditional branches is considerable different and will require factoring of all component templates using *ngIf directive. This should happen in tandem when upgrading and converting the components to standalone components.

@rmathew1011 rmathew1011 deleted the 463-total-people-count-for-search-result branch September 19, 2025 14:28
@rmathew1011 rmathew1011 mentioned this pull request Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In Discovery View: Add a count for search results

4 participants