Skip to content

Commit 4f799bb

Browse files
committed
enh(oauth2): allowed toggling of aria label
Signed-off-by: Eduardo Morales <emoral435@gmail.com>
1 parent b9fe130 commit 4f799bb

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

apps/oauth2/src/components/OAuthItem.vue

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@
2828
<div class="action-secret">
2929
<code>{{ renderedSecret }}</code>
3030
<NcButton type="tertiary-no-background"
31-
:aria-label="t('oauth2', 'Show client secret')"
31+
:aria-label="toggleAriaLabel"
3232
@click="toggleSecret">
3333
<template #icon>
34-
<EyeOutline :size="20"
35-
:title="t('oauth2', 'Show client secret')" />
34+
<EyeOutline :size="20"/>
3635
</template>
3736
</NcButton>
3837
</div>
@@ -87,6 +86,18 @@ export default {
8786
return '****'
8887
}
8988
},
89+
90+
/**
91+
* toggles the aria-label for button to show the secret key for OAuth 2.0 Clients
92+
*/
93+
toggleAriaLabel() {
94+
// if the secret key is not rendered (for examples, !this.rendered == '*******'), then suggest to show the secret key
95+
if (!this.renderSecret) {
96+
return t('oauth2', 'Show client secret')
97+
} else {
98+
return t('oauth2', 'Hide client secret')
99+
}
100+
}
90101
},
91102
methods: {
92103
toggleSecret() {

0 commit comments

Comments
 (0)