@simmalugnt-se/payload-content-health 0.10.2 → 0.10.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.3
4
+
5
+ - The work list's labels (documents, language, draft) are Payload's own pills, so they follow
6
+ Admin's theme.
7
+
3
8
  ## 0.10.2
4
9
 
5
10
  - The assistant's findings name checks and categories as the work list does, in the editor's chat
@@ -240,19 +240,6 @@
240
240
  font-size: 0.9em;
241
241
  }
242
242
 
243
- .content-health-list__pill {
244
- padding: 0 calc(var(--base) * 0.3);
245
- border-radius: var(--style-radius-s);
246
- background: var(--theme-elevation-100);
247
- color: var(--theme-elevation-800);
248
- font-size: 0.8em;
249
- text-transform: uppercase;
250
- }
251
-
252
- .content-health-list__pill--draft {
253
- text-transform: none;
254
- }
255
-
256
243
  .content-health-list__empty {
257
244
  margin: 0;
258
245
  padding: var(--base) 0;
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { Button, Link, ReactSelect } from "@payloadcms/ui";
3
+ import { Button, Link, Pill, ReactSelect } from "@payloadcms/ui";
4
4
  import { useId, useMemo, useState } from "react";
5
5
  import { categoryOf } from "../categories.js";
6
6
  import { LIST_COPY } from "../copy.js";
@@ -59,7 +59,7 @@ function Section({ adminRoute, ask, copy, filters, rows, }) {
59
59
  const batchHref = ask && targets.length > 1
60
60
  ? batchURL(adminRoute, { ...filters, check }, targets, ask)
61
61
  : undefined;
62
- return (_jsxs("section", { className: "content-health-list__section", children: [_jsxs("header", { className: "content-health-list__section-head", children: [_jsx("h2", { children: rows[0]?.checkLabel }), _jsx("span", { className: "content-health-list__pill", children: copy.documents(documents) }), batchHref ? (_jsx(Button, { buttonStyle: "secondary", className: "content-health-list__batch", el: "link", margin: false, size: "small", url: batchHref, children: copy.fixMany(Math.min(targets.length, MAX_BATCH_TARGETS), targets.length) })) : null] }), !BATCH_CHECKS[check] && rows.some((row) => row.askHref) ? (_jsx("p", { className: "content-health-list__detail", children: copy.individualFix })) : null, _jsx("ul", { className: "content-health-list__items", children: rows.map((row) => (_jsxs("li", { className: "content-health-list__item", children: [_jsx(Link, { href: row.href, prefetch: false, children: row.title }), row.locale ? _jsx("span", { className: "content-health-list__pill", children: row.locale }) : null, row.draft ? (_jsx("span", { className: "content-health-list__pill content-health-list__pill--draft", children: copy.draft })) : null, row.detail ? _jsx("span", { className: "content-health-list__detail", children: row.detail }) : null, row.askHref ? (_jsx(Link, { className: "content-health-list__fix", href: row.askHref, prefetch: false, children: copy.fix })) : null] }, row.key))) })] }));
62
+ return (_jsxs("section", { className: "content-health-list__section", children: [_jsxs("header", { className: "content-health-list__section-head", children: [_jsx("h2", { children: rows[0]?.checkLabel }), _jsx(Pill, { pillStyle: "light-gray", size: "small", children: copy.documents(documents) }), batchHref ? (_jsx(Button, { buttonStyle: "secondary", className: "content-health-list__batch", el: "link", margin: false, size: "small", url: batchHref, children: copy.fixMany(Math.min(targets.length, MAX_BATCH_TARGETS), targets.length) })) : null] }), !BATCH_CHECKS[check] && rows.some((row) => row.askHref) ? (_jsx("p", { className: "content-health-list__detail", children: copy.individualFix })) : null, _jsx("ul", { className: "content-health-list__items", children: rows.map((row) => (_jsxs("li", { className: "content-health-list__item", children: [_jsx(Link, { href: row.href, prefetch: false, children: row.title }), row.locale ? (_jsx(Pill, { pillStyle: "light-gray", size: "small", children: row.locale.toUpperCase() })) : null, row.draft ? (_jsx(Pill, { pillStyle: "warning", size: "small", children: copy.draft })) : null, row.detail ? _jsx("span", { className: "content-health-list__detail", children: row.detail }) : null, row.askHref ? (_jsx(Link, { className: "content-health-list__fix", href: row.askHref, prefetch: false, children: copy.fix })) : null] }, row.key))) })] }));
63
63
  }
64
64
  function Filter({ all, label, onChange, options, value, }) {
65
65
  const inputId = useId();
@@ -30,6 +30,7 @@ export async function ContentHealthWidget({ req, widgetData }) {
30
30
  const failing = stats.reduce((sum, stat) => sum + stat.failing, 0);
31
31
  const documents = Object.values(result.documents).reduce((sum, count) => sum + count, 0);
32
32
  const adminRoute = req.payload.config.routes.admin;
33
+ // A panel of our own: Payload's `Card` is a link to one collection, not a summary with categories.
33
34
  return (_jsxs("section", { className: "content-health", children: [_jsx("h2", { className: "content-health__heading", children: copy.title }), _jsxs("div", { className: "content-health__panel", children: [_jsxs("div", { className: "content-health__overview", children: [_jsx(Ring, { className: "content-health__ring", failing: failing, label: copy.ok(total - failing, total), total: total }), _jsxs("div", { className: "content-health__overview-text", children: [_jsx("p", { className: "content-health__overall", children: copy.overall }), _jsx("p", { className: "content-health__summary", children: result.findings.length
34
35
  ? copy.summary(countDocuments(result.findings), documents)
35
36
  : copy.allGood })] }), _jsx(Button, { buttonStyle: "secondary", el: "link", margin: false, size: "small", url: listURL(adminRoute), children: copy.openDetails })] }), _jsx("ul", { className: "content-health__categories", children: categories.map((stat) => (_jsx(CategoryRow, { adminRoute: adminRoute, language: language, stat: stat }, stat.category))) }), result.problems.length ? (_jsxs("div", { className: "content-health__problems", children: [_jsx("p", { children: copy.problems }), _jsx("ul", { children: result.problems.map((problem) => (_jsx("li", { children: problem }, problem))) })] })) : null] })] }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simmalugnt-se/payload-content-health",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "description": "Content health checks and dashboard widgets for Payload Admin: alt texts, SEO fields and more",
5
5
  "keywords": [
6
6
  "payload",