Skip to content

Commit

Permalink
login. Created error in case of missing subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyco97 committed Jun 3, 2024
1 parent b967fd1 commit e71b90a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
4 changes: 3 additions & 1 deletion ui/src/i18n/locale-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@
"session_expired": "Your session has expired",
"login_again": "Please login again",
"user": "User",
"password": "Password"
"password": "Password",
"enterprise_version_title": "Functionality not active",
"enterprise_version_message": "Reports available only on Enterprise version"
},
"caption": {
"recallTime": "Recall time",
Expand Down
4 changes: 3 additions & 1 deletion ui/src/i18n/locale-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@
"session_expired": "La tua sessione è scaduta",
"login_again": "Per favore, accedere nuovamente",
"user": "Utente",
"password": "Password"
"password": "Password",
"enterprise_version_title": "Funzionalità non attiva",
"enterprise_version_message": "Report disponibili solo sulla versione Enterprise"
},
"caption": {
"recallTime": "Tempo di Richiamata",
Expand Down
18 changes: 16 additions & 2 deletions ui/src/views/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,20 @@
v-model="password"
/>
</sui-form-field>
<sui-message error>
<sui-message v-if="error === 'invalid_credentials'" error>
<sui-message-header>
<i class="exclamation triangle icon"></i>
{{ $t("login.invalid_credentials") }}
</sui-message-header>
<p>{{ $t("login.invalid_user_pass_try") }}.</p>
</sui-message>
<sui-message v-if="error === 'enterprise_version'" error>
<sui-message-header>
<i class="exclamation triangle icon"></i>
{{ $t("login.enterprise_version_title") }}
</sui-message-header>
<p>{{ $t("login.enterprise_version_message") }}.</p>
</sui-message>
<sui-message warning>
<sui-message-header>
<i class="exclamation triangle icon"></i>
Expand Down Expand Up @@ -128,7 +135,14 @@ export default {
this.loading = false;
// show errors
this.error = true;
if (
error.body.message ===
"Reports available only on Enterprise version"
) {
this.error = "enterprise_version";
} else {
this.error = "invalid_credentials";
}
// print error
console.error(error.body);
Expand Down

0 comments on commit e71b90a

Please sign in to comment.