| @@ -11,6 +11,7 @@ import {ProductsDetailComponent} from "@app/products/products-detail/products-de | |||||
| import {DocumentsComponent} from "@app/documents/documents.component"; | import {DocumentsComponent} from "@app/documents/documents.component"; | ||||
| import {ContactsComponent} from "@app/contacts/contacts.component"; | import {ContactsComponent} from "@app/contacts/contacts.component"; | ||||
| import {ContactsDetailComponent} from "@app/contacts/contacts-detail/contacts-detail.component"; | import {ContactsDetailComponent} from "@app/contacts/contacts-detail/contacts-detail.component"; | ||||
| import {TasksComponent} from "@app/tasks/tasks.component"; | |||||
| const accountModule = () => import('./account/account.module').then(x => x.AccountModule); | const accountModule = () => import('./account/account.module').then(x => x.AccountModule); | ||||
| const usersModule = () => import('./users/users.module').then(x => x.UsersModule); | const usersModule = () => import('./users/users.module').then(x => x.UsersModule); | ||||
| @@ -64,6 +65,14 @@ const routes: Routes = [ | |||||
| {path: ':id', component: ProductsDetailComponent, data: {dataType: 'product-detail'}}, | {path: ':id', component: ProductsDetailComponent, data: {dataType: 'product-detail'}}, | ||||
| ] | ] | ||||
| }, | }, | ||||
| { | |||||
| path: 'tasks', | |||||
| component: TwoColumnComponent, | |||||
| canActivate: [AuthGuard], | |||||
| children: [ | |||||
| {path: '', component: TasksComponent, data: {dataType: 'task'}}, | |||||
| ] | |||||
| }, | |||||
| { | { | ||||
| path: 'documents', | path: 'documents', | ||||
| component: TwoColumnComponent, | component: TwoColumnComponent, | ||||
| @@ -30,6 +30,13 @@ import {PropertyInterceptor} from "@app/_helpers/property.interceptor"; | |||||
| import {MatPaginatorModule} from "@angular/material/paginator"; | import {MatPaginatorModule} from "@angular/material/paginator"; | ||||
| import {MatSortModule} from "@angular/material/sort"; | import {MatSortModule} from "@angular/material/sort"; | ||||
| import {MatTableModule} from "@angular/material/table"; | import {MatTableModule} from "@angular/material/table"; | ||||
| import { PostingsComponent } from './postings/postings.component'; | |||||
| import { NewPostingComponent } from './postings/new-posting/new-posting.component'; | |||||
| import { TasksComponent } from './tasks/tasks.component'; | |||||
| import { NewTaskComponent } from './tasks/new-task/new-task.component'; | |||||
| import { NewPartnerComponent } from './partners/new-partner/new-partner.component'; | |||||
| import { NewDocumentComponent } from './documents/new-document/new-document.component'; | |||||
| import { NewProductComponent } from './products/new-product/new-product.component'; | |||||
| export function apiConfigFactory(): Configuration { | export function apiConfigFactory(): Configuration { | ||||
| const params: ConfigurationParameters = { | const params: ConfigurationParameters = { | ||||
| @@ -80,7 +87,14 @@ export function HttpLoaderFactory(http: HttpClient) { | |||||
| PartnersDetailComponent, | PartnersDetailComponent, | ||||
| NewContactComponent, | NewContactComponent, | ||||
| ContactsComponent, | ContactsComponent, | ||||
| ContactsDetailComponent | |||||
| ContactsDetailComponent, | |||||
| PostingsComponent, | |||||
| NewPostingComponent, | |||||
| TasksComponent, | |||||
| NewTaskComponent, | |||||
| NewPartnerComponent, | |||||
| NewDocumentComponent, | |||||
| NewProductComponent | |||||
| ], | ], | ||||
| providers: [ | providers: [ | ||||
| {provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true}, | {provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true}, | ||||
| @@ -24,7 +24,7 @@ | |||||
| <div class="posts"> | <div class="posts"> | ||||
| <div class="d-flex justify-content-between align-items-start"> | <div class="d-flex justify-content-between align-items-start"> | ||||
| <h2>Notizen</h2> | <h2>Notizen</h2> | ||||
| <button>Neue Notiz</button> | |||||
| <button (click)="openModalNewPosting()">Neue Notiz</button> | |||||
| </div> | </div> | ||||
| <div *ngFor="let post of posts"> | <div *ngFor="let post of posts"> | ||||
| <div class="post mb-3"> | <div class="post mb-3"> | ||||
| @@ -5,6 +5,9 @@ import {Subscription} from "rxjs"; | |||||
| import {ActivatedRoute} from "@angular/router"; | import {ActivatedRoute} from "@angular/router"; | ||||
| import {MatPaginator, MatPaginatorIntl, PageEvent} from "@angular/material/paginator"; | import {MatPaginator, MatPaginatorIntl, PageEvent} from "@angular/material/paginator"; | ||||
| import {MatTableDataSource} from "@angular/material/table"; | import {MatTableDataSource} from "@angular/material/table"; | ||||
| import {NewPostingComponent} from "@app/postings/new-posting/new-posting.component"; | |||||
| import {ModalComponent} from "@app/_components/modal/modal.component"; | |||||
| import {NgbModal} from "@ng-bootstrap/ng-bootstrap"; | |||||
| @Component({ | @Component({ | ||||
| selector: 'app-contacts-detail', | selector: 'app-contacts-detail', | ||||
| @@ -30,7 +33,8 @@ export class ContactsDetailComponent implements OnInit, AfterViewInit { | |||||
| constructor( | constructor( | ||||
| private contactService: ContactService, | private contactService: ContactService, | ||||
| private route: ActivatedRoute, | private route: ActivatedRoute, | ||||
| private postService: PostService | |||||
| private postService: PostService, | |||||
| private modalService: NgbModal | |||||
| ) { | ) { | ||||
| this.id = ""; | this.id = ""; | ||||
| this.contact = {} as ContactJsonld; | this.contact = {} as ContactJsonld; | ||||
| @@ -94,4 +98,9 @@ export class ContactsDetailComponent implements OnInit, AfterViewInit { | |||||
| this.postsPageSize = e.pageSize.valueOf(); | this.postsPageSize = e.pageSize.valueOf(); | ||||
| this.getPostsData(); | this.getPostsData(); | ||||
| } | } | ||||
| openModalNewPosting() { | |||||
| const modalRef = this.modalService.open(ModalComponent); | |||||
| modalRef.componentInstance.dynamicComponent = NewPostingComponent; | |||||
| } | |||||
| } | } | ||||
| @@ -1 +1,3 @@ | |||||
| <p>contacts works!</p> | <p>contacts works!</p> | ||||
| <!-- This page is not used at the moment --> | |||||
| <!-- "all contacts" could be listed here --> | |||||
| @@ -1,3 +1,7 @@ | |||||
| <div class="d-flex justify-content-between align-items-start"> | |||||
| <h2>Dokumente</h2> | |||||
| <button (click)="openModalNewDocument()">Neues Dokument</button> | |||||
| </div> | |||||
| <table mat-table [dataSource]="dataSource" matSort (matSortChange)="onSortChange($event)" | <table mat-table [dataSource]="dataSource" matSort (matSortChange)="onSortChange($event)" | ||||
| class="mat-elevation-z8"> | class="mat-elevation-z8"> | ||||
| @@ -6,8 +6,11 @@ import {PartnerJsonld} from "@app/core/api/v1"; | |||||
| import {Router, RouterLink, RouterLinkActive} from "@angular/router"; | import {Router, RouterLink, RouterLinkActive} from "@angular/router"; | ||||
| import {MatTableDataSource, MatTableModule} from "@angular/material/table"; | import {MatTableDataSource, MatTableModule} from "@angular/material/table"; | ||||
| import {OrderFilter} from "@app/_models/orderFilter"; | import {OrderFilter} from "@app/_models/orderFilter"; | ||||
| import {ApiConverter} from "@app/_helpers/api.converter"; | |||||
| import {NgIf} from "@angular/common"; | import {NgIf} from "@angular/common"; | ||||
| import {ModalComponent} from "@app/_components/modal/modal.component"; | |||||
| import {NewPartnerComponent} from "@app/partners/new-partner/new-partner.component"; | |||||
| import {NgbModal} from "@ng-bootstrap/ng-bootstrap"; | |||||
| import {NewDocumentComponent} from "@app/documents/new-document/new-document.component"; | |||||
| @Component({ | @Component({ | ||||
| selector: 'app-documents', | selector: 'app-documents', | ||||
| @@ -33,7 +36,8 @@ export class DocumentsComponent { | |||||
| protected pageIndex: number; | protected pageIndex: number; | ||||
| constructor( | constructor( | ||||
| private router: Router | |||||
| private router: Router, | |||||
| private modalService: NgbModal | |||||
| ) { | ) { | ||||
| this.sort = new MatSort(); | this.sort = new MatSort(); | ||||
| this.paginator = new MatPaginator(new MatPaginatorIntl(), ChangeDetectorRef.prototype); | this.paginator = new MatPaginator(new MatPaginatorIntl(), ChangeDetectorRef.prototype); | ||||
| @@ -121,4 +125,9 @@ export class DocumentsComponent { | |||||
| // console.log(ApiConverter.extractId(partner.id)); | // console.log(ApiConverter.extractId(partner.id)); | ||||
| // this.router.navigate(['/documents', ApiConverter.extractId(partner.id)]); | // this.router.navigate(['/documents', ApiConverter.extractId(partner.id)]); | ||||
| } | } | ||||
| openModalNewDocument() { | |||||
| const modalRef = this.modalService.open(ModalComponent); | |||||
| modalRef.componentInstance.dynamicComponent = NewDocumentComponent; | |||||
| } | |||||
| } | } | ||||
| @@ -0,0 +1 @@ | |||||
| <p>new-document works!</p> | |||||
| @@ -0,0 +1,23 @@ | |||||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | |||||
| import { NewDocumentComponent } from './new-document.component'; | |||||
| describe('NewDocumentComponent', () => { | |||||
| let component: NewDocumentComponent; | |||||
| let fixture: ComponentFixture<NewDocumentComponent>; | |||||
| beforeEach(async () => { | |||||
| await TestBed.configureTestingModule({ | |||||
| declarations: [NewDocumentComponent] | |||||
| }) | |||||
| .compileComponents(); | |||||
| fixture = TestBed.createComponent(NewDocumentComponent); | |||||
| component = fixture.componentInstance; | |||||
| fixture.detectChanges(); | |||||
| }); | |||||
| it('should create', () => { | |||||
| expect(component).toBeTruthy(); | |||||
| }); | |||||
| }); | |||||
| @@ -0,0 +1,10 @@ | |||||
| import { Component } from '@angular/core'; | |||||
| @Component({ | |||||
| selector: 'app-new-document', | |||||
| templateUrl: './new-document.component.html', | |||||
| styleUrl: './new-document.component.scss' | |||||
| }) | |||||
| export class NewDocumentComponent { | |||||
| } | |||||
| @@ -0,0 +1 @@ | |||||
| <p>new-partner works!</p> | |||||
| @@ -0,0 +1,23 @@ | |||||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | |||||
| import { NewPartnerComponent } from './new-partner.component'; | |||||
| describe('NewPartnerComponent', () => { | |||||
| let component: NewPartnerComponent; | |||||
| let fixture: ComponentFixture<NewPartnerComponent>; | |||||
| beforeEach(async () => { | |||||
| await TestBed.configureTestingModule({ | |||||
| declarations: [NewPartnerComponent] | |||||
| }) | |||||
| .compileComponents(); | |||||
| fixture = TestBed.createComponent(NewPartnerComponent); | |||||
| component = fixture.componentInstance; | |||||
| fixture.detectChanges(); | |||||
| }); | |||||
| it('should create', () => { | |||||
| expect(component).toBeTruthy(); | |||||
| }); | |||||
| }); | |||||
| @@ -0,0 +1,10 @@ | |||||
| import { Component } from '@angular/core'; | |||||
| @Component({ | |||||
| selector: 'app-new-partner', | |||||
| templateUrl: './new-partner.component.html', | |||||
| styleUrl: './new-partner.component.scss' | |||||
| }) | |||||
| export class NewPartnerComponent { | |||||
| } | |||||
| @@ -83,7 +83,7 @@ | |||||
| <div class="posts spt-accordion"> | <div class="posts spt-accordion"> | ||||
| <div class="d-flex justify-content-between align-items-start"> | <div class="d-flex justify-content-between align-items-start"> | ||||
| <h2>Aufgaben</h2> | <h2>Aufgaben</h2> | ||||
| <button>Neue Aufgabe</button> | |||||
| <button (click)="openModalNewTask()">Neue Aufgabe</button> | |||||
| </div> | </div> | ||||
| <div class="card mb-3 p-3"> | <div class="card mb-3 p-3"> | ||||
| <div class="position-relative" data-bs-toggle="collapse" data-bs-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample"> | <div class="position-relative" data-bs-toggle="collapse" data-bs-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample"> | ||||
| @@ -128,7 +128,7 @@ | |||||
| <div class="posts"> | <div class="posts"> | ||||
| <div class="d-flex justify-content-between align-items-start"> | <div class="d-flex justify-content-between align-items-start"> | ||||
| <h2>Notizen</h2> | <h2>Notizen</h2> | ||||
| <button>Neue Notiz</button> | |||||
| <button (click)="openModalNewPosting()">Neue Notiz</button> | |||||
| </div> | </div> | ||||
| <div *ngFor="let post of posts"> | <div *ngFor="let post of posts"> | ||||
| <div class="post mb-3"> | <div class="post mb-3"> | ||||
| @@ -9,6 +9,8 @@ import {environment} from "@environments/environment"; | |||||
| import {ApiConverter} from "@app/_helpers/api.converter"; | import {ApiConverter} from "@app/_helpers/api.converter"; | ||||
| import {MatPaginator, MatPaginatorIntl, PageEvent} from "@angular/material/paginator"; | import {MatPaginator, MatPaginatorIntl, PageEvent} from "@angular/material/paginator"; | ||||
| import {MatTableDataSource} from "@angular/material/table"; | import {MatTableDataSource} from "@angular/material/table"; | ||||
| import {NewPostingComponent} from "@app/postings/new-posting/new-posting.component"; | |||||
| import {NewTaskComponent} from "@app/tasks/new-task/new-task.component"; | |||||
| @Component({ | @Component({ | ||||
| selector: 'app-partners-detail', | selector: 'app-partners-detail', | ||||
| @@ -96,6 +98,16 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { | |||||
| modalRef.componentInstance.dynamicComponent = NewContactComponent; | modalRef.componentInstance.dynamicComponent = NewContactComponent; | ||||
| } | } | ||||
| openModalNewPosting() { | |||||
| const modalRef = this.modalService.open(ModalComponent); | |||||
| modalRef.componentInstance.dynamicComponent = NewPostingComponent; | |||||
| } | |||||
| openModalNewTask() { | |||||
| const modalRef = this.modalService.open(ModalComponent); | |||||
| modalRef.componentInstance.dynamicComponent = NewTaskComponent; | |||||
| } | |||||
| ngOnInit() { | ngOnInit() { | ||||
| this.route.params.subscribe(params => { | this.route.params.subscribe(params => { | ||||
| this.id = params['id']; | this.id = params['id']; | ||||
| @@ -1,3 +1,7 @@ | |||||
| <div class="d-flex justify-content-between align-items-start"> | |||||
| <h2>{{ partnerName }}</h2> | |||||
| <button (click)="openModalNewPartner()">Neuer {{ partnerNameOne }}</button> | |||||
| </div> | |||||
| <table mat-table [dataSource]="dataSource" matSort (matSortChange)="onSortChange($event)" | <table mat-table [dataSource]="dataSource" matSort (matSortChange)="onSortChange($event)" | ||||
| class="mat-elevation-z8"> | class="mat-elevation-z8"> | ||||
| @@ -14,7 +18,8 @@ | |||||
| <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"><span (click)="navigateToPartnerDetails(element)">{{ element.name }}</span></td> | |||||
| <td mat-cell *matCellDef="let element"><span | |||||
| (click)="navigateToPartnerDetails(element)">{{ element.name }}</span></td> | |||||
| </ng-container> | </ng-container> | ||||
| <ng-container matColumnDef="address"> | <ng-container matColumnDef="address"> | ||||
| @@ -8,13 +8,17 @@ import {MatPaginator, MatPaginatorIntl, MatPaginatorModule, PageEvent} from "@an | |||||
| import {OrderFilter} from "@app/_models/orderFilter"; | import {OrderFilter} from "@app/_models/orderFilter"; | ||||
| import {ApiConverter} from "@app/_helpers/api.converter"; | import {ApiConverter} from "@app/_helpers/api.converter"; | ||||
| import {NgIf} from "@angular/common"; | import {NgIf} from "@angular/common"; | ||||
| import {ModalComponent} from "@app/_components/modal/modal.component"; | |||||
| import {NgbModal} from "@ng-bootstrap/ng-bootstrap"; | |||||
| import {NewPartnerComponent} from "@app/partners/new-partner/new-partner.component"; | |||||
| import {TranslateModule, TranslateService} from "@ngx-translate/core"; | |||||
| @Component({ | @Component({ | ||||
| selector: 'app-partners', | selector: 'app-partners', | ||||
| templateUrl: './partners.component.html', | templateUrl: './partners.component.html', | ||||
| styleUrl: './partners.component.scss', | styleUrl: './partners.component.scss', | ||||
| standalone: true, | standalone: true, | ||||
| imports: [MatTableModule, MatSortModule, MatPaginatorModule, RouterLink, RouterLinkActive, NgIf], | |||||
| imports: [MatTableModule, MatSortModule, MatPaginatorModule, RouterLink, RouterLinkActive, NgIf, TranslateModule], | |||||
| }) | }) | ||||
| export class PartnersComponent implements OnInit, AfterViewInit { | export class PartnersComponent implements OnInit, AfterViewInit { | ||||
| @ViewChild(MatSort) sort; | @ViewChild(MatSort) sort; | ||||
| @@ -28,6 +32,8 @@ export class PartnersComponent implements OnInit, AfterViewInit { | |||||
| protected websiteOrderAsc: OrderFilter; | protected websiteOrderAsc: OrderFilter; | ||||
| protected dataType!: string; | protected dataType!: string; | ||||
| protected partnerName: string; | |||||
| protected partnerNameOne: string; | |||||
| protected displayedColumns: string[]; | protected displayedColumns: string[]; | ||||
| protected dataSource; | protected dataSource; | ||||
| @@ -39,7 +45,9 @@ export class PartnersComponent implements OnInit, AfterViewInit { | |||||
| constructor( | constructor( | ||||
| private route: ActivatedRoute, | private route: ActivatedRoute, | ||||
| private partnerService: PartnerService, | private partnerService: PartnerService, | ||||
| private router: Router | |||||
| private router: Router, | |||||
| private modalService: NgbModal, | |||||
| private translateService: TranslateService | |||||
| ) { | ) { | ||||
| this.sort = new MatSort(); | this.sort = new MatSort(); | ||||
| this.paginator = new MatPaginator(new MatPaginatorIntl(), ChangeDetectorRef.prototype); | this.paginator = new MatPaginator(new MatPaginatorIntl(), ChangeDetectorRef.prototype); | ||||
| @@ -57,10 +65,20 @@ export class PartnersComponent implements OnInit, AfterViewInit { | |||||
| this.pageEvent = new PageEvent(); | this.pageEvent = new PageEvent(); | ||||
| this.pageSize = 10; | this.pageSize = 10; | ||||
| this.pageIndex = 0; | this.pageIndex = 0; | ||||
| this.partnerName = ""; | |||||
| this.partnerNameOne = ""; | |||||
| } | } | ||||
| ngOnInit() { | ngOnInit() { | ||||
| this.dataType = this.route.snapshot.data['dataType']; | this.dataType = this.route.snapshot.data['dataType']; | ||||
| // this.translateService.use(this.translateService.getDefaultLang()); | |||||
| this.translateService.get('basic.' + this.dataType).subscribe((translation: string) => { | |||||
| this.partnerName = translation; | |||||
| }); | |||||
| this.translateService.get('basic.' + this.dataType + 'One').subscribe((translation: string) => { | |||||
| this.partnerNameOne = translation; | |||||
| }); | |||||
| this.getData(); | this.getData(); | ||||
| } | } | ||||
| @@ -133,4 +151,9 @@ export class PartnersComponent implements OnInit, AfterViewInit { | |||||
| console.log(ApiConverter.extractId(partner.id)); | console.log(ApiConverter.extractId(partner.id)); | ||||
| this.router.navigate(['/' + partner.type, ApiConverter.extractId(partner.id)]); | this.router.navigate(['/' + partner.type, ApiConverter.extractId(partner.id)]); | ||||
| } | } | ||||
| openModalNewPartner() { | |||||
| const modalRef = this.modalService.open(ModalComponent); | |||||
| modalRef.componentInstance.dynamicComponent = NewPartnerComponent; | |||||
| } | |||||
| } | } | ||||
| @@ -0,0 +1 @@ | |||||
| <p>new-posting works!</p> | |||||
| @@ -0,0 +1,23 @@ | |||||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | |||||
| import { NewPostingComponent } from './new-posting.component'; | |||||
| describe('NewPostingComponent', () => { | |||||
| let component: NewPostingComponent; | |||||
| let fixture: ComponentFixture<NewPostingComponent>; | |||||
| beforeEach(async () => { | |||||
| await TestBed.configureTestingModule({ | |||||
| declarations: [NewPostingComponent] | |||||
| }) | |||||
| .compileComponents(); | |||||
| fixture = TestBed.createComponent(NewPostingComponent); | |||||
| component = fixture.componentInstance; | |||||
| fixture.detectChanges(); | |||||
| }); | |||||
| it('should create', () => { | |||||
| expect(component).toBeTruthy(); | |||||
| }); | |||||
| }); | |||||
| @@ -0,0 +1,10 @@ | |||||
| import { Component } from '@angular/core'; | |||||
| @Component({ | |||||
| selector: 'app-new-posting', | |||||
| templateUrl: './new-posting.component.html', | |||||
| styleUrl: './new-posting.component.scss' | |||||
| }) | |||||
| export class NewPostingComponent { | |||||
| } | |||||
| @@ -0,0 +1,3 @@ | |||||
| <p>postings works!</p> | |||||
| <!-- This page is not used at the moment --> | |||||
| <!-- "all postings" could be listed here --> | |||||
| @@ -0,0 +1,23 @@ | |||||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | |||||
| import { PostingsComponent } from './postings.component'; | |||||
| describe('PostingsComponent', () => { | |||||
| let component: PostingsComponent; | |||||
| let fixture: ComponentFixture<PostingsComponent>; | |||||
| beforeEach(async () => { | |||||
| await TestBed.configureTestingModule({ | |||||
| declarations: [PostingsComponent] | |||||
| }) | |||||
| .compileComponents(); | |||||
| fixture = TestBed.createComponent(PostingsComponent); | |||||
| component = fixture.componentInstance; | |||||
| fixture.detectChanges(); | |||||
| }); | |||||
| it('should create', () => { | |||||
| expect(component).toBeTruthy(); | |||||
| }); | |||||
| }); | |||||
| @@ -0,0 +1,10 @@ | |||||
| import { Component } from '@angular/core'; | |||||
| @Component({ | |||||
| selector: 'app-postings', | |||||
| templateUrl: './postings.component.html', | |||||
| styleUrl: './postings.component.scss' | |||||
| }) | |||||
| export class PostingsComponent { | |||||
| } | |||||
| @@ -0,0 +1 @@ | |||||
| <p>new-product works!</p> | |||||
| @@ -0,0 +1,23 @@ | |||||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | |||||
| import { NewProductComponent } from './new-product.component'; | |||||
| describe('NewProductComponent', () => { | |||||
| let component: NewProductComponent; | |||||
| let fixture: ComponentFixture<NewProductComponent>; | |||||
| beforeEach(async () => { | |||||
| await TestBed.configureTestingModule({ | |||||
| declarations: [NewProductComponent] | |||||
| }) | |||||
| .compileComponents(); | |||||
| fixture = TestBed.createComponent(NewProductComponent); | |||||
| component = fixture.componentInstance; | |||||
| fixture.detectChanges(); | |||||
| }); | |||||
| it('should create', () => { | |||||
| expect(component).toBeTruthy(); | |||||
| }); | |||||
| }); | |||||
| @@ -0,0 +1,10 @@ | |||||
| import { Component } from '@angular/core'; | |||||
| @Component({ | |||||
| selector: 'app-new-product', | |||||
| templateUrl: './new-product.component.html', | |||||
| styleUrl: './new-product.component.scss' | |||||
| }) | |||||
| export class NewProductComponent { | |||||
| } | |||||
| @@ -1,3 +1,7 @@ | |||||
| <div class="d-flex justify-content-between align-items-start"> | |||||
| <h2>Produkte</h2> | |||||
| <button (click)="openModalNewProduct()">Neues Produkt</button> | |||||
| </div> | |||||
| <table mat-table [dataSource]="dataSource" matSort (matSortChange)="onSortChange($event)" | <table mat-table [dataSource]="dataSource" matSort (matSortChange)="onSortChange($event)" | ||||
| class="mat-elevation-z8"> | class="mat-elevation-z8"> | ||||
| @@ -8,6 +8,10 @@ import {ApiConverter} from "@app/_helpers/api.converter"; | |||||
| import {Router, RouterLink, RouterLinkActive} from "@angular/router"; | import {Router, RouterLink, RouterLinkActive} from "@angular/router"; | ||||
| import {NgIf} from "@angular/common"; | import {NgIf} from "@angular/common"; | ||||
| import {Subscription} from "rxjs"; | import {Subscription} from "rxjs"; | ||||
| import {ModalComponent} from "@app/_components/modal/modal.component"; | |||||
| import {NewTaskComponent} from "@app/tasks/new-task/new-task.component"; | |||||
| import {NgbModal} from "@ng-bootstrap/ng-bootstrap"; | |||||
| import {NewProductComponent} from "@app/products/new-product/new-product.component"; | |||||
| @Component({ | @Component({ | ||||
| selector: 'app-products', | selector: 'app-products', | ||||
| @@ -33,7 +37,8 @@ export class ProductsComponent implements OnInit, AfterViewInit { | |||||
| protected pageIndex: number; | protected pageIndex: number; | ||||
| constructor( | constructor( | ||||
| private router: Router | |||||
| private router: Router, | |||||
| private modalService: NgbModal | |||||
| ) { | ) { | ||||
| this.sort = new MatSort(); | this.sort = new MatSort(); | ||||
| this.paginator = new MatPaginator(new MatPaginatorIntl(), ChangeDetectorRef.prototype); | this.paginator = new MatPaginator(new MatPaginatorIntl(), ChangeDetectorRef.prototype); | ||||
| @@ -122,4 +127,9 @@ export class ProductsComponent implements OnInit, AfterViewInit { | |||||
| // this.router.navigate(['/products', ApiConverter.extractId(product.id)]); | // this.router.navigate(['/products', ApiConverter.extractId(product.id)]); | ||||
| this.router.navigate(['/products', '1']); | this.router.navigate(['/products', '1']); | ||||
| } | } | ||||
| openModalNewProduct() { | |||||
| const modalRef = this.modalService.open(ModalComponent); | |||||
| modalRef.componentInstance.dynamicComponent = NewProductComponent; | |||||
| } | |||||
| } | } | ||||
| @@ -0,0 +1 @@ | |||||
| <p>new-task works!</p> | |||||
| @@ -0,0 +1,23 @@ | |||||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | |||||
| import { NewTaskComponent } from './new-task.component'; | |||||
| describe('NewTaskComponent', () => { | |||||
| let component: NewTaskComponent; | |||||
| let fixture: ComponentFixture<NewTaskComponent>; | |||||
| beforeEach(async () => { | |||||
| await TestBed.configureTestingModule({ | |||||
| declarations: [NewTaskComponent] | |||||
| }) | |||||
| .compileComponents(); | |||||
| fixture = TestBed.createComponent(NewTaskComponent); | |||||
| component = fixture.componentInstance; | |||||
| fixture.detectChanges(); | |||||
| }); | |||||
| it('should create', () => { | |||||
| expect(component).toBeTruthy(); | |||||
| }); | |||||
| }); | |||||
| @@ -0,0 +1,10 @@ | |||||
| import { Component } from '@angular/core'; | |||||
| @Component({ | |||||
| selector: 'app-new-task', | |||||
| templateUrl: './new-task.component.html', | |||||
| styleUrl: './new-task.component.scss' | |||||
| }) | |||||
| export class NewTaskComponent { | |||||
| } | |||||
| @@ -0,0 +1,5 @@ | |||||
| <div class="d-flex justify-content-between align-items-start"> | |||||
| <h2>Aufgaben</h2> | |||||
| <button (click)="openModalNewTask()">Neue Aufgabe</button> | |||||
| </div> | |||||
| <p>tasks works!</p> | |||||
| @@ -0,0 +1,23 @@ | |||||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | |||||
| import { TasksComponent } from './tasks.component'; | |||||
| describe('TasksComponent', () => { | |||||
| let component: TasksComponent; | |||||
| let fixture: ComponentFixture<TasksComponent>; | |||||
| beforeEach(async () => { | |||||
| await TestBed.configureTestingModule({ | |||||
| declarations: [TasksComponent] | |||||
| }) | |||||
| .compileComponents(); | |||||
| fixture = TestBed.createComponent(TasksComponent); | |||||
| component = fixture.componentInstance; | |||||
| fixture.detectChanges(); | |||||
| }); | |||||
| it('should create', () => { | |||||
| expect(component).toBeTruthy(); | |||||
| }); | |||||
| }); | |||||
| @@ -0,0 +1,27 @@ | |||||
| import {Component, OnInit} from '@angular/core'; | |||||
| import {NewTaskComponent} from "@app/tasks/new-task/new-task.component"; | |||||
| import {NgbModal} from "@ng-bootstrap/ng-bootstrap"; | |||||
| import {ModalComponent} from "@app/_components/modal/modal.component"; | |||||
| @Component({ | |||||
| selector: 'app-tasks', | |||||
| templateUrl: './tasks.component.html', | |||||
| styleUrl: './tasks.component.scss' | |||||
| }) | |||||
| export class TasksComponent implements OnInit { | |||||
| constructor( | |||||
| private modalService: NgbModal | |||||
| ) { | |||||
| } | |||||
| ngOnInit() { | |||||
| } | |||||
| openModalNewTask() { | |||||
| const modalRef = this.modalService.open(ModalComponent); | |||||
| modalRef.componentInstance.dynamicComponent = NewTaskComponent; | |||||
| } | |||||
| } | |||||
| @@ -2,6 +2,12 @@ | |||||
| "basic": | "basic": | ||||
| { | { | ||||
| "logout": "Logout", | "logout": "Logout", | ||||
| "company-name": "MATSEN CHEMIE AG" | |||||
| "company-name": "MATSEN CHEMIE AG", | |||||
| "customer": "Kunden", | |||||
| "supplier": "Dienstleister", | |||||
| "service": "Lieferanten", | |||||
| "customerOne": "Kunde", | |||||
| "supplierOne": "Dienstleister", | |||||
| "serviceOne": "Lieferant" | |||||
| } | } | ||||
| } | } | ||||