| @@ -1,7 +1,8 @@ | |||
| <div class="spt-container"> | |||
| <div class="contacts position-relative"> | |||
| <div class="top-btn"> | |||
| <button class="btn btn-primary" (click)="openModalNewContact()">+ {{ 'basic.new-contact' | translate }}</button> | |||
| <button class="btn btn-primary" (click)="openModalNewContact()">+ {{ 'basic.new-contact' | translate }} | |||
| </button> | |||
| </div> | |||
| <app-paging #pagingComponent | |||
| [getDataFunction]="getData" | |||
| @@ -18,10 +19,10 @@ | |||
| <img *ngIf="contact.imageUrl !== null && contact.imageUrl !== undefined" | |||
| src="{{contact.imageUrl}}" width="247" height="94" | |||
| alt="{{contact.firstName}} {{contact.lastName}}" | |||
| title="{{contact.firstName}} {{contact.lastName}}" /> | |||
| title="{{contact.firstName}} {{contact.lastName}}"/> | |||
| <img *ngIf="contact.imageUrl === null || contact.imageUrl === undefined" | |||
| src="/assets/images/icons/dummy-person.png" width="247" height="94" | |||
| alt="" /> | |||
| alt=""/> | |||
| </div> | |||
| <div class="col-8"> | |||
| <h3>{{ contact.firstName }} {{ contact.lastName }}</h3> | |||
| @@ -6,28 +6,32 @@ | |||
| <div class="col-12 col-lg-6"> | |||
| <h1>{{ contact.firstName }} {{ contact.lastName }}</h1> | |||
| <dl> | |||
| <dt *ngIf="contact.position">{{'form.position' | translate}}:</dt> | |||
| <dt *ngIf="contact.position">{{ 'form.position' | translate }}:</dt> | |||
| <dd *ngIf="contact.position">{{ contact.position }}</dd> | |||
| <dt *ngIf="contact.phone">{{'form.phone' | translate}}:</dt> | |||
| <dt *ngIf="contact.phone">{{ 'form.phone' | translate }}:</dt> | |||
| <dd *ngIf="contact.phone">{{ contact.phone }}</dd> | |||
| <dt *ngIf="contact.email">{{'form.email' | translate}}:</dt> | |||
| <dt *ngIf="contact.email">{{ 'form.email' | translate }}:</dt> | |||
| <dd *ngIf="contact.email"><a href="mailto:{{contact.email}}">{{ contact.email }}</a></dd> | |||
| <dt *ngIf="contact.birthday">{{'form.birthday' | translate}}:</dt> | |||
| <dt *ngIf="contact.birthday">{{ 'form.birthday' | translate }}:</dt> | |||
| <dd *ngIf="contact.birthday">{{ contact.birthday | date:'dd.MM.YYYY' }}</dd> | |||
| </dl> | |||
| </div> | |||
| <div class="col-12 col-lg-6"> | |||
| <ul *ngFor="let contactPartnerProduct of contactPartnerProducts"> | |||
| <li><a href="{{ appHelperService.getResourceLink(contactPartnerProduct.product) }}">{{contactPartnerProduct.product?.name}}</a></li> | |||
| <li> | |||
| <a href="{{ appHelperService.getResourceLink(contactPartnerProduct.product) }}">{{ contactPartnerProduct.product?.name }}</a> | |||
| </li> | |||
| </ul> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="col-12 col-sm-6 col-lg-4 has-image"> | |||
| <img *ngIf="contact.imageUrl !== null && contact.imageUrl !== undefined" src="{{contact.imageUrl}}" width="247" height="94" | |||
| alt="{{contact.firstName}} {{contact.lastName}}" title="{{contact.firstName}} {{contact.lastName}}" /> | |||
| <img *ngIf="contact.imageUrl !== null && contact.imageUrl !== undefined" src="{{contact.imageUrl}}" | |||
| width="247" height="94" | |||
| alt="{{contact.firstName}} {{contact.lastName}}" | |||
| title="{{contact.firstName}} {{contact.lastName}}"/> | |||
| <img *ngIf="contact.imageUrl === null || contact.imageUrl === undefined" | |||
| src="/assets/images/icons/dummy-person.png" width="247" height="94" alt="" /> | |||
| src="/assets/images/icons/dummy-person.png" width="247" height="94" alt=""/> | |||
| </div> | |||
| <span class="position-absolute bi bi-pencil p-2" data-type="user-tool" data-action="edit" | |||
| (click)="openModalEditContact()"> | |||
| @@ -1,59 +1,62 @@ | |||
| <h2 *ngIf="!contact?.id">{{'basic.new-contact' | translate}}</h2> | |||
| <h2 *ngIf="contact?.id">{{'basic.edit-contact' | translate}}</h2> | |||
| <h2 *ngIf="!contact?.id">{{ 'basic.new-contact' | translate }}</h2> | |||
| <h2 *ngIf="contact?.id">{{ 'basic.edit-contact' | translate }}</h2> | |||
| <div class="spt-form"> | |||
| <form [formGroup]="contactForm" (ngSubmit)="onSubmit()"> | |||
| <div class="mb-3"> | |||
| <label for="firstName" class="form-label">{{'form.firstname' | translate}}:</label> | |||
| <input type="text" class="form-control" id="firstName" formControlName="firstName" /> | |||
| <div class="form-text" *ngIf="contactForm.get('firstName')?.invalid && contactForm.get('firstName')?.touched"> | |||
| {{'form.firstname' | translate}} {{'form.mandatory' | translate}}. | |||
| <label for="firstName" class="form-label">{{ 'form.firstname' | translate }}:</label> | |||
| <input type="text" class="form-control" id="firstName" formControlName="firstName"/> | |||
| <div class="form-text" | |||
| *ngIf="contactForm.get('firstName')?.invalid && contactForm.get('firstName')?.touched"> | |||
| {{ 'form.firstname' | translate }} {{ 'form.mandatory' | translate }}. | |||
| </div> | |||
| </div> | |||
| <div class="mb-3"> | |||
| <label for="lastName" class="form-label">{{'form.lastname' | translate}}:</label> | |||
| <input type="text" class="form-control" id="lastName" formControlName="lastName" /> | |||
| <label for="lastName" class="form-label">{{ 'form.lastname' | translate }}:</label> | |||
| <input type="text" class="form-control" id="lastName" formControlName="lastName"/> | |||
| <div class="form-text" *ngIf="contactForm.get('lastName')?.invalid && contactForm.get('lastName')?.touched"> | |||
| {{'form.lastname' | translate}} {{'form.mandatory' | translate}}. | |||
| {{ 'form.lastname' | translate }} {{ 'form.mandatory' | translate }}. | |||
| </div> | |||
| </div> | |||
| <div class="mb-3"> | |||
| <label for="birthday" class="form-label">{{'form.birthday' | translate}}:</label> | |||
| <label for="birthday" class="form-label">{{ 'form.birthday' | translate }}:</label> | |||
| <input type="date" value="{{ birthdayValue }}" class="form-control" id="birthday" | |||
| (change)="onBirthdayChange($event)"/> | |||
| </div> | |||
| <div class="mb-3"> | |||
| <label for="position" class="form-label">{{'form.position' | translate}}:</label> | |||
| <input type="text" class="form-control" id="position" formControlName="position" /> | |||
| <label for="position" class="form-label">{{ 'form.position' | translate }}:</label> | |||
| <input type="text" class="form-control" id="position" formControlName="position"/> | |||
| </div> | |||
| <div class="mb-3"> | |||
| <label for="email" class="form-label">{{'form.email' | translate}}:</label> | |||
| <input type="email" class="form-control" id="email" formControlName="email" /> | |||
| <label for="email" class="form-label">{{ 'form.email' | translate }}:</label> | |||
| <input type="email" class="form-control" id="email" formControlName="email"/> | |||
| <div class="form-text" *ngIf="contactForm.get('email')?.invalid && contactForm.get('email')?.touched"> | |||
| {{'form.email-validation' | translate}}. | |||
| {{ 'form.email-validation' | translate }}. | |||
| </div> | |||
| </div> | |||
| <div class="mb-3"> | |||
| <label for="phone" class="form-label">{{'form.phone' | translate}}:</label> | |||
| <input type="text" class="form-control" id="phone" formControlName="phone" /> | |||
| <label for="phone" class="form-label">{{ 'form.phone' | translate }}:</label> | |||
| <input type="text" class="form-control" id="phone" formControlName="phone"/> | |||
| </div> | |||
| <div class="mb-3" *ngIf="contactForm.get('imageUrl')?.value === null"> | |||
| <label for="image" class="form-label">{{'form.upload-image' | translate}}:</label> | |||
| <input type="file" class="form-control" id="image" (change)="onFileSelected($event)" accept="image/*" /> | |||
| <label for="image" class="form-label">{{ 'form.upload-image' | translate }}:</label> | |||
| <input type="file" class="form-control" id="image" (change)="onFileSelected($event)" accept="image/*"/> | |||
| </div> | |||
| <div class="mb-3" *ngIf="contactForm.get('imageUrl')?.value !== null"> | |||
| <div class="delete-image" (click)="onDeleteImage()"> | |||
| <img src="{{contact.imageUrl}}" width="40" height="40" alt="{{contact.firstName}} {{contact.lastName}}" /> | |||
| <p class="mb-0 ms-3">{{'system.delete-image' | translate}}</p> | |||
| <img src="{{contact.imageUrl}}" width="40" height="40" | |||
| alt="{{contact.firstName}} {{contact.lastName}}"/> | |||
| <p class="mb-0 ms-3">{{ 'system.delete-image' | translate }}</p> | |||
| </div> | |||
| </div> | |||
| <button type="submit" class="btn btn-primary" [disabled]="contactForm.invalid">{{'form.send' | translate}}</button> | |||
| <button type="submit" class="btn btn-primary" [disabled]="contactForm.invalid">{{ 'form.send' | translate }} | |||
| </button> | |||
| </form> | |||
| </div> | |||
| @@ -1,6 +1,7 @@ | |||
| <div class="spt-container"> | |||
| <div class="top-btn"> | |||
| <button class="btn btn-primary" (click)="openModalNewDocument()">+ {{ 'basic.new-document' | translate }}</button> | |||
| <button class="btn btn-primary" (click)="openModalNewDocument()">+ {{ 'basic.new-document' | translate }} | |||
| </button> | |||
| </div> | |||
| <app-list #listComponent | |||
| [getDataFunction]="getData" | |||
| @@ -2,7 +2,7 @@ | |||
| <div class="pt-4"> | |||
| <div class="container"> | |||
| <h1>{{ 'user.hello' | translate }} {{ user?.firstName }}!</h1> | |||
| <!-- <p *ngIf="userIsAdmin"><a routerLink="/users">Manage Users</a></p>--> | |||
| <!-- <p *ngIf="userIsAdmin"><a routerLink="/users">Manage Users</a></p>--> | |||
| </div> | |||
| </div> | |||
| @@ -1,6 +1,8 @@ | |||
| <div class="spt-container"> | |||
| <div *ngIf="!this.user" class="top-btn"> | |||
| <button class="btn btn-primary" (click)="openModalNewPartner()">+ {{ 'basic.new' | translate }} {{ partnerColumnHeadline }}</button> | |||
| <button class="btn btn-primary" (click)="openModalNewPartner()"> | |||
| + {{ 'basic.new' | translate }} {{ partnerColumnHeadline }} | |||
| </button> | |||
| </div> | |||
| <app-list #listComponent | |||
| [getDataFunction]="getDataFunction" | |||
| @@ -35,11 +35,11 @@ | |||
| </div> | |||
| </div> | |||
| <div class="col-12 col-sm-6 col-lg-4 has-image"> | |||
| <img *ngIf="partner.logoUrl !== null && partner.logoUrl !== undefined" src="{{partner.logoUrl}}" | |||
| <img *ngIf="partner.logoUrl !== null && partner.logoUrl !== undefined" src="{{partner.logoUrl}}" | |||
| width="247" | |||
| height="94" alt="{{partner.name}}" title="{{partner.name}}" /> | |||
| height="94" alt="{{partner.name}}" title="{{partner.name}}"/> | |||
| <img *ngIf="partner.logoUrl === null || partner.logoUrl === undefined" | |||
| src="/assets/images/icons/dummy-company.png" width="247" height="94" alt="" /> | |||
| src="/assets/images/icons/dummy-company.png" width="247" height="94" alt=""/> | |||
| </div> | |||
| <span class="position-absolute bi p-2" | |||
| [class.bi-heart]="partnerFollow === null" | |||
| @@ -55,38 +55,38 @@ | |||
| </div> | |||
| <app-toggle #toggleProducts [headline]="'basic.products' | translate"> | |||
| <app-product-list *ngIf="toggleProducts.isOpened" #productListComponent | |||
| [partner]="partner"> | |||
| [partner]="partner"> | |||
| </app-product-list> | |||
| </app-toggle> | |||
| <app-toggle #toggleContacts [headline]="'basic.contacts' | translate"> | |||
| <app-contact-list *ngIf="toggleContacts.isOpened" #contactListComponent | |||
| [partner]="partner"> | |||
| [partner]="partner"> | |||
| </app-contact-list> | |||
| </app-toggle> | |||
| <app-toggle #toggleTasks [headline]="'basic.tasks' | translate"> | |||
| <app-task-list *ngIf="toggleTasks.isOpened" #taskListComponent | |||
| [partner]="partner"> | |||
| [partner]="partner"> | |||
| </app-task-list> | |||
| </app-toggle> | |||
| <app-toggle #togglePosts [headline]="'basic.posts' | translate"> | |||
| <app-post-list *ngIf="togglePosts.isOpened" #postListComponent | |||
| [partner]="partner" | |||
| [existsContact]="false" | |||
| [existsSale]="false" | |||
| [partner]="partner" | |||
| [existsContact]="false" | |||
| [existsSale]="false" | |||
| > | |||
| </app-post-list> | |||
| </app-toggle> | |||
| <app-toggle #toggleSales [headline]="'basic.sales' | translate"> | |||
| <app-sale-list *ngIf="toggleSales.isOpened" #salesListComponent | |||
| [partner]="partner" | |||
| [partner]="partner" | |||
| > | |||
| </app-sale-list> | |||
| </app-toggle> | |||
| <app-toggle #toggleDocuments [headline]="'basic.documents' | translate"> | |||
| <app-document-list *ngIf="toggleDocuments.isOpened" #documentsListComponent | |||
| [partner]="partner" | |||
| [partner]="partner" | |||
| > | |||
| </app-document-list> | |||
| </app-toggle> | |||
| @@ -3,6 +3,6 @@ | |||
| <h2 class="spt-headline">{{ headline }}</h2> | |||
| </div> | |||
| <app-partner-list #partnerList | |||
| [partnerType]="partnerType" | |||
| [partnerType]="partnerType" | |||
| ></app-partner-list> | |||
| </div> | |||
| @@ -1,15 +1,16 @@ | |||
| <h2 *ngIf="!comment.id">{{'basic.new-comment' | translate}}</h2> | |||
| <h2 *ngIf="comment.id">{{'basic.edit-comment' | translate}}</h2> | |||
| <h2 *ngIf="!comment.id">{{ 'basic.new-comment' | translate }}</h2> | |||
| <h2 *ngIf="comment.id">{{ 'basic.edit-comment' | translate }}</h2> | |||
| <div class="spt-form"> | |||
| <form [formGroup]="commentForm" (ngSubmit)="onSubmit()"> | |||
| <div class="mb-3"> | |||
| <label for="message" class="form-label">{{'form.comment' | translate}}:</label> | |||
| <label for="message" class="form-label">{{ 'form.comment' | translate }}:</label> | |||
| <textarea class="form-control" id="message" formControlName="message" cols="50" rows="5"></textarea> | |||
| <div class="form-text" *ngIf="commentForm.get('message')?.invalid && commentForm.get('message')?.touched"> | |||
| {{'form.comment' | translate}} {{'form.mandatory' | translate}}. | |||
| {{ 'form.comment' | translate }} {{ 'form.mandatory' | translate }}. | |||
| </div> | |||
| </div> | |||
| <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> | |||
| </div> | |||
| @@ -14,13 +14,13 @@ | |||
| <label for="product" class="form-label">{{ 'form.product' | translate }}:</label> | |||
| <ng-container *ngIf="posting.saleIri === null || posting.saleIri === undefined"> | |||
| <app-search-select *ngIf="this.posting.id === null || this.posting.id === undefined" | |||
| #productSearchSelect | |||
| [formId]="'productIri'" | |||
| [formLabelLangKey]="'form.product'" | |||
| [documentForm]="postForm" | |||
| [getDataFunction]="getProducts" | |||
| [displayedDataField]="'name'" | |||
| [listColDefinitions]="SearchSelectComponent.getDefaultColDefProducts()" | |||
| #productSearchSelect | |||
| [formId]="'productIri'" | |||
| [formLabelLangKey]="'form.product'" | |||
| [documentForm]="postForm" | |||
| [getDataFunction]="getProducts" | |||
| [displayedDataField]="'name'" | |||
| [listColDefinitions]="SearchSelectComponent.getDefaultColDefProducts()" | |||
| > | |||
| </app-search-select> | |||
| <input id="product" type="hidden" *ngIf="this.posting.id === null || this.posting.id === undefined" | |||
| @@ -23,7 +23,8 @@ | |||
| <app-linked-label [product]="post.product"></app-linked-label> | |||
| </h3> | |||
| <p><img src="/assets/images/icons/user.svg" class="icon-mini" alt=""/><a | |||
| href="/user/{{this.appHelperService.extractId(post.owner?.id)}}">{{ post.owner?.fullName }}</a></p> | |||
| href="/user/{{this.appHelperService.extractId(post.owner?.id)}}">{{ post.owner?.fullName }}</a> | |||
| </p> | |||
| </div> | |||
| <div class="spt-border col-12 col-md-8"> | |||
| <h2 class="m-0">{{ post.headline }}</h2> | |||
| @@ -1,16 +1,15 @@ | |||
| <h2 >{{'basic.assign-product' | translate}}</h2> | |||
| <h2>{{ 'basic.assign-product' | translate }}</h2> | |||
| <div class="spt-form"> | |||
| <form [formGroup]="form" (ngSubmit)="onSubmit()"> | |||
| <div class="mb-3" *ngIf="this.partnerProduct"> | |||
| <label for="product" class="form-label">{{ 'form.product' | translate }}:</label> | |||
| <app-search-select #productSearchSelect | |||
| [formId]="'productIri'" | |||
| [formLabelLangKey]="'form.product'" | |||
| [documentForm]="form" | |||
| [getDataFunction]="getUnassignedProducts" | |||
| [displayedDataField]="'name'" | |||
| [listColDefinitions]="SearchSelectComponent.getDefaultColDefProducts()" | |||
| [formId]="'productIri'" | |||
| [formLabelLangKey]="'form.product'" | |||
| [documentForm]="form" | |||
| [getDataFunction]="getUnassignedProducts" | |||
| [displayedDataField]="'name'" | |||
| [listColDefinitions]="SearchSelectComponent.getDefaultColDefProducts()" | |||
| > | |||
| <input type="hidden" id="product" formControlName="productIri" value="{{partnerProduct.productIri}}"/> | |||
| </app-search-select> | |||
| @@ -18,17 +17,18 @@ | |||
| <div class="mb-3" *ngIf="this.contactPartnerProduct"> | |||
| <label for="partnerProduct" class="form-label">{{ 'form.product' | translate }}:</label> | |||
| <app-search-select #productSearchSelect | |||
| [formId]="'partnerProductIri'" | |||
| [formLabelLangKey]="'form.product'" | |||
| [documentForm]="form" | |||
| [getDataFunction]="getUnassignedPartnerProducts" | |||
| [displayedDataField]="'name'" | |||
| [displayedDataSubResource]="'product'" | |||
| [listColDefinitions]="SearchSelectComponent.getDefaultColDefProducts('product')" | |||
| [formId]="'partnerProductIri'" | |||
| [formLabelLangKey]="'form.product'" | |||
| [documentForm]="form" | |||
| [getDataFunction]="getUnassignedPartnerProducts" | |||
| [displayedDataField]="'name'" | |||
| [displayedDataSubResource]="'product'" | |||
| [listColDefinitions]="SearchSelectComponent.getDefaultColDefProducts('product')" | |||
| > | |||
| <input type="hidden" id="partnerProduct" formControlName="partnerProductIri" value="{{contactPartnerProduct.partnerProductIri}}"/> | |||
| <input type="hidden" id="partnerProduct" formControlName="partnerProductIri" | |||
| value="{{contactPartnerProduct.partnerProductIri}}"/> | |||
| </app-search-select> | |||
| </div> | |||
| <button type="submit" class="btn btn-primary" [disabled]="form.invalid">{{'form.send' | translate}}</button> | |||
| <button type="submit" class="btn btn-primary" [disabled]="form.invalid">{{ 'form.send' | translate }}</button> | |||
| </form> | |||
| </div> | |||
| </div> | |||
| @@ -1,7 +1,9 @@ | |||
| import {AfterViewInit, Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core'; | |||
| import { | |||
| ContactPartnerProductJsonld, ContactPartnerProductService, | |||
| PartnerProductJsonld, PartnerProductService, ProductJsonld, | |||
| ContactPartnerProductJsonld, | |||
| ContactPartnerProductService, | |||
| PartnerProductJsonld, | |||
| PartnerProductService, | |||
| ProductService, | |||
| } from "@app/core/api/v1"; | |||
| import {ModalStatus} from "@app/_helpers/modal.states"; | |||
| @@ -9,22 +11,20 @@ import {FormGroupInitializer} from "@app/_helpers/formgroup.initializer"; | |||
| import {FormGroup} from "@angular/forms"; | |||
| import {contactPartnerProductForm, partnerProductForm} from "@app/_forms/apiForms"; | |||
| import {SearchSelectComponent} from "@app/_components/search-select/search-select.component"; | |||
| import {MatTableDataSource} from "@angular/material/table"; | |||
| import {SearchInputColDef} from "@app/_components/search-input/search-input-col-def"; | |||
| import {AppHelperService} from "@app/_helpers/app-helper.service"; | |||
| import {ListGetDataFunctionType} from "@app/_components/list/list-get-data-function-type"; | |||
| @Component({ | |||
| selector: 'app-assign-product', | |||
| templateUrl: './assign-product.component.html', | |||
| styleUrl: './assign-product.component.scss' | |||
| selector: 'app-assign-product', | |||
| templateUrl: './assign-product.component.html', | |||
| styleUrl: './assign-product.component.scss' | |||
| }) | |||
| export class AssignProductComponent implements OnInit, AfterViewInit { | |||
| @Input() public partnerIri!: string; | |||
| @Input() public partnerProduct!: PartnerProductJsonld; | |||
| @Input() public contactPartnerProduct!: ContactPartnerProductJsonld; | |||
| @Output() public submit: EventEmitter<ModalStatus> = new EventEmitter<ModalStatus>(); | |||
| @ViewChild('productSearchSelect', { static: false }) productSearchSelect!: SearchSelectComponent | |||
| @ViewChild('productSearchSelect', {static: false}) productSearchSelect!: SearchSelectComponent | |||
| protected readonly SearchSelectComponent = SearchSelectComponent; | |||
| protected form!: FormGroup; | |||