diff --git a/assets/js/components/Config/GeneralConfig.vue b/assets/js/components/Config/GeneralConfig.vue index 78657518d..00120e20e 100644 --- a/assets/js/components/Config/GeneralConfig.vue +++ b/assets/js/components/Config/GeneralConfig.vue @@ -33,15 +33,16 @@ v-if="$hiddenFeatures()" test-id="generalconfig-sponsoring" :label="$t('config.sponsor.title')" - :text="sponsorStatus.name || '---'" - :text-class="sponsorStatus.cssClass" + :text="sponsorStatus.title" + :text-class="sponsorStatus.textClass" modal-id="sponsorModal" experimental > @@ -79,6 +80,9 @@ export default { name: "GeneralConfig", components: { TitleModal, GeneralConfigEntry }, mixins: [formatter], + props: { + sponsorError: Boolean, + }, emits: ["site-changed"], data() { return { @@ -103,12 +107,27 @@ export default { sponsorStatus() { const sponsor = store.state?.sponsor || {}; const { name, expiresSoon } = sponsor; - let cssClass = ""; + let textClass = ""; + let badgeClass = ""; + let title = name; if (name) { - cssClass = expiresSoon ? "text-warning" : "text-primary"; + if (expiresSoon) { + textClass = "text-warning"; + badgeClass = "bg-warning"; + } else { + badgeClass = "bg-primary"; + } + } else { + title = "---"; } - return { name, expiresSoon, cssClass }; + if (this.sponsorError) { + textClass = "text-danger"; + badgeClass = "bg-danger"; + title = this.$t("config.sponsor.invalid"); + } + + return { title, expiresSoon, textClass, badgeClass }; }, }, async mounted() { diff --git a/assets/js/components/Config/JsonModal.vue b/assets/js/components/Config/JsonModal.vue index 7224ae2ba..33f140080 100644 --- a/assets/js/components/Config/JsonModal.vue +++ b/assets/js/components/Config/JsonModal.vue @@ -21,6 +21,7 @@ class="d-flex justify-content-between order-2 order-sm-1 gap-2 flex-grow-1 flex-sm-grow-0" >