@terpjs/react-core 0.31.0 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -5
- package/package.json +5 -5
- package/src/Breadcrumbs.test.tsx +78 -0
- package/src/Breadcrumbs.tsx +38 -5
- package/src/ModuleNav.test.tsx +29 -1
- package/src/ModuleNav.tsx +5 -1
- package/src/Page.tsx +16 -3
- package/src/Stat.test.tsx +35 -0
- package/src/Stat.tsx +3 -1
- package/src/WorkspacePage.test.tsx +69 -0
- package/src/WorkspacePage.tsx +103 -0
- package/src/admin/AdminHub.tsx +233 -86
- package/src/admin/GroupDetail.tsx +1 -1
- package/src/admin/RecordHistory.tsx +5 -0
- package/src/admin/UserDetail.tsx +1 -1
- package/src/admin/admin.test.tsx +233 -14
- package/src/charts/TrendChart.tsx +24 -18
- package/src/charts/charts.test.tsx +11 -0
- package/src/currentInView.ts +28 -0
- package/src/dataview/DataView.test.tsx +48 -1
- package/src/dataview/DataView.tsx +18 -3
- package/src/dataview/DataViewToolbar.tsx +4 -1
- package/src/index.ts +2 -0
- package/src/layoutContract.test.tsx +62 -1
- package/src/layoutContract.ts +12 -0
- package/src/locale.tsx +8 -0
- package/src/markers.test.ts +4 -0
- package/src/router.test.tsx +1 -1
- package/src/router.tsx +19 -1
- package/src/styles.test.ts +241 -2
- package/src/styles.ts +234 -39
- package/src/trailMemory.ts +56 -0
- package/src/ui/Tabs.test.tsx +44 -0
- package/src/ui/Tabs.tsx +5 -2
- package/src/uiText.tsx +30 -1
- package/src/viewerTimeZone.ts +15 -0
package/src/uiText.tsx
CHANGED
|
@@ -193,8 +193,29 @@ export interface TerpStrings {
|
|
|
193
193
|
statUnfavourable: string;
|
|
194
194
|
/** A figure's sparkline as text; `{points}` is the listed points, each a label and a value. */
|
|
195
195
|
statTrend: string;
|
|
196
|
-
/**
|
|
196
|
+
/**
|
|
197
|
+
* Named the total on the admin hub's users and groups cards until the hub became a dashboard,
|
|
198
|
+
* whose figures name what they count. Not read by the framework since; kept because a
|
|
199
|
+
* catalog that leaves out a framework string, or carries one the framework does not know, is
|
|
200
|
+
* refused, so an app's catalog written for 0.31.0 still loads.
|
|
201
|
+
*/
|
|
197
202
|
adminHubTotal: string;
|
|
203
|
+
/** The admin hub's headline figure: the accounts that can sign in. */
|
|
204
|
+
adminHubActiveAccounts: string;
|
|
205
|
+
/** Under that figure; `{count}` is the number of deactivated accounts. */
|
|
206
|
+
adminHubDeactivated: string;
|
|
207
|
+
/** The admin hub's figure for the audit trail's last days; `{count}` is how many. */
|
|
208
|
+
adminHubChangesWeek: string;
|
|
209
|
+
/** What that figure's change is measured against. */
|
|
210
|
+
adminHubVsWeekBefore: string;
|
|
211
|
+
/** The admin hub's chart of the trail per day. */
|
|
212
|
+
adminHubChangesPerDay: string;
|
|
213
|
+
/** That chart's series; `{count}` is how many days it draws. */
|
|
214
|
+
adminHubLastDays: string;
|
|
215
|
+
/** That chart's comparison, drawn dashed; `{count}` is how many days it covers. */
|
|
216
|
+
adminHubDaysBefore: string;
|
|
217
|
+
/** The admin hub's share of each kind of change; `{count}` is how many days it covers. */
|
|
218
|
+
adminHubChangesByKind: string;
|
|
198
219
|
/** A status history read out; `{label}` is what ran and `{runs}` the listed runs, each a label and its ending. */
|
|
199
220
|
statusHistoryRuns: string;
|
|
200
221
|
/** A record's own history, from the audit trail, on its admin screen: the section's title. */
|
|
@@ -552,6 +573,14 @@ export const DEFAULT_STRINGS: TerpStrings = {
|
|
|
552
573
|
statUnfavourable: "unfavourable",
|
|
553
574
|
statTrend: "Over time: {points}",
|
|
554
575
|
adminHubTotal: "Total",
|
|
576
|
+
adminHubActiveAccounts: "Active accounts",
|
|
577
|
+
adminHubDeactivated: "{count} deactivated",
|
|
578
|
+
adminHubChangesWeek: "Changes, last {count} days",
|
|
579
|
+
adminHubVsWeekBefore: "vs the week before",
|
|
580
|
+
adminHubChangesPerDay: "Changes per day",
|
|
581
|
+
adminHubLastDays: "Last {count} days",
|
|
582
|
+
adminHubDaysBefore: "The {count} days before",
|
|
583
|
+
adminHubChangesByKind: "Changes by kind, last {count} days",
|
|
555
584
|
statusHistoryRuns: "{label}, oldest first: {runs}",
|
|
556
585
|
recordHistory: "History",
|
|
557
586
|
auditActionCreated: "Created",
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The viewer's own time zone, as an IANA name, or `UTC` where the host cannot say.
|
|
3
|
+
*
|
|
4
|
+
* The one question about the host the app has no answer of its own for. Dates are formatted in
|
|
5
|
+
* the app's locale everywhere, but a calendar day is the viewer's: the admin hub counts the
|
|
6
|
+
* audit trail in the days of whoever is looking at it (ADR 0171). Its own module so the
|
|
7
|
+
* locale gate's allowance covers this one read and nothing that might format beside it.
|
|
8
|
+
*/
|
|
9
|
+
export function viewerTimeZone(): string {
|
|
10
|
+
try {
|
|
11
|
+
return Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
|
|
12
|
+
} catch {
|
|
13
|
+
return "UTC";
|
|
14
|
+
}
|
|
15
|
+
}
|