Give finished Rules a print path, folded launch counts, and a two-day follow-up.
Export is PDF, RULE.md, and Print on US Letter, with every shared term, no member names, and a takeaway that points at Ask an organizer. Finished Rules keep type and place so the team can read folded counts without a database, Umami can sit beside the app with no cookies, and the person who holds the pen gets working PDF and RULE.md links 48 hours later.
This commit is contained in:
1 parent
0efc907633
commit
d9c475a967
74 files changed
+2401
-630
No files matched your search
@@ -12,7 +12,10 @@ import { communityPossessive } from "../../../../lib/create/ruleInviteCardMeta";
|
||||
import { CREATE_FLOW_COPIED_QUERY, CREATE_FLOW_COPIED_VALUE } from "../../../../lib/create/invitePaths";
|
||||
import { formatInviteLastChanged } from "../../../../lib/create/inviteLastChanged";
|
||||
import { writeLastPublishedRule } from "../../../../lib/create/lastPublishedRule";
|
||||
import { downloadStoredRuleAsPdf } from "../../../../lib/create/ruleExport";
|
||||
import {
|
||||
downloadStoredRuleAsPdf,
|
||||
printStoredRule,
|
||||
} from "../../../../lib/create/ruleExport";
|
||||
import { createCompletedPath } from "../../create/utils/createFlowPaths";
|
||||
import { CreateFlowHeaderLockup } from "../../create/components/CreateFlowHeaderLockup";
|
||||
import { useCreateFlowMdUp } from "../../create/hooks/useCreateFlowMdUp";
|
||||
@@ -79,18 +82,34 @@ export function InvitedRuleView({
|
||||
|
||||
const handlePdf = useCallback(() => {
|
||||
try {
|
||||
downloadStoredRuleAsPdf({
|
||||
id: ruleId,
|
||||
title,
|
||||
summary,
|
||||
document,
|
||||
});
|
||||
downloadStoredRuleAsPdf(
|
||||
{
|
||||
id: ruleId,
|
||||
title,
|
||||
summary,
|
||||
document,
|
||||
},
|
||||
window.location.origin,
|
||||
);
|
||||
setExportError(false);
|
||||
} catch {
|
||||
setExportError(true);
|
||||
}
|
||||
}, [document, ruleId, summary, title]);
|
||||
|
||||
const handlePrint = useCallback(() => {
|
||||
const opened = printStoredRule(
|
||||
{
|
||||
id: ruleId,
|
||||
title,
|
||||
summary,
|
||||
document,
|
||||
},
|
||||
window.location.origin,
|
||||
);
|
||||
setExportError(!opened);
|
||||
}, [document, ruleId, summary, title]);
|
||||
|
||||
const handleCopy = useCallback(
|
||||
async (communityName: string) => {
|
||||
setCopyBusy(true);
|
||||
@@ -194,7 +213,7 @@ export function InvitedRuleView({
|
||||
size="xsmall"
|
||||
type="button"
|
||||
className={outlineButtonClass}
|
||||
onClick={() => window.print()}
|
||||
onClick={handlePrint}
|
||||
>
|
||||
{t("print")}
|
||||
</Button>
|
||||
|
||||
Reference in new issue
Block a user