Skip to content

Commit

Permalink
Restore total patron count. (PP-1744) (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdilauro authored Sep 27, 2024
1 parent 2ddcc4f commit a83177a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/components/LibraryStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const LibraryStats = ({ stats, library }: LibraryStatsProps) => {
<ul className={`stats ${statsLayoutClass}`}>
<li className="stat-group stat-patrons-group">
<StatsPatronGroup
total={patrons.total}
withActiveLoan={patrons.withActiveLoan}
withActiveLoanOrHold={patrons.withActiveLoanOrHold}
heading="Current Circulation Activity"
Expand Down
1 change: 0 additions & 1 deletion src/components/SingleStatListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from "react";
import * as numeral from "numeral";
import { formatNumber, roundedNumber } from "../utils/sharedFunctions";

export interface SingleStatListItemProps {
Expand Down
10 changes: 9 additions & 1 deletion src/components/StatsPatronGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@ const StatsPatronGroup = ({
<SingleStatListItem
label="Total Patrons"
value={total}
tooltip="Total number of patrons in the Palace System."
tooltip={`
Total number of patrons in the Palace System.
Please note:
this number could be artificially inflated if you have an
Aspen integration. We are working to address the issue and
will update you when it’s resolved.
`
.replace(/(?:\s|\r\n|\r|\n)+/g, " ")
.trim()}
/>
)}
<SingleStatListItem
Expand Down
7 changes: 4 additions & 3 deletions src/components/__tests__/LibraryStats-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,14 @@ describe("LibraryStats", () => {
/* Patrons */
expect(groups.at(0).text()).to.contain("Current Circulation Activity");
statItems = groups.at(0).find("SingleStatListItem");
expect(statItems.length).to.equal(2);
expectStats(statItems.at(0).props(), "Patrons With Active Loans", 21);
expectStats(statItems.at(0).props(), "Total Patrons", 132);
expectStats(statItems.at(1).props(), "Patrons With Active Loans", 21);
expectStats(
statItems.at(1).props(),
statItems.at(2).props(),
"Patrons With Active Loans or Holds",
23
);
expect(groups.at(0).text()).to.contain("132Total Patrons");
expect(groups.at(0).text()).to.contain("21Patrons With Active Loans");
expect(groups.at(0).text()).to.contain(
"23Patrons With Active Loans or Holds"
Expand Down

0 comments on commit a83177a

Please sign in to comment.