Pārlūkot izejas kodu

new api export, api converter as service, product likes

master
Daniel pirms 1 gada
vecāks
revīzija
5edeb0f962
51 mainītis faili ar 1222 papildinājumiem un 228 dzēšanām
  1. +1
    -1
      matsen-tool/openapi.json
  2. +442
    -142
      matsen-tool/openapi.yaml
  3. +34
    -3
      matsen-tool/src/app/_forms/apiForms.ts
  4. +2
    -2
      matsen-tool/src/app/_helpers/api.converter.ts
  5. +1
    -1
      matsen-tool/src/app/contacts/contacts-detail/contacts-detail.component.ts
  6. +3
    -2
      matsen-tool/src/app/contacts/new-contact/new-contact.component.ts
  7. +6
    -0
      matsen-tool/src/app/core/api/v1/.openapi-generator/FILES
  8. +3
    -1
      matsen-tool/src/app/core/api/v1/api/api.ts
  9. +2
    -2
      matsen-tool/src/app/core/api/v1/api/comment.service.ts
  10. +2
    -2
      matsen-tool/src/app/core/api/v1/api/contact.service.ts
  11. +2
    -2
      matsen-tool/src/app/core/api/v1/api/contactPartnerProduct.service.ts
  12. +2
    -2
      matsen-tool/src/app/core/api/v1/api/document.service.ts
  13. +2
    -2
      matsen-tool/src/app/core/api/v1/api/partner.service.ts
  14. +2
    -2
      matsen-tool/src/app/core/api/v1/api/partnerFollow.service.ts
  15. +2
    -2
      matsen-tool/src/app/core/api/v1/api/partnerProduct.service.ts
  16. +2
    -2
      matsen-tool/src/app/core/api/v1/api/post.service.ts
  17. +2
    -2
      matsen-tool/src/app/core/api/v1/api/product.service.ts
  18. +2
    -2
      matsen-tool/src/app/core/api/v1/api/sale.service.ts
  19. +2
    -2
      matsen-tool/src/app/core/api/v1/api/task.service.ts
  20. +2
    -2
      matsen-tool/src/app/core/api/v1/api/taskNote.service.ts
  21. +1
    -1
      matsen-tool/src/app/core/api/v1/api/user.service.ts
  22. +444
    -0
      matsen-tool/src/app/core/api/v1/api/userProduct.service.ts
  23. +23
    -0
      matsen-tool/src/app/core/api/v1/model/apiUserProductsGetCollection200Response.ts
  24. +22
    -0
      matsen-tool/src/app/core/api/v1/model/apiUserProductsGetCollection200Response1.ts
  25. +5
    -0
      matsen-tool/src/app/core/api/v1/model/models.ts
  26. +1
    -0
      matsen-tool/src/app/core/api/v1/model/partnerFollow.ts
  27. +1
    -0
      matsen-tool/src/app/core/api/v1/model/partnerFollowJsonhal.ts
  28. +1
    -0
      matsen-tool/src/app/core/api/v1/model/partnerFollowJsonld.ts
  29. +25
    -0
      matsen-tool/src/app/core/api/v1/model/userProduct.ts
  30. +27
    -0
      matsen-tool/src/app/core/api/v1/model/userProductJsonhal.ts
  31. +29
    -0
      matsen-tool/src/app/core/api/v1/model/userProductJsonld.ts
  32. +3
    -2
      matsen-tool/src/app/documents/new-document/new-document.component.ts
  33. +1
    -1
      matsen-tool/src/app/home/home.component.html
  34. +1
    -1
      matsen-tool/src/app/home/home.component.ts
  35. +3
    -2
      matsen-tool/src/app/partners/new-partner/new-partner.component.ts
  36. +4
    -3
      matsen-tool/src/app/partners/partners-detail/partners-detail.component.html
  37. +3
    -4
      matsen-tool/src/app/partners/partners-detail/partners-detail.component.ts
  38. +3
    -2
      matsen-tool/src/app/partners/partners.component.ts
  39. +3
    -2
      matsen-tool/src/app/postings/new-comment/new-comment.component.ts
  40. +3
    -2
      matsen-tool/src/app/postings/new-posting/new-posting.component.ts
  41. +3
    -2
      matsen-tool/src/app/products/new-product/new-product.component.ts
  42. +7
    -0
      matsen-tool/src/app/products/products-detail/products-detail.component.html
  43. +62
    -3
      matsen-tool/src/app/products/products-detail/products-detail.component.ts
  44. +3
    -2
      matsen-tool/src/app/products/products.component.ts
  45. +3
    -2
      matsen-tool/src/app/sales/new-sale/new-sale.component.ts
  46. +2
    -2
      matsen-tool/src/app/sales/sales.component.html
  47. +2
    -2
      matsen-tool/src/app/sales/sales.component.ts
  48. +3
    -2
      matsen-tool/src/app/tasks/new-task-note/new-task-note.component.ts
  49. +16
    -15
      matsen-tool/src/app/tasks/new-task/new-task.component.ts
  50. +1
    -1
      matsen-tool/src/app/tasks/tasks.component.html
  51. +1
    -1
      matsen-tool/src/app/tasks/tasks.component.ts

+ 1
- 1
matsen-tool/openapi.json
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 442
- 142
matsen-tool/openapi.yaml
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 34
- 3
matsen-tool/src/app/_forms/apiForms.ts Parādīt failu

@@ -231,7 +231,8 @@ export const partnerFollowForm = new FormGroup({
userName: new FormControl(null, []), userName: new FormControl(null, []),
partner: new FormControl(null, [Validators.required]), partner: new FormControl(null, [Validators.required]),
partnerName: new FormControl(null, []), partnerName: new FormControl(null, []),
createdAt: new FormControl(null, [])
createdAt: new FormControl(null, []),
owner: new FormControl(null, [])
}); });


