Skip to content

Commit

Permalink
Added toast
Browse files Browse the repository at this point in the history
  • Loading branch information
fabienSvstr committed Dec 23, 2024
1 parent 5a1035a commit b37dfdb
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
7 changes: 4 additions & 3 deletions client/src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1696,7 +1696,8 @@
"orders": {
"new": {
"title": "You need to create a new organization?",
"button": "New request"
"button": "New request",
"sent": "Your request has been sent."
},
"request": {
"title": "Request a new on-premise contract",
Expand Down Expand Up @@ -1724,8 +1725,8 @@
"label": "Describe your needs",
"placeholder": "Tell us more about your needs, expectations, and constraints..."
},
"connectionFailure": "Failed to contact the server.",
"serverFailure": "The server refused the request."
"connectionFailure": "An error occured (Failed to contact the server).",
"serverFailure": "An error occured (server request refused."
}
}
},
Expand Down
7 changes: 4 additions & 3 deletions client/src/locales/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -1696,7 +1696,8 @@
"orders": {
"new": {
"title": "Vous avez besoin de créer une nouvelle organisation ?",
"button": "Nouvelle demande"
"button": "Nouvelle demande",
"sent": "Votre demande a bien été envoyée."
},
"request": {
"title": "Demande d'un contrat sur-mesure",
Expand Down Expand Up @@ -1724,8 +1725,8 @@
"label": "Décrire vos besoins",
"placeholder": "Dites-nous en plus sur vos besoins, vos attentes et vos contraintes..."
},
"connectionFailure": "Impossible de contacter le serveur.",
"serverFailure": "Le serveur a refuse la requête."
"connectionFailure": "Un problème est survenu (connexion au serveur impossible).",
"serverFailure": "Un problème est survenu (requête serveur refusée)."
}
}
},
Expand Down
1 change: 1 addition & 0 deletions client/src/views/client-area/ClientAreaPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
v-if="currentPage === ClientAreaPages.Orders"
:organization="currentOrganization"
@organization-selected="onOrganizationSelected"
:information-manager="informationManager"
/>
<custom-order-billing-details-page
v-if="currentPage === ClientAreaPages.CustomOrderBillingDetails"
Expand Down
15 changes: 14 additions & 1 deletion client/src/views/client-area/orders/OrdersPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import { IonText, IonButton, modalController } from '@ionic/vue';
import { BmsAccessInstance, BmsOrganization, CustomOrderDetailsResultData, DataType } from '@/services/bms';
import NewOrderModal from '@/views/client-area/orders/NewOrderModal.vue';
import { ref, onMounted } from 'vue';
import { Information, InformationLevel, InformationManager, PresentationMode } from '@/services/informationManager';
import { MsModalResult } from 'megashark-lib';

const error = ref<string>('');
const querying = ref(true);
Expand All @@ -37,12 +39,23 @@ async function openNewOrderModal(): Promise<void> {
cssClass: 'new-order-modal',
});
await modal.present();
await modal.onWillDismiss();
const { role } = await modal.onDidDismiss();
await modal.dismiss();
if (role === MsModalResult.Confirm) {
await props.informationManager.present(
new Information({
message: 'clientArea.orders.new.sent',
level: InformationLevel.Success,
}),
PresentationMode.Toast,
);
}
await modal.dismiss();
}

const props = defineProps<{
organization: BmsOrganization;
informationManager: InformationManager;
}>();

onMounted(async () => {
Expand Down

0 comments on commit b37dfdb

Please sign in to comment.