Skip to content

Commit

Permalink
enh(oauth2): allowed toggling of aria label
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Morales <[email protected]>
  • Loading branch information
emoral435 committed Dec 13, 2023
1 parent b9fe130 commit 2a82c03
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
14 changes: 11 additions & 3 deletions apps/oauth2/src/components/OAuthItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@
<div class="action-secret">
<code>{{ renderedSecret }}</code>
<NcButton type="tertiary-no-background"
:aria-label="t('oauth2', 'Show client secret')"
:aria-label="toggleAriaLabel"
@click="toggleSecret">
<template #icon>
<EyeOutline :size="20"
:title="t('oauth2', 'Show client secret')" />
<EyeOutline :size="20"/>
</template>
</NcButton>
</div>
Expand Down Expand Up @@ -87,6 +86,15 @@ export default {
return '****'
}
},

toggleAriaLabel() {
// if the secret key is not rendered (for examples, !this.rendered == '*******'), then suggest to show the secret key
if (!this.renderSecret) {
return t('oauth2', 'Show client secret')
} else {
return t('oauth2', 'Hide client secret')
}
}
},
methods: {
toggleSecret() {
Expand Down
Loading

0 comments on commit 2a82c03

Please sign in to comment.