export const partnerFollowJsonhalForm = new FormGroup({ export const partnerFollowJsonhalForm = new FormGroup({
@@ -240,7 +241,8 @@ export const partnerFollowJsonhalForm = new FormGroup({
userName: new FormControl(null, []), userName: new FormControl(null, []),
partner: new FormControl(null, [Validators.required]), partner: new FormControl(null, [Validators.required]),
partnerName: new FormControl(null, []), partnerName: new FormControl(null, []),
createdAt: new FormControl(null, [])
createdAt: new FormControl(null, []),
owner: new FormControl(null, [])
}); });


export const partnerFollowJsonldForm = new FormGroup({ export const partnerFollowJsonldForm = new FormGroup({
@@ -248,7 +250,8 @@ export const partnerFollowJsonldForm = new FormGroup({
userName: new FormControl(null, []), userName: new FormControl(null, []),
partner: new FormControl(null, [Validators.required]), partner: new FormControl(null, [Validators.required]),
partnerName: new FormControl(null, []), partnerName: new FormControl(null, []),
createdAt: new FormControl(null, [])
createdAt: new FormControl(null, []),
owner: new FormControl(null, [])
}); });


export const partnerProductForm = new FormGroup({ export const partnerProductForm = new FormGroup({
@@ -570,3 +573,31 @@ export const userJsonldForm = new FormGroup({
active: new FormControl(null, []), active: new FormControl(null, []),
createdAt: new FormControl(null, []) createdAt: new FormControl(null, [])
}); });

export const userProductForm = new FormGroup({
user: new FormControl(null, []),
userName: new FormControl(null, []),
product: new FormControl(null, [Validators.required]),
productName: new FormControl(null, []),
createdAt: new FormControl(null, []),
owner: new FormControl(null, [])
});

export const userProductJsonhalForm = new FormGroup({
_links: new FormControl(null, []),
user: new FormControl(null, []),
userName: new FormControl(null, []),
product: new FormControl(null, [Validators.required]),
productName: new FormControl(null, []),
createdAt: new FormControl(null, []),
owner: new FormControl(null, [])
});

export const userProductJsonldForm = new FormGroup({
user: new FormControl(null, []),
userName: new FormControl(null, []),
product: new FormControl(null, [Validators.required]),
productName: new FormControl(null, []),
createdAt: new FormControl(null, []),
owner: new FormControl(null, [])
});

+ 2
- 2
matsen-tool/src/app/_helpers/api.converter.ts Parādīt failu

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


constructor(private sanitizer: DomSanitizer) {} constructor(private sanitizer: DomSanitizer) {}


public static extractId(iri: string | undefined | null): string {
public extractId(iri: string | undefined | null): string {
if (iri !== undefined && iri !== null) { if (iri !== undefined && iri !== null) {
const iriRegex = /\/(\d+)$/; const iriRegex = /\/(\d+)$/;
const match = iri.match(iriRegex); const match = iri.match(iriRegex);
@@ -17,7 +17,7 @@ export class ApiConverter {
return ""; return "";
} }


public static convertDate(dateString: string | null, withTime = false) {
public convertDate(dateString: string | null, withTime = false) {
// number 10 for input date (2024-03-15) // number 10 for input date (2024-03-15)
// number 16 for input datetime-local (2024-04-28T03:22) // number 16 for input datetime-local (2024-04-28T03:22)
if (dateString !== null) { if (dateString !== null) {


+ 1
- 1
matsen-tool/src/app/contacts/contacts-detail/contacts-detail.component.ts Parādīt failu

@@ -177,7 +177,7 @@ export class ContactsDetailComponent implements OnInit, AfterViewInit {
const modalRefContact = this.modalService.open(NewContactComponent, this.modalOptions); const modalRefContact = this.modalService.open(NewContactComponent, this.modalOptions);
modalRefContact.componentInstance.contact = this.contact; modalRefContact.componentInstance.contact = this.contact;
if (this.contact.birthday !== undefined) { if (this.contact.birthday !== undefined) {
modalRefContact.componentInstance.birthdayValue = ApiConverter.convertDate(this.contact.birthday);
modalRefContact.componentInstance.birthdayValue = this.apiConverter.convertDate(this.contact.birthday);
} }
modalRefContact.componentInstance.submit.subscribe((modalStatus: ModalStatus) => { modalRefContact.componentInstance.submit.subscribe((modalStatus: ModalStatus) => {
if (modalStatus === ModalStatus.Submitted) { if (modalStatus === ModalStatus.Submitted) {


+ 3
- 2
matsen-tool/src/app/contacts/new-contact/new-contact.component.ts Parādīt failu

@@ -28,7 +28,8 @@ export class NewContactComponent implements OnInit {
constructor( constructor(
private contactService: ContactService, private contactService: ContactService,
private mediaObjectService: MediaObjectService, private mediaObjectService: MediaObjectService,
private translateService: TranslateService
private translateService: TranslateService,
protected apiConverter: ApiConverter,
) { ) {
this.contactForm = contactForm; this.contactForm = contactForm;
this.selectedImage = null; this.selectedImage = null;
@@ -84,7 +85,7 @@ export class NewContactComponent implements OnInit {
} else { } else {
// Edit contact // Edit contact
this.contactSub = this.contactService.contactsIdPatch( this.contactSub = this.contactService.contactsIdPatch(
ApiConverter.extractId(this.contact.id),
this.apiConverter.extractId(this.contact.id),
this.contactForm.value as ContactJsonld this.contactForm.value as ContactJsonld
).subscribe( ).subscribe(
data => { data => {


+ 6
- 0
matsen-tool/src/app/core/api/v1/.openapi-generator/FILES Parādīt failu

@@ -19,6 +19,7 @@ api/saleSummary.service.ts
api/task.service.ts api/task.service.ts
api/taskNote.service.ts api/taskNote.service.ts
api/user.service.ts api/user.service.ts
api/userProduct.service.ts
configuration.ts configuration.ts
encoder.ts encoder.ts
git_push.sh git_push.sh
@@ -58,6 +59,8 @@ model/apiTaskNotesGetCollection200Response.ts
model/apiTaskNotesGetCollection200Response1.ts model/apiTaskNotesGetCollection200Response1.ts
model/apiTasksGetCollection200Response.ts model/apiTasksGetCollection200Response.ts
model/apiTasksGetCollection200Response1.ts model/apiTasksGetCollection200Response1.ts
model/apiUserProductsGetCollection200Response.ts
model/apiUserProductsGetCollection200Response1.ts
model/apiUsersGetCollection200Response.ts model/apiUsersGetCollection200Response.ts
model/apiUsersGetCollection200Response1.ts model/apiUsersGetCollection200Response1.ts
model/comment.ts model/comment.ts
@@ -118,5 +121,8 @@ model/taskNoteJsonld.ts
model/user.ts model/user.ts
model/userJsonhal.ts model/userJsonhal.ts
model/userJsonld.ts model/userJsonld.ts
model/userProduct.ts
model/userProductJsonhal.ts
model/userProductJsonld.ts
param.ts param.ts
variables.ts variables.ts

+ 3
- 1
matsen-tool/src/app/core/api/v1/api/api.ts Parādīt failu

@@ -32,4 +32,6 @@ export * from './taskNote.service';
import { TaskNoteService } from './taskNote.service'; import { TaskNoteService } from './taskNote.service';
export * from './user.service'; export * from './user.service';
import { UserService } from './user.service'; import { UserService } from './user.service';
export const APIS = [CommentService, ContactService, ContactPartnerProductService, DocumentService, DocumentObjectService, LoginCheckService, MediaObjectService, PartnerService, PartnerFollowService, PartnerProductService, PostService, ProductService, SaleService, SaleSummaryService, TaskService, TaskNoteService, UserService];
export * from './userProduct.service';
import { UserProductService } from './userProduct.service';
export const APIS = [CommentService, ContactService, ContactPartnerProductService, DocumentService, DocumentObjectService, LoginCheckService, MediaObjectService, PartnerService, PartnerFollowService, PartnerProductService, PostService, ProductService, SaleService, SaleSummaryService, TaskService, TaskNoteService, UserService, UserProductService];

+ 2
- 2
matsen-tool/src/app/core/api/v1/api/comment.service.ts Parādīt failu

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


+ 2
- 2
matsen-tool/src/app/core/api/v1/api/contact.service.ts Parādīt failu

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


+ 2
- 2
matsen-tool/src/app/core/api/v1/api/contactPartnerProduct.service.ts Parādīt failu

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


+ 2
- 2
matsen-tool/src/app/core/api/v1/api/document.service.ts Parādīt failu

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


+ 2
- 2
matsen-tool/src/app/core/api/v1/api/partner.service.ts Parādīt failu

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


+ 2
- 2
matsen-tool/src/app/core/api/v1/api/partnerFollow.service.ts Parādīt failu

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


+ 2
- 2
matsen-tool/src/app/core/api/v1/api/partnerProduct.service.ts Parādīt failu

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


+ 2
- 2
matsen-tool/src/app/core/api/v1/api/post.service.ts Parādīt failu

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


+ 2
- 2
matsen-tool/src/app/core/api/v1/api/product.service.ts Parādīt failu

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


+ 2
- 2
matsen-tool/src/app/core/api/v1/api/sale.service.ts Parādīt failu

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


+ 2
- 2
matsen-tool/src/app/core/api/v1/api/task.service.ts Parādīt failu

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


+ 2
- 2
matsen-tool/src/app/core/api/v1/api/taskNote.service.ts Parādīt failu

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


+ 1
- 1
matsen-tool/src/app/core/api/v1/api/user.service.ts Parādīt failu

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


+ 444
- 0
matsen-tool/src/app/core/api/v1/api/userProduct.service.ts Parādīt failu

@@ -0,0 +1,444 @@
/**
* Matsen API Platform
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable:no-unused-variable member-ordering */

import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';

// @ts-ignore
import { ApiUserProductsGetCollection200Response } from '../model/apiUserProductsGetCollection200Response';
// @ts-ignore
import { ApiUserProductsGetCollection200Response1 } from '../model/apiUserProductsGetCollection200Response1';
// @ts-ignore
import { UserProduct } from '../model/userProduct';
// @ts-ignore
import { UserProductJsonhal } from '../model/userProductJsonhal';
// @ts-ignore
import { UserProductJsonld } from '../model/userProductJsonld';

// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';



@Injectable({
providedIn: 'root'
})
export class UserProductService {

protected basePath = 'http://localhost';
public defaultHeaders = new HttpHeaders();
public configuration = new Configuration();
public encoder: HttpParameterCodec;

constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) {
if (configuration) {
this.configuration = configuration;
}
if (typeof this.configuration.basePath !== 'string') {
if (Array.isArray(basePath) && basePath.length > 0) {
basePath = basePath[0];
}

if (typeof basePath !== 'string') {
basePath = this.basePath;
}
this.configuration.basePath = basePath;
}
this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
}


// @ts-ignore
private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams {
if (typeof value === "object" && value instanceof Date === false) {
httpParams = this.addToHttpParamsRecursive(httpParams, value);
} else {
httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
}
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if (value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
} else if (value instanceof Date) {
if (key != null) {
httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10));
} else {
throw Error("key may not be null if value is Date");
}
} else {
Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive(
httpParams, value[k], key != null ? `${key}.${k}` : k));
}
} else if (key != null) {
httpParams = httpParams.append(key, value);
} else {
throw Error("key may not be null if value is not object or array");
}
return httpParams;
}

/**
* Retrieves the collection of UserProduct resources.
* Retrieves the collection of UserProduct resources.
* @param page The collection page number
* @param itemsPerPage The number of items per page
* @param user
* @param user2
* @param product
* @param product2
* @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.
*/
public userProductsGetCollection(page?: number, itemsPerPage?: number, user?: string, user2?: Array<string>, product?: string, product2?: Array<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiUserProductsGetCollection200Response>;
public userProductsGetCollection(page?: number, itemsPerPage?: number, user?: string, user2?: Array<string>, product?: string, product2?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiUserProductsGetCollection200Response>>;
public userProductsGetCollection(page?: number, itemsPerPage?: number, user?: string, user2?: Array<string>, product?: string, product2?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiUserProductsGetCollection200Response>>;
public userProductsGetCollection(page?: number, itemsPerPage?: number, user?: string, user2?: Array<string>, product?: string, product2?: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {

let localVarQueryParameters = new HttpParams({encoder: this.encoder});
if (page !== undefined && page !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>page, 'page');
}
if (itemsPerPage !== undefined && itemsPerPage !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>itemsPerPage, 'itemsPerPage');
}
if (user !== undefined && user !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>user, 'user');
}
if (user2) {
user2.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>element, 'user[]');
})
}
if (product !== undefined && product !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>product, 'product');
}
if (product2) {
product2.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>element, 'product[]');
})
}

let localVarHeaders = this.defaultHeaders;

let localVarCredential: string | undefined;
// authentication (JWT) required
localVarCredential = this.configuration.lookupCredential('JWT');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
}

let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = [
'application/ld+json',
'application/json',
'text/html',
'application/hal+json'
];
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}

let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}

let localVarTransferCache: boolean | undefined = options && options.transferCache;
if (localVarTransferCache === undefined) {
localVarTransferCache = true;
}


let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}

let localVarPath = `/api/user_products`;
return this.httpClient.request<ApiUserProductsGetCollection200Response>('get', `${this.configuration.basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
}

/**
* Removes the UserProduct resource.
* Removes the UserProduct resource.
* @param id UserProduct 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.
*/
public userProductsIdDelete(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
public userProductsIdDelete(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public userProductsIdDelete(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public userProductsIdDelete(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling userProductsIdDelete.');
}

let localVarHeaders = this.defaultHeaders;

let localVarCredential: string | undefined;
// authentication (JWT) required
localVarCredential = this.configuration.lookupCredential('JWT');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
}

let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = [
];
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}

let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}

let localVarTransferCache: boolean | undefined = options && options.transferCache;
if (localVarTransferCache === undefined) {
localVarTransferCache = true;
}


let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}

let localVarPath = `/api/user_products/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
}

/**
* Retrieves a UserProduct resource.
* Retrieves a UserProduct resource.
* @param id UserProduct 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.
*/
public userProductsIdGet(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<UserProductJsonld>;
public userProductsIdGet(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<UserProductJsonld>>;
public userProductsIdGet(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<UserProductJsonld>>;
public userProductsIdGet(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling userProductsIdGet.');
}

let localVarHeaders = this.defaultHeaders;

let localVarCredential: string | undefined;
// authentication (JWT) required
localVarCredential = this.configuration.lookupCredential('JWT');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
}

let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = [
'application/ld+json',
'application/json',
'text/html',
'application/hal+json'
];
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}

let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}

let localVarTransferCache: boolean | undefined = options && options.transferCache;
if (localVarTransferCache === undefined) {
localVarTransferCache = true;
}


let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}

let localVarPath = `/api/user_products/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<UserProductJsonld>('get', `${this.configuration.basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
}

/**
* Creates a UserProduct resource.
* Creates a UserProduct resource.
* @param userProductJsonld The new UserProduct 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.
*/
public userProductsPost(userProductJsonld: UserProductJsonld, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<UserProductJsonld>;
public userProductsPost(userProductJsonld: UserProductJsonld, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<UserProductJsonld>>;
public userProductsPost(userProductJsonld: UserProductJsonld, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<UserProductJsonld>>;
public userProductsPost(userProductJsonld: UserProductJsonld, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (userProductJsonld === null || userProductJsonld === undefined) {
throw new Error('Required parameter userProductJsonld was null or undefined when calling userProductsPost.');
}

let localVarHeaders = this.defaultHeaders;

let localVarCredential: string | undefined;
// authentication (JWT) required
localVarCredential = this.configuration.lookupCredential('JWT');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
}

let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = [
'application/ld+json',
'application/json',
'text/html',
'application/hal+json'
];
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}

let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}

let localVarTransferCache: boolean | undefined = options && options.transferCache;
if (localVarTransferCache === undefined) {
localVarTransferCache = true;
}


// to determine the Content-Type header
const consumes: string[] = [
'application/ld+json',
'application/json',
'text/html',
'application/hal+json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}

let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}

let localVarPath = `/api/user_products`;
return this.httpClient.request<UserProductJsonld>('post', `${this.configuration.basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: userProductJsonld,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
}

}

+ 23
- 0
matsen-tool/src/app/core/api/v1/model/apiUserProductsGetCollection200Response.ts Parādīt failu

@@ -0,0 +1,23 @@
/**
* Matsen API Platform
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { UserProductJsonld } from './userProductJsonld';
import { ApiCommentsGetCollection200ResponseHydraSearch } from './apiCommentsGetCollection200ResponseHydraSearch';
import { ApiCommentsGetCollection200ResponseHydraView } from './apiCommentsGetCollection200ResponseHydraView';


export interface ApiUserProductsGetCollection200Response {
'hydra:member': Array<UserProductJsonld>;
'hydra:totalItems'?: number;
'hydra:view'?: ApiCommentsGetCollection200ResponseHydraView;
'hydra:search'?: ApiCommentsGetCollection200ResponseHydraSearch;
}


+ 22
- 0
matsen-tool/src/app/core/api/v1/model/apiUserProductsGetCollection200Response1.ts Parādīt failu

@@ -0,0 +1,22 @@
/**
* Matsen API Platform
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { UserProductJsonhal } from './userProductJsonhal';
import { ApiCommentsGetCollection200Response1Links } from './apiCommentsGetCollection200Response1Links';


export interface ApiUserProductsGetCollection200Response1 {
_embedded: Array<UserProductJsonhal>;
totalItems?: number;
itemsPerPage?: number;
_links: ApiCommentsGetCollection200Response1Links;
}


+ 5
- 0
matsen-tool/src/app/core/api/v1/model/models.ts Parādīt failu

@@ -33,6 +33,8 @@ export * from './apiTaskNotesGetCollection200Response';
export * from './apiTaskNotesGetCollection200Response1'; export * from './apiTaskNotesGetCollection200Response1';
export * from './apiTasksGetCollection200Response'; export * from './apiTasksGetCollection200Response';
export * from './apiTasksGetCollection200Response1'; export * from './apiTasksGetCollection200Response1';
export * from './apiUserProductsGetCollection200Response';
export * from './apiUserProductsGetCollection200Response1';
export * from './apiUsersGetCollection200Response'; export * from './apiUsersGetCollection200Response';
export * from './apiUsersGetCollection200Response1'; export * from './apiUsersGetCollection200Response1';
export * from './comment'; export * from './comment';
@@ -92,3 +94,6 @@ export * from './taskNoteJsonld';
export * from './user'; export * from './user';
export * from './userJsonhal'; export * from './userJsonhal';
export * from './userJsonld'; export * from './userJsonld';
export * from './userProduct';
export * from './userProductJsonhal';
export * from './userProductJsonld';

+ 1
- 0
matsen-tool/src/app/core/api/v1/model/partnerFollow.ts Parādīt failu

@@ -20,5 +20,6 @@ export interface PartnerFollow {
partner: string | null; partner: string | null;
readonly partnerName?: string | null; readonly partnerName?: string | null;
readonly createdAt?: string | null; readonly createdAt?: string | null;
readonly owner?: string | null;
} }



+ 1
- 0
matsen-tool/src/app/core/api/v1/model/partnerFollowJsonhal.ts Parādīt failu

@@ -22,5 +22,6 @@ export interface PartnerFollowJsonhal {
partner: string | null; partner: string | null;
readonly partnerName?: string | null; readonly partnerName?: string | null;
readonly createdAt?: string | null; readonly createdAt?: string | null;
readonly owner?: string | null;
} }



+ 1
- 0
matsen-tool/src/app/core/api/v1/model/partnerFollowJsonld.ts Parādīt failu

@@ -24,5 +24,6 @@ export interface PartnerFollowJsonld {
partner: string | null; partner: string | null;
readonly partnerName?: string | null; readonly partnerName?: string | null;
readonly createdAt?: string | null; readonly createdAt?: string | null;
readonly owner?: string | null;
} }



+ 25
- 0
matsen-tool/src/app/core/api/v1/model/userProduct.ts Parādīt failu

@@ -0,0 +1,25 @@
/**
* Matsen API Platform
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


/**
*
*/
export interface UserProduct {
readonly user?: string | null;
readonly userName?: string | null;
product: string | null;
readonly productName?: string | null;
readonly createdAt?: string | null;
readonly owner?: string | null;
}


+ 27
- 0
matsen-tool/src/app/core/api/v1/model/userProductJsonhal.ts Parādīt failu

@@ -0,0 +1,27 @@
/**
* Matsen API Platform
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { CommentJsonhalLinks } from './commentJsonhalLinks';


/**
*
*/
export interface UserProductJsonhal {
_links?: CommentJsonhalLinks;
readonly user?: string | null;
readonly userName?: string | null;
product: string | null;
readonly productName?: string | null;
readonly createdAt?: string | null;
readonly owner?: string | null;
}


+ 29
- 0
matsen-tool/src/app/core/api/v1/model/userProductJsonld.ts Parādīt failu

@@ -0,0 +1,29 @@
/**
* Matsen API Platform
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { CommentJsonldContext } from './commentJsonldContext';


/**
*
*/
export interface UserProductJsonld {
context?: CommentJsonldContext;
readonly id?: string;
readonly type?: string;
readonly user?: string | null;
readonly userName?: string | null;
product: string | null;
readonly productName?: string | null;
readonly createdAt?: string | null;
readonly owner?: string | null;
}


+ 3
- 2
matsen-tool/src/app/documents/new-document/new-document.component.ts Parādīt failu

@@ -34,7 +34,8 @@ export class NewDocumentComponent implements OnInit {
private documentObjectService: DocumentObjectService, private documentObjectService: DocumentObjectService,
private translateService: TranslateService, private translateService: TranslateService,
private partnerService: PartnerService, private partnerService: PartnerService,
private productService: ProductService
private productService: ProductService,
protected apiConverter: ApiConverter,
) { ) {
this.documentForm = documentForm; this.documentForm = documentForm;
this.documentSub = new Subscription(); this.documentSub = new Subscription();
@@ -120,7 +121,7 @@ export class NewDocumentComponent implements OnInit {
} else { } else {
// Edit contact // Edit contact
this.documentSub = this.documentService.documentsIdPatch( this.documentSub = this.documentService.documentsIdPatch(
ApiConverter.extractId(this.document.id),
this.apiConverter.extractId(this.document.id),
this.documentForm.value as DocumentJsonld this.documentForm.value as DocumentJsonld
).subscribe( ).subscribe(
data => { data => {


+ 1
- 1
matsen-tool/src/app/home/home.component.html Parādīt failu

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


+ 1
- 1
matsen-tool/src/app/home/home.component.ts Parādīt failu

@@ -159,7 +159,7 @@ export class HomeComponent implements OnInit, AfterViewInit {
openModalEditTask(task: TaskJsonld) { openModalEditTask(task: TaskJsonld) {
const modalRefTaskEdit = this.modalService.open(NewTaskComponent, this.modalOptions); const modalRefTaskEdit = this.modalService.open(NewTaskComponent, this.modalOptions);
modalRefTaskEdit.componentInstance.task = task; modalRefTaskEdit.componentInstance.task = task;
modalRefTaskEdit.componentInstance.dueAtValue = ApiConverter.convertDate(task.dueAt);
modalRefTaskEdit.componentInstance.dueAtValue = this.apiConverter.convertDate(task.dueAt);
modalRefTaskEdit.componentInstance.submit.subscribe((modalStatus: ModalStatus) => { modalRefTaskEdit.componentInstance.submit.subscribe((modalStatus: ModalStatus) => {
if (modalStatus === ModalStatus.Submitted) { if (modalStatus === ModalStatus.Submitted) {
modalRefTaskEdit.dismiss(); modalRefTaskEdit.dismiss();


+ 3
- 2
matsen-tool/src/app/partners/new-partner/new-partner.component.ts Parādīt failu

@@ -28,7 +28,8 @@ export class NewPartnerComponent implements OnInit {
constructor( constructor(
private partnerService: PartnerService, private partnerService: PartnerService,
private mediaObjectService: MediaObjectService, private mediaObjectService: MediaObjectService,
private translateService: TranslateService
private translateService: TranslateService,
protected apiConverter: ApiConverter,
) { ) {
this.partnerForm = partnerForm; this.partnerForm = partnerForm;
this.selectedImage = null; this.selectedImage = null;
@@ -78,7 +79,7 @@ export class NewPartnerComponent implements OnInit {
} else { } else {
// Edit contact // Edit contact
this.partnerSub = this.partnerService.partnersIdPatch( this.partnerSub = this.partnerService.partnersIdPatch(
ApiConverter.extractId(this.partner.id),
this.apiConverter.extractId(this.partner.id),
this.partnerForm.value as PartnerJsonld this.partnerForm.value as PartnerJsonld
).subscribe( ).subscribe(
data => { data => {


+ 4
- 3
matsen-tool/src/app/partners/partners-detail/partners-detail.component.html Parādīt failu

@@ -35,7 +35,8 @@
[class.bi-heart-fill]="partnerFollow !== null" [class.bi-heart-fill]="partnerFollow !== null"
[class.user-follows]="partnerFollow !== null" [class.user-follows]="partnerFollow !== null"
data-type="user-tool" data-action="follow" data-type="user-tool" data-action="follow"
(click)="followPartner($event)"></span>
(click)="followPartner($event)">
</span>
<span class="position-absolute bi bi-pencil p-2" data-type="user-tool" data-action="edit" <span class="position-absolute bi bi-pencil p-2" data-type="user-tool" data-action="edit"
(click)="openModalEditPartner()"></span> (click)="openModalEditPartner()"></span>
</div> </div>
@@ -47,7 +48,7 @@
<div class="card-body row" *ngIf="partnerProducts"> <div class="card-body row" *ngIf="partnerProducts">
<div class="col-12"> <div class="col-12">
<ul *ngFor="let partnerProduct of partnerProducts"> <ul *ngFor="let partnerProduct of partnerProducts">
<li><a href="/products/{{ApiConverter.extractId(partnerProduct.product)}}">{{partnerProduct.productName}}</a></li>
<li><a href="/products/{{this.apiConverter.extractId(partnerProduct.product)}}">{{partnerProduct.productName}}</a></li>
</ul> </ul>
</div> </div>
</div> </div>
@@ -101,7 +102,7 @@
<div class="tasks mb-3" *ngFor="let task of tasks"> <div class="tasks mb-3" *ngFor="let task of tasks">
<div class="card p-3"> <div class="card p-3">
<div class="position-relative"> <div class="position-relative">
<h3 class="m-0" *ngIf="task.partner"><a href="/{{task.partnerType}}/{{ApiConverter.extractId(task.partner)}}">{{task.partnerName}}</a></h3>
<h3 class="m-0" *ngIf="task.partner"><a href="/{{task.partnerType}}/{{this.apiConverter.extractId(task.partner)}}">{{task.partnerName}}</a></h3>
<span class="info d-flex position-absolute"> <span class="info d-flex position-absolute">
<span class="due-date">{{ task.dueAt | date:'dd.MM.YYYY':'GMT+0000' }}</span> <span class="due-date">{{ task.dueAt | date:'dd.MM.YYYY':'GMT+0000' }}</span>
<span class="importance" [attr.data-importance]="task.prio"></span> <span class="importance" [attr.data-importance]="task.prio"></span>


+ 3
- 4
matsen-tool/src/app/partners/partners-detail/partners-detail.component.ts Parādīt failu

@@ -40,7 +40,6 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit {
@ViewChild(MatPaginator) postsPaginator: MatPaginator; @ViewChild(MatPaginator) postsPaginator: MatPaginator;


protected user: User | null; protected user: User | null;
protected readonly ApiConverter = ApiConverter;


protected readonly environment = environment; protected readonly environment = environment;
protected id: string; protected id: string;
@@ -268,7 +267,7 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit {


navigateToContactDetails(element: any) { navigateToContactDetails(element: any) {
const contact: ContactJsonld = element as ContactJsonld; const contact: ContactJsonld = element as ContactJsonld;
this.router.navigate(['/contacts', ApiConverter.extractId(contact.id)]);
this.router.navigate(['/contacts', this.apiConverter.extractId(contact.id)]);
} }


openModalNewContact() { openModalNewContact() {
@@ -340,7 +339,7 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit {
openModalEditTask(task: TaskJsonld) { openModalEditTask(task: TaskJsonld) {
const modalRefTaskEdit = this.modalService.open(NewTaskComponent, this.modalOptions); const modalRefTaskEdit = this.modalService.open(NewTaskComponent, this.modalOptions);
modalRefTaskEdit.componentInstance.task = task; modalRefTaskEdit.componentInstance.task = task;
modalRefTaskEdit.componentInstance.dueAtValue = ApiConverter.convertDate(task.dueAt);
modalRefTaskEdit.componentInstance.dueAtValue = this.apiConverter.convertDate(task.dueAt);
modalRefTaskEdit.componentInstance.submit.subscribe((modalStatus: ModalStatus) => { modalRefTaskEdit.componentInstance.submit.subscribe((modalStatus: ModalStatus) => {
if (modalStatus === ModalStatus.Submitted) { if (modalStatus === ModalStatus.Submitted) {
modalRefTaskEdit.dismiss(); modalRefTaskEdit.dismiss();
@@ -439,7 +438,7 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit {
); );
} else { } else {
this.partnerFollowSub = this.partnerFollowService.partnerFollowsIdDelete( this.partnerFollowSub = this.partnerFollowService.partnerFollowsIdDelete(
ApiConverter.extractId(this.partnerFollow.id)
this.apiConverter.extractId(this.partnerFollow.id)
).subscribe( ).subscribe(
data => { data => {
this.partnerFollow = null; this.partnerFollow = null;


+ 3
- 2
matsen-tool/src/app/partners/partners.component.ts Parādīt failu

@@ -52,7 +52,8 @@ export class PartnersComponent implements OnInit, AfterViewInit {
private partnerService: PartnerService, private partnerService: PartnerService,
private router: Router, private router: Router,
private modalService: NgbModal, private modalService: NgbModal,
private translateService: TranslateService
private translateService: TranslateService,
protected apiConverter: ApiConverter,
) { ) {
this.partnersSort = new MatSort(); this.partnersSort = new MatSort();
this.partnersPaginator = new MatPaginator(new MatPaginatorIntl(), ChangeDetectorRef.prototype); this.partnersPaginator = new MatPaginator(new MatPaginatorIntl(), ChangeDetectorRef.prototype);
@@ -152,7 +153,7 @@ export class PartnersComponent implements OnInit, AfterViewInit {


navigateToPartnerDetails(element: any) { navigateToPartnerDetails(element: any) {
const partner: PartnerJsonld = element as PartnerJsonld; const partner: PartnerJsonld = element as PartnerJsonld;
this.router.navigate(['/' + partner.partnerType, ApiConverter.extractId(partner.id)]);
this.router.navigate(['/' + partner.partnerType, this.apiConverter.extractId(partner.id)]);
} }


openModalNewPartner() { openModalNewPartner() {


+ 3
- 2
matsen-tool/src/app/postings/new-comment/new-comment.component.ts Parādīt failu

@@ -20,7 +20,8 @@ export class NewCommentComponent implements OnInit {
protected commentSub: Subscription; protected commentSub: Subscription;


constructor( constructor(
private commentService: CommentService
private commentService: CommentService,
protected apiConverter: ApiConverter,
) { ) {
this.commentForm = commentForm; this.commentForm = commentForm;
this.commentSub = new Subscription(); this.commentSub = new Subscription();
@@ -45,7 +46,7 @@ export class NewCommentComponent implements OnInit {
} else { } else {
// Edit comment // Edit comment
this.commentSub = this.commentService.commentsIdPatch( this.commentSub = this.commentService.commentsIdPatch(
ApiConverter.extractId(this.comment.id),
this.apiConverter.extractId(this.comment.id),
this.commentForm.value as CommentJsonld this.commentForm.value as CommentJsonld
).subscribe( ).subscribe(
data => { data => {


+ 3
- 2
matsen-tool/src/app/postings/new-posting/new-posting.component.ts Parādīt failu

@@ -20,7 +20,8 @@ export class NewPostingComponent implements OnInit {
protected postSub: Subscription; protected postSub: Subscription;


constructor( constructor(
private postService: PostService
private postService: PostService,
protected apiConverter: ApiConverter,
) { ) {
this.postForm = postForm; this.postForm = postForm;
this.postSub = new Subscription(); this.postSub = new Subscription();
@@ -46,7 +47,7 @@ export class NewPostingComponent implements OnInit {
} else { } else {
// Edit post // Edit post
this.postSub = this.postService.postsIdPatch( this.postSub = this.postService.postsIdPatch(
ApiConverter.extractId(this.posting.id),
this.apiConverter.extractId(this.posting.id),
this.postForm.value as PostJsonld this.postForm.value as PostJsonld
).subscribe( ).subscribe(
data => { data => {


+ 3
- 2
matsen-tool/src/app/products/new-product/new-product.component.ts Parādīt failu

@@ -26,7 +26,8 @@ export class NewProductComponent implements OnInit {
constructor( constructor(
private productService: ProductService, private productService: ProductService,
private mediaObjectService: MediaObjectService, private mediaObjectService: MediaObjectService,
private translateService: TranslateService
private translateService: TranslateService,
protected apiConverter: ApiConverter,
) { ) {
this.productForm = productForm; this.productForm = productForm;
this.productSub = new Subscription(); this.productSub = new Subscription();
@@ -69,7 +70,7 @@ export class NewProductComponent implements OnInit {
} else { } else {
// Edit product // Edit product
this.productSub = this.productService.productsIdPatch( this.productSub = this.productService.productsIdPatch(
ApiConverter.extractId(this.product.id),
this.apiConverter.extractId(this.product.id),
this.productForm.value as ProductJsonld this.productForm.value as ProductJsonld
).subscribe( ).subscribe(
data => { data => {


+ 7
- 0
matsen-tool/src/app/products/products-detail/products-detail.component.html Parādīt failu

@@ -22,6 +22,13 @@
ngSrc="{{product.imageUrl}}" width="247" height="94" ngSrc="{{product.imageUrl}}" width="247" height="94"
alt="{{product.name}}" title="{{product.name}}"/> alt="{{product.name}}" title="{{product.name}}"/>
</div> </div>
<span class="position-absolute bi p-2"
[class.bi-heart]="userProduct === null"
[class.bi-heart-fill]="userProduct !== null"
[class.user-follows]="userProduct !== null"
data-type="user-tool" data-action="follow"
(click)="followProduct($event)">
</span>
<span class="position-absolute bi bi-pencil p-2" data-type="user-tool" data-action="edit" <span class="position-absolute bi bi-pencil p-2" data-type="user-tool" data-action="edit"
(click)="openModalEditProduct()"></span> (click)="openModalEditProduct()"></span>
</div> </div>


+ 62
- 3
matsen-tool/src/app/products/products-detail/products-detail.component.ts Parādīt failu

@@ -2,11 +2,18 @@ import {AfterViewInit, Component, OnInit} from '@angular/core';
import {environment} from "@environments/environment"; import {environment} from "@environments/environment";
import {ActivatedRoute} from "@angular/router"; import {ActivatedRoute} from "@angular/router";
import {Subscription} from "rxjs"; import {Subscription} from "rxjs";
import {ProductJsonld, ProductService} from "@app/core/api/v1";
import {NewContactComponent} from "@app/contacts/new-contact/new-contact.component";
import {
ProductJsonld,
ProductService,
UserProductJsonld,
UserProductService
} from "@app/core/api/v1";
import {ModalStatus} from "@app/_helpers/modal.states"; import {ModalStatus} from "@app/_helpers/modal.states";
import {NgbModal, NgbModalOptions} from "@ng-bootstrap/ng-bootstrap"; import {NgbModal, NgbModalOptions} from "@ng-bootstrap/ng-bootstrap";
import {NewProductComponent} from "@app/products/new-product/new-product.component"; import {NewProductComponent} from "@app/products/new-product/new-product.component";
import {User} from "@app/_models";
import {AccountService} from "@app/_services";
import {ApiConverter} from "@app/_helpers/api.converter";


@Component({ @Component({
selector: 'app-products-detail', selector: 'app-products-detail',
@@ -19,6 +26,9 @@ export class ProductsDetailComponent implements OnInit, AfterViewInit {
protected id: string; protected id: string;
protected productDetailSub: Subscription; protected productDetailSub: Subscription;
protected product: ProductJsonld; protected product: ProductJsonld;
protected userProductSub: Subscription;
protected userProduct: UserProductJsonld | null;
protected user: User | null;


protected modalOptions: NgbModalOptions = { protected modalOptions: NgbModalOptions = {
centered: true centered: true
@@ -26,12 +36,19 @@ export class ProductsDetailComponent implements OnInit, AfterViewInit {


constructor( constructor(
private route: ActivatedRoute, private route: ActivatedRoute,
private accountService: AccountService,
private productService: ProductService, private productService: ProductService,
private modalService: NgbModal
private userProductService: UserProductService,
private modalService: NgbModal,
protected apiConverter: ApiConverter,
) { ) {
this.id = ""; this.id = "";
this.user = this.accountService.userValue;
this.productDetailSub = new Subscription(); this.productDetailSub = new Subscription();
this.product = {} as ProductJsonld; this.product = {} as ProductJsonld;

this.userProductSub = new Subscription();
this.userProduct = null;
} }


ngOnInit() { ngOnInit() {
@@ -39,6 +56,8 @@ export class ProductsDetailComponent implements OnInit, AfterViewInit {
this.id = params['id']; this.id = params['id'];
}); });
this.getProductData(); this.getProductData();
this.getUserProductStatus();

} }


ngAfterViewInit() { ngAfterViewInit() {
@@ -55,6 +74,46 @@ export class ProductsDetailComponent implements OnInit, AfterViewInit {
); );
} }


getUserProductStatus() {
this.userProductSub = this.userProductService.userProductsGetCollection(
1,
50,
this.user?.id,
undefined,
this.product.id
).subscribe(
data => {
let userProduct = data["hydra:member"];
if (userProduct.length > 0) {
this.userProduct = userProduct[0];
}
}
)
}

followProduct(event: any) {
if (this.userProduct === null) {
this.userProductSub = this.userProductService.userProductsPost(
{
user: this.user?.id,
product: this.product.id,
} as UserProductJsonld
).subscribe(
data => {
this.userProduct = data;
}
);
} else {
this.userProductSub = this.userProductService.userProductsIdDelete(
this.apiConverter.extractId(this.userProduct.id)
).subscribe(
data => {
this.userProduct = null;
}
);
}
}

openModalEditProduct() { openModalEditProduct() {
const modalRefProduct = this.modalService.open(NewProductComponent, this.modalOptions); const modalRefProduct = this.modalService.open(NewProductComponent, this.modalOptions);
modalRefProduct.componentInstance.product = this.product; modalRefProduct.componentInstance.product = this.product;


+ 3
- 2
matsen-tool/src/app/products/products.component.ts Parādīt failu

@@ -41,7 +41,8 @@ export class ProductsComponent implements OnInit, AfterViewInit {
constructor( constructor(
private router: Router, private router: Router,
private modalService: NgbModal, private modalService: NgbModal,
private productService: ProductService
private productService: ProductService,
protected apiConverter: ApiConverter,
) { ) {
this.sort = new MatSort(); this.sort = new MatSort();
this.displayedColumns = ['pos', 'image', 'name', 'storage', 'number']; this.displayedColumns = ['pos', 'image', 'name', 'storage', 'number'];
@@ -118,7 +119,7 @@ export class ProductsComponent implements OnInit, AfterViewInit {


navigateToProductDetails(element: any) { navigateToProductDetails(element: any) {
const product: ProductJsonld = element as ProductJsonld; const product: ProductJsonld = element as ProductJsonld;
this.router.navigate(['/products', ApiConverter.extractId(product.id)]);
this.router.navigate(['/products', this.apiConverter.extractId(product.id)]);
} }


openModalNewProduct() { openModalNewProduct() {


+ 3
- 2
matsen-tool/src/app/sales/new-sale/new-sale.component.ts Parādīt failu

@@ -34,7 +34,8 @@ export class NewSaleComponent implements OnInit {
private saleService: SaleService, private saleService: SaleService,
private partnerService: PartnerService, private partnerService: PartnerService,
private productService: ProductService, private productService: ProductService,
private translateService: TranslateService
private translateService: TranslateService,
protected apiConverter: ApiConverter,
) { ) {
this.saleForm = saleForm; this.saleForm = saleForm;


@@ -112,7 +113,7 @@ export class NewSaleComponent implements OnInit {
} else { } else {
// Edit sale // Edit sale
this.saleSub = this.saleService.salesIdPatch( this.saleSub = this.saleService.salesIdPatch(
ApiConverter.extractId(this.sale.id),
this.apiConverter.extractId(this.sale.id),
this.saleForm.value as SaleJsonld this.saleForm.value as SaleJsonld
).subscribe( ).subscribe(
data => { data => {


+ 2
- 2
matsen-tool/src/app/sales/sales.component.html Parādīt failu

@@ -53,7 +53,7 @@
{{ 'overview.sale-partner' | translate }} {{ 'overview.sale-partner' | translate }}
</th> </th>
<td mat-cell *matCellDef="let element"> <td mat-cell *matCellDef="let element">
<a [routerLink]="['/customer', ApiConverter.extractId(element.partner)]">{{ element.partnerName }}</a>
<a [routerLink]="['/customer', apiConverter.extractId(element.partner)]">{{ element.partnerName }}</a>
</td> </td>
</ng-container> </ng-container>


@@ -63,7 +63,7 @@
{{ 'overview.productname' | translate }} {{ 'overview.productname' | translate }}
</th> </th>
<td mat-cell *matCellDef="let element"> <td mat-cell *matCellDef="let element">
<a [routerLink]="['/products', ApiConverter.extractId(element.product)]">{{ element.productName }}</a>
<a [routerLink]="['/products', apiConverter.extractId(element.product)]">{{ element.productName }}</a>
</td> </td>
</ng-container> </ng-container>




+ 2
- 2
matsen-tool/src/app/sales/sales.component.ts Parādīt failu

@@ -63,6 +63,7 @@ export class SalesComponent implements OnInit {
private translateService: TranslateService, private translateService: TranslateService,
private modalService: NgbModal, private modalService: NgbModal,
private router: Router, private router: Router,
protected apiConverter: ApiConverter,
) { ) {
this.sort = new MatSort(); this.sort = new MatSort();
this.displayedColumns = ['pos', 'user', 'partner', 'product', 'turnover', 'profit', 'date', 'details']; this.displayedColumns = ['pos', 'user', 'partner', 'product', 'turnover', 'profit', 'date', 'details'];
@@ -161,7 +162,7 @@ export class SalesComponent implements OnInit {


navigateToSaleDetails(element: any) { navigateToSaleDetails(element: any) {
const sale: SaleJsonld = element as SaleJsonld; const sale: SaleJsonld = element as SaleJsonld;
this.router.navigate(['/sales', ApiConverter.extractId(sale.id)]);
this.router.navigate(['/sales', this.apiConverter.extractId(sale.id)]);
} }


openModalNewSale() { openModalNewSale() {
@@ -178,5 +179,4 @@ export class SalesComponent implements OnInit {
} }


protected readonly Number = Number; protected readonly Number = Number;
protected readonly ApiConverter = ApiConverter;
} }

+ 3
- 2
matsen-tool/src/app/tasks/new-task-note/new-task-note.component.ts Parādīt failu

@@ -20,7 +20,8 @@ export class NewTaskNoteComponent {
protected taskNoteSub: Subscription; protected taskNoteSub: Subscription;


constructor( constructor(
private taskNoteService: TaskNoteService
private taskNoteService: TaskNoteService,
protected apiConverter: ApiConverter
) { ) {
this.taskNoteForm = taskNoteForm; this.taskNoteForm = taskNoteForm;
this.taskNoteSub = new Subscription(); this.taskNoteSub = new Subscription();
@@ -45,7 +46,7 @@ export class NewTaskNoteComponent {
} else { } else {
// Edit taskNote // Edit taskNote
this.taskNoteSub = this.taskNoteService.taskNotesIdPatch( this.taskNoteSub = this.taskNoteService.taskNotesIdPatch(
ApiConverter.extractId(this.taskNote.id),
this.apiConverter.extractId(this.taskNote.id),
this.taskNoteForm.value as TaskNoteJsonld this.taskNoteForm.value as TaskNoteJsonld
).subscribe( ).subscribe(
data => { data => {


+ 16
- 15
matsen-tool/src/app/tasks/new-task/new-task.component.ts Parādīt failu

@@ -23,6 +23,21 @@ export class NewTaskComponent implements OnInit {


protected formatter = (apiData: any) => apiData.name; protected formatter = (apiData: any) => apiData.name;


constructor(
private taskService: TaskService,
private userService: UserService,
private partnerService: PartnerService,
protected apiConverter: ApiConverter
) {
this.taskForm = taskForm;
this.taskSub = new Subscription();
this.dueAtValue = "";
}

ngOnInit(): void {
this.taskForm = FormGroupInitializer.initFormGroup(this.taskForm, this.task);
}

protected searchUsers: OperatorFunction<string, readonly { id: any; name: any }[]> = (text$: Observable<string>) => protected searchUsers: OperatorFunction<string, readonly { id: any; name: any }[]> = (text$: Observable<string>) =>
text$.pipe( text$.pipe(
debounceTime(200), debounceTime(200),
@@ -41,20 +56,6 @@ export class NewTaskComponent implements OnInit {
map((partners) => partners.slice(0, 10)), map((partners) => partners.slice(0, 10)),
); );


constructor(
private taskService: TaskService,
private userService: UserService,
private partnerService: PartnerService
) {
this.taskForm = taskForm;
this.taskSub = new Subscription();
this.dueAtValue = "";
}

ngOnInit(): void {
this.taskForm = FormGroupInitializer.initFormGroup(this.taskForm, this.task);
}

protected fetchUsers(term: string): Observable<{ id: any; name: any }[]> { protected fetchUsers(term: string): Observable<{ id: any; name: any }[]> {
return this.userService.usersGetCollection(1, 50, undefined, term).pipe( return this.userService.usersGetCollection(1, 50, undefined, term).pipe(
map((response) => response['hydra:member'].map(user => ({ id: user.id, name: user.firstName + ' ' + user.lastName }))), map((response) => response['hydra:member'].map(user => ({ id: user.id, name: user.firstName + ' ' + user.lastName }))),
@@ -96,7 +97,7 @@ export class NewTaskComponent implements OnInit {
} else { } else {
// Edit task // Edit task
this.taskSub = this.taskService.tasksIdPatch( this.taskSub = this.taskService.tasksIdPatch(
ApiConverter.extractId(this.task.id),
this.apiConverter.extractId(this.task.id),
this.taskForm.value as TaskJsonld this.taskForm.value as TaskJsonld
).subscribe( ).subscribe(
data => { data => {


+ 1
- 1
matsen-tool/src/app/tasks/tasks.component.html Parādīt failu

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


+ 1
- 1
matsen-tool/src/app/tasks/tasks.component.ts Parādīt failu

@@ -118,7 +118,7 @@ export class TasksComponent implements OnInit, AfterViewInit {
openModalEditTask(task: TaskJsonld) { openModalEditTask(task: TaskJsonld) {
const modalRefTaskEdit = this.modalService.open(NewTaskComponent, this.modalOptions); const modalRefTaskEdit = this.modalService.open(NewTaskComponent, this.modalOptions);
modalRefTaskEdit.componentInstance.task = task; modalRefTaskEdit.componentInstance.task = task;
modalRefTaskEdit.componentInstance.dueAtValue = ApiConverter.convertDate(task.dueAt);
modalRefTaskEdit.componentInstance.dueAtValue = this.apiConverter.convertDate(task.dueAt);
modalRefTaskEdit.componentInstance.submit.subscribe((modalStatus: ModalStatus) => { modalRefTaskEdit.componentInstance.submit.subscribe((modalStatus: ModalStatus) => {
if (modalStatus === ModalStatus.Submitted) { if (modalStatus === ModalStatus.Submitted) {
modalRefTaskEdit.dismiss(); modalRefTaskEdit.dismiss();


Notiek ielāde…
Atcelt
Saglabāt