| @@ -1,10 +1,10 @@ | |||||
| <div class="card"> | <div class="card"> | ||||
| <div class="card-body row"> | <div class="card-body row"> | ||||
| <div class="col-4"> | <div class="col-4"> | ||||
| <h1>spawntree GmbH</h1> | |||||
| <p>Bauernvogtskoppel 6c<br/> | |||||
| 21465 Wentorf<br/> | |||||
| Deutschland</p> | |||||
| <h1>{{partner.name}}</h1> | |||||
| <p>{{partner.street}} {{partner.streetNo}}<br/> | |||||
| {{partner.zip}} {{partner.city}}<br/> | |||||
| {{partner.country}}</p> | |||||
| <p>Sprache: Deutsch</p> | <p>Sprache: Deutsch</p> | ||||
| </div> | </div> | ||||
| <div class="col-4"> | <div class="col-4"> | ||||
| @@ -12,6 +12,8 @@ | |||||
| <dl> | <dl> | ||||
| <dt>Telefon:</dt> | <dt>Telefon:</dt> | ||||
| <dd>0177 289 23 02</dd> | <dd>0177 289 23 02</dd> | ||||
| <dt>Website:</dt> | |||||
| <dd><a href="{{partner.website}}" target="_blank">{{partner.website}}</a></dd> | |||||
| <dt>Streckenpunkt:</dt> | <dt>Streckenpunkt:</dt> | ||||
| <dd>AT-Salzburg</dd> | <dd>AT-Salzburg</dd> | ||||
| <dt>Geschäftsbuchungsgruppe:</dt> | <dt>Geschäftsbuchungsgruppe:</dt> | ||||
| @@ -23,8 +25,8 @@ | |||||
| </dl> | </dl> | ||||
| </div> | </div> | ||||
| <div class="col-4"> | <div class="col-4"> | ||||
| <img src="./assets/images/specific/matsen_logo.svg" width="247" height="94" | |||||
| alt="{{'basic.company-name' | translate}}"/> | |||||
| <img src="{{environment.basePath}}{{partnerLogo}}" width="247" height="94" | |||||
| alt="{{partner.name}}" title="{{partner.name}}" /> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| @@ -3,6 +3,9 @@ import {NgbModal} from "@ng-bootstrap/ng-bootstrap"; | |||||
| import {ModalComponent} from "@app/_components/modal/modal.component"; | import {ModalComponent} from "@app/_components/modal/modal.component"; | ||||
| import {NewContactComponent} from "@app/partners/new-contact/new-contact.component"; | import {NewContactComponent} from "@app/partners/new-contact/new-contact.component"; | ||||
| import {ActivatedRoute} from "@angular/router"; | import {ActivatedRoute} from "@angular/router"; | ||||
| import {MediaObjectService, PartnerJsonld, PartnerService} from "@app/core/api/v1"; | |||||
| import {Subscription} from "rxjs"; | |||||
| import {environment} from "@environments/environment"; | |||||
| @Component({ | @Component({ | ||||
| selector: 'app-partners-detail', | selector: 'app-partners-detail', | ||||
| @@ -13,12 +16,23 @@ export class PartnersDetailComponent implements OnInit { | |||||
| private closeResult = ''; | private closeResult = ''; | ||||
| protected id: string; | protected id: string; | ||||
| protected partnerDetailSub: Subscription; | |||||
| protected partner: PartnerJsonld; | |||||
| protected partnerLogoSub: Subscription; | |||||
| protected partnerLogo: string|null|undefined; | |||||
| protected readonly ModalComponent = ModalComponent; | protected readonly ModalComponent = ModalComponent; | ||||
| constructor( | constructor( | ||||
| private modalService: NgbModal, | private modalService: NgbModal, | ||||
| private route: ActivatedRoute | |||||
| private route: ActivatedRoute, | |||||
| private partnerService: PartnerService, | |||||
| private mediaObjectService: MediaObjectService | |||||
| ) { | ) { | ||||
| this.id = ""; | this.id = ""; | ||||
| this.partnerDetailSub = new Subscription(); | |||||
| this.partner = {}; | |||||
| this.partnerLogoSub = new Subscription(); | |||||
| this.partnerLogo = ""; | |||||
| } | } | ||||
| openModalNewContact() { | openModalNewContact() { | ||||
| const modalRef = this.modalService.open(ModalComponent); | const modalRef = this.modalService.open(ModalComponent); | ||||
| @@ -30,5 +44,33 @@ export class PartnersDetailComponent implements OnInit { | |||||
| this.id = params['id']; | this.id = params['id']; | ||||
| // Hier kannst du die Logik für die Anzeige der Details für den bestimmten Partner implementieren | // Hier kannst du die Logik für die Anzeige der Details für den bestimmten Partner implementieren | ||||
| }); | }); | ||||
| this.getData(); | |||||
| } | |||||
| getData() | |||||
| { | |||||
| this.partnerDetailSub = this.partnerService.partnersIdGet( | |||||
| "1" | |||||
| ).subscribe( | |||||
| data => { | |||||
| console.log(data); | |||||
| this.partner = data; | |||||
| // TODO: logoUrl ist hier falsch, wir müssten nur die ID des logos haben... | |||||
| let logoUrl: string = typeof data.logo === 'string' ? data.logo : ""; | |||||
| this.partnerLogoSub = this.mediaObjectService.mediaObjectsIdGet( | |||||
| // logoUrl | |||||
| "4" | |||||
| ).subscribe( | |||||
| data => { | |||||
| this.partnerLogo = data.contentUrl; | |||||
| console.log(this.partnerLogo); | |||||
| } | |||||
| ); | |||||
| } | |||||
| ); | |||||
| } | } | ||||
| protected readonly environment = environment; | |||||
| } | } | ||||
| @@ -14,7 +14,7 @@ | |||||
| <th mat-header-cell *matHeaderCellDef mat-sort-header sortActionDescription="Nach Partner sortieren"> | <th mat-header-cell *matHeaderCellDef mat-sort-header sortActionDescription="Nach Partner sortieren"> | ||||
| Partner | Partner | ||||
| </th> | </th> | ||||
| <td mat-cell *matCellDef="let element"><a [routerLink]="['/customers', element.name]">{{ element.name }}</a></td> | |||||
| <td mat-cell *matCellDef="let element"><span (click)="navigateToDetails(element)">{{ element.name }}</span></td> | |||||
| </ng-container> | </ng-container> | ||||
| <ng-container matColumnDef="address"> | <ng-container matColumnDef="address"> | ||||
| @@ -1,12 +1,10 @@ | |||||
| import {AfterViewInit, ChangeDetectorRef, Component, OnInit, ViewChild} from '@angular/core'; | import {AfterViewInit, ChangeDetectorRef, Component, OnInit, ViewChild} from '@angular/core'; | ||||
| import {MatSort, Sort, MatSortModule} from "@angular/material/sort"; | import {MatSort, Sort, MatSortModule} from "@angular/material/sort"; | ||||
| import {LiveAnnouncer} from "@angular/cdk/a11y"; | |||||
| import {MatTableDataSource, MatTableModule} from "@angular/material/table"; | import {MatTableDataSource, MatTableModule} from "@angular/material/table"; | ||||
| import {ActivatedRoute, RouterLink, RouterLinkActive} from "@angular/router"; | |||||
| import {ActivatedRoute, Router, RouterLink, RouterLinkActive} from "@angular/router"; | |||||
| import {Subscription} from "rxjs"; | import {Subscription} from "rxjs"; | ||||
| import {PartnerJsonld, PartnerService} from "@app/core/api/v1"; | import {PartnerJsonld, PartnerService} from "@app/core/api/v1"; | ||||
| import {MatPaginator, MatPaginatorIntl, MatPaginatorModule, PageEvent} from "@angular/material/paginator"; | import {MatPaginator, MatPaginatorIntl, MatPaginatorModule, PageEvent} from "@angular/material/paginator"; | ||||
| import {NumberInput} from "@angular/cdk/coercion"; | |||||
| import {OrderFilter} from "@app/_models/orderFilter"; | import {OrderFilter} from "@app/_models/orderFilter"; | ||||
| @Component({ | @Component({ | ||||
| @@ -37,7 +35,8 @@ export class PartnersComponent implements OnInit, AfterViewInit { | |||||
| constructor( | constructor( | ||||
| private route: ActivatedRoute, | private route: ActivatedRoute, | ||||
| private partnerService: PartnerService | |||||
| private partnerService: PartnerService, | |||||
| private router: Router | |||||
| ) { | ) { | ||||
| this.sort = new MatSort(); | this.sort = new MatSort(); | ||||
| this.paginator = new MatPaginator(new MatPaginatorIntl(), ChangeDetectorRef.prototype); | this.paginator = new MatPaginator(new MatPaginatorIntl(), ChangeDetectorRef.prototype); | ||||
| @@ -125,5 +124,8 @@ export class PartnersComponent implements OnInit, AfterViewInit { | |||||
| this.getData(); | this.getData(); | ||||
| } | } | ||||
| protected readonly Number = Number; | |||||
| navigateToDetails(partner: any) { | |||||
| // this.partnerService.setPartnerData(partner); | |||||
| this.router.navigate(['/customers', partner.name]); | |||||
| } | |||||
| } | } | ||||