Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore total patron count. (PP-1744) #137

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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