Skip to content

Commit

Permalink
Update password warning messages and add action button
Browse files Browse the repository at this point in the history
  • Loading branch information
stephdl committed May 6, 2024
1 parent 651eb53 commit bdfa223
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 7 deletions.
5 changes: 3 additions & 2 deletions ui/public/i18n/language.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@
"mail_server_is_not_valid": "This mail server cannot be used by Piler",
"host_pattern": "Must be a valid fully qualified domain name",
"host_format": "Must be a valid fully qualified domain name",
"password_warning": "The passwords are the default ones",
"password_warning_description": "Please change the password in the Piler webapp for admin@local(pilerrocks) and auditor@local(auditor)",
"password_warning": "Change {user} password",
"password_warning_description": "The default password {password} of {user} must be changed",
"go_to_piler": "Go to Piler",
"import_email_is_running_warning": "Import emails is running",
"import_email_is_running_description": "Please wait until the import emails action is finished",
"import_email_to_piler": "Import emails to Piler",
Expand Down
41 changes: 36 additions & 5 deletions ui/src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,39 @@
/>
</cv-column>
</cv-row>
<cv-row v-if="is_default_password">
<cv-row v-if="piler_is_running && is_default_password_admin">
<cv-column>
<NsInlineNotification
kind="warning"
:title="$t('settings.password_warning')"
:description="$t('settings.password_warning_description')"
:title="$t('settings.password_warning', {user:'admin@local'})"
:description="$t('settings.password_warning_description', {user:'admin@local', password:'pilerrocks'})"
:showCloseButton="false"
@click="goToPilerWebapp"
:actionLabel="$t('settings.go_to_piler')"
/>
</cv-column>
</cv-row>
<!-- the button is displayed in the admin warning box, do not need to display twice -->
<cv-row v-if="piler_is_running && is_default_password_auditor && is_default_password_admin">
<cv-column>
<NsInlineNotification
kind="warning"
:title="$t('settings.password_warning', {user:'auditor@local'})"
:description="$t('settings.password_warning_description', {user:'auditor@local', password:'auditor'})"
:showCloseButton="false"
/>
</cv-column>
</cv-row>
<!-- only the admin password has been changed, let's display the button to go to piler -->
<cv-row v-if="piler_is_running && is_default_password_auditor && !is_default_password_admin">
<cv-column>
<NsInlineNotification
kind="warning"
:title="$t('settings.password_warning', {user:'auditor@local'})"
:description="$t('settings.password_warning_description', {user:'auditor@local', password:'auditor'})"
:showCloseButton="false"
@click="goToPilerWebapp"
:actionLabel="$t('settings.go_to_piler')"
/>
</cv-column>
</cv-row>
Expand Down Expand Up @@ -192,7 +218,8 @@ export default {
import_email_is_running: false,
piler_is_running: false,
always_bcc_correctly_set: false,
is_default_password: false,
is_default_password_admin: false,
is_default_password_auditor: false,
isLetsEncryptEnabled: false,
isHttpToHttpsEnabled: false,
loading: {
Expand Down Expand Up @@ -228,6 +255,9 @@ export default {
next();
},
methods: {
goToPilerWebapp() {
window.open(`https://${this.host}`, "_blank");
},
async getConfiguration() {
this.loading.getConfiguration = true;
this.error.getConfiguration = "";
Expand Down Expand Up @@ -280,7 +310,8 @@ export default {
this.mail_server = config.mail_server;
});
this.mail_server_URL = config.mail_server_URL;
this.is_default_password = config.is_default_password;
this.is_default_password_admin = config.is_default_password_admin;
this.is_default_password_auditor = config.is_default_password_auditor;
this.import_email_is_running = config.import_email_is_running;
this.piler_is_running = config.piler_is_running;
this.always_bcc_correctly_set = config.always_bcc_correctly_set;
Expand Down

0 comments on commit bdfa223

Please sign in to comment.