@antelopejs/dms-saas 0.8.0 → 0.9.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/README.md +22 -6
- package/dist/auth/owner-only-permissions-resolver.js.map +1 -1
- package/dist/auth/plan-permissions-resolver.js.map +1 -1
- package/dist/automation/index.js.map +1 -1
- package/dist/billing-state/directory-hooks.js.map +1 -1
- package/dist/billing-state/directory.js.map +1 -1
- package/dist/billing-state/past-due-banner.js.map +1 -1
- package/dist/billing-state/recovery.js +2 -1
- package/dist/billing-state/recovery.js.map +1 -1
- package/dist/billing-state/trial-ending-banner.js.map +1 -1
- package/dist/crons/hard-delete-cancelled.js.map +1 -1
- package/dist/crons/recompute-billing-state.js +1 -4
- package/dist/crons/recompute-billing-state.js.map +1 -1
- package/dist/data-api/platformOwner/admin-user-workspaces.js +1 -1
- package/dist/data-api/platformOwner/admin-user-workspaces.js.map +1 -1
- package/dist/data-api/platformOwner/credit-note-rows.d.ts +4 -4
- package/dist/data-api/platformOwner/credit-note-rows.js +2 -1
- package/dist/data-api/platformOwner/credit-note-rows.js.map +1 -1
- package/dist/data-api/platformOwner/credit-notes.d.ts +1 -1
- package/dist/data-api/platformOwner/credit-notes.js +1 -1
- package/dist/data-api/platformOwner/credit-notes.js.map +1 -1
- package/dist/data-api/platformOwner/features.js.map +1 -1
- package/dist/data-api/platformOwner/invitations.js.map +1 -1
- package/dist/data-api/platformOwner/invoice-cells.js.map +1 -1
- package/dist/data-api/platformOwner/invoice-rows.d.ts +5 -4
- package/dist/data-api/platformOwner/invoice-rows.js.map +1 -1
- package/dist/data-api/platformOwner/invoices.d.ts +5 -5
- package/dist/data-api/platformOwner/invoices.js +5 -4
- package/dist/data-api/platformOwner/invoices.js.map +1 -1
- package/dist/data-api/platformOwner/plan-migrations.js.map +1 -1
- package/dist/data-api/platformOwner/plans.d.ts +5 -5
- package/dist/data-api/platformOwner/plans.js.map +1 -1
- package/dist/data-api/platformOwner/segments.js.map +1 -1
- package/dist/data-api/platformOwner/table-scope.d.ts +2 -1
- package/dist/data-api/platformOwner/table-scope.js.map +1 -1
- package/dist/data-api/platformOwner/users.js +7 -6
- package/dist/data-api/platformOwner/users.js.map +1 -1
- package/dist/data-api/platformOwner/workspace-cells.d.ts +2 -2
- package/dist/data-api/platformOwner/workspace-cells.js +1 -1
- package/dist/data-api/platformOwner/workspace-cells.js.map +1 -1
- package/dist/data-api/platformOwner/workspaces.d.ts +6 -5
- package/dist/data-api/platformOwner/workspaces.js +7 -10
- package/dist/data-api/platformOwner/workspaces.js.map +1 -1
- package/dist/data-api/tenant/tenant-invoices.js.map +1 -1
- package/dist/frontend-module.js.map +1 -1
- package/dist/hooks/register.js +8 -1
- package/dist/hooks/register.js.map +1 -1
- package/dist/hooks/tenant-export.js.map +1 -1
- package/dist/hooks/tenant-provisioning.js +2 -2
- package/dist/hooks/tenant-provisioning.js.map +1 -1
- package/dist/i18n/composed-text.js.map +1 -1
- package/dist/implementations/dms-saas/invoice-line-items.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/invoice-line-items/injection.d.ts +1 -1
- package/dist/invoice-line-items/injection.js.map +1 -1
- package/dist/invoice-line-items/recovery/discovery.js +11 -9
- package/dist/invoice-line-items/recovery/discovery.js.map +1 -1
- package/dist/invoice-line-items/recovery/managed-lines.js +18 -12
- package/dist/invoice-line-items/recovery/managed-lines.js.map +1 -1
- package/dist/metrics/activity-sources.js +1 -3
- package/dist/metrics/activity-sources.js.map +1 -1
- package/dist/metrics/activity.d.ts +3 -2
- package/dist/metrics/activity.js +19 -3
- package/dist/metrics/activity.js.map +1 -1
- package/dist/metrics/directory-summary.js +12 -4
- package/dist/metrics/directory-summary.js.map +1 -1
- package/dist/metrics/normalised-mrr.js.map +1 -1
- package/dist/metrics/revenue.d.ts +2 -2
- package/dist/metrics/revenue.js +3 -2
- package/dist/metrics/revenue.js.map +1 -1
- package/dist/operator-actions/commands.js +2 -1
- package/dist/operator-actions/commands.js.map +1 -1
- package/dist/operator-actions/db/lifecycle-delivery.model.js.map +1 -1
- package/dist/operator-actions/invitation-commands.d.ts +1 -1
- package/dist/operator-actions/invitation-commands.js +5 -27
- package/dist/operator-actions/invitation-commands.js.map +1 -1
- package/dist/operator-actions/journal.js +5 -2
- package/dist/operator-actions/journal.js.map +1 -1
- package/dist/operator-actions/lifecycle-consumers.js.map +1 -1
- package/dist/operator-actions/one-shot.d.ts +9 -0
- package/dist/operator-actions/one-shot.js +21 -0
- package/dist/operator-actions/one-shot.js.map +1 -0
- package/dist/operator-actions/types.d.ts +1 -1
- package/dist/operator-billing/billing-settings-store.d.ts +2 -0
- package/dist/operator-billing/billing-settings-store.js +8 -2
- package/dist/operator-billing/billing-settings-store.js.map +1 -1
- package/dist/operator-billing/billing-stats.d.ts +2 -1
- package/dist/operator-billing/billing-stats.js +3 -2
- package/dist/operator-billing/billing-stats.js.map +1 -1
- package/dist/operator-billing/credit-allowance.d.ts +6 -3
- package/dist/operator-billing/credit-allowance.js.map +1 -1
- package/dist/operator-billing/credit-note-request.js.map +1 -1
- package/dist/operator-billing/invoice-credit.js +9 -3
- package/dist/operator-billing/invoice-credit.js.map +1 -1
- package/dist/operator-billing/legal-documents-store.js.map +1 -1
- package/dist/operator-billing/legal-versions.js +13 -8
- package/dist/operator-billing/legal-versions.js.map +1 -1
- package/dist/pages/platform/dashboard.js.map +1 -1
- package/dist/pages/platform/features.js.map +1 -1
- package/dist/pages/platform/plans/edit.js.map +1 -1
- package/dist/pages/platform/plans/index.js.map +1 -1
- package/dist/pages/platform/plans/migrations.js.map +1 -1
- package/dist/pages/platform/settings.js +11 -3
- package/dist/pages/platform/settings.js.map +1 -1
- package/dist/pages/platform/users/detail.js.map +1 -1
- package/dist/pages/platform/users/index.js.map +1 -1
- package/dist/pages/platform/workspaces/detail.js.map +1 -1
- package/dist/pages/platform/workspaces/index.js.map +1 -1
- package/dist/pages/public/index.js.map +1 -1
- package/dist/pages/public/legal/privacy-policy.js.map +1 -1
- package/dist/pages/public/legal/terms-and-conditions.js.map +1 -1
- package/dist/pages/public/legal/terms-of-use.js.map +1 -1
- package/dist/pages/public/pricing.js.map +1 -1
- package/dist/pages/public/register.js.map +1 -1
- package/dist/pages/public/screens.js +5 -2
- package/dist/pages/public/screens.js.map +1 -1
- package/dist/pages/tenant/billing.js.map +1 -1
- package/dist/pages/tenant/general.js.map +1 -1
- package/dist/pages/tenant/members-seat-quota.js.map +1 -1
- package/dist/pages/tenant/workspace-suspended.js.map +1 -1
- package/dist/plan-changes/applied-upgrade.d.ts +1 -1
- package/dist/plan-changes/applied-upgrade.js.map +1 -1
- package/dist/plan-changes/deferred.js.map +1 -1
- package/dist/plan-changes/guarded-free.js.map +1 -1
- package/dist/plan-changes/guarded-landing.js.map +1 -1
- package/dist/plan-changes/inventory-barrier.js.map +1 -1
- package/dist/plans/migration-blocks.js +6 -6
- package/dist/plans/migration-blocks.js.map +1 -1
- package/dist/plans/migration-dialogs.js.map +1 -1
- package/dist/plans/plan-diff.js +2 -1
- package/dist/plans/plan-diff.js.map +1 -1
- package/dist/plans/plan-permission-tree.js.map +1 -1
- package/dist/plans/plan-write.js +9 -7
- package/dist/plans/plan-write.js.map +1 -1
- package/dist/plans/seat-hooks.js.map +1 -1
- package/dist/plans/stripe-sync.js.map +1 -1
- package/dist/routes/platformOwner/dashboard.d.ts +2 -1
- package/dist/routes/platformOwner/dashboard.js.map +1 -1
- package/dist/routes/platformOwner/plan-deletion.js.map +1 -1
- package/dist/routes/platformOwner/plan-dialogs.d.ts +3 -2
- package/dist/routes/platformOwner/plan-dialogs.js.map +1 -1
- package/dist/routes/platformOwner/plan-migrations.d.ts +4 -2
- package/dist/routes/platformOwner/plan-migrations.js +2 -1
- package/dist/routes/platformOwner/plan-migrations.js.map +1 -1
- package/dist/routes/platformOwner/plans.d.ts +7 -5
- package/dist/routes/platformOwner/plans.js +10 -0
- package/dist/routes/platformOwner/plans.js.map +1 -1
- package/dist/routes/platformOwner/platform-notes.js +3 -3
- package/dist/routes/platformOwner/platform-notes.js.map +1 -1
- package/dist/routes/platformOwner/segments-export.js.map +1 -1
- package/dist/routes/platformOwner/segments.js +2 -3
- package/dist/routes/platformOwner/segments.js.map +1 -1
- package/dist/routes/platformOwner/workspace-detail.d.ts +6 -2
- package/dist/routes/platformOwner/workspace-detail.js +10 -1
- package/dist/routes/platformOwner/workspace-detail.js.map +1 -1
- package/dist/routes/platformOwner/workspace-operator-actions.d.ts +2 -1
- package/dist/routes/platformOwner/workspace-operator-actions.js +4 -4
- package/dist/routes/platformOwner/workspace-operator-actions.js.map +1 -1
- package/dist/routes/platformOwner/workspaces-admin.d.ts +4 -2
- package/dist/routes/platformOwner/workspaces-admin.js +30 -7
- package/dist/routes/platformOwner/workspaces-admin.js.map +1 -1
- package/dist/routes/public/pricing.d.ts +2 -1
- package/dist/routes/public/pricing.js.map +1 -1
- package/dist/routes/public/public-plan-catalog.d.ts +2 -1
- package/dist/routes/public/public-plan-catalog.js +2 -1
- package/dist/routes/public/public-plan-catalog.js.map +1 -1
- package/dist/routes/public/register.d.ts +6 -3
- package/dist/routes/public/register.js +2 -1
- package/dist/routes/public/register.js.map +1 -1
- package/dist/routes/tenant/billing-pay-invoice.js.map +1 -1
- package/dist/routes/tenant/billing-portal.js.map +1 -1
- package/dist/routes/tenant/billing-self-refund.js.map +1 -1
- package/dist/routes/tenant/data-export.js.map +1 -1
- package/dist/routes/tenant/tenant-billing.js.map +1 -1
- package/dist/routes/tenant/tenant-plan-authentication.js.map +1 -1
- package/dist/routes/tenant/tenant-plan-cancellation.js.map +1 -1
- package/dist/routes/tenant/tenant-plan-checkout-recovery.js.map +1 -1
- package/dist/routes/tenant/tenant-plan-checkout.js +2 -3
- package/dist/routes/tenant/tenant-plan-checkout.js.map +1 -1
- package/dist/routes/tenant/tenant-plan-ops.js.map +1 -1
- package/dist/routes/tenant/tenant-plan-preview.js.map +1 -1
- package/dist/routes/tenant/tenant-plan-resubscription.js.map +1 -1
- package/dist/routes/tenant/tenant-plan.d.ts +5 -3
- package/dist/routes/tenant/tenant-plan.js +4 -3
- package/dist/routes/tenant/tenant-plan.js.map +1 -1
- package/dist/routes/tenant/tenant-upcoming-invoice.js +2 -3
- package/dist/routes/tenant/tenant-upcoming-invoice.js.map +1 -1
- package/dist/routes/tenant/workspaces.d.ts +2 -1
- package/dist/routes/tenant/workspaces.js.map +1 -1
- package/dist/stripe/client.js +2 -1
- package/dist/stripe/client.js.map +1 -1
- package/dist/stripe/customer-billing.d.ts +1 -1
- package/dist/stripe/customer-billing.js +1 -1
- package/dist/stripe/customer-billing.js.map +1 -1
- package/dist/stripe/payload-shapes.d.ts +20 -5
- package/dist/stripe/payload-shapes.js +4 -4
- package/dist/stripe/payload-shapes.js.map +1 -1
- package/dist/stripe/pending-update.js +2 -1
- package/dist/stripe/pending-update.js.map +1 -1
- package/dist/stripe/plan-schedule.js +3 -2
- package/dist/stripe/plan-schedule.js.map +1 -1
- package/dist/stripe/sync-plan.js +9 -8
- package/dist/stripe/sync-plan.js.map +1 -1
- package/dist/stripe/webhook-checkout.d.ts +2 -2
- package/dist/stripe/webhook-checkout.js +5 -4
- package/dist/stripe/webhook-checkout.js.map +1 -1
- package/dist/stripe/webhook-credit-notes.d.ts +2 -2
- package/dist/stripe/webhook-credit-notes.js +2 -1
- package/dist/stripe/webhook-credit-notes.js.map +1 -1
- package/dist/stripe/webhook-dispatch.js +6 -2
- package/dist/stripe/webhook-dispatch.js.map +1 -1
- package/dist/stripe/webhook-handlers.d.ts +10 -10
- package/dist/stripe/webhook-handlers.js.map +1 -1
- package/dist/stripe/webhook-shared.d.ts +1 -1
- package/dist/stripe/webhook-shared.js +2 -1
- package/dist/stripe/webhook-shared.js.map +1 -1
- package/dist/stripe/workspace-checkout.js +2 -1
- package/dist/stripe/workspace-checkout.js.map +1 -1
- package/dist/upcoming-invoice/eligibility.js.map +1 -1
- package/dist/upcoming-invoice/preview.js.map +1 -1
- package/dist/upcoming-invoice/pricing.js +6 -2
- package/dist/upcoming-invoice/pricing.js.map +1 -1
- package/dist/users/user-facts.js.map +1 -1
- package/dist/utils/content-language.d.ts +3 -1
- package/dist/utils/content-language.js +2 -1
- package/dist/utils/content-language.js.map +1 -1
- package/dist/utils/keyed-insert.d.ts +3 -7
- package/dist/utils/keyed-insert.js.map +1 -1
- package/dist/utils/parse-future-date.js +2 -1
- package/dist/utils/parse-future-date.js.map +1 -1
- package/dist/utils/primitive-guards.d.ts +4 -0
- package/dist/utils/primitive-guards.js +19 -0
- package/dist/utils/primitive-guards.js.map +1 -0
- package/dist/utils/query-parameter.d.ts +1 -0
- package/dist/utils/query-parameter.js +3 -0
- package/dist/utils/query-parameter.js.map +1 -0
- package/dist/utils/row-instance.js.map +1 -1
- package/dist/utils/segment-conditions-type.js +2 -1
- package/dist/utils/segment-conditions-type.js.map +1 -1
- package/dist/utils/segment-evaluator.js +8 -7
- package/dist/utils/segment-evaluator.js.map +1 -1
- package/dist/utils/segment-explain.js +2 -1
- package/dist/utils/segment-explain.js.map +1 -1
- package/dist/utils/segment-matching.js.map +1 -1
- package/dist/utils/segment-validation.js +12 -13
- package/dist/utils/segment-validation.js.map +1 -1
- package/dist/utils/time.js +2 -1
- package/dist/utils/time.js.map +1 -1
- package/dist/workers/plan-migration.js.map +1 -1
- package/dist/workspaces/billing-identity.d.ts +3 -1
- package/dist/workspaces/billing-identity.js +10 -1
- package/dist/workspaces/billing-identity.js.map +1 -1
- package/dist/workspaces/default-plan.d.ts +1 -1
- package/dist/workspaces/default-plan.js +11 -7
- package/dist/workspaces/default-plan.js.map +1 -1
- package/dist/workspaces/deletion.js.map +1 -1
- package/dist/workspaces/detail-items.js.map +1 -1
- package/dist/workspaces/operator-creation.js +2 -3
- package/dist/workspaces/operator-creation.js.map +1 -1
- package/dist/workspaces/owner-invitation-email.js.map +1 -1
- package/dist/workspaces/provisioning-types.d.ts +46 -0
- package/dist/workspaces/provisioning-types.js +3 -0
- package/dist/workspaces/provisioning-types.js.map +1 -0
- package/dist/workspaces/provisioning.d.ts +3 -45
- package/dist/workspaces/provisioning.js.map +1 -1
- package/dist/workspaces/registration-extras.js +13 -9
- package/dist/workspaces/registration-extras.js.map +1 -1
- package/dist/workspaces/self-serve-creation.js.map +1 -1
- package/dist/workspaces/subscription-create-params.js.map +1 -1
- package/frontend-vue/app/build/PayInvoicePanel.vue +3 -2
- package/frontend-vue/app/build/PlanChangeReview.vue +7 -6
- package/frontend-vue/app/build/components/RetirePlanDiff.vue +178 -0
- package/frontend-vue/app/build/public/OtherWorkspaces.vue +4 -11
- package/frontend-vue/app/build/public/registration-errors.ts +2 -0
- package/frontend-vue/app/build/workspace-detail/ComplimentaryDialog.vue +7 -5
- package/frontend-vue/app/build/workspace-detail/CreditDialog.vue +5 -4
- package/frontend-vue/app/build/workspace-detail/UpgradeDialog.vue +7 -5
- package/frontend-vue/app/build/workspace-detail/types.ts +1 -1
- package/frontend-vue/app/build/workspace-detail/useWorkspaceActions.ts +2 -7
- package/frontend-vue/app/build/workspace-paths.ts +12 -0
- package/frontend-vue/app/components/CustomerPortalButton.vue +4 -2
- package/frontend-vue/app/components/DataExport.vue +14 -14
- package/frontend-vue/app/components/DataExportHistory.vue +7 -12
- package/frontend-vue/app/components/IssueCreditNoteModal.vue +4 -7
- package/frontend-vue/app/components/LegalLayout.vue +5 -4
- package/frontend-vue/app/components/MigrationStripeCheck.vue +2 -5
- package/frontend-vue/app/components/PendingCheckoutModal.vue +2 -7
- package/frontend-vue/app/components/PlanTaxSync.vue +2 -6
- package/frontend-vue/app/components/PlanUpgradeModal.vue +10 -11
- package/frontend-vue/app/components/PlatformNotes.vue +4 -8
- package/frontend-vue/app/components/Pricing.vue +4 -2
- package/frontend-vue/app/components/RefundButton.vue +4 -2
- package/frontend-vue/app/components/RetirePlanModal.vue +16 -165
- package/frontend-vue/app/components/TenantBillingForm.vue +3 -7
- package/frontend-vue/app/components/TenantPlanCard.vue +11 -18
- package/frontend-vue/app/components/UserPlatformRoleCard.vue +2 -5
- package/frontend-vue/app/components/WorkspaceAdminCreateModal.vue +5 -3
- package/frontend-vue/app/components/WorkspaceCreateModal.vue +12 -5
- package/frontend-vue/app/components/WorkspaceDangerZone.vue +8 -3
- package/frontend-vue/app/components/WorkspaceDetailHeader.vue +16 -13
- package/frontend-vue/app/components/WorkspaceInvitationLink.vue +3 -2
- package/frontend-vue/app/components/WorkspaceOperatorActions.vue +17 -4
- package/frontend-vue/app/components/WorkspaceSuspended.vue +6 -13
- package/frontend-vue/app/components/WorkspaceSwitcherWidget.vue +21 -15
- package/frontend-vue/app/composables/useApiErrorMessage.ts +4 -33
- package/frontend-vue/app/composables/useInvitationLink.ts +14 -11
- package/frontend-vue/app/composables/useSaasRegistration.ts +14 -72
- package/frontend-vue/app/composables/useSaasRegistrationPlan.ts +73 -0
- package/frontend-vue/app/custom-pages/auth/no-workspace.vue +14 -11
- package/frontend-vue/build/backend-boundary.ts +122 -0
- package/frontend-vue/dms.frontend.build.ts +2 -0
- package/frontend-vue/i18n/locales/saas-operator-dashboard-en-GB.json +66 -0
- package/frontend-vue/i18n/locales/saas-operator-dashboard-fr-FR.json +66 -0
- package/frontend-vue/i18n/locales/saas-operator-workspaces-en-GB.json +13 -65
- package/frontend-vue/i18n/locales/saas-operator-workspaces-fr-FR.json +13 -65
- package/frontend-vue/i18n/locales/saas-public-en-GB.json +2 -4
- package/frontend-vue/i18n/locales/saas-public-fr-FR.json +2 -4
- package/frontend-vue/i18n/locales/saas-tenant-workspace-en-GB.json +0 -1
- package/frontend-vue/i18n/locales/saas-tenant-workspace-fr-FR.json +0 -1
- package/frontend-vue/package.json +1 -1
- package/package.json +17 -18
- package/skills/dms-saas/SKILL.md +2 -3
- package/skills/dms-saas/cases.json +48 -0
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { computed, onMounted, ref } from 'vue'
|
|
3
3
|
import FormFieldRow from '../components/FormFieldRow.vue'
|
|
4
4
|
import FormRows from '../components/FormRows.vue'
|
|
5
|
-
import { useApiErrorMessage } from '../../composables/useApiErrorMessage'
|
|
6
5
|
import { formatMinorUnits } from '../../composables/useMoneyFormat'
|
|
7
6
|
import { PLAN_UNLIMITED } from '../plan-catalog'
|
|
8
7
|
import { planPriceLabel } from './planPrice'
|
|
@@ -21,7 +20,7 @@ const D = 'saas.workspace_detail.complimentary'
|
|
|
21
20
|
const { $authFetch } = useAuthFetch()
|
|
22
21
|
const { t, locale } = useI18n()
|
|
23
22
|
const toast = useToast()
|
|
24
|
-
const {
|
|
23
|
+
const { resolveError } = useApiErrorPresenter()
|
|
25
24
|
|
|
26
25
|
const impact = ref<ComplimentaryImpact | null>(null)
|
|
27
26
|
const loadError = ref<string | null>(null)
|
|
@@ -59,7 +58,8 @@ const fitNote = computed(() => {
|
|
|
59
58
|
const plan = selectedPlan.value
|
|
60
59
|
const seats = impact.value?.seats ?? 0
|
|
61
60
|
if (!plan) return ''
|
|
62
|
-
if (plan.maxMembers === PLAN_UNLIMITED)
|
|
61
|
+
if (plan.maxMembers === PLAN_UNLIMITED)
|
|
62
|
+
return t(`${D}.fits_unlimited`, { seats }, seats)
|
|
63
63
|
const key = plan.fits ? 'fits' : 'exceeds'
|
|
64
64
|
return t(`${D}.${key}`, { seats, max: plan.maxMembers }, seats)
|
|
65
65
|
})
|
|
@@ -95,7 +95,8 @@ async function load(): Promise<void> {
|
|
|
95
95
|
planId.value = impact.value.currentPlanId ?? impact.value.plans[0]?.id
|
|
96
96
|
freeUntil.value = impact.value.freeUntil?.slice(0, 10) ?? ''
|
|
97
97
|
} catch (error) {
|
|
98
|
-
loadError.value =
|
|
98
|
+
loadError.value =
|
|
99
|
+
resolveError(error, { fallbackKey: `${D}.load_error` })?.message ?? ''
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
|
|
@@ -122,7 +123,8 @@ async function submit(): Promise<void> {
|
|
|
122
123
|
})
|
|
123
124
|
emit('done')
|
|
124
125
|
} catch (error) {
|
|
125
|
-
submitError.value =
|
|
126
|
+
submitError.value =
|
|
127
|
+
resolveError(error, { fallbackKey: `${D}.error` })?.message ?? ''
|
|
126
128
|
} finally {
|
|
127
129
|
isSubmitting.value = false
|
|
128
130
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { computed, onMounted, ref } from 'vue'
|
|
3
3
|
import FormFieldRow from '../components/FormFieldRow.vue'
|
|
4
4
|
import FormRows from '../components/FormRows.vue'
|
|
5
|
-
import { useApiErrorMessage } from '../../composables/useApiErrorMessage'
|
|
6
5
|
import {
|
|
7
6
|
formatMinorUnits,
|
|
8
7
|
fromMinorUnits,
|
|
@@ -29,7 +28,7 @@ const REASON_MAX_LENGTH = 500
|
|
|
29
28
|
const { $authFetch } = useAuthFetch()
|
|
30
29
|
const { t, locale } = useI18n()
|
|
31
30
|
const toast = useToast()
|
|
32
|
-
const {
|
|
31
|
+
const { resolveError } = useApiErrorPresenter()
|
|
33
32
|
|
|
34
33
|
const options = ref<OperatorOptions | null>(null)
|
|
35
34
|
const loadError = ref<string | null>(null)
|
|
@@ -82,7 +81,8 @@ async function load(): Promise<void> {
|
|
|
82
81
|
try {
|
|
83
82
|
options.value = await optionsRead.read()
|
|
84
83
|
} catch (error) {
|
|
85
|
-
loadError.value =
|
|
84
|
+
loadError.value =
|
|
85
|
+
resolveError(error, { fallbackKey: `${D}.load_error` })?.message ?? ''
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
@@ -110,7 +110,8 @@ async function submit(): Promise<void> {
|
|
|
110
110
|
})
|
|
111
111
|
emit('done')
|
|
112
112
|
} catch (error) {
|
|
113
|
-
submitError.value =
|
|
113
|
+
submitError.value =
|
|
114
|
+
resolveError(error, { fallbackKey: `${D}.error` })?.message ?? ''
|
|
114
115
|
} finally {
|
|
115
116
|
isSubmitting.value = false
|
|
116
117
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { computed, onMounted, ref, watch } from 'vue'
|
|
3
3
|
import FormFieldRow from '../components/FormFieldRow.vue'
|
|
4
4
|
import FormRows from '../components/FormRows.vue'
|
|
5
|
-
import { useApiErrorMessage } from '../../composables/useApiErrorMessage'
|
|
6
5
|
import { formatMinorUnits } from '../../composables/useMoneyFormat'
|
|
7
6
|
import type { OperatorOptions, UpgradePreview } from './types'
|
|
8
7
|
|
|
@@ -19,7 +18,7 @@ const D = 'saas.workspace_detail.upgrade'
|
|
|
19
18
|
const { $authFetch } = useAuthFetch()
|
|
20
19
|
const { t, locale } = useI18n()
|
|
21
20
|
const toast = useToast()
|
|
22
|
-
const {
|
|
21
|
+
const { resolveError } = useApiErrorPresenter()
|
|
23
22
|
|
|
24
23
|
const options = ref<OperatorOptions | null>(null)
|
|
25
24
|
const loadError = ref<string | null>(null)
|
|
@@ -74,7 +73,8 @@ async function load(): Promise<void> {
|
|
|
74
73
|
options.value = await optionsRead.read()
|
|
75
74
|
planId.value = plans.value[0]?.id
|
|
76
75
|
} catch (error) {
|
|
77
|
-
loadError.value =
|
|
76
|
+
loadError.value =
|
|
77
|
+
resolveError(error, { fallbackKey: `${D}.load_error` })?.message ?? ''
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -94,7 +94,8 @@ async function loadPreview(): Promise<void> {
|
|
|
94
94
|
try {
|
|
95
95
|
preview.value = await previewRead.read()
|
|
96
96
|
} catch (error) {
|
|
97
|
-
previewError.value =
|
|
97
|
+
previewError.value =
|
|
98
|
+
resolveError(error, { fallbackKey: `${D}.preview_error` })?.message ?? ''
|
|
98
99
|
} finally {
|
|
99
100
|
isPreviewing.value = false
|
|
100
101
|
}
|
|
@@ -116,7 +117,8 @@ async function submit(): Promise<void> {
|
|
|
116
117
|
})
|
|
117
118
|
emit('done')
|
|
118
119
|
} catch (error) {
|
|
119
|
-
submitError.value =
|
|
120
|
+
submitError.value =
|
|
121
|
+
resolveError(error, { fallbackKey: `${D}.error` })?.message ?? ''
|
|
120
122
|
} finally {
|
|
121
123
|
isSubmitting.value = false
|
|
122
124
|
}
|
|
@@ -10,7 +10,7 @@ export interface WorkspaceOverview {
|
|
|
10
10
|
ownerName: string | null
|
|
11
11
|
ownerEmail: string | null
|
|
12
12
|
ownerStatus: string
|
|
13
|
-
joinedAt: string | null
|
|
13
|
+
membership: { role: 'owner' | 'member' | 'support'; joinedAt: string } | null
|
|
14
14
|
stripeCustomerId: string | null
|
|
15
15
|
stripeCustomerUrl: string | null
|
|
16
16
|
hasStripeSubscription: boolean
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useApiErrorMessage } from '../../composables/useApiErrorMessage'
|
|
2
1
|
import { formatMinorUnits } from '../../composables/useMoneyFormat'
|
|
3
2
|
import type { SuspensionImpact } from './types'
|
|
4
3
|
|
|
@@ -22,7 +21,7 @@ export function useWorkspaceActions(tenantId: string) {
|
|
|
22
21
|
const { confirm } = useConfirm()
|
|
23
22
|
const { confirmFrom } = useConfirmFrom()
|
|
24
23
|
const toast = useToast()
|
|
25
|
-
const {
|
|
24
|
+
const { presentError } = useApiErrorPresenter()
|
|
26
25
|
const base = `/api/saas/workspaces/${tenantId}`
|
|
27
26
|
const impactRead = useOnDemandRead<SuspensionImpact>(
|
|
28
27
|
() => `${base}/suspension-impact`,
|
|
@@ -47,11 +46,7 @@ export function useWorkspaceActions(tenantId: string) {
|
|
|
47
46
|
})
|
|
48
47
|
refreshPageBlocks()
|
|
49
48
|
} catch (error) {
|
|
50
|
-
|
|
51
|
-
title: resolveApiError(error, `${D}.error.prepare`),
|
|
52
|
-
color: 'error',
|
|
53
|
-
icon: 'i-ph-warning-circle',
|
|
54
|
-
})
|
|
49
|
+
presentError(error, { fallbackKey: `${D}.error.prepare` })
|
|
55
50
|
}
|
|
56
51
|
}
|
|
57
52
|
|
|
@@ -6,3 +6,15 @@ export const DATA_EXPORT_PATH = '/settings/workspace/data-export'
|
|
|
6
6
|
export const GENERAL_PATH = '/settings/workspace/general'
|
|
7
7
|
/** Where a workspace switch lands: the previous page belonged to the old tenant. */
|
|
8
8
|
export const HOME_PATH = '/'
|
|
9
|
+
|
|
10
|
+
export function workspaceSwitchLandingPath(
|
|
11
|
+
metadata: unknown,
|
|
12
|
+
): string | undefined {
|
|
13
|
+
return typeof metadata === 'object' &&
|
|
14
|
+
metadata !== null &&
|
|
15
|
+
Object.hasOwn(metadata, 'workspaceScoped') &&
|
|
16
|
+
'workspaceScoped' in metadata &&
|
|
17
|
+
metadata.workspaceScoped === true
|
|
18
|
+
? HOME_PATH
|
|
19
|
+
: undefined
|
|
20
|
+
}
|
|
@@ -30,7 +30,7 @@ interface PortalSession {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
const { $authFetch } = useAuthFetch()
|
|
33
|
-
const {
|
|
33
|
+
const { resolveError } = useApiErrorPresenter()
|
|
34
34
|
const billingStatus = useBillingStatus({ server: !props.isDeferred }).data
|
|
35
35
|
const data = props.isDeferred ? useMountedData(billingStatus) : billingStatus
|
|
36
36
|
const isLoading = ref(false)
|
|
@@ -52,7 +52,9 @@ async function openCustomerPortal(): Promise<void> {
|
|
|
52
52
|
})
|
|
53
53
|
if (typeof window !== 'undefined') window.location.href = result.url
|
|
54
54
|
} catch (error) {
|
|
55
|
-
failure.value =
|
|
55
|
+
failure.value =
|
|
56
|
+
resolveError(error, { fallbackKey: 'saas.tenant_billing.portal.error' })
|
|
57
|
+
?.message ?? ''
|
|
56
58
|
isLoading.value = false
|
|
57
59
|
}
|
|
58
60
|
}
|
|
@@ -16,10 +16,9 @@ const TIME_FORMAT: Intl.DateTimeFormatOptions = {
|
|
|
16
16
|
|
|
17
17
|
const { t, locale } = useI18n()
|
|
18
18
|
const { user } = useCurrentUser()
|
|
19
|
-
const {
|
|
19
|
+
const { presentError } = useApiErrorPresenter()
|
|
20
20
|
const route = useDmsRoute()
|
|
21
21
|
const router = useDmsRouter()
|
|
22
|
-
const toast = useToast()
|
|
23
22
|
const { state, running, load, start, download } = useExportHistory()
|
|
24
23
|
|
|
25
24
|
/** The export this visit watched finish, shown until the page is left. */
|
|
@@ -34,7 +33,11 @@ const runningStatus = useApiData<ExportJobStatus>(
|
|
|
34
33
|
running.value
|
|
35
34
|
? `${EXPORT_STATUS_ENDPOINT}/${encodeURIComponent(running.value.jobId)}`
|
|
36
35
|
: null,
|
|
37
|
-
{
|
|
36
|
+
{
|
|
37
|
+
server: false,
|
|
38
|
+
refreshInterval: POLL_INTERVAL_MS,
|
|
39
|
+
refreshOnPageRefresh: false,
|
|
40
|
+
},
|
|
38
41
|
)
|
|
39
42
|
|
|
40
43
|
const email = computed(() => user.value?.email ?? '')
|
|
@@ -70,25 +73,21 @@ function errorStatus(error: unknown): number | undefined {
|
|
|
70
73
|
return typeof status === 'number' ? status : undefined
|
|
71
74
|
}
|
|
72
75
|
|
|
73
|
-
function notifyError(error: unknown, fallbackKey: string): void {
|
|
74
|
-
toast.add({
|
|
75
|
-
title: resolveApiError(error, fallbackKey),
|
|
76
|
-
color: 'error',
|
|
77
|
-
icon: 'i-ph-warning-circle',
|
|
78
|
-
})
|
|
79
|
-
}
|
|
80
|
-
|
|
81
76
|
async function requestExport(): Promise<void> {
|
|
82
77
|
finished.value = null
|
|
83
78
|
expiredLinkJobId.value = null
|
|
84
|
-
await start().catch((error) =>
|
|
79
|
+
await start().catch((error) =>
|
|
80
|
+
presentError(error, { fallbackKey: `${KEYS}.error.start` }),
|
|
81
|
+
)
|
|
85
82
|
}
|
|
86
83
|
|
|
87
84
|
async function downloadFinished(): Promise<void> {
|
|
88
85
|
if (!finished.value || isDownloading.value) return
|
|
89
86
|
isDownloading.value = true
|
|
90
87
|
await download(finished.value.jobId, finished.value)
|
|
91
|
-
.catch((error) =>
|
|
88
|
+
.catch((error) =>
|
|
89
|
+
presentError(error, { fallbackKey: `${KEYS}.error.download` }),
|
|
90
|
+
)
|
|
92
91
|
.finally(() => {
|
|
93
92
|
isDownloading.value = false
|
|
94
93
|
})
|
|
@@ -127,7 +126,8 @@ async function consumeDeliveredLink(): Promise<void> {
|
|
|
127
126
|
await clearDeliveredLink()
|
|
128
127
|
} catch (error) {
|
|
129
128
|
const isGone = GONE_STATUSES.has(errorStatus(error) ?? 0)
|
|
130
|
-
if (!isGone)
|
|
129
|
+
if (!isGone)
|
|
130
|
+
return presentError(error, { fallbackKey: `${KEYS}.error.download` })
|
|
131
131
|
expiredLinkJobId.value = jobId
|
|
132
132
|
await clearDeliveredLink()
|
|
133
133
|
}
|
|
@@ -28,8 +28,7 @@ const ROW_TONES: Record<ExportRowState, Tone> = {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
const { t, locale } = useI18n()
|
|
31
|
-
const {
|
|
32
|
-
const toast = useToast()
|
|
31
|
+
const { presentError } = useApiErrorPresenter()
|
|
33
32
|
const { state, running, load, goToPage, start, download } = useExportHistory()
|
|
34
33
|
|
|
35
34
|
const downloadingJobId = ref<string | null>(null)
|
|
@@ -80,20 +79,14 @@ function detail(entry: ExportHistoryEntry): string {
|
|
|
80
79
|
return t('saas.workspace.data_export.scope')
|
|
81
80
|
}
|
|
82
81
|
|
|
83
|
-
function notifyError(error: unknown, fallbackKey: string): void {
|
|
84
|
-
toast.add({
|
|
85
|
-
title: resolveApiError(error, fallbackKey),
|
|
86
|
-
color: 'error',
|
|
87
|
-
icon: 'i-ph-warning-circle',
|
|
88
|
-
})
|
|
89
|
-
}
|
|
90
|
-
|
|
91
82
|
async function downloadEntry(entry: ExportHistoryEntry): Promise<void> {
|
|
92
83
|
if (downloadingJobId.value) return
|
|
93
84
|
downloadingJobId.value = entry.jobId
|
|
94
85
|
await download(entry.jobId, entry)
|
|
95
86
|
.catch((error) =>
|
|
96
|
-
|
|
87
|
+
presentError(error, {
|
|
88
|
+
fallbackKey: 'saas.workspace.data_export.error.download',
|
|
89
|
+
}),
|
|
97
90
|
)
|
|
98
91
|
.finally(() => {
|
|
99
92
|
downloadingJobId.value = null
|
|
@@ -102,7 +95,9 @@ async function downloadEntry(entry: ExportHistoryEntry): Promise<void> {
|
|
|
102
95
|
|
|
103
96
|
function requestAnother(): Promise<void> {
|
|
104
97
|
return start().catch((error) =>
|
|
105
|
-
|
|
98
|
+
presentError(error, {
|
|
99
|
+
fallbackKey: 'saas.workspace.data_export.error.start',
|
|
100
|
+
}),
|
|
106
101
|
)
|
|
107
102
|
}
|
|
108
103
|
</script>
|
|
@@ -33,7 +33,7 @@ const { t } = useI18n()
|
|
|
33
33
|
const toast = useToast()
|
|
34
34
|
const { confirm } = useConfirm()
|
|
35
35
|
const { $authFetch } = useAuthFetch()
|
|
36
|
-
const {
|
|
36
|
+
const { presentError, resolveError } = useApiErrorPresenter()
|
|
37
37
|
|
|
38
38
|
const preview = ref<CreditNotePreview | null>(null)
|
|
39
39
|
const isLoading = ref(true)
|
|
@@ -61,7 +61,8 @@ async function load(): Promise<void> {
|
|
|
61
61
|
preview.value = await previewRead.read()
|
|
62
62
|
draft.reset(preview.value)
|
|
63
63
|
} catch (error) {
|
|
64
|
-
loadError.value =
|
|
64
|
+
loadError.value =
|
|
65
|
+
resolveError(error, { fallbackKey: `${TEXT}.load_failed` })?.message ?? ''
|
|
65
66
|
} finally {
|
|
66
67
|
isLoading.value = false
|
|
67
68
|
}
|
|
@@ -166,11 +167,7 @@ async function creditDirectly(): Promise<void> {
|
|
|
166
167
|
try {
|
|
167
168
|
announce(await issue())
|
|
168
169
|
} catch (error) {
|
|
169
|
-
|
|
170
|
-
title: resolveApiError(error, `${TEXT}.error`),
|
|
171
|
-
color: 'error',
|
|
172
|
-
icon: 'i-ph-warning-circle',
|
|
173
|
-
})
|
|
170
|
+
presentError(error, { fallbackKey: `${TEXT}.error` })
|
|
174
171
|
} finally {
|
|
175
172
|
isSubmitting.value = false
|
|
176
173
|
}
|
|
@@ -41,7 +41,7 @@ const HEADING_LEVEL_OFFSET = 1
|
|
|
41
41
|
const { t, locale } = useI18n()
|
|
42
42
|
const route = useDmsRoute()
|
|
43
43
|
const publicFetch = usePublicFetch()
|
|
44
|
-
const {
|
|
44
|
+
const { resolveError } = useApiErrorPresenter()
|
|
45
45
|
|
|
46
46
|
const payload = ref<LegalDocumentsPayload | null>(null)
|
|
47
47
|
const isLoading = ref(true)
|
|
@@ -137,7 +137,9 @@ async function loadDocument(): Promise<void> {
|
|
|
137
137
|
try {
|
|
138
138
|
payload.value = await publicFetch<LegalDocumentsPayload>(LEGAL_ENDPOINT)
|
|
139
139
|
} catch (error) {
|
|
140
|
-
loadError.value =
|
|
140
|
+
loadError.value =
|
|
141
|
+
resolveError(error, { fallbackKey: 'saas.public.legal.load_error' })
|
|
142
|
+
?.message ?? ''
|
|
141
143
|
} finally {
|
|
142
144
|
isLoading.value = false
|
|
143
145
|
}
|
|
@@ -243,8 +245,7 @@ onMounted(() => {
|
|
|
243
245
|
</p>
|
|
244
246
|
</header>
|
|
245
247
|
<DmsCard>
|
|
246
|
-
<!--
|
|
247
|
-
<!-- eslint-disable-next-line vue/no-v-html -->
|
|
248
|
+
<!-- eslint-disable-next-line vue/no-v-html -- Legal documents are platform-admin-authored HTML. -->
|
|
248
249
|
<div
|
|
249
250
|
class="prose prose-neutral dark:prose-invert max-w-none"
|
|
250
251
|
v-html="legalDocument.html"
|
|
@@ -36,7 +36,7 @@ const { $authFetch } = useAuthFetch()
|
|
|
36
36
|
const { t } = useI18n()
|
|
37
37
|
const { confirmFrom } = useConfirmFrom()
|
|
38
38
|
const toast = useToast()
|
|
39
|
-
const {
|
|
39
|
+
const { presentError } = useApiErrorPresenter()
|
|
40
40
|
|
|
41
41
|
const reading = ref<StripeReading | null>(null)
|
|
42
42
|
const loadFailed = ref(false)
|
|
@@ -83,10 +83,7 @@ async function openSettlement(kind: UncertainResolution): Promise<void> {
|
|
|
83
83
|
onConfirm: () => settle(kind),
|
|
84
84
|
})
|
|
85
85
|
} catch (error) {
|
|
86
|
-
|
|
87
|
-
color: 'error',
|
|
88
|
-
title: resolveApiError(error, `${DETAIL}.settle_failed`),
|
|
89
|
-
})
|
|
86
|
+
presentError(error, { fallbackKey: `${DETAIL}.settle_failed` })
|
|
90
87
|
}
|
|
91
88
|
}
|
|
92
89
|
|
|
@@ -3,8 +3,7 @@ import { computed, ref } from 'vue'
|
|
|
3
3
|
|
|
4
4
|
const KEY_PREFIX = 'saas.workspace.plan.checkout_pending'
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
const { resolveApiError } = useApiErrorMessage()
|
|
6
|
+
const { presentError } = useApiErrorPresenter()
|
|
8
7
|
const { prompt, resume, startOver } = usePendingCheckout()
|
|
9
8
|
|
|
10
9
|
const isRestarting = ref(false)
|
|
@@ -32,11 +31,7 @@ async function restart(): Promise<void> {
|
|
|
32
31
|
try {
|
|
33
32
|
await startOver()
|
|
34
33
|
} catch (error) {
|
|
35
|
-
|
|
36
|
-
title: resolveApiError(error, `${KEY_PREFIX}.restart_error`),
|
|
37
|
-
color: 'error',
|
|
38
|
-
icon: 'i-ph-warning-circle',
|
|
39
|
-
})
|
|
34
|
+
presentError(error, { fallbackKey: `${KEY_PREFIX}.restart_error` })
|
|
40
35
|
isRestarting.value = false
|
|
41
36
|
}
|
|
42
37
|
}
|
|
@@ -31,7 +31,7 @@ const DATE_TIME_FORMAT: Intl.DateTimeFormatOptions = {
|
|
|
31
31
|
const { t, locale } = useI18n()
|
|
32
32
|
const toast = useToast()
|
|
33
33
|
const { $authFetch } = useAuthFetch()
|
|
34
|
-
const {
|
|
34
|
+
const { presentError } = useApiErrorPresenter()
|
|
35
35
|
const live = useLiveFormValues(() => props.componentId)
|
|
36
36
|
|
|
37
37
|
const status = ref<PlanTaxSyncStatus | null>(props.modelValue ?? null)
|
|
@@ -77,11 +77,7 @@ async function resync(): Promise<void> {
|
|
|
77
77
|
icon: 'i-ph-check-circle',
|
|
78
78
|
})
|
|
79
79
|
} catch (error) {
|
|
80
|
-
|
|
81
|
-
title: resolveApiError(error, `${TEXT}.resync_failed`),
|
|
82
|
-
color: 'error',
|
|
83
|
-
icon: 'i-ph-warning-circle',
|
|
84
|
-
})
|
|
80
|
+
presentError(error, { fallbackKey: `${TEXT}.resync_failed` })
|
|
85
81
|
} finally {
|
|
86
82
|
isSyncing.value = false
|
|
87
83
|
}
|
|
@@ -20,7 +20,7 @@ const PREVIEW_DEBOUNCE_MS = 400
|
|
|
20
20
|
|
|
21
21
|
const toast = useToast()
|
|
22
22
|
const { t, locale } = useI18n()
|
|
23
|
-
const {
|
|
23
|
+
const { presentError, resolveError } = useApiErrorPresenter()
|
|
24
24
|
const identity = useBillingIdentity()
|
|
25
25
|
const { changePlan, previewChange } = useTenantPlanChanges()
|
|
26
26
|
const { offerFor: offerPendingCheckout } = usePendingCheckout()
|
|
@@ -113,10 +113,9 @@ async function price(): Promise<void> {
|
|
|
113
113
|
previewFailure.value = null
|
|
114
114
|
} catch (error) {
|
|
115
115
|
preview.value = null
|
|
116
|
-
previewFailure.value =
|
|
117
|
-
error,
|
|
118
|
-
|
|
119
|
-
)
|
|
116
|
+
previewFailure.value =
|
|
117
|
+
resolveError(error, { fallbackKey: `${KEY_PREFIX}.preview_failed` })
|
|
118
|
+
?.message ?? ''
|
|
120
119
|
} finally {
|
|
121
120
|
isPricing.value = false
|
|
122
121
|
}
|
|
@@ -149,10 +148,6 @@ watch(
|
|
|
149
148
|
},
|
|
150
149
|
)
|
|
151
150
|
|
|
152
|
-
function notifyError(title: string): void {
|
|
153
|
-
toast.add({ title, color: 'error', icon: 'i-ph-warning-circle' })
|
|
154
|
-
}
|
|
155
|
-
|
|
156
151
|
/**
|
|
157
152
|
* The identity is saved first: the plan change checks the plan's audience
|
|
158
153
|
* against the stored customer type, and Stripe Checkout bills the customer
|
|
@@ -163,7 +158,11 @@ async function confirm(): Promise<void> {
|
|
|
163
158
|
if (!plan) return
|
|
164
159
|
hasTriedSubmit.value = true
|
|
165
160
|
if (invalidFields.value.length > 0) {
|
|
166
|
-
|
|
161
|
+
toast.add({
|
|
162
|
+
title: t('saas.tenant_billing.billing_info.incomplete_toast'),
|
|
163
|
+
color: 'warning',
|
|
164
|
+
icon: 'i-ph-warning-circle',
|
|
165
|
+
})
|
|
167
166
|
return
|
|
168
167
|
}
|
|
169
168
|
isSubmitting.value = true
|
|
@@ -186,7 +185,7 @@ async function confirm(): Promise<void> {
|
|
|
186
185
|
open.value = false
|
|
187
186
|
return
|
|
188
187
|
}
|
|
189
|
-
|
|
188
|
+
presentError(error, { fallbackKey: 'saas.workspace.plan.change_error' })
|
|
190
189
|
} finally {
|
|
191
190
|
isSubmitting.value = false
|
|
192
191
|
}
|
|
@@ -35,9 +35,8 @@ const MAX_INITIALS = 2
|
|
|
35
35
|
|
|
36
36
|
const { $authFetch } = useAuthFetch()
|
|
37
37
|
const { t, locale } = useI18n()
|
|
38
|
-
const toast = useToast()
|
|
39
38
|
const { confirm } = useConfirm()
|
|
40
|
-
const {
|
|
39
|
+
const { presentError, resolveError } = useApiErrorPresenter()
|
|
41
40
|
|
|
42
41
|
const targetId = computed(() => props.routeParams?.id ?? '')
|
|
43
42
|
const baseUrl = computed(
|
|
@@ -63,7 +62,8 @@ const isLoading = computed(
|
|
|
63
62
|
)
|
|
64
63
|
const loadError = computed(() =>
|
|
65
64
|
page.error.value
|
|
66
|
-
?
|
|
65
|
+
? (resolveError(page.error.value, { fallbackKey: `${N}.error.load` })
|
|
66
|
+
?.message ?? '')
|
|
67
67
|
: null,
|
|
68
68
|
)
|
|
69
69
|
const isSubmitting = ref(false)
|
|
@@ -120,11 +120,7 @@ async function submit(): Promise<void> {
|
|
|
120
120
|
// The note is listed before the button comes back.
|
|
121
121
|
await refreshPageBlocks()
|
|
122
122
|
} catch (error) {
|
|
123
|
-
|
|
124
|
-
color: 'error',
|
|
125
|
-
icon: 'i-ph-warning',
|
|
126
|
-
title: resolveApiError(error, `${N}.error.create`),
|
|
127
|
-
})
|
|
123
|
+
presentError(error, { fallbackKey: `${N}.error.create` })
|
|
128
124
|
} finally {
|
|
129
125
|
isSubmitting.value = false
|
|
130
126
|
}
|
|
@@ -25,7 +25,7 @@ import type { PlanInterval } from '../composables/usePlanIntervalLabel'
|
|
|
25
25
|
const SKELETON_CARDS = 3
|
|
26
26
|
|
|
27
27
|
const { t } = useI18n()
|
|
28
|
-
const {
|
|
28
|
+
const { resolveError } = useApiErrorPresenter()
|
|
29
29
|
const config = useDmsRuntimeConfig()
|
|
30
30
|
const saasConfig = config.public.dmsSaas as
|
|
31
31
|
| DmsSaasPublicRuntimeConfig
|
|
@@ -41,7 +41,9 @@ const isLoading = computed(
|
|
|
41
41
|
)
|
|
42
42
|
const loadError = computed(() =>
|
|
43
43
|
pricingRead.error.value
|
|
44
|
-
?
|
|
44
|
+
? (resolveError(pricingRead.error.value, {
|
|
45
|
+
fallbackKey: 'saas.public.pricing.load_error',
|
|
46
|
+
})?.message ?? '')
|
|
45
47
|
: null,
|
|
46
48
|
)
|
|
47
49
|
const interval = ref<PlanInterval>('month')
|
|
@@ -57,7 +57,6 @@ const { $authFetch } = useAuthFetch()
|
|
|
57
57
|
const toast = useToast()
|
|
58
58
|
const { t, locale } = useI18n()
|
|
59
59
|
const { confirm } = useConfirm()
|
|
60
|
-
const { resolveApiError } = useApiErrorMessage()
|
|
61
60
|
const { formatMinorUnits } = useMoneyFormat()
|
|
62
61
|
const billingStatus = useBillingStatus()
|
|
63
62
|
const tenantPlan = useTenantPlan()
|
|
@@ -223,7 +222,10 @@ async function requestRefund(): Promise<void> {
|
|
|
223
222
|
try {
|
|
224
223
|
await submitRefund()
|
|
225
224
|
} catch (error) {
|
|
226
|
-
throw new
|
|
225
|
+
throw new ConfirmActionError(
|
|
226
|
+
{ fallbackKey: `${KEY_PREFIX}.error` },
|
|
227
|
+
{ cause: error },
|
|
228
|
+
)
|
|
227
229
|
}
|
|
228
230
|
},
|
|
229
231
|
})
|