From 1391cfd6bfcb8351263e2e6f4c8cf90eaa9c2558 Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Sat, 5 Jul 2025 13:11:31 +0000 Subject: [PATCH] Extract UsageLimitsSection as vue-facing-decorator component and integrate into AccountViewView - Created UsageLimitsSection.vue using vue-facing-decorator (class-based, TypeScript, @Component, @Prop, @Emit). - Moved 'Usage Limits' UI and logic (status, spinner, message, recheck button) into the new component. - Replaced original usage limits section markup in AccountViewView.vue with . - Passed loadingLimits and limitsMessage props, and wired up @recheck-limits event to call checkLimits(). - Ensured all linter errors are resolved and code is consistent with project conventions. --- src/components/UsageLimitsSection.vue | 28 +++++++++ src/views/AccountViewView.vue | 91 ++++----------------------- 2 files changed, 39 insertions(+), 80 deletions(-) create mode 100644 src/components/UsageLimitsSection.vue diff --git a/src/components/UsageLimitsSection.vue b/src/components/UsageLimitsSection.vue new file mode 100644 index 00000000..6b5be2a3 --- /dev/null +++ b/src/components/UsageLimitsSection.vue @@ -0,0 +1,28 @@ + + + \ No newline at end of file diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue index b5b444ed..231d8451 100644 --- a/src/views/AccountViewView.vue +++ b/src/views/AccountViewView.vue @@ -248,86 +248,11 @@
Saving...
-
-

Usage Limits

- -
- Checking… - -
-
- {{ limitsMessage }} -
-
-

- You have done - {{ endorserLimits?.doneClaimsThisWeek ?? "?" }} claim{{ - Number(endorserLimits?.doneClaimsThisWeek || 0) === 1 ? "" : "s" - }} - out of {{ endorserLimits?.maxClaimsPerWeek ?? "?" }} for this - week. Your claims counter resets at - {{ - readableDate(endorserLimits?.nextWeekBeginDateTime) - }} -

-

- You have done - {{ - endorserLimits?.doneRegistrationsThisMonth ?? "?" - }} - registration{{ - Number(endorserLimits?.doneRegistrationsThisMonth || 0) === 1 - ? "" - : "s" - }} - out of - {{ endorserLimits?.maxRegistrationsPerMonth ?? "?" }} for this - this month. - (You cannot register anyone on your first day.) - Your registration counter resets at - - {{ readableDate(endorserLimits?.nextMonthBeginDateTime) }} - -

-

- You have uploaded - {{ imageLimits?.doneImagesThisWeek ?? "?" }} image{{ - Number(imageLimits?.doneImagesThisWeek || 0) === 1 ? "" : "s" - }} - out of {{ imageLimits?.maxImagesPerWeek ?? "?" }} for this - week. Your image counter resets at - {{ - readableDate(imageLimits?.nextWeekBeginDateTime || "") - }} -

-
- -
+ @@ -844,6 +769,7 @@ import DataExportSection from "../components/DataExportSection.vue"; import IdentitySection from '@/components/IdentitySection.vue'; import RegistrationNotice from '@/components/RegistrationNotice.vue'; import LocationSearchSection from '@/components/LocationSearchSection.vue'; +import UsageLimitsSection from '@/components/UsageLimitsSection.vue'; import { AppString, DEFAULT_IMAGE_API_SERVER, @@ -900,6 +826,7 @@ const inputImportFileNameRef = ref(); IdentitySection, RegistrationNotice, LocationSearchSection, + UsageLimitsSection, }, mixins: [PlatformServiceMixin], }) @@ -1726,5 +1653,9 @@ export default class AccountViewView extends Vue { // TODO: Implement search area dialog logic this.notify.info('Search area dialog not yet implemented.'); } + + onRecheckLimits() { + this.checkLimits(); + } }