diff --git a/src/frontend/app/administration/shipping/shipping-administration.component.html b/src/frontend/app/administration/shipping/shipping-administration.component.html index 00038eb0733b8780fa626e01f1748d1fee85a7b1..09ea0f5d17363fe17615a88f311aac74bcaef514 100644 --- a/src/frontend/app/administration/shipping/shipping-administration.component.html +++ b/src/frontend/app/administration/shipping/shipping-administration.component.html @@ -10,6 +10,9 @@ <mat-spinner style="margin:auto;"></mat-spinner> </div> <mat-card *ngIf="!loading" class="card-app-content"> + <div *ngIf="!shippingAvailable" class="alert-message alert-message-danger" role="alert" [innerHTML]="lang.shippingUnavailable" style="max-width: 100%"> + </div> + <form class="form-horizontal" (ngSubmit)="onSubmit()" #shippingForm="ngForm"> <div class="form-group"> <div class="col-sm-12"> @@ -135,4 +138,4 @@ </mat-list> </mat-sidenav> </mat-sidenav-container> -</div> \ No newline at end of file +</div> diff --git a/src/frontend/app/administration/shipping/shipping-administration.component.ts b/src/frontend/app/administration/shipping/shipping-administration.component.ts index 3ff4151e973ba1f93fa68c4e63286450e3508845..2e366c2cc64da7e3aac1f4ff92bf308bddb81b4a 100644 --- a/src/frontend/app/administration/shipping/shipping-administration.component.ts +++ b/src/frontend/app/administration/shipping/shipping-administration.component.ts @@ -6,6 +6,8 @@ import { NotificationService } from '../../notification.service'; import { HeaderService } from '../../../service/header.service'; import { ActivatedRoute, Router } from '@angular/router'; import { AppService } from '../../../service/app.service'; +import {catchError, tap} from "rxjs/operators"; +import {of} from "rxjs"; declare function $j(selector: any): any; @@ -61,6 +63,8 @@ export class ShippingAdministrationComponent implements OnInit { ]; hidePassword: boolean = true; + shippingAvailable: boolean = false; + constructor( @@ -79,6 +83,18 @@ export class ShippingAdministrationComponent implements OnInit { window['MainHeaderComponent'].setSnav(this.sidenavLeft); window['MainHeaderComponent'].setSnavRight(this.sidenavRight); + this.http.get("../../rest/externalConnectionsEnabled").pipe( + tap((data: any) => { + console.log(data); + this.shippingAvailable = data.connection.maileva === true; + console.log(this.shippingAvailable) + }), + catchError((err: any) => { + this.notify.handleErrors(err); + return of(false); + }) + ).subscribe(); + this.route.params.subscribe(params => { if (typeof params['id'] == "undefined") { this.headerService.setHeader(this.lang.shippingCreation); diff --git a/src/frontend/lang/lang-en.ts b/src/frontend/lang/lang-en.ts index a18c1efb3399444a6b3e667b87579ad045a0d5bf..3284be571a6355e8eb66ce2929fae9612aa46553 100755 --- a/src/frontend/lang/lang-en.ts +++ b/src/frontend/lang/lang-en.ts @@ -1583,5 +1583,6 @@ export const LANG_EN = { "mustEditAttachmentFirst" : "You must edit the attachment first", "saveAndClose" : "Save and close", "opinionCircuit" : "Opinion circuit", - "visaCircuit" : "Visa circuit", + "visaCircuit" : "Visa circuit", + "shippingUnavailable" : "<b>Warning </b> Shipping is not activated. Check the configuration file mailevaConfig.xml", }; diff --git a/src/frontend/lang/lang-fr.ts b/src/frontend/lang/lang-fr.ts index c7dce329448b0f3afcffbe07228af187c1ba0893..72abd3825c5db420009081cdd3f4c497b95e3e49 100755 --- a/src/frontend/lang/lang-fr.ts +++ b/src/frontend/lang/lang-fr.ts @@ -1622,5 +1622,6 @@ export const LANG_FR = { "mustEditAttachmentFirst" : "Vous devez d'abord éditer la pièce jointe", "saveAndClose" : "Enregistrer et fermer", "opinionCircuit" : "Circuit d'avis", - "visaCircuit" : "Circuit de visa", + "visaCircuit" : "Circuit de visa", + "shippingUnavailable" : "<b>Attention !</b> Maileva n'est pas activé. Veuillez vérifier le fichier de configuration mailevaConfig.xml", }; diff --git a/src/frontend/lang/lang-nl.ts b/src/frontend/lang/lang-nl.ts index 0c9d2c01cb9c8f1e630e09f32e5740875b48c2d3..38ae2ce1264235e2f61793f7067c0ac6ad0c6e8a 100755 --- a/src/frontend/lang/lang-nl.ts +++ b/src/frontend/lang/lang-nl.ts @@ -1609,4 +1609,5 @@ export const LANG_NL = { "saveAndClose" : "Save and close", //_TO_TRANSLATE "opinionCircuit" : "Opinion circuit", //_TO_TRANSLATE "visaCircuit" : "Visa circuit", //_TO_TRANSLATE + "shippingUnavailable" : "<b>Warning </b> Shipping is not activated. Check the configuration file mailevaConfig.xml", //_TO_TRANSLATE };