@saasicat/ui-vue 0.2.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/LICENSE +202 -0
- package/README.md +47 -0
- package/dist/index.cjs +3776 -0
- package/dist/index.d.cts +2395 -0
- package/dist/index.d.ts +2395 -0
- package/dist/index.js +3659 -0
- package/dist/testing-e2e/admin-pages-suite.cjs +134 -0
- package/dist/testing-e2e/admin-pages-suite.d.cts +37 -0
- package/dist/testing-e2e/admin-pages-suite.d.ts +37 -0
- package/dist/testing-e2e/admin-pages-suite.js +109 -0
- package/package.json +87 -0
- package/src/action-registry.ts +110 -0
- package/src/batch-column-fetcher.ts +152 -0
- package/src/boot-loader.ts +60 -0
- package/src/components/BundleVersionPublishDialog.vue +359 -0
- package/src/components/BusinessTypeVersionEditorDialog.vue +417 -0
- package/src/components/BusinessTypeVersionPublishDialog.vue +258 -0
- package/src/components/FeatureGate.vue +56 -0
- package/src/components/KpiCard.vue +53 -0
- package/src/components/KvBlock.vue +36 -0
- package/src/components/MarketingPromotionsTab.vue +861 -0
- package/src/components/MfaPromptDialog.vue +104 -0
- package/src/components/TenantActionConfirmDialog.vue +252 -0
- package/src/components/VersionDiffPreview.vue +150 -0
- package/src/components/bundle-editor/BundleCreatePanel.vue +681 -0
- package/src/components/bundle-editor/BundleFeaturesEditor.vue +215 -0
- package/src/components/bundle-editor/BundlePlanCompatPicker.vue +316 -0
- package/src/components/bundle-editor/BundleQuotasEditor.vue +219 -0
- package/src/components/bundle-editor/BundleStatusBanner.vue +189 -0
- package/src/components/bundle-editor/BundleVersionInlineEditor.vue +659 -0
- package/src/components/bundle-editor/BundleVersionStrip.vue +207 -0
- package/src/components/bundle-editor/bundle-version-status.ts +164 -0
- package/src/components/bundle-editor/catalog-i18n.ts +85 -0
- package/src/components/dialogs/PilotCreateDialog.vue +780 -0
- package/src/components/dialogs/PilotEditDialog.vue +548 -0
- package/src/components/dialogs/PromoCodeCreateDialog.vue +737 -0
- package/src/components/dialogs/PromoCodeEditDialog.vue +859 -0
- package/src/components/dialogs/types.ts +126 -0
- package/src/components/plan/PlanCycleToggle.vue +99 -0
- package/src/components/plan/PlanGrid.vue +211 -0
- package/src/components/plan/PriceSummary.vue +293 -0
- package/src/components/plan/PromoCodeInput.vue +192 -0
- package/src/components/plan/PublicBundleGrid.vue +287 -0
- package/src/components/plan-cockpit/PlanCockpit.vue +993 -0
- package/src/components/plan-cockpit/PlanCockpitAuditLog.vue +65 -0
- package/src/components/plan-cockpit/PlanCockpitDiffPanel.vue +91 -0
- package/src/components/plan-cockpit/PlanCockpitHeader.vue +98 -0
- package/src/components/plan-cockpit/PlanCockpitImpactPanel.vue +99 -0
- package/src/components/plan-cockpit/PlanCockpitKpis.vue +57 -0
- package/src/components/plan-cockpit/PlanCockpitVersions.vue +226 -0
- package/src/components/plan-cockpit/types.ts +72 -0
- package/src/components/plan-create-dialog/PlanCreateDialog.vue +508 -0
- package/src/components/plan-detail/PlanAuditLog.vue +59 -0
- package/src/components/plan-detail/PlanDetail.vue +1195 -0
- package/src/components/plan-detail/PlanDetailHeader.vue +185 -0
- package/src/components/plan-detail/PlanDetailKpis.vue +57 -0
- package/src/components/plan-detail/PlanTerminateDialog.vue +76 -0
- package/src/components/plan-detail/PlanVersionDiffPanel.vue +149 -0
- package/src/components/plan-detail/PlanVersionsPanel.vue +255 -0
- package/src/components/plan-detail/types.ts +59 -0
- package/src/components/plan-list/PlanList.vue +1067 -0
- package/src/components/plan-matrix/PlanMatrix.vue +1113 -0
- package/src/components/plan-review/PlanReview.vue +742 -0
- package/src/components/plan-version-editor/PlanCatalogPreview.vue +184 -0
- package/src/components/plan-version-editor/PlanComponentPool.vue +272 -0
- package/src/components/plan-version-editor/PlanVersionBasket.vue +281 -0
- package/src/components/plan-version-editor/PlanVersionDiffDialog.vue +84 -0
- package/src/components/plan-version-editor/PlanVersionEditor.vue +1728 -0
- package/src/components/plan-version-editor/PlanVersionEditorHeader.vue +94 -0
- package/src/components/plan-version-editor/types.ts +96 -0
- package/src/components/wizard-stepper/WizardStepper.vue +107 -0
- package/src/create-admin-routes.ts +68 -0
- package/src/create-super-admin-app.ts +345 -0
- package/src/entitlement-provider.ts +36 -0
- package/src/feature-router-guard.ts +77 -0
- package/src/http-json.ts +62 -0
- package/src/index.ts +98 -0
- package/src/manifest-loader.ts +139 -0
- package/src/manifest-store-factory.ts +114 -0
- package/src/nav-builder.ts +274 -0
- package/src/pages-standard/AdminLayout.vue +411 -0
- package/src/pages-standard/AdminManifestErrorPage.vue +79 -0
- package/src/pages-standard/AuditPage.vue +223 -0
- package/src/pages-standard/BundlesPage.vue +910 -0
- package/src/pages-standard/BusinessTypesPage.vue +662 -0
- package/src/pages-standard/DashboardPage.vue +595 -0
- package/src/pages-standard/DiscoveryPage.vue +663 -0
- package/src/pages-standard/EmailHistoryPage.vue +576 -0
- package/src/pages-standard/MarketingCatalogPage.vue +1771 -0
- package/src/pages-standard/PilotsPage.vue +577 -0
- package/src/pages-standard/PlanVersionsPage.vue +216 -0
- package/src/pages-standard/PlansPage.vue +1222 -0
- package/src/pages-standard/PlatformEmailPage.vue +434 -0
- package/src/pages-standard/PromoCodeDetailPage.vue +331 -0
- package/src/pages-standard/PromoCodesPage.vue +589 -0
- package/src/pages-standard/SubscriptionsPage.vue +159 -0
- package/src/pages-standard/SuperAdminLoginPage.vue +299 -0
- package/src/pages-standard/SuperAdminSetupWizard.vue +405 -0
- package/src/pages-standard/TenantDetailPage.vue +432 -0
- package/src/pages-standard/TenantsPage.vue +732 -0
- package/src/pages-standard/UsersPage.vue +504 -0
- package/src/pages-standard/bundles-page/BundleAccordionList.vue +116 -0
- package/src/pages-standard/bundles-page/BundleDetailPanel.vue +193 -0
- package/src/pages-standard/bundles-page/BundlesFilterBar.vue +48 -0
- package/src/pages-standard/bundles-page/BundlesHeader.vue +67 -0
- package/src/pages-standard/bundles-page/BundlesKpis.vue +39 -0
- package/src/pages-standard/bundles-page/types.ts +15 -0
- package/src/pages-standard/discovery-page/CatalogEntryTransPanel.vue +246 -0
- package/src/pages-standard/discovery-page/DiscoveryCapList.vue +171 -0
- package/src/pages-standard/discovery-page/DiscoveryFeatureCard.vue +410 -0
- package/src/pages-standard/discovery-page/DiscoveryHeader.vue +31 -0
- package/src/pages-standard/discovery-page/DiscoveryKpis.vue +47 -0
- package/src/pages-standard/discovery-page/DiscoveryMetaBanner.vue +26 -0
- package/src/pages-standard/discovery-page/DiscoveryQuotaCard.vue +247 -0
- package/src/pages-standard/discovery-page/DiscoveryStatusControl.vue +73 -0
- package/src/pages-standard/discovery-page/discovery-ui.ts +166 -0
- package/src/pages-standard/email-history.types.ts +48 -0
- package/src/pages-standard/marketing-catalog/MarketingCatalogAdmin.vue +448 -0
- package/src/pages-standard/marketing-catalog/MarketingCatalogHeader.vue +93 -0
- package/src/pages-standard/marketing-catalog/MarketingCatalogPreview.vue +138 -0
- package/src/pages-standard/marketing-catalog/MarketingCatalogToolbar.vue +58 -0
- package/src/pages-standard/marketing-catalog/types.ts +43 -0
- package/src/pages-standard/plan-versions/PlanDiffCard.vue +132 -0
- package/src/pages-standard/plan-versions/PlanVersionHeader.vue +293 -0
- package/src/pages-standard/plan-versions/PlanVersionStatusBadge.vue +48 -0
- package/src/pages-standard/plan-versions/PlanVersionsAudit.vue +307 -0
- package/src/pages-standard/plan-versions/PlanVersionsDiff.vue +269 -0
- package/src/pages-standard/plan-versions/PlanVersionsKpi.vue +65 -0
- package/src/pages-standard/plan-versions/PlanVersionsList.vue +292 -0
- package/src/pages-standard/plan-versions/PlanVersionsMatrix.vue +261 -0
- package/src/pages-standard/plan-versions/PlanVersionsTimeline.vue +300 -0
- package/src/pages-standard/plan-versions/VersionDiffPreview.vue +167 -0
- package/src/pages-standard/plan-versions/format.ts +53 -0
- package/src/pages-standard/plan-versions/types.ts +33 -0
- package/src/pages-standard/plans-page/PlanArchiveDialog.vue +50 -0
- package/src/pages-standard/plans-page/PlanBundleOverview.vue +147 -0
- package/src/pages-standard/plans-page/PlanDiscardDraftDialog.vue +46 -0
- package/src/pages-standard/plans-page/PlanPublishDialog.vue +106 -0
- package/src/pages-standard/plans-page/PlansPageToast.vue +69 -0
- package/src/pages-standard/plans-page/types.ts +18 -0
- package/src/pages-standard/platform-email.types.ts +41 -0
- package/src/pages-standard/sa-theme.css +223 -0
- package/src/pages-standard/tenants/StatusPill.vue +62 -0
- package/src/pages-standard/tenants/format.ts +38 -0
- package/src/pages-tenant/LimitsRow.vue +67 -0
- package/src/pages-tenant/MySubscriptionBundlesPage.vue +604 -0
- package/src/pages-tenant/OnboardingConfigurator.vue +417 -0
- package/src/pages-tenant/PackageSnapshotPanel.vue +241 -0
- package/src/pages-tenant/PendingVersionBanner.vue +126 -0
- package/src/pages-tenant/PlanChangeWizard.vue +630 -0
- package/src/pages-tenant/TenantPlanSection.vue +729 -0
- package/src/pages-tenant/UsageBar.vue +107 -0
- package/src/pages-tenant/default-i18n.ts +280 -0
- package/src/pages-tenant/tenant-plan-section/BundlePreviewDialog.vue +304 -0
- package/src/pages-tenant/tenant-plan-section/TenantBundleStore.vue +323 -0
- package/src/pages-tenant/tenant-plan-section/TenantFeatureMatrix.vue +122 -0
- package/src/pages-tenant/tenant-plan-section/TenantPlanCardHeader.vue +67 -0
- package/src/pages-tenant/tenant-plan-section/TenantUsageGrid.vue +31 -0
- package/src/plan-versions-catalog.ts +368 -0
- package/src/platform-loaders.ts +68 -0
- package/src/project-page-host.ts +108 -0
- package/src/testing-e2e/admin-pages-suite.ts +187 -0
- package/src/types.ts +58 -0
- package/src/use-actions.ts +25 -0
- package/src/use-api-list.ts +151 -0
- package/src/use-audit-entries.ts +48 -0
- package/src/use-batch-columns.ts +59 -0
- package/src/use-bulk-publish.ts +150 -0
- package/src/use-bundle-versions-map.ts +112 -0
- package/src/use-bundles.ts +297 -0
- package/src/use-business-types.ts +269 -0
- package/src/use-catalog-entries.ts +243 -0
- package/src/use-discovery.ts +158 -0
- package/src/use-entitlement.ts +87 -0
- package/src/use-live-plan-versions.ts +126 -0
- package/src/use-manifest.ts +57 -0
- package/src/use-marketing-projections.ts +160 -0
- package/src/use-nav.ts +33 -0
- package/src/use-plan-editor.ts +162 -0
- package/src/use-plan-versions.ts +83 -0
- package/src/use-plans.ts +375 -0
- package/src/use-platform-tenant-actions.ts +286 -0
- package/src/use-promotions.ts +126 -0
- package/src/use-public-boot.ts +40 -0
- package/src/use-subscription-draft.ts +355 -0
- package/src/use-super-admin-context.ts +93 -0
- package/src/use-tenant-action-flow.ts +238 -0
- package/src/use-tenant-billing-catalog.ts +160 -0
- package/src/use-tenant-billing.ts +453 -0
- package/src/use-tenant-manifest.ts +94 -0
- package/src/use-tenant-subscription-bundles.ts +148 -0
- package/src/use-tenants.ts +61 -0
- package/src/version.ts +10 -0
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<aside class="sa-pv-timeline">
|
|
3
|
+
<div class="sa-pv-timeline__head">
|
|
4
|
+
<div class="sa-pv-timeline__row">
|
|
5
|
+
<div class="sa-pv-timeline__title">{{ title ?? 'Plan-Catalog' }}</div>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="sa-pv-timeline__count">{{ snapshots.length }} Snapshots</div>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<div class="sa-pv-timeline__list">
|
|
11
|
+
<div v-for="(s, i) in snapshots" :key="s.id" class="sa-pv-timeline__item">
|
|
12
|
+
<span
|
|
13
|
+
v-if="i < snapshots.length - 1"
|
|
14
|
+
class="sa-pv-timeline__line"
|
|
15
|
+
aria-hidden="true"
|
|
16
|
+
/>
|
|
17
|
+
<button
|
|
18
|
+
type="button"
|
|
19
|
+
class="sa-pv-timeline__btn"
|
|
20
|
+
:class="{ 'sa-pv-timeline__btn--selected': selectedId === s.id }"
|
|
21
|
+
@click="emit('select', s.id)"
|
|
22
|
+
@contextmenu.prevent="emit('setCompare', s.id)"
|
|
23
|
+
>
|
|
24
|
+
<span
|
|
25
|
+
class="sa-pv-timeline__node"
|
|
26
|
+
:class="`sa-pv-timeline__node--${s.status.toLowerCase()}`"
|
|
27
|
+
>
|
|
28
|
+
<q-icon v-if="s.kind === 'active'" name="check" size="13px" />
|
|
29
|
+
<q-icon v-else-if="s.kind === 'drafts'" name="edit_note" size="12px" />
|
|
30
|
+
<span v-else class="sa-pv-timeline__node-dot" />
|
|
31
|
+
</span>
|
|
32
|
+
<span class="sa-pv-timeline__main">
|
|
33
|
+
<span class="sa-pv-timeline__top">
|
|
34
|
+
<span class="sa-pv-timeline__label">{{ s.label }}</span>
|
|
35
|
+
<span
|
|
36
|
+
class="sa-pv-timeline__status"
|
|
37
|
+
:class="`sa-pv-timeline__status--${s.status.toLowerCase()}`"
|
|
38
|
+
>
|
|
39
|
+
{{ statusLabel(s.status) }}
|
|
40
|
+
</span>
|
|
41
|
+
<span v-if="compareId === s.id" class="sa-pv-timeline__vs">VS</span>
|
|
42
|
+
</span>
|
|
43
|
+
<span class="sa-pv-timeline__h2">{{ s.title }}</span>
|
|
44
|
+
<span class="sa-pv-timeline__meta">
|
|
45
|
+
<q-icon
|
|
46
|
+
:name="s.kind === 'drafts' ? 'edit_note' : 'schedule'"
|
|
47
|
+
size="11px"
|
|
48
|
+
/>
|
|
49
|
+
<span>{{ metaText(s) }}</span>
|
|
50
|
+
</span>
|
|
51
|
+
</span>
|
|
52
|
+
</button>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<div class="sa-pv-timeline__foot">
|
|
57
|
+
<div class="sa-pv-timeline__hint">
|
|
58
|
+
<q-icon name="info" size="13px" />
|
|
59
|
+
<span>Rechtsklick auf Snapshot → vergleichen</span>
|
|
60
|
+
</div>
|
|
61
|
+
<button
|
|
62
|
+
v-if="compareId"
|
|
63
|
+
type="button"
|
|
64
|
+
class="sa-pv-timeline__clear-btn"
|
|
65
|
+
@click="emit('clearCompare')"
|
|
66
|
+
>
|
|
67
|
+
Vergleich beenden
|
|
68
|
+
</button>
|
|
69
|
+
</div>
|
|
70
|
+
</aside>
|
|
71
|
+
</template>
|
|
72
|
+
|
|
73
|
+
<script setup lang="ts">
|
|
74
|
+
import type { CatalogSnapshot } from '../../plan-versions-catalog.js';
|
|
75
|
+
import { formatRelativeDe } from './format.js';
|
|
76
|
+
|
|
77
|
+
defineProps<{
|
|
78
|
+
snapshots: CatalogSnapshot[];
|
|
79
|
+
selectedId: string;
|
|
80
|
+
compareId: string | null;
|
|
81
|
+
title?: string;
|
|
82
|
+
}>();
|
|
83
|
+
|
|
84
|
+
const emit = defineEmits<{
|
|
85
|
+
(e: 'select', id: string): void;
|
|
86
|
+
(e: 'setCompare', id: string): void;
|
|
87
|
+
(e: 'clearCompare'): void;
|
|
88
|
+
}>();
|
|
89
|
+
|
|
90
|
+
function statusLabel(status: CatalogSnapshot['status']): string {
|
|
91
|
+
if (status === 'DRAFT') return 'DRAFT';
|
|
92
|
+
if (status === 'ACTIVE') return 'AKTIV';
|
|
93
|
+
return 'ARCHIV';
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function metaText(s: CatalogSnapshot): string {
|
|
97
|
+
if (s.kind === 'drafts') {
|
|
98
|
+
return s.draftCount === 0 ? 'keine offenen Drafts' : `${s.draftCount} offen`;
|
|
99
|
+
}
|
|
100
|
+
if (s.publishedAt) return formatRelativeDe(s.publishedAt);
|
|
101
|
+
return 'unbekannt';
|
|
102
|
+
}
|
|
103
|
+
</script>
|
|
104
|
+
|
|
105
|
+
<style scoped>
|
|
106
|
+
.sa-pv-timeline {
|
|
107
|
+
width: 280px;
|
|
108
|
+
flex-shrink: 0;
|
|
109
|
+
background: var(--sa-bg-surface, #ffffff);
|
|
110
|
+
border-right: 1px solid var(--sa-border, #e2e8f0);
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-direction: column;
|
|
113
|
+
overflow: hidden;
|
|
114
|
+
}
|
|
115
|
+
.sa-pv-timeline__head {
|
|
116
|
+
padding: 14px 16px;
|
|
117
|
+
border-bottom: 1px solid var(--sa-border, #e2e8f0);
|
|
118
|
+
background: #fafbfc;
|
|
119
|
+
}
|
|
120
|
+
.sa-pv-timeline__row {
|
|
121
|
+
display: flex;
|
|
122
|
+
align-items: center;
|
|
123
|
+
justify-content: space-between;
|
|
124
|
+
}
|
|
125
|
+
.sa-pv-timeline__title {
|
|
126
|
+
font-size: 11px;
|
|
127
|
+
font-weight: 700;
|
|
128
|
+
letter-spacing: 0.08em;
|
|
129
|
+
color: var(--sa-muted, #64748b);
|
|
130
|
+
text-transform: uppercase;
|
|
131
|
+
}
|
|
132
|
+
.sa-pv-timeline__count {
|
|
133
|
+
margin-top: 2px;
|
|
134
|
+
font-size: 11px;
|
|
135
|
+
color: var(--sa-muted, #64748b);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.sa-pv-timeline__list {
|
|
139
|
+
flex: 1;
|
|
140
|
+
overflow-y: auto;
|
|
141
|
+
padding: 8px 4px;
|
|
142
|
+
}
|
|
143
|
+
.sa-pv-timeline__item {
|
|
144
|
+
position: relative;
|
|
145
|
+
}
|
|
146
|
+
.sa-pv-timeline__line {
|
|
147
|
+
position: absolute;
|
|
148
|
+
left: 22px;
|
|
149
|
+
top: 36px;
|
|
150
|
+
bottom: -6px;
|
|
151
|
+
width: 2px;
|
|
152
|
+
background: var(--sa-border, #e2e8f0);
|
|
153
|
+
z-index: 0;
|
|
154
|
+
}
|
|
155
|
+
.sa-pv-timeline__btn {
|
|
156
|
+
position: relative;
|
|
157
|
+
z-index: 1;
|
|
158
|
+
width: calc(100% - 8px);
|
|
159
|
+
display: flex;
|
|
160
|
+
align-items: flex-start;
|
|
161
|
+
gap: 10px;
|
|
162
|
+
padding: 10px 12px;
|
|
163
|
+
margin: 2px 4px;
|
|
164
|
+
background: transparent;
|
|
165
|
+
border: 1px solid transparent;
|
|
166
|
+
border-radius: 10px;
|
|
167
|
+
cursor: pointer;
|
|
168
|
+
text-align: left;
|
|
169
|
+
transition: all 0.12s;
|
|
170
|
+
font-family: inherit;
|
|
171
|
+
color: inherit;
|
|
172
|
+
}
|
|
173
|
+
.sa-pv-timeline__btn:hover:not(.sa-pv-timeline__btn--selected) {
|
|
174
|
+
background: var(--sa-border-soft, #f1f5f9);
|
|
175
|
+
}
|
|
176
|
+
.sa-pv-timeline__btn--selected {
|
|
177
|
+
background: var(--sa-primary-soft, rgba(63, 107, 255, 0.08));
|
|
178
|
+
border-color: var(--sa-primary-border, rgba(63, 107, 255, 0.18));
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.sa-pv-timeline__node {
|
|
182
|
+
width: 24px;
|
|
183
|
+
height: 24px;
|
|
184
|
+
border-radius: 50%;
|
|
185
|
+
display: flex;
|
|
186
|
+
align-items: center;
|
|
187
|
+
justify-content: center;
|
|
188
|
+
flex-shrink: 0;
|
|
189
|
+
border: 2px solid;
|
|
190
|
+
}
|
|
191
|
+
.sa-pv-timeline__node--draft {
|
|
192
|
+
background: var(--sa-warning-soft, rgba(245, 158, 11, 0.1));
|
|
193
|
+
border-color: var(--sa-warning, #b45309);
|
|
194
|
+
color: var(--sa-warning, #b45309);
|
|
195
|
+
}
|
|
196
|
+
.sa-pv-timeline__node--active {
|
|
197
|
+
background: var(--sa-positive-soft, rgba(4, 120, 87, 0.1));
|
|
198
|
+
border-color: var(--sa-positive, #047857);
|
|
199
|
+
color: var(--sa-positive, #047857);
|
|
200
|
+
}
|
|
201
|
+
.sa-pv-timeline__node--archived {
|
|
202
|
+
background: #f1f5f9;
|
|
203
|
+
border-color: var(--sa-muted, #64748b);
|
|
204
|
+
color: var(--sa-muted, #64748b);
|
|
205
|
+
}
|
|
206
|
+
.sa-pv-timeline__node-dot {
|
|
207
|
+
width: 6px;
|
|
208
|
+
height: 6px;
|
|
209
|
+
border-radius: 50%;
|
|
210
|
+
background: currentColor;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.sa-pv-timeline__main {
|
|
214
|
+
flex: 1;
|
|
215
|
+
min-width: 0;
|
|
216
|
+
display: flex;
|
|
217
|
+
flex-direction: column;
|
|
218
|
+
}
|
|
219
|
+
.sa-pv-timeline__top {
|
|
220
|
+
display: flex;
|
|
221
|
+
align-items: center;
|
|
222
|
+
gap: 6px;
|
|
223
|
+
margin-bottom: 2px;
|
|
224
|
+
}
|
|
225
|
+
.sa-pv-timeline__label {
|
|
226
|
+
font-family: var(--sa-font-mono, ui-monospace, 'SF Mono', Menlo, monospace);
|
|
227
|
+
font-size: 12px;
|
|
228
|
+
font-weight: 700;
|
|
229
|
+
color: var(--sa-heading, #0f172a);
|
|
230
|
+
}
|
|
231
|
+
.sa-pv-timeline__status {
|
|
232
|
+
font-size: 9.5px;
|
|
233
|
+
font-weight: 700;
|
|
234
|
+
letter-spacing: 0.06em;
|
|
235
|
+
padding: 2px 6px;
|
|
236
|
+
border-radius: 4px;
|
|
237
|
+
}
|
|
238
|
+
.sa-pv-timeline__status--draft {
|
|
239
|
+
background: var(--sa-warning-soft, rgba(245, 158, 11, 0.1));
|
|
240
|
+
color: var(--sa-warning, #b45309);
|
|
241
|
+
}
|
|
242
|
+
.sa-pv-timeline__status--active {
|
|
243
|
+
background: var(--sa-positive-soft, rgba(4, 120, 87, 0.1));
|
|
244
|
+
color: var(--sa-positive, #047857);
|
|
245
|
+
}
|
|
246
|
+
.sa-pv-timeline__status--archived {
|
|
247
|
+
background: #f1f5f9;
|
|
248
|
+
color: var(--sa-muted, #64748b);
|
|
249
|
+
}
|
|
250
|
+
.sa-pv-timeline__vs {
|
|
251
|
+
font-size: 9.5px;
|
|
252
|
+
font-weight: 700;
|
|
253
|
+
letter-spacing: 0.06em;
|
|
254
|
+
background: #fef3c7;
|
|
255
|
+
color: #92400e;
|
|
256
|
+
padding: 2px 6px;
|
|
257
|
+
border-radius: 4px;
|
|
258
|
+
}
|
|
259
|
+
.sa-pv-timeline__h2 {
|
|
260
|
+
font-size: 12px;
|
|
261
|
+
font-weight: 600;
|
|
262
|
+
color: var(--sa-body, #1e293b);
|
|
263
|
+
line-height: 1.3;
|
|
264
|
+
white-space: nowrap;
|
|
265
|
+
overflow: hidden;
|
|
266
|
+
text-overflow: ellipsis;
|
|
267
|
+
}
|
|
268
|
+
.sa-pv-timeline__meta {
|
|
269
|
+
font-size: 11px;
|
|
270
|
+
color: var(--sa-muted, #64748b);
|
|
271
|
+
margin-top: 2px;
|
|
272
|
+
display: flex;
|
|
273
|
+
align-items: center;
|
|
274
|
+
gap: 6px;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.sa-pv-timeline__foot {
|
|
278
|
+
padding: 10px 14px;
|
|
279
|
+
border-top: 1px solid var(--sa-border, #e2e8f0);
|
|
280
|
+
background: #fafbfc;
|
|
281
|
+
font-size: 11px;
|
|
282
|
+
color: var(--sa-muted, #64748b);
|
|
283
|
+
}
|
|
284
|
+
.sa-pv-timeline__hint {
|
|
285
|
+
display: flex;
|
|
286
|
+
align-items: center;
|
|
287
|
+
gap: 6px;
|
|
288
|
+
}
|
|
289
|
+
.sa-pv-timeline__clear-btn {
|
|
290
|
+
margin-top: 6px;
|
|
291
|
+
background: #fff;
|
|
292
|
+
border: 1px solid var(--sa-border, #e2e8f0);
|
|
293
|
+
border-radius: 6px;
|
|
294
|
+
padding: 4px 10px;
|
|
295
|
+
font-size: 11px;
|
|
296
|
+
font-weight: 600;
|
|
297
|
+
color: var(--sa-body, #1e293b);
|
|
298
|
+
cursor: pointer;
|
|
299
|
+
}
|
|
300
|
+
</style>
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="!changes || changes.length === 0" class="sa-pv-diff-preview__empty">
|
|
3
|
+
Keine Änderungen gegenüber der Vorgängerversion.
|
|
4
|
+
</div>
|
|
5
|
+
<div v-else class="sa-pv-diff-preview__list">
|
|
6
|
+
<div
|
|
7
|
+
v-for="(c, idx) in changes"
|
|
8
|
+
:key="idx"
|
|
9
|
+
class="sa-pv-diff-preview__row"
|
|
10
|
+
:class="rowClass(c.direction)"
|
|
11
|
+
>
|
|
12
|
+
<div class="sa-pv-diff-preview__direction">
|
|
13
|
+
<q-icon :name="iconFor(c.direction)" size="16px" />
|
|
14
|
+
<span>{{ labelFor(c.direction) }}</span>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="sa-pv-diff-preview__field">{{ humanFieldLabel(c.field) }}</div>
|
|
17
|
+
<div class="sa-pv-diff-preview__values">
|
|
18
|
+
<span v-if="c.field !== 'features.added'" class="old">{{
|
|
19
|
+
formatValue(c.oldValue)
|
|
20
|
+
}}</span>
|
|
21
|
+
<q-icon
|
|
22
|
+
v-if="c.field !== 'features.added' && c.field !== 'features.removed'"
|
|
23
|
+
name="arrow_forward"
|
|
24
|
+
size="14px"
|
|
25
|
+
/>
|
|
26
|
+
<span v-if="c.field !== 'features.removed'" class="new">{{
|
|
27
|
+
formatValue(c.newValue)
|
|
28
|
+
}}</span>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script setup lang="ts">
|
|
35
|
+
import { computed } from 'vue';
|
|
36
|
+
import type { VersionChange } from '@saasicat/types';
|
|
37
|
+
|
|
38
|
+
const props = defineProps<{
|
|
39
|
+
changes?: VersionChange[] | null;
|
|
40
|
+
/**
|
|
41
|
+
* Optional: field labels (e.g. `{ maxUsers: 'Max. Benutzer' }`).
|
|
42
|
+
* Apps map their own Quota fields here; the default covers the generic
|
|
43
|
+
* platform fields.
|
|
44
|
+
*/
|
|
45
|
+
fieldLabels?: Record<string, string>;
|
|
46
|
+
}>();
|
|
47
|
+
|
|
48
|
+
const DEFAULT_FIELD_LABELS: Record<string, string> = {
|
|
49
|
+
'features.added': 'Hinzugefügte Features',
|
|
50
|
+
'features.removed': 'Entfernte Features',
|
|
51
|
+
maxUsers: 'Max. Benutzer',
|
|
52
|
+
maxStorageGb: 'Speicher (GB)',
|
|
53
|
+
monthlyNet: 'Preis monatlich (netto)',
|
|
54
|
+
yearlyNet: 'Preis jährlich (netto)',
|
|
55
|
+
unitSize: 'Einheitsgröße',
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const mergedFieldLabels = computed(() => ({
|
|
59
|
+
...DEFAULT_FIELD_LABELS,
|
|
60
|
+
...(props.fieldLabels ?? {}),
|
|
61
|
+
}));
|
|
62
|
+
|
|
63
|
+
function iconFor(direction: VersionChange['direction']): string {
|
|
64
|
+
if (direction === 'IMPROVEMENT') return 'trending_up';
|
|
65
|
+
if (direction === 'REGRESSION') return 'trending_down';
|
|
66
|
+
return 'remove';
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function labelFor(direction: VersionChange['direction']): string {
|
|
70
|
+
if (direction === 'IMPROVEMENT') return 'Verbesserung';
|
|
71
|
+
if (direction === 'REGRESSION') return 'Verschlechterung';
|
|
72
|
+
return 'Neutral';
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function rowClass(direction: VersionChange['direction']): string {
|
|
76
|
+
if (direction === 'IMPROVEMENT') return 'sa-pv-diff-preview__row--improvement';
|
|
77
|
+
if (direction === 'REGRESSION') return 'sa-pv-diff-preview__row--regression';
|
|
78
|
+
return 'sa-pv-diff-preview__row--neutral';
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function humanFieldLabel(field: string): string {
|
|
82
|
+
return mergedFieldLabels.value[field] ?? field;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function formatValue(value: unknown): string {
|
|
86
|
+
if (value === null || value === undefined) return '–';
|
|
87
|
+
if (Array.isArray(value)) {
|
|
88
|
+
if (value.length === 0) return '–';
|
|
89
|
+
return value.join(', ');
|
|
90
|
+
}
|
|
91
|
+
if (typeof value === 'string' && /^\d+\.\d{2}$/.test(value)) {
|
|
92
|
+
return `${value} €`;
|
|
93
|
+
}
|
|
94
|
+
return String(value);
|
|
95
|
+
}
|
|
96
|
+
</script>
|
|
97
|
+
|
|
98
|
+
<style scoped>
|
|
99
|
+
.sa-pv-diff-preview__empty {
|
|
100
|
+
color: #64748b;
|
|
101
|
+
font-style: italic;
|
|
102
|
+
padding: 12px;
|
|
103
|
+
background: #f8fafc;
|
|
104
|
+
border-radius: 8px;
|
|
105
|
+
border: 1px dashed #cbd5e1;
|
|
106
|
+
}
|
|
107
|
+
.sa-pv-diff-preview__list {
|
|
108
|
+
display: flex;
|
|
109
|
+
flex-direction: column;
|
|
110
|
+
gap: 6px;
|
|
111
|
+
}
|
|
112
|
+
.sa-pv-diff-preview__row {
|
|
113
|
+
display: grid;
|
|
114
|
+
grid-template-columns: 160px 200px 1fr;
|
|
115
|
+
gap: 12px;
|
|
116
|
+
padding: 8px 12px;
|
|
117
|
+
border-radius: 8px;
|
|
118
|
+
border: 1px solid;
|
|
119
|
+
font-size: 13px;
|
|
120
|
+
align-items: center;
|
|
121
|
+
}
|
|
122
|
+
.sa-pv-diff-preview__row--improvement {
|
|
123
|
+
background: #f0fdf4;
|
|
124
|
+
border-color: #bbf7d0;
|
|
125
|
+
color: #166534;
|
|
126
|
+
}
|
|
127
|
+
.sa-pv-diff-preview__row--regression {
|
|
128
|
+
background: #fef2f2;
|
|
129
|
+
border-color: #fecaca;
|
|
130
|
+
color: #991b1b;
|
|
131
|
+
}
|
|
132
|
+
.sa-pv-diff-preview__row--neutral {
|
|
133
|
+
background: #f8fafc;
|
|
134
|
+
border-color: #e2e8f0;
|
|
135
|
+
color: #475569;
|
|
136
|
+
}
|
|
137
|
+
.sa-pv-diff-preview__direction {
|
|
138
|
+
display: flex;
|
|
139
|
+
align-items: center;
|
|
140
|
+
gap: 6px;
|
|
141
|
+
font-weight: 600;
|
|
142
|
+
font-size: 12px;
|
|
143
|
+
text-transform: uppercase;
|
|
144
|
+
letter-spacing: 0.04em;
|
|
145
|
+
}
|
|
146
|
+
.sa-pv-diff-preview__field {
|
|
147
|
+
color: #0f172a;
|
|
148
|
+
font-weight: 500;
|
|
149
|
+
}
|
|
150
|
+
.sa-pv-diff-preview__values {
|
|
151
|
+
display: flex;
|
|
152
|
+
align-items: center;
|
|
153
|
+
gap: 8px;
|
|
154
|
+
}
|
|
155
|
+
.sa-pv-diff-preview__values .old {
|
|
156
|
+
color: #94a3b8;
|
|
157
|
+
text-decoration: line-through;
|
|
158
|
+
font-family: ui-monospace, 'SF Mono', Menlo, monospace;
|
|
159
|
+
font-size: 12px;
|
|
160
|
+
}
|
|
161
|
+
.sa-pv-diff-preview__values .new {
|
|
162
|
+
color: inherit;
|
|
163
|
+
font-weight: 600;
|
|
164
|
+
font-family: ui-monospace, 'SF Mono', Menlo, monospace;
|
|
165
|
+
font-size: 12px;
|
|
166
|
+
}
|
|
167
|
+
</style>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Formatting helpers for the plan-versions views.
|
|
2
|
+
//
|
|
3
|
+
// Phase 2c: Ported from a consumer admin.
|
|
4
|
+
// The time reference point for `formatRelativeDe` is the moment of the call,
|
|
5
|
+
// not a hard-coded demo date (the ported template had `2026-05-04` —
|
|
6
|
+
// the platform must work in production).
|
|
7
|
+
|
|
8
|
+
export function fmtEuro(n: number): string {
|
|
9
|
+
if (n === 0) return 'individuell';
|
|
10
|
+
return n.toFixed(2).replace('.', ',') + ' €';
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function fmtStorage(gb: number): string {
|
|
14
|
+
if (gb === 0) return '500 MB';
|
|
15
|
+
if (gb >= 1000 && gb % 1000 === 0) return `${gb / 1000} TB`;
|
|
16
|
+
return `${gb} GB`;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function formatRelativeDe(iso: string | undefined, now: Date = new Date()): string {
|
|
20
|
+
if (!iso) return '—';
|
|
21
|
+
const d = new Date(iso);
|
|
22
|
+
const diffMs = now.getTime() - d.getTime();
|
|
23
|
+
const days = Math.floor(diffMs / 86_400_000);
|
|
24
|
+
if (days === 0) return 'heute';
|
|
25
|
+
if (days === 1) return 'gestern';
|
|
26
|
+
if (days < 7) return `vor ${days} Tagen`;
|
|
27
|
+
if (days < 30) {
|
|
28
|
+
const w = Math.floor(days / 7);
|
|
29
|
+
return `vor ${w} Woche${w > 1 ? 'n' : ''}`;
|
|
30
|
+
}
|
|
31
|
+
if (days < 365) return `vor ${Math.floor(days / 30)} Monaten`;
|
|
32
|
+
const y = Math.floor(days / 365);
|
|
33
|
+
return `vor ${y} Jahr${y > 1 ? 'en' : ''}`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function formatDateDe(iso: string | undefined): string {
|
|
37
|
+
if (!iso) return '—';
|
|
38
|
+
return new Date(iso).toLocaleDateString('de-DE', {
|
|
39
|
+
day: '2-digit',
|
|
40
|
+
month: 'short',
|
|
41
|
+
year: 'numeric',
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function formatTsDe(iso: string): string {
|
|
46
|
+
return new Date(iso).toLocaleString('de-DE', {
|
|
47
|
+
day: '2-digit',
|
|
48
|
+
month: 'short',
|
|
49
|
+
year: 'numeric',
|
|
50
|
+
hour: '2-digit',
|
|
51
|
+
minute: '2-digit',
|
|
52
|
+
});
|
|
53
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Shared types of the plan version views.
|
|
2
|
+
//
|
|
3
|
+
// Phase 2c: ported from a consumer admin;
|
|
4
|
+
// source type generic over the platform version rows.
|
|
5
|
+
|
|
6
|
+
import type { PlanVersionRow } from '@saasicat/types';
|
|
7
|
+
|
|
8
|
+
export type PlanVersionViewMode = 'list' | 'matrix' | 'audit';
|
|
9
|
+
|
|
10
|
+
export type DraftKind = 'plan';
|
|
11
|
+
|
|
12
|
+
export interface DraftEntry {
|
|
13
|
+
kind: DraftKind;
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
detail: string;
|
|
17
|
+
source: PlanVersionRow;
|
|
18
|
+
baseId: string | null;
|
|
19
|
+
hasChangeNote: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface ValidationCheck {
|
|
23
|
+
ok: boolean;
|
|
24
|
+
label: string;
|
|
25
|
+
detail: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface PublishResult {
|
|
29
|
+
id: string;
|
|
30
|
+
label: string;
|
|
31
|
+
ok: boolean;
|
|
32
|
+
error?: string;
|
|
33
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-dialog
|
|
3
|
+
:model-value="modelValue"
|
|
4
|
+
persistent
|
|
5
|
+
@update:model-value="$emit('update:modelValue', $event)"
|
|
6
|
+
>
|
|
7
|
+
<q-card style="min-width: 440px">
|
|
8
|
+
<q-card-section>
|
|
9
|
+
<div class="text-h6">Plan komplett löschen?</div>
|
|
10
|
+
<div class="text-body2 q-mt-sm">
|
|
11
|
+
Plan <code>{{ target?.plan.planKey }}</code> wird
|
|
12
|
+
<b>unwiderruflich aus der DB entfernt</b>. Da der Plan keine published Version
|
|
13
|
+
hat, sind keine Subscriptions betroffen.
|
|
14
|
+
</div>
|
|
15
|
+
<div class="text-caption text-grey-7 q-mt-sm">
|
|
16
|
+
Vertragsschutz P1: Pläne mit jemals veröffentlichten Versionen können nicht
|
|
17
|
+
gelöscht werden — das Backend würde 422 antworten.
|
|
18
|
+
</div>
|
|
19
|
+
</q-card-section>
|
|
20
|
+
<q-banner v-if="error" class="bg-warning q-mx-md q-mb-md" rounded>
|
|
21
|
+
{{ error }}
|
|
22
|
+
</q-banner>
|
|
23
|
+
<q-card-actions align="right">
|
|
24
|
+
<q-btn flat label="Abbrechen" @click="$emit('update:modelValue', false)" />
|
|
25
|
+
<q-btn
|
|
26
|
+
color="negative"
|
|
27
|
+
label="Löschen"
|
|
28
|
+
:loading="archiving"
|
|
29
|
+
@click="$emit('execute')"
|
|
30
|
+
/>
|
|
31
|
+
</q-card-actions>
|
|
32
|
+
</q-card>
|
|
33
|
+
</q-dialog>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script setup lang="ts">
|
|
37
|
+
import type { PlanArchiveTarget } from './types.js';
|
|
38
|
+
|
|
39
|
+
defineProps<{
|
|
40
|
+
modelValue: boolean;
|
|
41
|
+
target: PlanArchiveTarget | null;
|
|
42
|
+
error: string | null;
|
|
43
|
+
archiving: boolean;
|
|
44
|
+
}>();
|
|
45
|
+
|
|
46
|
+
defineEmits<{
|
|
47
|
+
(e: 'update:modelValue', value: boolean): void;
|
|
48
|
+
(e: 'execute'): void;
|
|
49
|
+
}>();
|
|
50
|
+
</script>
|