Florian Eisenmenger 1 рік тому
джерело
коміт
eb8b6f488f
22 змінених файлів з 203 додано та 60 видалено
  1. +1
    -1
      matsen-tool/openapi.json
  2. +142
    -25
      matsen-tool/openapi.yaml
  3. +2
    -2
      matsen-tool/src/app/_helpers/api.converter.ts
  4. +2
    -2
      matsen-tool/src/app/core/api/v1/api/comment.service.ts
  5. +2
    -2
      matsen-tool/src/app/core/api/v1/api/contact.service.ts
  6. +2
    -2
      matsen-tool/src/app/core/api/v1/api/contactPartnerProduct.service.ts
  7. +2
    -2
      matsen-tool/src/app/core/api/v1/api/document.service.ts
  8. +2
    -2
      matsen-tool/src/app/core/api/v1/api/partner.service.ts
  9. +2
    -2
      matsen-tool/src/app/core/api/v1/api/partnerFollow.service.ts
  10. +2
    -2
      matsen-tool/src/app/core/api/v1/api/partnerProduct.service.ts
  11. +2
    -2
      matsen-tool/src/app/core/api/v1/api/post.service.ts
  12. +2
    -2
      matsen-tool/src/app/core/api/v1/api/product.service.ts
  13. +2
    -2
      matsen-tool/src/app/core/api/v1/api/sale.service.ts
  14. +2
    -2
      matsen-tool/src/app/core/api/v1/api/task.service.ts
  15. +2
    -2
      matsen-tool/src/app/core/api/v1/api/taskNote.service.ts
  16. +1
    -1
      matsen-tool/src/app/core/api/v1/api/user.service.ts
  17. +1
    -1
      matsen-tool/src/app/home/home.component.html
  18. +8
    -1
      matsen-tool/src/app/partners/partners-detail/partners-detail.component.html
  19. +21
    -4
      matsen-tool/src/app/partners/partners-detail/partners-detail.component.ts
  20. +1
    -0
      matsen-tool/src/app/postings/new-posting/new-posting.component.ts
  21. +1
    -0
      matsen-tool/src/app/sales/sales-detail/sales-detail.component.ts
  22. +1
    -1
      matsen-tool/src/app/tasks/tasks.component.html

+ 1
- 1
matsen-tool/openapi.json
Різницю між файлами не показано, бо вона завелика
Переглянути файл


+ 142
- 25
matsen-tool/openapi.yaml
Різницю між файлами не показано, бо вона завелика
Переглянути файл


+ 2
- 2
matsen-tool/src/app/_helpers/api.converter.ts Переглянути файл

