From f500a0f87fccb4b77c160c91dff3d5b6cd0642b9 Mon Sep 17 00:00:00 2001
From: "Grigorii K. Shartsev"
Date: Wed, 21 Feb 2024 22:12:38 +0100
Subject: [PATCH 1/4] chore(updatenotification): lint
Signed-off-by: Grigorii K. Shartsev
---
.../src/components/UpdateNotification.vue | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/apps/updatenotification/src/components/UpdateNotification.vue b/apps/updatenotification/src/components/UpdateNotification.vue
index 16a98799a8647..0dc0188cb2cd4 100644
--- a/apps/updatenotification/src/components/UpdateNotification.vue
+++ b/apps/updatenotification/src/components/UpdateNotification.vue
@@ -85,7 +85,11 @@
{{ t('updatenotification', 'Your version is up to date.') }}
-
+
@@ -131,8 +135,8 @@
-
Date: Wed, 21 Feb 2024 22:14:44 +0100
Subject: [PATCH 2/4] fix(updatenotification): a11y of channel menu
Signed-off-by: Grigorii K. Shartsev
---
.../src/components/UpdateNotification.vue | 86 +++++--------------
1 file changed, 20 insertions(+), 66 deletions(-)
diff --git a/apps/updatenotification/src/components/UpdateNotification.vue b/apps/updatenotification/src/components/UpdateNotification.vue
index 0dc0188cb2cd4..8a91bddca6ca6 100644
--- a/apps/updatenotification/src/components/UpdateNotification.vue
+++ b/apps/updatenotification/src/components/UpdateNotification.vue
@@ -112,18 +112,16 @@
-
-
+ @update:modelValue="changeReleaseChannel">
{{ channel.longtext }}
@@ -274,41 +272,34 @@ export default {
icon: 'icon-star',
active: this.currentChannel === 'enterprise',
disabled: !this.hasValidSubscription,
- action: this.changeReleaseChannelToEnterprise,
+ value: 'enterprise',
})
channelList.push({
text: t('updatenotification', 'Stable'),
longtext: t('updatenotification', 'The most recent stable version. It is suited for regular use and will always update to the latest major version.'),
icon: 'icon-checkmark',
- active: this.currentChannel === 'stable',
- action: this.changeReleaseChannelToStable,
+ value: 'stable',
})
channelList.push({
text: t('updatenotification', 'Beta'),
longtext: t('updatenotification', 'A pre-release version only for testing new features, not for production environments.'),
icon: 'icon-category-customization',
- active: this.currentChannel === 'beta',
- action: this.changeReleaseChannelToBeta,
+ value: 'beta',
})
- if (this.isNonDefaultChannel) {
+ if (this.isNonDefaultChannel(this.currentChannel)) {
channelList.push({
text: this.currentChannel,
icon: 'icon-rename',
- active: true,
- action: () => {},
+ value: this.currentChannel,
})
}
return channelList
},
- isNonDefaultChannel() {
- return this.currentChannel !== 'enterprise' && this.currentChannel !== 'stable' && this.currentChannel !== 'beta'
- },
-
localizedChannelName() {
switch (this.currentChannel) {
case 'enterprise':
@@ -433,16 +424,16 @@ export default {
form.submit()
})
},
- changeReleaseChannelToEnterprise() {
- this.changeReleaseChannel('enterprise')
- },
- changeReleaseChannelToStable() {
- this.changeReleaseChannel('stable')
- },
- changeReleaseChannelToBeta() {
- this.changeReleaseChannel('beta')
+
+ isNonDefaultChannel(channel) {
+ return !['enterprise', 'stable', 'beta'].includes(channel)
},
+
changeReleaseChannel(channel) {
+ if (this.isNonDefaultChannel(channel)) {
+ return
+ }
+
this.currentChannel = channel
axios.post(generateUrl('/apps/updatenotification/channel'), {
@@ -503,46 +494,9 @@ export default {
.applist {
margin-bottom: 25px;
}
-
- .update-menu {
- position: relative;
- cursor: pointer;
- margin-left: 3px;
- display: inline-block;
- padding: 10px;
- border-radius: 10px;
- border: 2px solid var(--color-border-dark);
- .icon-update-menu {
- cursor: inherit;
- .icon-triangle-s {
- display: inline-block;
- vertical-align: middle;
- cursor: inherit;
- opacity: 1;
- }
- }
- }
}