@cat-factory/app 0.267.0 → 0.268.1

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.
@@ -0,0 +1,69 @@
1
+ <script setup lang="ts">
2
+ // One risk policy this board INHERITS from its account (ADR 0055): read-only, with the two actions
3
+ // a board actually has over a row it does not own.
4
+ //
5
+ // A summary rather than a disabled copy of the editor. Rendering the full form greyed out would
6
+ // suggest the numbers are a click away from editable when the remedy is a different act entirely
7
+ // (clone it, then edit the copy), and it would put twenty inert controls on screen to say so. The
8
+ // summary itself is `RiskPolicyPreview`, the same component the task picker explains a policy with,
9
+ // so what a policy MEANS is worded one way everywhere.
10
+ import type { RiskPolicyLibraryEntry } from '~/types/merge'
11
+ import RiskPolicyPreview from '~/components/riskPolicy/RiskPolicyPreview.vue'
12
+
13
+ defineProps<{
14
+ policy: RiskPolicyLibraryEntry
15
+ /** Which single control is mid-request, keyed `<policyId>:<action>` by the owning panel. */
16
+ busy: string | null
17
+ }>()
18
+
19
+ const emit = defineEmits<{ clone: []; hide: [] }>()
20
+
21
+ const { t } = useI18n()
22
+ </script>
23
+
24
+ <template>
25
+ <div
26
+ class="rounded-lg border border-slate-700/70 bg-slate-900/30 p-3"
27
+ data-testid="risk-policy-inherited-row"
28
+ :data-policy-id="policy.id"
29
+ :data-policy-tier="policy.tier"
30
+ >
31
+ <div class="mb-2 flex flex-wrap items-center justify-end gap-2">
32
+ <UBadge
33
+ color="neutral"
34
+ variant="subtle"
35
+ size="sm"
36
+ class="mr-auto"
37
+ :title="t('settings.riskPolicy.tier.accountHint')"
38
+ >
39
+ {{ t('settings.riskPolicy.tier.account') }}
40
+ </UBadge>
41
+ <UButton
42
+ color="neutral"
43
+ variant="ghost"
44
+ size="xs"
45
+ icon="i-lucide-copy"
46
+ :loading="busy === `${policy.id}:clone`"
47
+ :title="t('settings.riskPolicy.inherited.cloneHint')"
48
+ data-testid="risk-policy-clone"
49
+ @click="emit('clone')"
50
+ >
51
+ {{ t('settings.riskPolicy.inherited.clone') }}
52
+ </UButton>
53
+ <UButton
54
+ color="neutral"
55
+ variant="ghost"
56
+ size="xs"
57
+ icon="i-lucide-eye-off"
58
+ :loading="busy === `${policy.id}:hide`"
59
+ :title="t('settings.riskPolicy.inherited.hideHint')"
60
+ data-testid="risk-policy-hide"
61
+ @click="emit('hide')"
62
+ >
63
+ {{ t('settings.riskPolicy.inherited.hide') }}
64
+ </UButton>
65
+ </div>
66
+
67
+ <RiskPolicyPreview :policy="policy" />
68
+ </div>
69
+ </template>