| @@ -5,4 +5,4 @@ | |||||
| <app-document-list #documentList | <app-document-list #documentList | ||||
| ></app-document-list> | ></app-document-list> | ||||
| </div> | |||||
| </div> | |||||
| @@ -1,18 +1,4 @@ | |||||
| import {ChangeDetectorRef, Component, ViewChild} from '@angular/core'; | |||||
| import {MatSort, MatSortModule, Sort} from "@angular/material/sort"; | |||||
| import {MatPaginator, MatPaginatorIntl, MatPaginatorModule, PageEvent} from "@angular/material/paginator"; | |||||
| import {Subscription} from "rxjs"; | |||||
| import {DocumentJsonld, DocumentService} from "@app/core/api/v1"; | |||||
| import {Router, RouterLink, RouterLinkActive} from "@angular/router"; | |||||
| import {MatTableDataSource, MatTableModule} from "@angular/material/table"; | |||||
| import {OrderFilter} from "@app/_models/orderFilter"; | |||||
| import {DatePipe, NgIf} from "@angular/common"; | |||||
| import {NgbModal, NgbModalOptions} from "@ng-bootstrap/ng-bootstrap"; | |||||
| import {NewDocumentComponent} from "@app/_views/documents/new-document/new-document.component"; | |||||
| import {TranslateModule} from "@ngx-translate/core"; | |||||
| import {ModalStatus} from "@app/_helpers/modal.states"; | |||||
| import {AppHelperService} from "@app/_helpers/app-helper.service"; | |||||
| import {ProductListComponent} from "@app/_views/products/product-list/product-list.component"; | |||||
| import {Component, ViewChild} from '@angular/core'; | |||||
| import {DocumentListComponent} from "@app/_views/documents/document-list/document-list.component"; | import {DocumentListComponent} from "@app/_views/documents/document-list/document-list.component"; | ||||
| @Component({ | @Component({ | ||||
| @@ -75,4 +75,4 @@ | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </div> | |||||
| </div> | |||||
| @@ -1,10 +1,8 @@ | |||||
| import {AfterViewInit, ChangeDetectorRef, Component, OnInit, ViewChild} from '@angular/core'; | |||||
| import {AfterViewInit, Component, OnInit} from '@angular/core'; | |||||
| import {User} from '@app/_models'; | import {User} from '@app/_models'; | ||||
| import {AccountService} from '@app/_services'; | import {AccountService} from '@app/_services'; | ||||
| import {AppHelperService} from "@app/_helpers/app-helper.service"; | import {AppHelperService} from "@app/_helpers/app-helper.service"; | ||||
| import {ToggleComponent} from "@app/_components/toggle/toggle.component"; | |||||
| import {TaskListComponent} from "@app/_views/tasks/task-list/task-list.component"; | |||||
| @Component({ | @Component({ | ||||
| templateUrl: 'home.component.html', | templateUrl: 'home.component.html', | ||||
| @@ -52,7 +52,7 @@ | |||||
| <div class="mb-3" *ngIf="partnerForm.get('logoUrl')?.value !== null"> | <div class="mb-3" *ngIf="partnerForm.get('logoUrl')?.value !== null"> | ||||
| <div class="delete-image" (click)="onDeleteImage()"> | <div class="delete-image" (click)="onDeleteImage()"> | ||||
| <img src="{{partner.logoUrl}}" width="40" height="40" /> | |||||
| <img src="{{partner.logoUrl}}" width="40" height="40" alt="{{partner.name}}"/> | |||||
| <p class="mb-0 ms-3">{{ 'system.delete-image' | translate }}</p> | <p class="mb-0 ms-3">{{ 'system.delete-image' | translate }}</p> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| @@ -61,4 +61,3 @@ | |||||
| </button> | </button> | ||||
| </form> | </form> | ||||
| </div> | </div> | ||||
| @@ -3,7 +3,6 @@ import {partnerForm} from "@app/_forms/apiForms"; | |||||
| import {MediaObjectService, PartnerJsonld, PartnerService} from "@app/core/api/v1"; | import {MediaObjectService, PartnerJsonld, PartnerService} from "@app/core/api/v1"; | ||||
| import {ModalStatus} from "@app/_helpers/modal.states"; | import {ModalStatus} from "@app/_helpers/modal.states"; | ||||
| import {FormGroup} from "@angular/forms"; | import {FormGroup} from "@angular/forms"; | ||||
| import {Subscription} from "rxjs"; | |||||
| import {TranslateService} from "@ngx-translate/core"; | import {TranslateService} from "@ngx-translate/core"; | ||||
| import {FormGroupInitializer} from "@app/_helpers/formgroup.initializer"; | import {FormGroupInitializer} from "@app/_helpers/formgroup.initializer"; | ||||
| import {AppHelperService} from "@app/_helpers/app-helper.service"; | import {AppHelperService} from "@app/_helpers/app-helper.service"; | ||||
| @@ -18,11 +17,7 @@ export class NewPartnerComponent implements OnInit { | |||||
| @Output() public submit: EventEmitter<ModalStatus> = new EventEmitter<ModalStatus>(); | @Output() public submit: EventEmitter<ModalStatus> = new EventEmitter<ModalStatus>(); | ||||
| protected partnerForm: FormGroup; | protected partnerForm: FormGroup; | ||||
| protected partnerSub: Subscription; | |||||
| protected selectedImage: File | null; | protected selectedImage: File | null; | ||||
| protected mediaSub: Subscription; | |||||
| protected partnerNameOne: string; | protected partnerNameOne: string; | ||||
| constructor( | constructor( | ||||
| @@ -33,10 +28,6 @@ export class NewPartnerComponent implements OnInit { | |||||
| ) { | ) { | ||||
| this.partnerForm = partnerForm; | this.partnerForm = partnerForm; | ||||
| this.selectedImage = null; | this.selectedImage = null; | ||||
| this.partnerSub = new Subscription(); | |||||
| this.mediaSub = new Subscription(); | |||||
| this.partnerNameOne = ""; | this.partnerNameOne = ""; | ||||
| } | } | ||||
| @@ -50,7 +41,7 @@ export class NewPartnerComponent implements OnInit { | |||||
| // On submit form: Check if image is set | // On submit form: Check if image is set | ||||
| onSubmit() { | onSubmit() { | ||||
| if (this.selectedImage !== null) { | if (this.selectedImage !== null) { | ||||
| this.mediaSub = this.mediaObjectService.mediaObjectsPost( | |||||
| this.mediaObjectService.mediaObjectsPost( | |||||
| this.selectedImage | this.selectedImage | ||||
| ).subscribe( | ).subscribe( | ||||
| data => { | data => { | ||||
| @@ -68,7 +59,7 @@ export class NewPartnerComponent implements OnInit { | |||||
| if (this.partnerForm.valid) { | if (this.partnerForm.valid) { | ||||
| if (this.partner.id === null || this.partner.id === undefined) { | if (this.partner.id === null || this.partner.id === undefined) { | ||||
| // Create new contact | // Create new contact | ||||
| this.partnerSub = this.partnerService.partnersPost( | |||||
| this.partnerService.partnersPost( | |||||
| this.partnerForm.value as PartnerJsonld | this.partnerForm.value as PartnerJsonld | ||||
| ).subscribe( | ).subscribe( | ||||
| data => { | data => { | ||||
| @@ -78,7 +69,7 @@ export class NewPartnerComponent implements OnInit { | |||||
| ); | ); | ||||
| } else { | } else { | ||||
| // Edit contact | // Edit contact | ||||
| this.partnerSub = this.partnerService.partnersIdPatch( | |||||
| this.partnerService.partnersIdPatch( | |||||
| this.appHelperService.extractId(this.partner.id), | this.appHelperService.extractId(this.partner.id), | ||||
| this.partnerForm.value as PartnerJsonld | this.partnerForm.value as PartnerJsonld | ||||
| ).subscribe( | ).subscribe( | ||||
| @@ -9,4 +9,4 @@ | |||||
| [onRemoveItemFunction]="unassignPartner" | [onRemoveItemFunction]="unassignPartner" | ||||
| [listColDefinitions]="listColDefinitions" | [listColDefinitions]="listColDefinitions" | ||||
| ></app-list> | ></app-list> | ||||
| </div> | |||||
| </div> | |||||
| @@ -1,8 +1,10 @@ | |||||
| import {AfterViewInit, Component, OnInit, ViewChild} from '@angular/core'; | import {AfterViewInit, Component, OnInit, ViewChild} from '@angular/core'; | ||||
| import {ActivatedRoute} from "@angular/router"; | import {ActivatedRoute} from "@angular/router"; | ||||
| import { | import { | ||||
| PartnerFollowJsonld, PartnerFollowService, | |||||
| PartnerJsonld, PartnerService | |||||
| PartnerFollowJsonld, | |||||
| PartnerFollowService, | |||||
| PartnerJsonld, | |||||
| PartnerService | |||||
| } from "@app/core/api/v1"; | } from "@app/core/api/v1"; | ||||
| import {Subscription} from "rxjs"; | import {Subscription} from "rxjs"; | ||||
| import {environment} from "@environments/environment"; | import {environment} from "@environments/environment"; | ||||
| @@ -25,25 +27,22 @@ import {DocumentListComponent} from "@app/_views/documents/document-list/documen | |||||
| }) | }) | ||||
| export class PartnersDetailComponent implements OnInit, AfterViewInit { | export class PartnersDetailComponent implements OnInit, AfterViewInit { | ||||
| @ViewChild("toggleProducts", { static: true }) toggleProducts!: ToggleComponent; | |||||
| @ViewChild("productListComponent", { static: false }) productsComponent!: ProductListComponent; | |||||
| @ViewChild("toggleContacts", { static: true }) toggleContacts!: ToggleComponent; | |||||
| @ViewChild("contactListComponent", { static: false }) contactsComponent!: ContactListComponent; | |||||
| @ViewChild("toggleTasks", { static: true }) toggleTasks!: ToggleComponent; | |||||
| @ViewChild("taskListComponent", { static: false }) taskListComponent!: TaskListComponent; | |||||
| @ViewChild("togglePosts", { static: true }) togglePosts!: ToggleComponent; | |||||
| @ViewChild("postListComponent", { static: false }) postsComponent!: PostListComponent; | |||||
| @ViewChild("toggleSales", { static: true }) toggleSales!: ToggleComponent; | |||||
| @ViewChild("salesListComponent", { static: false }) salesListComponent!: SaleListComponent; | |||||
| @ViewChild("toggleDocuments", { static: true }) toggleDocuments!: ToggleComponent; | |||||
| @ViewChild("documentsListComponent", { static: false }) documentsListComponent!: DocumentListComponent; | |||||
| protected user: User | null; | |||||
| @ViewChild("toggleProducts", {static: true}) toggleProducts!: ToggleComponent; | |||||
| @ViewChild("productListComponent", {static: false}) productsComponent!: ProductListComponent; | |||||
| @ViewChild("toggleContacts", {static: true}) toggleContacts!: ToggleComponent; | |||||
| @ViewChild("contactListComponent", {static: false}) contactsComponent!: ContactListComponent; | |||||
| @ViewChild("toggleTasks", {static: true}) toggleTasks!: ToggleComponent; | |||||
| @ViewChild("taskListComponent", {static: false}) taskListComponent!: TaskListComponent; | |||||
| @ViewChild("togglePosts", {static: true}) togglePosts!: ToggleComponent; | |||||
| @ViewChild("postListComponent", {static: false}) postsComponent!: PostListComponent; | |||||
| @ViewChild("toggleSales", {static: true}) toggleSales!: ToggleComponent; | |||||
| @ViewChild("salesListComponent", {static: false}) salesListComponent!: SaleListComponent; | |||||
| @ViewChild("toggleDocuments", {static: true}) toggleDocuments!: ToggleComponent; | |||||
| @ViewChild("documentsListComponent", {static: false}) documentsListComponent!: DocumentListComponent; | |||||
| protected readonly environment = environment; | protected readonly environment = environment; | ||||
| protected user: User | null; | |||||
| protected partnerId!: string; | protected partnerId!: string; | ||||
| protected partnerDetailSub: Subscription; | |||||
| protected partner!: PartnerJsonld; | protected partner!: PartnerJsonld; | ||||
| protected partnerFollowSub: Subscription; | protected partnerFollowSub: Subscription; | ||||
| protected partnerFollow: PartnerFollowJsonld | null; | protected partnerFollow: PartnerFollowJsonld | null; | ||||
| @@ -55,11 +54,8 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { | |||||
| private partnerFollowService: PartnerFollowService, | private partnerFollowService: PartnerFollowService, | ||||
| protected appHelperService: AppHelperService | protected appHelperService: AppHelperService | ||||
| ) { | ) { | ||||
| this.partnerDetailSub = new Subscription(); | |||||
| this.partnerFollowSub = new Subscription(); | this.partnerFollowSub = new Subscription(); | ||||
| this.partnerFollow = null; | this.partnerFollow = null; | ||||
| this.user = this.accountService.userValue; | this.user = this.accountService.userValue; | ||||
| } | } | ||||
| @@ -80,7 +76,7 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { | |||||
| } | } | ||||
| getPartnerData = () => { | getPartnerData = () => { | ||||
| this.partnerDetailSub = this.partnerService.partnersIdGet( | |||||
| this.partnerService.partnersIdGet( | |||||
| this.partnerId | this.partnerId | ||||
| ).subscribe( | ).subscribe( | ||||
| data => { | data => { | ||||
| @@ -130,6 +126,6 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { | |||||
| } | } | ||||
| openModalEditPartner() { | openModalEditPartner() { | ||||
| this.appHelperService.openModal(NewPartnerComponent, { 'partner': this.partner }, this.getData); | |||||
| this.appHelperService.openModal(NewPartnerComponent, {'partner': this.partner}, this.getData); | |||||
| } | } | ||||
| } | } | ||||
| @@ -5,4 +5,4 @@ | |||||
| <app-partner-list #partnerList | <app-partner-list #partnerList | ||||
| [partnerType]="partnerType" | [partnerType]="partnerType" | ||||
| ></app-partner-list> | ></app-partner-list> | ||||
| </div> | |||||
| </div> | |||||
| @@ -13,4 +13,3 @@ | |||||
| <button type="submit" class="btn btn-primary" [disabled]="commentForm.invalid">{{'form.send' | translate}}</button> | <button type="submit" class="btn btn-primary" [disabled]="commentForm.invalid">{{'form.send' | translate}}</button> | ||||
| </form> | </form> | ||||
| </div> | </div> | ||||
| @@ -1,7 +1,6 @@ | |||||
| import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; | import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; | ||||
| import {ModalStatus} from "@app/_helpers/modal.states"; | import {ModalStatus} from "@app/_helpers/modal.states"; | ||||
| import {CommentJsonld, CommentService, PostJsonld} from "@app/core/api/v1"; | |||||
| import {Subscription} from "rxjs"; | |||||
| import {CommentJsonld, CommentService} from "@app/core/api/v1"; | |||||
| import {FormGroupInitializer} from "@app/_helpers/formgroup.initializer"; | import {FormGroupInitializer} from "@app/_helpers/formgroup.initializer"; | ||||
| import {FormGroup} from "@angular/forms"; | import {FormGroup} from "@angular/forms"; | ||||
| import {commentForm} from "@app/_forms/apiForms"; | import {commentForm} from "@app/_forms/apiForms"; | ||||
| @@ -17,14 +16,12 @@ export class NewCommentComponent implements OnInit { | |||||
| @Output() public submit: EventEmitter<ModalStatus> = new EventEmitter<ModalStatus>(); | @Output() public submit: EventEmitter<ModalStatus> = new EventEmitter<ModalStatus>(); | ||||
| protected commentForm: FormGroup; | protected commentForm: FormGroup; | ||||
| protected commentSub: Subscription; | |||||
| constructor( | constructor( | ||||
| private commentService: CommentService, | private commentService: CommentService, | ||||
| protected appHelperService: AppHelperService, | protected appHelperService: AppHelperService, | ||||
| ) { | ) { | ||||
| this.commentForm = commentForm; | this.commentForm = commentForm; | ||||
| this.commentSub = new Subscription(); | |||||
| } | } | ||||
| ngOnInit(): void { | ngOnInit(): void { | ||||
| @@ -35,7 +32,7 @@ export class NewCommentComponent implements OnInit { | |||||
| if (this.commentForm.valid) { | if (this.commentForm.valid) { | ||||
| if (this.comment.id === null || this.comment.id === undefined) { | if (this.comment.id === null || this.comment.id === undefined) { | ||||
| // Create new comment | // Create new comment | ||||
| this.commentSub = this.commentService.commentsPost( | |||||
| this.commentService.commentsPost( | |||||
| this.commentForm.value as CommentJsonld | this.commentForm.value as CommentJsonld | ||||
| ).subscribe( | ).subscribe( | ||||
| data => { | data => { | ||||
| @@ -45,7 +42,7 @@ export class NewCommentComponent implements OnInit { | |||||
| ); | ); | ||||
| } else { | } else { | ||||
| // Edit comment | // Edit comment | ||||
| this.commentSub = this.commentService.commentsIdPatch( | |||||
| this.commentService.commentsIdPatch( | |||||
| this.appHelperService.extractId(this.comment.id), | this.appHelperService.extractId(this.comment.id), | ||||
| this.commentForm.value as CommentJsonld | this.commentForm.value as CommentJsonld | ||||
| ).subscribe( | ).subscribe( | ||||
| @@ -45,4 +45,3 @@ | |||||
| </button> | </button> | ||||
| </form> | </form> | ||||
| </div> | </div> | ||||
| @@ -67,4 +67,4 @@ | |||||
| </div> | </div> | ||||
| </app-paging> | </app-paging> | ||||
| </div> | </div> | ||||
| </div> | |||||
| </div> | |||||