Keep listed published rules public and guest-claim rules unlisted, with semantic document markup and share chrome that stays clickable.
Guest publishes remain share-by-link but stay out of the catalog and sitemap, and their pages send noindex until claimed. The published-rule view now uses heading and list markup matching Markdown export, and top banners sit below the header so Share is not covered. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
77b0ec8ad8
commit
1445cb7e1e
27 files changed
+524
-86
No files matched your search
@@ -0,0 +1,36 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
LISTED_PUBLISHED_RULE_WHERE,
|
||||
isListedPublishedRule,
|
||||
} from "../../lib/publishedRuleAccess";
|
||||
|
||||
describe("isListedPublishedRule", () => {
|
||||
it("lists owned rules", () => {
|
||||
expect(
|
||||
isListedPublishedRule({ userId: "user-1", claimTokenHash: null }),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("lists ownerless rows that are not waiting on a guest claim", () => {
|
||||
expect(isListedPublishedRule({ userId: null, claimTokenHash: null })).toBe(
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
it("keeps guest-claim rows unlisted", () => {
|
||||
expect(
|
||||
isListedPublishedRule({
|
||||
userId: null,
|
||||
claimTokenHash: "claim-hash",
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("LISTED_PUBLISHED_RULE_WHERE", () => {
|
||||
it("matches owned rows or rows with no claim token", () => {
|
||||
expect(LISTED_PUBLISHED_RULE_WHERE).toEqual({
|
||||
OR: [{ userId: { not: null } }, { claimTokenHash: null }],
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user