From d943b67270e363ae8e22f3d725020060f6029858 Mon Sep 17 00:00:00 2001 From: Zack Spear Date: Tue, 3 Oct 2023 17:58:03 -0700 Subject: [PATCH] refactor: Registration component regExp usage & styles --- web/components/Registration.ce.vue | 7 +- web/components/Registration/Item.vue | 4 +- .../Registration/UpdateExpiration.vue | 64 +++++++++++++++++++ ...iration.vue => UpdateExpirationAction.vue} | 28 ++++---- 4 files changed, 84 insertions(+), 19 deletions(-) create mode 100644 web/components/Registration/UpdateExpiration.vue rename web/components/Registration/{UpgradeExpiration.vue => UpdateExpirationAction.vue} (71%) diff --git a/web/components/Registration.ce.vue b/web/components/Registration.ce.vue index ac832d194..5890dfb52 100644 --- a/web/components/Registration.ce.vue +++ b/web/components/Registration.ce.vue @@ -31,7 +31,7 @@ import type { RegistrationItemProps } from '~/types/registration'; import KeyActions from '~/components/KeyActions.vue'; import RegistrationReplaceCheck from '~/components/Registration/ReplaceCheck.vue'; -import RegistrationUpgradeExpiration from '~/components/Registration/UpgradeExpiration.vue'; +import RegistrationUpdateExpirationAction from '~/components/Registration/UpdateExpirationAction.vue'; import UserProfileUptimeExpire from '~/components/UserProfile/UptimeExpire.vue'; const { t } = useI18n(); @@ -111,9 +111,9 @@ const items = computed((): RegistrationItemProps[] => { text: formatDate(regTm.value), }] : []), ...(regExp.value && (state.value === 'STARTER' || state.value === 'UNLEASHED') ? [{ - error: regUpdatesExpired.value, label: t('OS Update Eligibility'), - component: RegistrationUpgradeExpiration, + warning: regUpdatesExpired.value, + component: RegistrationUpdateExpirationAction, componentProps: { t }, componentOpacity: !regUpdatesExpired.value, }] @@ -186,6 +186,7 @@ const items = computed((): RegistrationItemProps[] => { :component="item?.component" :component-props="item?.componentProps" :error="item.error ?? false" + :warning="item.warning ?? false" :label="item.label" :text="item.text" > diff --git a/web/components/Registration/Item.vue b/web/components/Registration/Item.vue index 9e6eb1963..31544dbfe 100644 --- a/web/components/Registration/Item.vue +++ b/web/components/Registration/Item.vue @@ -8,6 +8,7 @@ import { RegistrationItemProps } from '~/types/registration'; withDefaults(defineProps(), { error: false, text: '', + warning: false, }); const { darkMode } = storeToRefs(useThemeStore()); @@ -20,8 +21,9 @@ const evenBgColor = computed(() => {