Skip to content

Commit

Permalink
[MS] Correctly update error messages on organization creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ironicbay committed Sep 10, 2024
1 parent 15e5526 commit 633ce62
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions client/src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@
"errors": {
"timestampOutOfBallpark": "Your device time differs from the server time. Please check your device clock and make sure it is up-to-date (your device time is {clientTime}, server time is {serverTime}).",
"offline": "Failed to contact server. Please make sure you are online.",
"customOffline": "Failed to contact server. Please make sure you are online and that the server address is valid.",
"alreadyExists": "This organization name is not available, please choose another one.",
"generic": "Failed to create the organization (reason: {reason}).",
"customOrderNotAuthorized": "Clients with a custom contract are not allowed to directly create organizations. If you need another organization, please contact us."
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@
"errors": {
"timestampOutOfBallpark": "L'heure de votre appareil est différente de celle du serveur. Veuillez vérifier votre horloge et vous assurer qu'elle est à jour (l'horloge de votre machine est {clientTime}, l'horloge du serveur est {serverTime}).",
"offline": "Impossible de contacter le serveur. Veuillez vérifier que vous êtes connecté(e) à Internet.",
"customOffline": "Impossible de contacter le serveur. Veuillez vérifier que vous êtes connecté(e) à Internet et que l'adresse du serveur est correcte.",
"alreadyExists": "Ce nom d'organisation n'est pas disponible, veuillez en choisir un autre.",
"generic": "Impossible de créer l'organisation (raison: {reason}).",
"customOrderNotAuthorized": "Les clients sous contrat personnalisé ne sont pas autorisés à créer une organisation directement. Si vous avez besoin d'une organisation supplémentaire, veuillez nous contacter."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@
:can-edit-email="true"
:can-edit-name="true"
:can-edit-organization-name="props.bootstrapLink === undefined"
:can-edit-server-address="props.bootstrapLink === undefined"
:can-edit-save-strategy="true"
@create-clicked="onCreateClicked"
@update-email-clicked="onUpdatePersonalInformationClicked"
@update-name-clicked="onUpdatePersonalInformationClicked"
@update-organization-name-clicked="onUpdateOrganizationNameClicked"
@update-server-address-clicked="onUpdateOrganizationNameClicked"
@update-save-strategy-clicked="onUpdateSaveStrategyClicked"
@close-requested="$emit('closeRequested')"
@go-back-requested="onGoBackRequested"
Expand Down Expand Up @@ -146,6 +148,7 @@ async function onUserInformationFilled(chosenName: string, chosenEmail: string):
}
async function onAuthenticationChosen(chosenSaveStrategy: DeviceSaveStrategy): Promise<void> {
currentError.value = undefined;
saveStrategy.value = chosenSaveStrategy;
step.value = Steps.Summary;
}
Expand Down Expand Up @@ -206,7 +209,7 @@ async function onCreateClicked(): Promise<void> {
if (result.error.tag === BootstrapOrganizationErrorTag.AlreadyUsedToken) {
currentError.value = 'CreateOrganization.errors.alreadyExists';
} else if (result.error.tag === BootstrapOrganizationErrorTag.Offline) {
currentError.value = 'CreateOrganization.errors.offline';
currentError.value = 'CreateOrganization.errors.customOffline';
} else {
currentError.value = { key: 'CreateOrganization.errors.generic', data: { reason: result.error.tag } };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
:can-edit-email="false"
:can-edit-name="false"
:can-edit-organization-name="true"
:can-edit-server-address="false"
:can-edit-save-strategy="true"
@create-clicked="onCreateClicked"
@update-save-strategy-clicked="onUpdateSaveStrategyClicked"
Expand Down Expand Up @@ -168,6 +169,7 @@ async function onAuthenticationChosen(chosenSaveStrategy: DeviceSaveStrategy): P
if (!personalInformation.value) {
window.electronAPI.log('error', 'OrganizationCreation: missing data on auth chosen, should not happen');
}
currentError.value = undefined;
saveStrategy.value = chosenSaveStrategy;
step.value = Steps.Summary;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@
<ion-text class="summary-item__text body-lg">
{{ serverType === ServerType.Saas ? $msTranslate('CreateOrganization.saas') : $msTranslate('CreateOrganization.customServer') }}
</ion-text>
<ion-button
v-show="canEditServerAddress"
fill="clear"
class="summary-item__button"
@click="$emit('updateServerAddressClicked')"
>
{{ $msTranslate('CreateOrganization.button.modify') }}
</ion-button>
</div>
</ion-item>

Expand Down Expand Up @@ -177,6 +185,7 @@ defineProps<{
name: string;
saveStrategy: DeviceSaveStrategyTag;
canEditOrganizationName?: boolean;
canEditServerAddress?: boolean;
canEditEmail?: boolean;
canEditName?: boolean;
canEditSaveStrategy?: boolean;
Expand All @@ -186,6 +195,7 @@ defineProps<{
defineEmits<{
(e: 'createClicked'): void;
(e: 'updateOrganizationNameClicked'): void;
(e: 'updateServerAddressClicked'): void;
(e: 'updateNameClicked'): void;
(e: 'updateEmailClicked'): void;
(e: 'updateSaveStrategyClicked'): void;
Expand Down

0 comments on commit 633ce62

Please sign in to comment.