@@ -6,8 +6,8 @@ export class ApiConverter {

constructor(private sanitizer: DomSanitizer) {}

public static extractId(iri: string | undefined): string {
if (iri !== undefined) {
public static extractId(iri: string | undefined | null): string {
if (iri !== undefined && iri !== null) {
const iriRegex = /\/(\d+)$/;
const match = iri.match(iriRegex);
if (match && match[1]) {


+ 2
- 2
matsen-tool/src/app/core/api/v1/api/comment.service.ts Переглянути файл

@@ -186,7 +186,7 @@ export class CommentService {
/**
* Retrieves a Comment resource.
* Retrieves a Comment resource.
* @param id Comment identifier
* @param id CommentApi identifier
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
@@ -261,7 +261,7 @@ export class CommentService {
/**
* Updates the Comment resource.
* Updates the Comment resource.
* @param id Comment identifier
* @param id CommentApi identifier
* @param comment The updated Comment resource
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.


+ 2
- 2
matsen-tool/src/app/core/api/v1/api/contact.service.ts Переглянути файл

@@ -198,7 +198,7 @@ export class ContactService {
/**
* Retrieves a Contact resource.
* Retrieves a Contact resource.
* @param id Contact identifier
* @param id ContactApi identifier
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
@@ -273,7 +273,7 @@ export class ContactService {
/**
* Updates the Contact resource.
* Updates the Contact resource.
* @param id Contact identifier
* @param id ContactApi identifier
* @param contact The updated Contact resource
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.


+ 2
- 2
matsen-tool/src/app/core/api/v1/api/contactPartnerProduct.service.ts Переглянути файл

@@ -198,7 +198,7 @@ export class ContactPartnerProductService {
/**
* Removes the ContactPartnerProduct resource.
* Removes the ContactPartnerProduct resource.
* @param id ContactPartnerProduct identifier
* @param id ContactPartnerProductApi identifier
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
@@ -269,7 +269,7 @@ export class ContactPartnerProductService {
/**
* Retrieves a ContactPartnerProduct resource.
* Retrieves a ContactPartnerProduct resource.
* @param id ContactPartnerProduct identifier
* @param id ContactPartnerProductApi identifier
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/


+ 2
- 2
matsen-tool/src/app/core/api/v1/api/document.service.ts Переглянути файл

@@ -210,7 +210,7 @@ export class DocumentService {
/**
* Retrieves a Document resource.
* Retrieves a Document resource.
* @param id Document identifier
* @param id DocumentApi identifier
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
@@ -285,7 +285,7 @@ export class DocumentService {
/**
* Updates the Document resource.
* Updates the Document resource.
* @param id Document identifier
* @param id DocumentApi identifier
* @param document The updated Document resource
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.


+ 2
- 2
matsen-tool/src/app/core/api/v1/api/partner.service.ts Переглянути файл

@@ -218,7 +218,7 @@ export class PartnerService {
/**
* Retrieves a Partner resource.
* Retrieves a Partner resource.
* @param id Partner identifier
* @param id PartnerApi identifier
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
@@ -293,7 +293,7 @@ export class PartnerService {
/**
* Updates the Partner resource.
* Updates the Partner resource.
* @param id Partner identifier
* @param id PartnerApi identifier
* @param partner The updated Partner resource
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.


+ 2
- 2
matsen-tool/src/app/core/api/v1/api/partnerFollow.service.ts Переглянути файл

@@ -210,7 +210,7 @@ export class PartnerFollowService {
/**
* Removes the PartnerFollow resource.
* Removes the PartnerFollow resource.
* @param id PartnerFollow identifier
* @param id PartnerFollowApi identifier
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
@@ -281,7 +281,7 @@ export class PartnerFollowService {
/**
* Retrieves a PartnerFollow resource.
* Retrieves a PartnerFollow resource.
* @param id PartnerFollow identifier
* @param id PartnerFollowApi identifier
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/


+ 2
- 2
matsen-tool/src/app/core/api/v1/api/partnerProduct.service.ts Переглянути файл

@@ -210,7 +210,7 @@ export class PartnerProductService {
/**
* Removes the PartnerProduct resource.
* Removes the PartnerProduct resource.
* @param id PartnerProduct identifier
* @param id PartnerProductApi identifier
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
@@ -281,7 +281,7 @@ export class PartnerProductService {
/**
* Retrieves a PartnerProduct resource.
* Retrieves a PartnerProduct resource.
* @param id PartnerProduct identifier
* @param id PartnerProductApi identifier
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/


+ 2
- 2
matsen-tool/src/app/core/api/v1/api/post.service.ts Переглянути файл

@@ -240,7 +240,7 @@ export class PostService {
/**
* Retrieves a Post resource.
* Retrieves a Post resource.
* @param id Post identifier
* @param id PostingApi identifier
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
@@ -315,7 +315,7 @@ export class PostService {
/**
* Updates the Post resource.
* Updates the Post resource.
* @param id Post identifier
* @param id PostingApi identifier
* @param postPostingPatch The updated Post resource
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.


+ 2
- 2
matsen-tool/src/app/core/api/v1/api/product.service.ts Переглянути файл

@@ -196,7 +196,7 @@ export class ProductService {
/**
* Retrieves a Product resource.
* Retrieves a Product resource.
* @param id Product identifier
* @param id ProductApi identifier
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
@@ -271,7 +271,7 @@ export class ProductService {
/**
* Updates the Product resource.
* Updates the Product resource.
* @param id Product identifier
* @param id ProductApi identifier
* @param product The updated Product resource
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.


+ 2
- 2
matsen-tool/src/app/core/api/v1/api/sale.service.ts Переглянути файл

@@ -210,7 +210,7 @@ export class SaleService {
/**
* Retrieves a Sale resource.
* Retrieves a Sale resource.
* @param id Sale identifier
* @param id SaleApi identifier
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
@@ -285,7 +285,7 @@ export class SaleService {
/**
* Updates the Sale resource.
* Updates the Sale resource.
* @param id Sale identifier
* @param id SaleApi identifier
* @param sale The updated Sale resource
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.


+ 2
- 2
matsen-tool/src/app/core/api/v1/api/task.service.ts Переглянути файл

@@ -222,7 +222,7 @@ export class TaskService {
/**
* Retrieves a Task resource.
* Retrieves a Task resource.
* @param id Task identifier
* @param id TaskApi identifier
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
@@ -297,7 +297,7 @@ export class TaskService {
/**
* Updates the Task resource.
* Updates the Task resource.
* @param id Task identifier
* @param id TaskApi identifier
* @param task The updated Task resource
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.


+ 2
- 2
matsen-tool/src/app/core/api/v1/api/taskNote.service.ts Переглянути файл

@@ -198,7 +198,7 @@ export class TaskNoteService {
/**
* Retrieves a TaskNote resource.
* Retrieves a TaskNote resource.
* @param id TaskNote identifier
* @param id TaskNoteApi identifier
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
@@ -273,7 +273,7 @@ export class TaskNoteService {
/**
* Updates the TaskNote resource.
* Updates the TaskNote resource.
* @param id TaskNote identifier
* @param id TaskNoteApi identifier
* @param taskNote The updated TaskNote resource
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.


+ 1
- 1
matsen-tool/src/app/core/api/v1/api/user.service.ts Переглянути файл

@@ -196,7 +196,7 @@ export class UserService {
/**
* Retrieves a User resource.
* Retrieves a User resource.
* @param id User identifier
* @param id UserApi identifier
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/


+ 1
- 1
matsen-tool/src/app/home/home.component.html Переглянути файл

@@ -69,7 +69,7 @@
<div class="tasks mb-3" *ngFor="let task of tasks">
<div class="card p-3">
<div class="position-relative">
<h3 class="m-0"><a *ngIf="task.partner" href="/{{task.partnerType}}/{{ApiConverter.extractId(task.partner)}}">{{task.partnerName}}</a></h3>
<h3 class="m-0" *ngIf="task.partner"><a href="/{{task.partnerType}}/{{ApiConverter.extractId(task.partner)}}">{{task.partnerName}}</a></h3>
<span class="info d-flex position-absolute">
<span class="due-date">{{ task.dueAt | date:'dd.MM.YYYY':'GMT+0000' }}</span>
<span class="importance" [attr.data-importance]="task.prio"></span>


+ 8
- 1
matsen-tool/src/app/partners/partners-detail/partners-detail.component.html Переглянути файл

@@ -44,6 +44,13 @@
<p [innerHTML]="apiConverter.getSafeLongtext(partner.description)"></p>
</div>
</div>
<div class="card-body row" *ngIf="partnerProducts">
<div class="col-12">
<ul *ngFor="let partnerProduct of partnerProducts">
<li><a href="/products/{{ApiConverter.extractId(partnerProduct.product)}}">{{partnerProduct.productName}}</a></li>
</ul>
</div>
</div>
</div>
</div>
<app-toggle #toggleContacts [headline]="'basic.contacts' | translate">
@@ -94,7 +101,7 @@
<div class="tasks mb-3" *ngFor="let task of tasks">
<div class="card p-3">
<div class="position-relative">
<h3 class="m-0"><a *ngIf="task.partner" href="/{{task.partnerType}}/{{ApiConverter.extractId(task.partner)}}">{{task.partnerName}}</a></h3>
<h3 class="m-0" *ngIf="task.partner"><a href="/{{task.partnerType}}/{{ApiConverter.extractId(task.partner)}}">{{task.partnerName}}</a></h3>
<span class="info d-flex position-absolute">
<span class="due-date">{{ task.dueAt | date:'dd.MM.YYYY':'GMT+0000' }}</span>
<span class="importance" [attr.data-importance]="task.prio"></span>


+ 21
- 4
matsen-tool/src/app/partners/partners-detail/partners-detail.component.ts Переглянути файл

@@ -6,7 +6,7 @@ import {
CommentJsonld,
ContactJsonld,
ContactService, PartnerFollowJsonld, PartnerFollowService,
PartnerJsonld,
PartnerJsonld, PartnerProductJsonld, PartnerProductService,
PartnerService,
PostJsonld,
PostService, TaskJsonld, TaskNoteJsonld, TaskService
@@ -48,6 +48,9 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit {
protected partnerDetailSub: Subscription;
protected partner: PartnerJsonld;

protected partnerProductSub: Subscription;
protected partnerProducts: Array<PartnerProductJsonld>;

protected partnerFollowSub: Subscription;
protected partnerFollow: PartnerFollowJsonld | null;

@@ -88,6 +91,7 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit {
private modalService: NgbModal,
private route: ActivatedRoute,
private partnerService: PartnerService,
private partnerProductService: PartnerProductService,
private partnerFollowService: PartnerFollowService,
private contactService: ContactService,
private postService: PostService,
@@ -98,6 +102,9 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit {
this.partnerDetailSub = new Subscription();
this.partner = {} as PartnerJsonld;

this.partnerProductSub = new Subscription();
this.partnerProducts = [];

this.partnerFollowSub = new Subscription();
this.partnerFollow = null;

@@ -138,6 +145,7 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit {
this.id = params['id'];
});
this.getPartnerData();
this.getPartnerProducts();
this.getContactsData();
this.getPostsData();
this.getTasksData();
@@ -156,7 +164,18 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit {
).subscribe(
data => {
this.partner = data;
console.log(this.partner);
}
);
}

getPartnerProducts() {
this.partnerProductSub = this.partnerProductService.partnerProductsGetCollection(
this.contactsPageIndex + 1,
this.contactsPageSize,
this.id
).subscribe(
data => {
this.partnerProducts = data["hydra:member"];
}
);
}
@@ -296,8 +315,6 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit {
const modalRefPosting = this.modalService.open(NewPostingComponent, this.modalOptions);
let posting: PostJsonld = {} as PostJsonld;
posting.partner = this.partner.id ?? null;
// TODO: REAL PRODUCT
posting.product = "/api/products/101";
modalRefPosting.componentInstance.posting = posting;
modalRefPosting.componentInstance.submit.subscribe((modalStatus: ModalStatus) => {
if (modalStatus === ModalStatus.Submitted) {


+ 1
- 0
matsen-tool/src/app/postings/new-posting/new-posting.component.ts Переглянути файл

@@ -28,6 +28,7 @@ export class NewPostingComponent implements OnInit {

ngOnInit(): void {
this.postForm = FormGroupInitializer.initFormGroup(this.postForm, this.posting);
console.log(this.posting);
}

onSubmit() {


+ 1
- 0
matsen-tool/src/app/sales/sales-detail/sales-detail.component.ts Переглянути файл

@@ -128,6 +128,7 @@ export class SalesDetailComponent implements OnInit, AfterViewInit {
let posting: PostJsonld = {} as PostJsonld;
posting.sale = this.sale.id ?? null;
posting.partner = this.sale.partner ?? null;
posting.product = this.sale.product ?? null;
modalRefPosting.componentInstance.posting = posting;
modalRefPosting.componentInstance.submit.subscribe((modalStatus: ModalStatus) => {
if (modalStatus === ModalStatus.Submitted) {


+ 1
- 1
matsen-tool/src/app/tasks/tasks.component.html Переглянути файл

@@ -7,7 +7,7 @@
<div class="tasks mb-3" *ngFor="let task of tasks">
<div class="card p-3">
<div class="position-relative">
<h3 class="m-0"><a *ngIf="task.partner" href="/{{task.partnerType}}/{{ApiConverter.extractId(task.partner)}}">{{task.partnerName}}</a></h3>
<h3 class="m-0" *ngIf="task.partner"><a href="/{{task.partnerType}}/{{ApiConverter.extractId(task.partner)}}">{{task.partnerName}}</a></h3>
<span class="info d-flex position-absolute">
<span class="due-date">{{ task.dueAt | date:'dd.MM.YYYY':'GMT+0000' }}</span>
<span class="importance" [attr.data-importance]="task.prio"></span>


Завантаження…
Відмінити
Зберегти