Skip to content

Commit

Permalink
fix: missing account url link in my profile page
Browse files Browse the repository at this point in the history
  • Loading branch information
ymarcon committed Sep 11, 2024
1 parent bbd3a15 commit 4d28fe2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
19 changes: 17 additions & 2 deletions opal-ui/src/components/profile/ProfileUser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@
:label="$t('user_profile.update_password')"
@click="onUpdatePassword"
/>
<div v-else-if="profile?.accountUrl">
<q-btn
no-caps
color="primary"
size="sm"
icon-right="open_in_new"
:label="$t('user_profile.external_account')"
@click="onAccountLink"
/>
</div>
<div v-else square class="box-info q-mt-md" text-color="white" icon="warning">
<q-icon name="info" size="1.2rem" />
<span class="on-right">{{ $t('user_profile.password_update_not_allowed', { realm: profile?.realm }) }}</span>
Expand Down Expand Up @@ -310,9 +320,10 @@ const columns = computed(() => [
const tokenNames = computed(() => tokens.value.map((t) => t.name));
const otpIcon = computed(() => (profile.value?.otpEnabled ? 'lock_open' : 'lock'));
const isOpalUserRealm = computed(() => profile.value && 'opal-user-realm' === profile.value.realm);
const realms = computed(() => profile.value?.realm?.split(',') || []);
const isOpalUserRealm = computed(() => realms.value?.includes('opal-user-realm'));
const isAnOpalRealm = computed(
() => profile.value && ['opal-ini-realm', 'opal-user-realm'].includes(profile.value.realm)
() => profile.value && (realms.value?.includes('opal-user-realm') || realms.value?.includes('opal-ini-realm'))
);
const androidOtpUrl = computed(() => {
return `<a href="https://play.google.com/store/apps/details?id=com.azure.authenticator" target="_blank">${t(
Expand Down Expand Up @@ -435,4 +446,8 @@ onMounted(() => {
loading.value = false;
});
});
function onAccountLink() {
window.open(profile.value?.accountUrl, '_blank');
}
</script>
1 change: 1 addition & 0 deletions opal-ui/src/i18n/en/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ export default {
android_only_otp: 'Android only',
ios_otp: 'iOS',
update_password: 'Update Password',
external_account: 'External account',
enable_2fa: 'Enable 2FA',
disable_2fa: 'Disable 2FA',
otp_qr_core_info: 'Open the authenticator mobile app and scan this QR code to initialise your PIN code generator:',
Expand Down
1 change: 1 addition & 0 deletions opal-ui/src/i18n/fr/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ export default {
android_only_otp: 'Android uniquement',
ios_otp: 'iOS',
update_password: 'Mettre à jour le mot de passe',
external_account: 'Compte externe',
enable_2fa: 'Activer 2FA',
disable_2fa: 'Désactiver 2FA',
otp_qr_core_info: "Ouvrez l'application mobile authenticator et scannez ce code QR pour initialiser votre générateur de code PIN :",
Expand Down

0 comments on commit 4d28fe2

Please sign in to comment.