Florian Eisenmenger hace 1 año
padre
commit
00692f152d
Se han modificado 53 ficheros con 2541 adiciones y 540 borrados
  1. +1
    -1
      matsen-tool/openapi.json
  2. +600
    -240
      matsen-tool/openapi.yaml
  3. +49
    -6
      matsen-tool/src/app/_forms/apiForms.ts
  4. +3
    -1
      matsen-tool/src/app/app.module.ts
  5. +2
    -2
      matsen-tool/src/app/contacts/new-contact/new-contact.component.html
  6. +3
    -3
      matsen-tool/src/app/contacts/new-contact/new-contact.component.ts
  7. +15
    -9
      matsen-tool/src/app/core/api/v1/.openapi-generator/FILES
  8. +5
    -3
      matsen-tool/src/app/core/api/v1/api/api.ts
  9. +112
    -51
      matsen-tool/src/app/core/api/v1/api/document.service.ts
  10. +440
    -0
      matsen-tool/src/app/core/api/v1/api/documentObject.service.ts
  11. +440
    -0
      matsen-tool/src/app/core/api/v1/api/mediaObject.service.ts
  12. +9
    -4
      matsen-tool/src/app/core/api/v1/api/partner.service.ts
  13. +16
    -4
      matsen-tool/src/app/core/api/v1/api/partnerFollow.service.ts
  14. +9
    -4
      matsen-tool/src/app/core/api/v1/api/product.service.ts
  15. +16
    -4
      matsen-tool/src/app/core/api/v1/api/task.service.ts
  16. +23
    -0
      matsen-tool/src/app/core/api/v1/model/apiDocumentObjectsGetCollection200Response.ts
  17. +22
    -0
      matsen-tool/src/app/core/api/v1/model/apiDocumentObjectsGetCollection200Response1.ts
  18. +2
    -2
      matsen-tool/src/app/core/api/v1/model/apiDocumentsGetCollection200Response.ts
  19. +2
    -2
      matsen-tool/src/app/core/api/v1/model/apiDocumentsGetCollection200Response1.ts
  20. +23
    -0
      matsen-tool/src/app/core/api/v1/model/apiMediaObjectsGetCollection200Response.ts
  21. +22
    -0
      matsen-tool/src/app/core/api/v1/model/apiMediaObjectsGetCollection200Response1.ts
  22. +30
    -0
      matsen-tool/src/app/core/api/v1/model/document.ts
  23. +32
    -0
      matsen-tool/src/app/core/api/v1/model/documentJsonhal.ts
  24. +34
    -0
      matsen-tool/src/app/core/api/v1/model/documentJsonld.ts
  25. +20
    -0
      matsen-tool/src/app/core/api/v1/model/documentObjectDocumentObjectRead.ts
  26. +22
    -0
      matsen-tool/src/app/core/api/v1/model/documentObjectJsonhalDocumentObjectRead.ts
  27. +24
    -0
      matsen-tool/src/app/core/api/v1/model/documentObjectJsonldDocumentObjectRead.ts
  28. +22
    -0
      matsen-tool/src/app/core/api/v1/model/mediaObjectJsonhalMediaObjectRead.ts
  29. +24
    -0
      matsen-tool/src/app/core/api/v1/model/mediaObjectJsonldMediaObjectRead.ts
  30. +20
    -0
      matsen-tool/src/app/core/api/v1/model/mediaObjectMediaObjectRead.ts
  31. +13
    -8
      matsen-tool/src/app/core/api/v1/model/models.ts
  32. +1
    -0
      matsen-tool/src/app/documents/documents-detail/documents-detail.component.html
  33. +0
    -0
      matsen-tool/src/app/documents/documents-detail/documents-detail.component.scss
  34. +23
    -0
      matsen-tool/src/app/documents/documents-detail/documents-detail.component.spec.ts
  35. +10
    -0
      matsen-tool/src/app/documents/documents-detail/documents-detail.component.ts
  36. +55
    -10
      matsen-tool/src/app/documents/documents.component.html
  37. +24
    -15
      matsen-tool/src/app/documents/documents.component.ts
  38. +46
    -5
      matsen-tool/src/app/documents/new-document/new-document.component.html
  39. +111
    -27
      matsen-tool/src/app/documents/new-document/new-document.component.ts
  40. +70
    -0
      matsen-tool/src/app/home/home.component.html
  41. +0
    -2
      matsen-tool/src/app/home/home.component.ts
  42. +24
    -23
      matsen-tool/src/app/partners/new-partner/new-partner.component.html
  43. +6
    -5
      matsen-tool/src/app/partners/new-partner/new-partner.component.ts
  44. +3
    -3
      matsen-tool/src/app/partners/partners-detail/partners-detail.component.html
  45. +22
    -27
      matsen-tool/src/app/partners/partners-detail/partners-detail.component.ts
  46. +5
    -5
      matsen-tool/src/app/partners/partners.component.html
  47. +27
    -26
      matsen-tool/src/app/partners/partners.component.ts
  48. +2
    -2
      matsen-tool/src/app/products/new-product/new-product.component.html
  49. +3
    -3
      matsen-tool/src/app/products/new-product/new-product.component.ts
  50. +7
    -6
      matsen-tool/src/app/tasks/new-task-note/new-task-note.component.html
  51. +26
    -24
      matsen-tool/src/app/tasks/new-task/new-task.component.html
  52. +11
    -11
      matsen-tool/src/app/tasks/new-task/new-task.component.ts
  53. +10
    -2
      matsen-tool/src/assets/i18n/de.json

+ 1
- 1
matsen-tool/openapi.json
La diferencia del archivo ha sido suprimido porque es demasiado grande
Ver fichero


+ 600
- 240
matsen-tool/openapi.yaml
La diferencia del archivo ha sido suprimido porque es demasiado grande
Ver fichero


+ 49
- 6
matsen-tool/src/app/_forms/apiForms.ts Ver fichero

@@ -68,29 +68,72 @@ export const contactJsonldForm = new FormGroup({
createdAt: new FormControl(null, [])
});

export const documentDocumentObjectReadForm = new FormGroup({
export const documentForm = new FormGroup({
createdBy: new FormControl(null, []),
createdByName: new FormControl(null, []),
name: new FormControl(null, [Validators.required]),
description: new FormControl(null, []),
partner: new FormControl(null, []),
partnerName: new FormControl(null, []),
product: new FormControl(null, []),
productName: new FormControl(null, []),
documentObject: new FormControl(null, [Validators.required]),
documentUrl: new FormControl(null, []),
createdAt: new FormControl(null, [])
});

export const documentJsonhalForm = new FormGroup({
_links: new FormControl(null, []),
createdBy: new FormControl(null, []),
createdByName: new FormControl(null, []),
name: new FormControl(null, [Validators.required]),
description: new FormControl(null, []),
partner: new FormControl(null, []),
partnerName: new FormControl(null, []),
product: new FormControl(null, []),
productName: new FormControl(null, []),
documentObject: new FormControl(null, [Validators.required]),
documentUrl: new FormControl(null, []),
createdAt: new FormControl(null, [])
});

export const documentJsonldForm = new FormGroup({
createdBy: new FormControl(null, []),
createdByName: new FormControl(null, []),
name: new FormControl(null, [Validators.required]),
description: new FormControl(null, []),
partner: new FormControl(null, []),
partnerName: new FormControl(null, []),
product: new FormControl(null, []),
productName: new FormControl(null, []),
documentObject: new FormControl(null, [Validators.required]),
documentUrl: new FormControl(null, []),
createdAt: new FormControl(null, [])
});

export const documentObjectDocumentObjectReadForm = new FormGroup({
contentUrl: new FormControl(null, [])
});

export const documentJsonhalDocumentObjectReadForm = new FormGroup({
export const documentObjectJsonhalDocumentObjectReadForm = new FormGroup({
_links: new FormControl(null, []),
contentUrl: new FormControl(null, [])
});

export const documentJsonldDocumentObjectReadForm = new FormGroup({
export const documentObjectJsonldDocumentObjectReadForm = new FormGroup({
contentUrl: new FormControl(null, [])
});

export const mediaMediaObjectReadForm = new FormGroup({
export const mediaObjectMediaObjectReadForm = new FormGroup({
contentUrl: new FormControl(null, [])
});

export const mediaJsonhalMediaObjectReadForm = new FormGroup({
export const mediaObjectJsonhalMediaObjectReadForm = new FormGroup({
_links: new FormControl(null, []),
contentUrl: new FormControl(null, [])
});

export const mediaJsonldMediaObjectReadForm = new FormGroup({
export const mediaObjectJsonldMediaObjectReadForm = new FormGroup({
contentUrl: new FormControl(null, [])
});



+ 3
- 1
matsen-tool/src/app/app.module.ts Ver fichero

@@ -42,6 +42,7 @@ import {MatAutocompleteModule} from "@angular/material/autocomplete";
import {MatFormFieldModule} from "@angular/material/form-field";
import {MatInputModule} from "@angular/material/input";
import { NewTaskNoteComponent } from './tasks/new-task-note/new-task-note.component';
import { DocumentsDetailComponent } from './documents/documents-detail/documents-detail.component';

export function apiConfigFactory(): Configuration {
const params: ConfigurationParameters = {
@@ -104,7 +105,8 @@ export function HttpLoaderFactory(http: HttpClient) {
NewDocumentComponent,
NewProductComponent,
NewCommentComponent,
NewTaskNoteComponent
NewTaskNoteComponent,
DocumentsDetailComponent
],
providers: [
{provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true},


+ 2
- 2
matsen-tool/src/app/contacts/new-contact/new-contact.component.html Ver fichero

@@ -46,9 +46,9 @@
<input type="file" class="form-control" id="image" (change)="onFileSelected($event)" accept="image/*" />
</div>

<div class="mb-3">
<div class="mb-3" *ngIf="contact.imageUrl !== undefined">
<div class="delete-image" (click)="onDeleteImage()">
<img *ngIf="contact.imageUrl !== null" src="{{contact.imageUrl}}" width="40" height="40" />
<img src="{{contact.imageUrl}}" width="40" height="40" />
<p class="mb-0 ms-3">{{'system.delete-image' | translate}}</p>
</div>
</div>


+ 3
- 3
matsen-tool/src/app/contacts/new-contact/new-contact.component.ts Ver fichero

@@ -1,7 +1,7 @@
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {FormGroup} from "@angular/forms";
import {contactForm} from "@app/_forms/apiForms";
import {ContactJsonld, ContactService, MediaService} from "@app/core/api/v1";
import {ContactJsonld, ContactService, MediaObjectService} from "@app/core/api/v1";
import {Subscription} from "rxjs";
import {ModalStatus} from "@app/_helpers/modal.states";
import {FormGroupInitializer} from "@app/_helpers/formgroup.initializer";
@@ -26,7 +26,7 @@ export class NewContactComponent implements OnInit {

constructor(
private contactService: ContactService,
private mediaService: MediaService,
private mediaObjectService: MediaObjectService,
private translateService: TranslateService
) {
this.contactForm = contactForm;
@@ -43,7 +43,7 @@ export class NewContactComponent implements OnInit {
// On submit form: Check if image is set
onSubmit() {
if (this.selectedImage !== null) {
this.mediaSub = this.mediaService.mediasPost(
this.mediaSub = this.mediaObjectService.mediaObjectsPost(
this.selectedImage
).subscribe(
data => {


+ 15
- 9
matsen-tool/src/app/core/api/v1/.openapi-generator/FILES Ver fichero

@@ -5,8 +5,9 @@ api/api.ts
api/comment.service.ts
api/contact.service.ts
api/document.service.ts
api/documentObject.service.ts
api/loginCheck.service.ts
api/media.service.ts
api/mediaObject.service.ts
api/partner.service.ts
api/partnerFollow.service.ts
api/post.service.ts
@@ -29,10 +30,12 @@ model/apiCommentsGetCollection200ResponseHydraSearchHydraMappingInner.ts
model/apiCommentsGetCollection200ResponseHydraView.ts
model/apiContactsGetCollection200Response.ts
model/apiContactsGetCollection200Response1.ts
model/apiDocumentObjectsGetCollection200Response.ts
model/apiDocumentObjectsGetCollection200Response1.ts
model/apiDocumentsGetCollection200Response.ts
model/apiDocumentsGetCollection200Response1.ts
model/apiMediasGetCollection200Response.ts
model/apiMediasGetCollection200Response1.ts
model/apiMediaObjectsGetCollection200Response.ts
model/apiMediaObjectsGetCollection200Response1.ts
model/apiPartnerFollowsGetCollection200Response.ts
model/apiPartnerFollowsGetCollection200Response1.ts
model/apiPartnersGetCollection200Response.ts
@@ -60,14 +63,17 @@ model/commentJsonldContextOneOf.ts
model/contact.ts
model/contactJsonhal.ts
model/contactJsonld.ts
model/documentDocumentObjectRead.ts
model/documentJsonhalDocumentObjectRead.ts
model/documentJsonldDocumentObjectRead.ts
model/document.ts
model/documentJsonhal.ts
model/documentJsonld.ts
model/documentObjectDocumentObjectRead.ts
model/documentObjectJsonhalDocumentObjectRead.ts
model/documentObjectJsonldDocumentObjectRead.ts
model/loginCheckPost200Response.ts
model/loginCheckPostRequest.ts
model/mediaJsonhalMediaObjectRead.ts
model/mediaJsonldMediaObjectRead.ts
model/mediaMediaObjectRead.ts
model/mediaObjectJsonhalMediaObjectRead.ts
model/mediaObjectJsonldMediaObjectRead.ts
model/mediaObjectMediaObjectRead.ts
model/models.ts
model/partner.ts
model/partnerFollow.ts


+ 5
- 3
matsen-tool/src/app/core/api/v1/api/api.ts Ver fichero

@@ -4,10 +4,12 @@ export * from './contact.service';
import { ContactService } from './contact.service';
export * from './document.service';
import { DocumentService } from './document.service';
export * from './documentObject.service';
import { DocumentObjectService } from './documentObject.service';
export * from './loginCheck.service';
import { LoginCheckService } from './loginCheck.service';
export * from './media.service';
import { MediaService } from './media.service';
export * from './mediaObject.service';
import { MediaObjectService } from './mediaObject.service';
export * from './partner.service';
import { PartnerService } from './partner.service';
export * from './partnerFollow.service';
@@ -26,4 +28,4 @@ export * from './taskNote.service';
import { TaskNoteService } from './taskNote.service';
export * from './user.service';
import { UserService } from './user.service';
export const APIS = [CommentService, ContactService, DocumentService, LoginCheckService, MediaService, PartnerService, PartnerFollowService, PostService, ProductService, SaleService, SaleSummaryService, TaskService, TaskNoteService, UserService];
export const APIS = [CommentService, ContactService, DocumentService, DocumentObjectService, LoginCheckService, MediaObjectService, PartnerService, PartnerFollowService, PostService, ProductService, SaleService, SaleSummaryService, TaskService, TaskNoteService, UserService];

+ 112
- 51
matsen-tool/src/app/core/api/v1/api/document.service.ts Ver fichero

@@ -23,11 +23,11 @@ import { ApiDocumentsGetCollection200Response } from '../model/apiDocumentsGetCo
// @ts-ignore
import { ApiDocumentsGetCollection200Response1 } from '../model/apiDocumentsGetCollection200Response1';
// @ts-ignore
import { DocumentDocumentObjectRead } from '../model/documentDocumentObjectRead';
import { Document } from '../model/document';
// @ts-ignore
import { DocumentJsonhalDocumentObjectRead } from '../model/documentJsonhalDocumentObjectRead';
import { DocumentJsonhal } from '../model/documentJsonhal';
// @ts-ignore
import { DocumentJsonldDocumentObjectRead } from '../model/documentJsonldDocumentObjectRead';
import { DocumentJsonld } from '../model/documentJsonld';

// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
@@ -62,19 +62,6 @@ export class DocumentService {
this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
}

/**
* @param consumes string[] mime-types
* @return true: consumes contains 'multipart/form-data', false: otherwise
*/
private canConsumeForm(consumes: string[]): boolean {
const form = 'multipart/form-data';
for (const consume of consumes) {
if (form === consume) {
return true;
}
}
return false;
}

// @ts-ignore
private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams {
@@ -223,7 +210,7 @@ export class DocumentService {
/**
* Removes the Document resource.
* Removes the Document resource.
* @param id DocumentObject 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.
*/
@@ -294,13 +281,13 @@ export class DocumentService {
/**
* Retrieves a Document resource.
* Retrieves a Document resource.
* @param id DocumentObject 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.
*/
public documentsIdGet(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<DocumentJsonldDocumentObjectRead>;
public documentsIdGet(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<DocumentJsonldDocumentObjectRead>>;
public documentsIdGet(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<DocumentJsonldDocumentObjectRead>>;
public documentsIdGet(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<DocumentJsonld>;
public documentsIdGet(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<DocumentJsonld>>;
public documentsIdGet(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<DocumentJsonld>>;
public documentsIdGet(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 documentsIdGet.');
@@ -353,7 +340,7 @@ export class DocumentService {
}

let localVarPath = `/api/documents/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<DocumentJsonldDocumentObjectRead>('get', `${this.configuration.basePath}${localVarPath}`,
return this.httpClient.request<DocumentJsonld>('get', `${this.configuration.basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
@@ -367,18 +354,23 @@ export class DocumentService {
}

/**
* Creates a Document resource.
* Creates a Document resource.
* @param file
* @param partner
* @param product
* Updates the Document resource.
* Updates the Document resource.
* @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.
*/
public documentsPost(file?: Blob, partner?: string, product?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<DocumentJsonldDocumentObjectRead>;
public documentsPost(file?: Blob, partner?: string, product?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<DocumentJsonldDocumentObjectRead>>;
public documentsPost(file?: Blob, partner?: string, product?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<DocumentJsonldDocumentObjectRead>>;
public documentsPost(file?: Blob, partner?: string, product?: 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> {
public documentsIdPatch(id: string, document: Document, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<DocumentJsonld>;
public documentsIdPatch(id: string, document: Document, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<DocumentJsonld>>;
public documentsIdPatch(id: string, document: Document, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<DocumentJsonld>>;
public documentsIdPatch(id: string, document: Document, 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 documentsIdPatch.');
}
if (document === null || document === undefined) {
throw new Error('Required parameter document was null or undefined when calling documentsIdPatch.');
}

let localVarHeaders = this.defaultHeaders;

@@ -414,33 +406,102 @@ export class DocumentService {
localVarTransferCache = true;
}


// to determine the Content-Type header
const consumes: string[] = [
'multipart/form-data'
'application/merge-patch+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';
}
}

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

let localVarFormParams: { append(param: string, value: any): any; };
let localVarUseForm = false;
let localVarConvertFormParamsToString = false;
// use FormData to transmit files using content-type "multipart/form-data"
// see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data
localVarUseForm = canConsumeForm;
if (localVarUseForm) {
localVarFormParams = new FormData();
} else {
localVarFormParams = new HttpParams({encoder: this.encoder});
/**
* Creates a Document resource.
* Creates a Document resource.
* @param documentJsonld The new 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.
*/
public documentsPost(documentJsonld: DocumentJsonld, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<DocumentJsonld>;
public documentsPost(documentJsonld: DocumentJsonld, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<DocumentJsonld>>;
public documentsPost(documentJsonld: DocumentJsonld, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<DocumentJsonld>>;
public documentsPost(documentJsonld: DocumentJsonld, 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 (documentJsonld === null || documentJsonld === undefined) {
throw new Error('Required parameter documentJsonld was null or undefined when calling documentsPost.');
}

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);
}

if (file !== undefined) {
localVarFormParams = localVarFormParams.append('file', <any>file) as any || localVarFormParams;
let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}
if (partner !== undefined) {
localVarFormParams = localVarFormParams.append('partner', <any>partner) as any || localVarFormParams;

let localVarTransferCache: boolean | undefined = options && options.transferCache;
if (localVarTransferCache === undefined) {
localVarTransferCache = true;
}
if (product !== undefined) {
localVarFormParams = localVarFormParams.append('product', <any>product) as any || localVarFormParams;


// 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';
@@ -455,10 +516,10 @@ export class DocumentService {
}

let localVarPath = `/api/documents`;
return this.httpClient.request<DocumentJsonldDocumentObjectRead>('post', `${this.configuration.basePath}${localVarPath}`,
return this.httpClient.request<DocumentJsonld>('post', `${this.configuration.basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
body: documentJsonld,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,


+ 440
- 0
matsen-tool/src/app/core/api/v1/api/documentObject.service.ts Ver fichero

@@ -0,0 +1,440 @@
/**
* 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 { ApiDocumentObjectsGetCollection200Response } from '../model/apiDocumentObjectsGetCollection200Response';
// @ts-ignore
import { ApiDocumentObjectsGetCollection200Response1 } from '../model/apiDocumentObjectsGetCollection200Response1';
// @ts-ignore
import { DocumentObjectDocumentObjectRead } from '../model/documentObjectDocumentObjectRead';
// @ts-ignore
import { DocumentObjectJsonhalDocumentObjectRead } from '../model/documentObjectJsonhalDocumentObjectRead';
// @ts-ignore
import { DocumentObjectJsonldDocumentObjectRead } from '../model/documentObjectJsonldDocumentObjectRead';

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



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

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();
}

/**
* @param consumes string[] mime-types
* @return true: consumes contains 'multipart/form-data', false: otherwise
*/
private canConsumeForm(consumes: string[]): boolean {
const form = 'multipart/form-data';
for (const consume of consumes) {
if (form === consume) {
return true;
}
}
return false;
}

// @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 DocumentObject resources.
* Retrieves the collection of DocumentObject resources.
* @param page The collection page number
* @param itemsPerPage The number of items per page
* @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 documentObjectsGetCollection(page?: number, itemsPerPage?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiDocumentObjectsGetCollection200Response>;
public documentObjectsGetCollection(page?: number, itemsPerPage?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiDocumentObjectsGetCollection200Response>>;
public documentObjectsGetCollection(page?: number, itemsPerPage?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiDocumentObjectsGetCollection200Response>>;
public documentObjectsGetCollection(page?: number, itemsPerPage?: number, 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');
}

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/document_objects`;
return this.httpClient.request<ApiDocumentObjectsGetCollection200Response>('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 DocumentObject resource.
* Removes the DocumentObject resource.
* @param id DocumentObject 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 documentObjectsIdDelete(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
public documentObjectsIdDelete(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public documentObjectsIdDelete(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public documentObjectsIdDelete(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 documentObjectsIdDelete.');
}

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/document_objects/${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 DocumentObject resource.
* Retrieves a DocumentObject resource.
* @param id DocumentObject 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 documentObjectsIdGet(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<DocumentObjectJsonldDocumentObjectRead>;
public documentObjectsIdGet(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<DocumentObjectJsonldDocumentObjectRead>>;
public documentObjectsIdGet(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<DocumentObjectJsonldDocumentObjectRead>>;
public documentObjectsIdGet(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 documentObjectsIdGet.');
}

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/document_objects/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<DocumentObjectJsonldDocumentObjectRead>('get', `${this.configuration.basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
}

/**
* Creates a DocumentObject resource.
* Creates a DocumentObject resource.
* @param file
* @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 documentObjectsPost(file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<DocumentObjectJsonldDocumentObjectRead>;
public documentObjectsPost(file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<DocumentObjectJsonldDocumentObjectRead>>;
public documentObjectsPost(file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<DocumentObjectJsonldDocumentObjectRead>>;
public documentObjectsPost(file?: Blob, 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 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[] = [
'multipart/form-data'
];

const canConsumeForm = this.canConsumeForm(consumes);

let localVarFormParams: { append(param: string, value: any): any; };
let localVarUseForm = false;
let localVarConvertFormParamsToString = false;
// use FormData to transmit files using content-type "multipart/form-data"
// see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data
localVarUseForm = canConsumeForm;
if (localVarUseForm) {
localVarFormParams = new FormData();
} else {
localVarFormParams = new HttpParams({encoder: this.encoder});
}

if (file !== undefined) {
localVarFormParams = localVarFormParams.append('file', <any>file) as any || localVarFormParams;
}

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/document_objects`;
return this.httpClient.request<DocumentObjectJsonldDocumentObjectRead>('post', `${this.configuration.basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
}

}

+ 440
- 0
matsen-tool/src/app/core/api/v1/api/mediaObject.service.ts Ver fichero

@@ -0,0 +1,440 @@
/**
* 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 { ApiMediaObjectsGetCollection200Response } from '../model/apiMediaObjectsGetCollection200Response';
// @ts-ignore
import { ApiMediaObjectsGetCollection200Response1 } from '../model/apiMediaObjectsGetCollection200Response1';
// @ts-ignore
import { MediaObjectJsonhalMediaObjectRead } from '../model/mediaObjectJsonhalMediaObjectRead';
// @ts-ignore
import { MediaObjectJsonldMediaObjectRead } from '../model/mediaObjectJsonldMediaObjectRead';
// @ts-ignore
import { MediaObjectMediaObjectRead } from '../model/mediaObjectMediaObjectRead';

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



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

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();
}

/**
* @param consumes string[] mime-types
* @return true: consumes contains 'multipart/form-data', false: otherwise
*/
private canConsumeForm(consumes: string[]): boolean {
const form = 'multipart/form-data';
for (const consume of consumes) {
if (form === consume) {
return true;
}
}
return false;
}

// @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 MediaObject resources.
* Retrieves the collection of MediaObject resources.
* @param page The collection page number
* @param itemsPerPage The number of items per page
* @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 mediaObjectsGetCollection(page?: number, itemsPerPage?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiMediaObjectsGetCollection200Response>;
public mediaObjectsGetCollection(page?: number, itemsPerPage?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiMediaObjectsGetCollection200Response>>;
public mediaObjectsGetCollection(page?: number, itemsPerPage?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiMediaObjectsGetCollection200Response>>;
public mediaObjectsGetCollection(page?: number, itemsPerPage?: number, 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');
}

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/media_objects`;
return this.httpClient.request<ApiMediaObjectsGetCollection200Response>('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 MediaObject resource.
* Removes the MediaObject resource.
* @param id MediaObject 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 mediaObjectsIdDelete(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
public mediaObjectsIdDelete(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public mediaObjectsIdDelete(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public mediaObjectsIdDelete(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 mediaObjectsIdDelete.');
}

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/media_objects/${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 MediaObject resource.
* Retrieves a MediaObject resource.
* @param id MediaObject 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 mediaObjectsIdGet(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<MediaObjectJsonldMediaObjectRead>;
public mediaObjectsIdGet(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<MediaObjectJsonldMediaObjectRead>>;
public mediaObjectsIdGet(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<MediaObjectJsonldMediaObjectRead>>;
public mediaObjectsIdGet(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 mediaObjectsIdGet.');
}

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/media_objects/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<MediaObjectJsonldMediaObjectRead>('get', `${this.configuration.basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
}

/**
* Creates a MediaObject resource.
* Creates a MediaObject resource.
* @param file
* @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 mediaObjectsPost(file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<MediaObjectJsonldMediaObjectRead>;
public mediaObjectsPost(file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<MediaObjectJsonldMediaObjectRead>>;
public mediaObjectsPost(file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<MediaObjectJsonldMediaObjectRead>>;
public mediaObjectsPost(file?: Blob, 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 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[] = [
'multipart/form-data'
];

const canConsumeForm = this.canConsumeForm(consumes);

let localVarFormParams: { append(param: string, value: any): any; };
let localVarUseForm = false;
let localVarConvertFormParamsToString = false;
// use FormData to transmit files using content-type "multipart/form-data"
// see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data
localVarUseForm = canConsumeForm;
if (localVarUseForm) {
localVarFormParams = new FormData();
} else {
localVarFormParams = new HttpParams({encoder: this.encoder});
}

if (file !== undefined) {
localVarFormParams = localVarFormParams.append('file', <any>file) as any || localVarFormParams;
}

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/media_objects`;
return this.httpClient.request<MediaObjectJsonldMediaObjectRead>('post', `${this.configuration.basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
}

}

+ 9
- 4
matsen-tool/src/app/core/api/v1/api/partner.service.ts Ver fichero

@@ -106,16 +106,17 @@ export class PartnerService {
* @param itemsPerPage The number of items per page
* @param type
* @param type2
* @param name
* @param orderName
* @param orderCity
* @param orderWebsite
* @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 partnersGetCollection(page?: number, itemsPerPage?: number, type?: string, type2?: Array<string>, orderName?: 'asc' | 'desc', orderCity?: 'asc' | 'desc', orderWebsite?: 'asc' | 'desc', observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiPartnersGetCollection200Response>;
public partnersGetCollection(page?: number, itemsPerPage?: number, type?: string, type2?: Array<string>, orderName?: 'asc' | 'desc', orderCity?: 'asc' | 'desc', orderWebsite?: 'asc' | 'desc', observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiPartnersGetCollection200Response>>;
public partnersGetCollection(page?: number, itemsPerPage?: number, type?: string, type2?: Array<string>, orderName?: 'asc' | 'desc', orderCity?: 'asc' | 'desc', orderWebsite?: 'asc' | 'desc', observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiPartnersGetCollection200Response>>;
public partnersGetCollection(page?: number, itemsPerPage?: number, type?: string, type2?: Array<string>, orderName?: 'asc' | 'desc', orderCity?: 'asc' | 'desc', orderWebsite?: 'asc' | 'desc', observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
public partnersGetCollection(page?: number, itemsPerPage?: number, type?: string, type2?: Array<string>, name?: string, orderName?: 'asc' | 'desc', orderCity?: 'asc' | 'desc', orderWebsite?: 'asc' | 'desc', observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiPartnersGetCollection200Response>;
public partnersGetCollection(page?: number, itemsPerPage?: number, type?: string, type2?: Array<string>, name?: string, orderName?: 'asc' | 'desc', orderCity?: 'asc' | 'desc', orderWebsite?: 'asc' | 'desc', observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiPartnersGetCollection200Response>>;
public partnersGetCollection(page?: number, itemsPerPage?: number, type?: string, type2?: Array<string>, name?: string, orderName?: 'asc' | 'desc', orderCity?: 'asc' | 'desc', orderWebsite?: 'asc' | 'desc', observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiPartnersGetCollection200Response>>;
public partnersGetCollection(page?: number, itemsPerPage?: number, type?: string, type2?: Array<string>, name?: string, orderName?: 'asc' | 'desc', orderCity?: 'asc' | 'desc', orderWebsite?: 'asc' | 'desc', 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) {
@@ -136,6 +137,10 @@ export class PartnerService {
<any>element, 'type[]');
})
}
if (name !== undefined && name !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>name, 'name');
}
if (orderName !== undefined && orderName !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>orderName, 'order[name]');


+ 16
- 4
matsen-tool/src/app/core/api/v1/api/partnerFollow.service.ts Ver fichero

@@ -106,13 +106,15 @@ export class PartnerFollowService {
* @param itemsPerPage The number of items per page
* @param partner
* @param partner2
* @param user
* @param user2
* @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 partnerFollowsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiPartnerFollowsGetCollection200Response>;
public partnerFollowsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiPartnerFollowsGetCollection200Response>>;
public partnerFollowsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiPartnerFollowsGetCollection200Response>>;
public partnerFollowsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: 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> {
public partnerFollowsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, user?: string, user2?: Array<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiPartnerFollowsGetCollection200Response>;
public partnerFollowsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, user?: string, user2?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiPartnerFollowsGetCollection200Response>>;
public partnerFollowsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, user?: string, user2?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiPartnerFollowsGetCollection200Response>>;
public partnerFollowsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, user?: string, user2?: 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) {
@@ -133,6 +135,16 @@ export class PartnerFollowService {
<any>element, 'partner[]');
})
}
if (user !== undefined && user !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>user, 'user');
}
if (user2) {
user2.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>element, 'user[]');
})
}

let localVarHeaders = this.defaultHeaders;



+ 9
- 4
matsen-tool/src/app/core/api/v1/api/product.service.ts Ver fichero

@@ -104,14 +104,15 @@ export class ProductService {
* Retrieves the collection of Product resources.
* @param page The collection page number
* @param itemsPerPage The number of items per page
* @param name
* @param orderName
* @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 productsGetCollection(page?: number, itemsPerPage?: number, orderName?: 'asc' | 'desc', observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiProductsGetCollection200Response>;
public productsGetCollection(page?: number, itemsPerPage?: number, orderName?: 'asc' | 'desc', observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiProductsGetCollection200Response>>;
public productsGetCollection(page?: number, itemsPerPage?: number, orderName?: 'asc' | 'desc', observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiProductsGetCollection200Response>>;
public productsGetCollection(page?: number, itemsPerPage?: number, orderName?: 'asc' | 'desc', observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
public productsGetCollection(page?: number, itemsPerPage?: number, name?: string, orderName?: 'asc' | 'desc', observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiProductsGetCollection200Response>;
public productsGetCollection(page?: number, itemsPerPage?: number, name?: string, orderName?: 'asc' | 'desc', observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiProductsGetCollection200Response>>;
public productsGetCollection(page?: number, itemsPerPage?: number, name?: string, orderName?: 'asc' | 'desc', observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiProductsGetCollection200Response>>;
public productsGetCollection(page?: number, itemsPerPage?: number, name?: string, orderName?: 'asc' | 'desc', 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) {
@@ -122,6 +123,10 @@ export class ProductService {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>itemsPerPage, 'itemsPerPage');
}
if (name !== undefined && name !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>name, 'name');
}
if (orderName !== undefined && orderName !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>orderName, 'order[name]');


+ 16
- 4
matsen-tool/src/app/core/api/v1/api/task.service.ts Ver fichero

@@ -104,6 +104,8 @@ export class TaskService {
* Retrieves the collection of Task resources.
* @param page The collection page number
* @param itemsPerPage The number of items per page
* @param assignedTo
* @param assignedTo2
* @param partner
* @param partner2
* @param contact
@@ -111,10 +113,10 @@ export class TaskService {
* @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 tasksGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, contact?: string, contact2?: Array<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiTasksGetCollection200Response>;
public tasksGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, contact?: string, contact2?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiTasksGetCollection200Response>>;
public tasksGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, contact?: string, contact2?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiTasksGetCollection200Response>>;
public tasksGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array<string>, contact?: string, contact2?: 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> {
public tasksGetCollection(page?: number, itemsPerPage?: number, assignedTo?: string, assignedTo2?: Array<string>, partner?: string, partner2?: Array<string>, contact?: string, contact2?: Array<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiTasksGetCollection200Response>;
public tasksGetCollection(page?: number, itemsPerPage?: number, assignedTo?: string, assignedTo2?: Array<string>, partner?: string, partner2?: Array<string>, contact?: string, contact2?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiTasksGetCollection200Response>>;
public tasksGetCollection(page?: number, itemsPerPage?: number, assignedTo?: string, assignedTo2?: Array<string>, partner?: string, partner2?: Array<string>, contact?: string, contact2?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiTasksGetCollection200Response>>;
public tasksGetCollection(page?: number, itemsPerPage?: number, assignedTo?: string, assignedTo2?: Array<string>, partner?: string, partner2?: Array<string>, contact?: string, contact2?: 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) {
@@ -125,6 +127,16 @@ export class TaskService {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>itemsPerPage, 'itemsPerPage');
}
if (assignedTo !== undefined && assignedTo !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>assignedTo, 'assignedTo');
}
if (assignedTo2) {
assignedTo2.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>element, 'assignedTo[]');
})
}
if (partner !== undefined && partner !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>partner, 'partner');


+ 23
- 0
matsen-tool/src/app/core/api/v1/model/apiDocumentObjectsGetCollection200Response.ts Ver fichero

@@ -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 { DocumentObjectJsonldDocumentObjectRead } from './documentObjectJsonldDocumentObjectRead';
import { ApiCommentsGetCollection200ResponseHydraSearch } from './apiCommentsGetCollection200ResponseHydraSearch';
import { ApiCommentsGetCollection200ResponseHydraView } from './apiCommentsGetCollection200ResponseHydraView';


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


+ 22
- 0
matsen-tool/src/app/core/api/v1/model/apiDocumentObjectsGetCollection200Response1.ts Ver fichero

@@ -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 { ApiCommentsGetCollection200Response1Links } from './apiCommentsGetCollection200Response1Links';
import { DocumentObjectJsonhalDocumentObjectRead } from './documentObjectJsonhalDocumentObjectRead';


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


+ 2
- 2
matsen-tool/src/app/core/api/v1/model/apiDocumentsGetCollection200Response.ts Ver fichero

@@ -9,13 +9,13 @@
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { DocumentJsonld } from './documentJsonld';
import { ApiCommentsGetCollection200ResponseHydraSearch } from './apiCommentsGetCollection200ResponseHydraSearch';
import { ApiCommentsGetCollection200ResponseHydraView } from './apiCommentsGetCollection200ResponseHydraView';
import { DocumentJsonldDocumentObjectRead } from './documentJsonldDocumentObjectRead';


export interface ApiDocumentsGetCollection200Response {
'hydra:member': Array<DocumentJsonldDocumentObjectRead>;
'hydra:member': Array<DocumentJsonld>;
'hydra:totalItems'?: number;
'hydra:view'?: ApiCommentsGetCollection200ResponseHydraView;
'hydra:search'?: ApiCommentsGetCollection200ResponseHydraSearch;


+ 2
- 2
matsen-tool/src/app/core/api/v1/model/apiDocumentsGetCollection200Response1.ts Ver fichero

@@ -9,12 +9,12 @@
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { DocumentJsonhalDocumentObjectRead } from './documentJsonhalDocumentObjectRead';
import { DocumentJsonhal } from './documentJsonhal';
import { ApiCommentsGetCollection200Response1Links } from './apiCommentsGetCollection200Response1Links';


export interface ApiDocumentsGetCollection200Response1 {
_embedded: Array<DocumentJsonhalDocumentObjectRead>;
_embedded: Array<DocumentJsonhal>;
totalItems?: number;
itemsPerPage?: number;
_links: ApiCommentsGetCollection200Response1Links;


+ 23
- 0
matsen-tool/src/app/core/api/v1/model/apiMediaObjectsGetCollection200Response.ts Ver fichero

@@ -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 { ApiCommentsGetCollection200ResponseHydraSearch } from './apiCommentsGetCollection200ResponseHydraSearch';
import { ApiCommentsGetCollection200ResponseHydraView } from './apiCommentsGetCollection200ResponseHydraView';
import { MediaObjectJsonldMediaObjectRead } from './mediaObjectJsonldMediaObjectRead';


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


+ 22
- 0
matsen-tool/src/app/core/api/v1/model/apiMediaObjectsGetCollection200Response1.ts Ver fichero

@@ -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 { MediaObjectJsonhalMediaObjectRead } from './mediaObjectJsonhalMediaObjectRead';
import { ApiCommentsGetCollection200Response1Links } from './apiCommentsGetCollection200Response1Links';


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


+ 30
- 0
matsen-tool/src/app/core/api/v1/model/document.ts Ver fichero

@@ -0,0 +1,30 @@
/**
* 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 Document {
readonly createdBy?: string | null;
readonly createdByName?: string | null;
name: string | null;
description?: string | null;
partner?: string | null;
readonly partnerName?: string | null;
product?: string | null;
readonly productName?: string | null;
documentObject: string | null;
readonly documentUrl?: string | null;
readonly createdAt?: string | null;
}


+ 32
- 0
matsen-tool/src/app/core/api/v1/model/documentJsonhal.ts Ver fichero

@@ -0,0 +1,32 @@
/**
* 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 DocumentJsonhal {
_links?: CommentJsonhalLinks;
readonly createdBy?: string | null;
readonly createdByName?: string | null;
name: string | null;
description?: string | null;
partner?: string | null;
readonly partnerName?: string | null;
product?: string | null;
readonly productName?: string | null;
documentObject: string | null;
readonly documentUrl?: string | null;
readonly createdAt?: string | null;
}


+ 34
- 0
matsen-tool/src/app/core/api/v1/model/documentJsonld.ts Ver fichero

@@ -0,0 +1,34 @@
/**
* 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 DocumentJsonld {
context?: CommentJsonldContext;
readonly id?: string;
readonly type?: string;
readonly createdBy?: string | null;
readonly createdByName?: string | null;
name: string | null;
description?: string | null;
partner?: string | null;
readonly partnerName?: string | null;
product?: string | null;
readonly productName?: string | null;
documentObject: string | null;
readonly documentUrl?: string | null;
readonly createdAt?: string | null;
}


+ 20
- 0
matsen-tool/src/app/core/api/v1/model/documentObjectDocumentObjectRead.ts Ver fichero

@@ -0,0 +1,20 @@
/**
* 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 DocumentObjectDocumentObjectRead {
contentUrl?: string | null;
}


+ 22
- 0
matsen-tool/src/app/core/api/v1/model/documentObjectJsonhalDocumentObjectRead.ts Ver fichero

@@ -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 { CommentJsonhalLinks } from './commentJsonhalLinks';


/**
*
*/
export interface DocumentObjectJsonhalDocumentObjectRead {
_links?: CommentJsonhalLinks;
contentUrl?: string | null;
}


+ 24
- 0
matsen-tool/src/app/core/api/v1/model/documentObjectJsonldDocumentObjectRead.ts Ver fichero

@@ -0,0 +1,24 @@
/**
* 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 DocumentObjectJsonldDocumentObjectRead {
context?: CommentJsonldContext;
readonly id?: string;
readonly type?: string;
contentUrl?: string | null;
}


+ 22
- 0
matsen-tool/src/app/core/api/v1/model/mediaObjectJsonhalMediaObjectRead.ts Ver fichero

@@ -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 { CommentJsonhalLinks } from './commentJsonhalLinks';


/**
*
*/
export interface MediaObjectJsonhalMediaObjectRead {
_links?: CommentJsonhalLinks;
contentUrl?: string | null;
}


+ 24
- 0
matsen-tool/src/app/core/api/v1/model/mediaObjectJsonldMediaObjectRead.ts Ver fichero

@@ -0,0 +1,24 @@
/**
* 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 MediaObjectJsonldMediaObjectRead {
context?: CommentJsonldContext;
readonly id?: string;
readonly type?: string;
contentUrl?: string | null;
}


+ 20
- 0
matsen-tool/src/app/core/api/v1/model/mediaObjectMediaObjectRead.ts Ver fichero

@@ -0,0 +1,20 @@
/**
* 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 MediaObjectMediaObjectRead {
contentUrl?: string | null;
}


+ 13
- 8
matsen-tool/src/app/core/api/v1/model/models.ts Ver fichero

@@ -7,10 +7,12 @@ export * from './apiCommentsGetCollection200ResponseHydraSearchHydraMappingInner
export * from './apiCommentsGetCollection200ResponseHydraView';
export * from './apiContactsGetCollection200Response';
export * from './apiContactsGetCollection200Response1';
export * from './apiDocumentObjectsGetCollection200Response';
export * from './apiDocumentObjectsGetCollection200Response1';
export * from './apiDocumentsGetCollection200Response';
export * from './apiDocumentsGetCollection200Response1';
export * from './apiMediasGetCollection200Response';
export * from './apiMediasGetCollection200Response1';
export * from './apiMediaObjectsGetCollection200Response';
export * from './apiMediaObjectsGetCollection200Response1';
export * from './apiPartnerFollowsGetCollection200Response';
export * from './apiPartnerFollowsGetCollection200Response1';
export * from './apiPartnersGetCollection200Response';
@@ -38,14 +40,17 @@ export * from './commentJsonldContextOneOf';
export * from './contact';
export * from './contactJsonhal';
export * from './contactJsonld';
export * from './documentDocumentObjectRead';
export * from './documentJsonhalDocumentObjectRead';
export * from './documentJsonldDocumentObjectRead';
export * from './document';
export * from './documentJsonhal';
export * from './documentJsonld';
export * from './documentObjectDocumentObjectRead';
export * from './documentObjectJsonhalDocumentObjectRead';
export * from './documentObjectJsonldDocumentObjectRead';
export * from './loginCheckPost200Response';
export * from './loginCheckPostRequest';
export * from './mediaJsonhalMediaObjectRead';
export * from './mediaJsonldMediaObjectRead';
export * from './mediaMediaObjectRead';
export * from './mediaObjectJsonhalMediaObjectRead';
export * from './mediaObjectJsonldMediaObjectRead';
export * from './mediaObjectMediaObjectRead';
export * from './partner';
export * from './partnerFollow';
export * from './partnerFollowJsonhal';


+ 1
- 0
matsen-tool/src/app/documents/documents-detail/documents-detail.component.html Ver fichero

@@ -0,0 +1 @@
<p>documents-detail works!</p>

+ 0
- 0
matsen-tool/src/app/documents/documents-detail/documents-detail.component.scss Ver fichero


+ 23
- 0
matsen-tool/src/app/documents/documents-detail/documents-detail.component.spec.ts Ver fichero

@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { DocumentsDetailComponent } from './documents-detail.component';

describe('DocumentsDetailComponent', () => {
let component: DocumentsDetailComponent;
let fixture: ComponentFixture<DocumentsDetailComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [DocumentsDetailComponent]
})
.compileComponents();
fixture = TestBed.createComponent(DocumentsDetailComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});

+ 10
- 0
matsen-tool/src/app/documents/documents-detail/documents-detail.component.ts Ver fichero

@@ -0,0 +1,10 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-documents-detail',
templateUrl: './documents-detail.component.html',
styleUrl: './documents-detail.component.scss'
})
export class DocumentsDetailComponent {

}

+ 55
- 10
matsen-tool/src/app/documents/documents.component.html Ver fichero

@@ -1,7 +1,7 @@
<div class="spt-container">
<div class="d-flex justify-content-between align-items-start">
<h2>{{ 'basic.documents' | translate }}</h2>
<button class="btn btn-primary" (click)="openModalNewDocument()">{{'basic.new-document' | translate}}</button>
<button class="btn btn-primary" (click)="openModalNewDocument()">{{ 'basic.new-document' | translate }}</button>
</div>
<table mat-table [dataSource]="documentsDataSource" matSort (matSortChange)="onSortChange($event)"
class="mat-elevation-z8 mb-3">
@@ -16,26 +16,71 @@
</ng-container>

<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef mat-sort-header sortActionDescription="{{ 'overview.sort' | translate }}: {{ 'overview.document' | translate }}">
<th mat-header-cell *matHeaderCellDef mat-sort-header
sortActionDescription="{{ 'overview.sort' | translate }}: {{ 'overview.document' | translate }}">
{{ 'overview.document' | translate }}
</th>
<td mat-cell *matCellDef="let element"><span (click)="navigateToDocumentFile(element)">{{ element.name }}</span>
<td mat-cell *matCellDef="let element">{{ element.name }}
</td>
</ng-container>

<ng-container matColumnDef="type">
<th mat-header-cell *matHeaderCellDef mat-sort-header sortActionDescription="{{ 'overview.sort' | translate }}: {{ 'overview.type' | translate }}">
{{ 'overview.type' | translate }}
<ng-container matColumnDef="description">
<th mat-header-cell *matHeaderCellDef>
{{ 'overview.description' | translate }}
</th>
<td mat-cell *matCellDef="let element"
title="{{element.description}}">{{ element.description?.length > 70 ? element.description?.slice(0, 70) + '...' : element.description }}
</td>
</ng-container>

<ng-container matColumnDef="partnerName">
<th mat-header-cell *matHeaderCellDef>
{{ 'overview.partner' | translate }}
</th>
<td mat-cell *matCellDef="let element">{{ element.storage }}
<td mat-cell *matCellDef="let element">{{ element.partnerName }}
</td>
</ng-container>

<ng-container matColumnDef="date">
<th mat-header-cell *matHeaderCellDef mat-sort-header sortActionDescription="{{ 'overview.sort' | translate }}: {{ 'overview.uploaded' | translate }}">
<ng-container matColumnDef="productName">
<th mat-header-cell *matHeaderCellDef>
{{ 'overview.product' | translate }}
</th>
<td mat-cell *matCellDef="let element">{{ element.productName }}
</td>
</ng-container>

<ng-container matColumnDef="download">
<th mat-header-cell *matHeaderCellDef>
{{ 'overview.download' | translate }}
</th>
<td mat-cell *matCellDef="let element"><span class="btn btn-primary btn-sm" role="button"
(click)="navigateToDocumentFile(element)">Herunterladen</span>
</td>
</ng-container>

<ng-container matColumnDef="createdAt">
<th mat-header-cell *matHeaderCellDef mat-sort-header
sortActionDescription="{{ 'overview.sort' | translate }}: {{ 'overview.uploaded' | translate }}">
{{ 'overview.uploaded' | translate }}
</th>
<td mat-cell *matCellDef="let element"><a href="{{ element.number }}" target="_blank">{{ element.website }}</a>
<td mat-cell *matCellDef="let element">{{ element.createdAt | date:'dd.MM.YYYY HH:mm' }}
</td>
</ng-container>

<ng-container matColumnDef="createdByName">
<th mat-header-cell *matHeaderCellDef mat-sort-header
sortActionDescription="{{ 'overview.sort' | translate }}: {{ 'overview.createdBy' | translate }}">
{{ 'overview.createdBy' | translate }}
</th>
<td mat-cell *matCellDef="let element">{{ element.createdByName }}
</td>
</ng-container>

<ng-container matColumnDef="edit">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let element">
<span class="bi bi-pencil p-2"
data-type="user-tool" data-action="edit" (click)="openModalEditDocument(element)"></span>
</td>
</ng-container>



+ 24
- 15
matsen-tool/src/app/documents/documents.component.ts Ver fichero

@@ -2,22 +2,23 @@ import {ChangeDetectorRef, Component, ViewChild} from '@angular/core';
import {MatSort, MatSortModule, Sort} from "@angular/material/sort";
import {MatPaginator, MatPaginatorIntl, MatPaginatorModule, PageEvent} from "@angular/material/paginator";
import {Subscription} from "rxjs";
import {DocumentJsonldDocumentObjectRead, DocumentService, PartnerJsonld, ProductJsonld} from "@app/core/api/v1";
import {DocumentJsonld, DocumentService, ProductJsonld} from "@app/core/api/v1";
import {Router, RouterLink, RouterLinkActive} from "@angular/router";
import {MatTableDataSource, MatTableModule} from "@angular/material/table";
import {OrderFilter} from "@app/_models/orderFilter";
import {NgIf} from "@angular/common";
import {DatePipe, NgIf} from "@angular/common";
import {NgbModal, NgbModalOptions} from "@ng-bootstrap/ng-bootstrap";
import {NewDocumentComponent} from "@app/documents/new-document/new-document.component";
import {TranslateModule} from "@ngx-translate/core";
import {ModalStatus} from "@app/_helpers/modal.states";
import {NewCommentComponent} from "@app/postings/new-comment/new-comment.component";

@Component({
selector: 'app-documents',
templateUrl: './documents.component.html',
styleUrl: './documents.component.scss',
standalone: true,
imports: [MatTableModule, MatSortModule, MatPaginatorModule, RouterLink, RouterLinkActive, NgIf, TranslateModule],
imports: [MatTableModule, MatSortModule, MatPaginatorModule, RouterLink, RouterLinkActive, NgIf, TranslateModule, DatePipe],
})
export class DocumentsComponent {
@ViewChild(MatSort) sort;
@@ -26,7 +27,7 @@ export class DocumentsComponent {
protected displayedColumns: string[];

protected documentsSub: Subscription;
protected documents: Array<DocumentJsonldDocumentObjectRead>;
protected documents: Array<DocumentJsonld>;
protected documentsDataSource;
protected documentsLength: number;
protected documentsPageEvent: PageEvent;
@@ -43,12 +44,12 @@ export class DocumentsComponent {
private documentService: DocumentService
) {
this.sort = new MatSort();
this.displayedColumns = ['pos', 'name', 'type', 'date'];
this.displayedColumns = ['pos', 'name', 'description', 'download', 'partnerName', 'productName', 'createdAt', 'createdByName', 'edit'];

this.documentsSub = new Subscription();
this.documents = [];
this.documentsPaginator = new MatPaginator(new MatPaginatorIntl(), ChangeDetectorRef.prototype);
this.documentsDataSource = new MatTableDataSource<DocumentJsonldDocumentObjectRead>(this.documents);
this.documentsDataSource = new MatTableDataSource<DocumentJsonld>(this.documents);
this.documentsLength = 0;
this.documentsPageEvent = new PageEvent();
this.documentsPageSize = 10;
@@ -71,7 +72,8 @@ export class DocumentsComponent {
).subscribe(
data => {
this.documents = data["hydra:member"];
this.documentsDataSource = new MatTableDataSource<DocumentJsonldDocumentObjectRead>(this.documents);
console.log(this.documents);
this.documentsDataSource = new MatTableDataSource<DocumentJsonld>(this.documents);
this.documentsLength = Number(data["hydra:totalItems"]);
this.documentsPaginator.length = this.documentsLength;
}
@@ -115,18 +117,13 @@ export class DocumentsComponent {
this.getDocumentsData();
}

navigateToDocumentFile(element: any) {
// const partner: PartnerJsonld = element as PartnerJsonld;
// console.log(partner.type);
// console.log(ApiConverter.extractId(partner.id));
// this.router.navigate(['/documents', ApiConverter.extractId(partner.id)]);
navigateToDocumentFile(element: DocumentJsonld) {
window.open(element.documentUrl?.toString(), '_blank');
}

openModalNewDocument() {
const modalRefDocument = this.modalService.open(NewDocumentComponent, this.modalOptions);
// TODO: Warum muss ich einen leeren String übergeben, damit es funktioniert?
let document: ProductJsonld = {} as ProductJsonld;
document.name = "";
let document: DocumentJsonld = {} as DocumentJsonld;
modalRefDocument.componentInstance.document = document;
modalRefDocument.componentInstance.submit.subscribe((modalStatus: ModalStatus) => {
if (modalStatus === ModalStatus.Submitted) {
@@ -135,4 +132,16 @@ export class DocumentsComponent {
}
});
}

openModalEditDocument(document: DocumentJsonld) {
const modalRefDocument = this.modalService.open(NewDocumentComponent, this.modalOptions);
modalRefDocument.componentInstance.document = document;
console.log(document);
modalRefDocument.componentInstance.submit.subscribe((modalStatus: ModalStatus) => {
if (modalStatus === ModalStatus.Submitted) {
modalRefDocument.dismiss();
this.getDocumentsData();
}
});
}
}

+ 46
- 5
matsen-tool/src/app/documents/new-document/new-document.component.html Ver fichero

@@ -1,12 +1,53 @@
<h2 *ngIf="!document.id">{{'basic.new-document' | translate}}</h2>
<h2 *ngIf="document.id">{{'basic.edit-document' | translate}}</h2>
<h2 *ngIf="!document.id">{{ 'basic.new-document' | translate }}</h2>
<h2 *ngIf="document.id">{{ 'basic.edit-document' | translate }}</h2>
<div class="spt-form">
<form [formGroup]="documentForm" (ngSubmit)="onSubmit()">
<div class="mb-3">
<label for="image" class="form-label">{{'form.upload-image' | translate}}:</label>
<input type="file" class="form-control" id="image" (change)="onFileSelected($event)" accept="image/*" />
<label for="name" class="form-label">{{ 'form.name' | translate }}:</label>
<input type="text" class="form-control" id="name" formControlName="name"/>
</div>

<button type="submit" class="btn btn-primary" [disabled]="documentForm.invalid">{{'form.send' | translate}}</button>
<div class="mb-3">
<label for="description" class="form-label">{{ 'form.description' | translate }}:</label>
<input type="text" class="form-control" id="description" formControlName="description"/>
</div>

<div class="mb-3">
<label for="partner" class="form-label">{{ 'form.partner' | translate }}:</label>
<input type="text" class="form-control" id="partner" [ngbTypeahead]="searchPartners"
[inputFormatter]="formatter" [value]="documentForm.get('partnerName')?.value"
[resultFormatter]="formatter" [editable]="false" (selectItem)="onAssignedToSelectPartner($event)"/>
<input type="hidden" formControlName="partner"/>
</div>

<div class="mb-3">
<label for="product" class="form-label">{{ 'form.product' | translate }}:</label>
<input type="text" class="form-control" id="product" [ngbTypeahead]="searchProducts"
[inputFormatter]="formatter" [value]="documentForm.get('productName')?.value"
[resultFormatter]="formatter" [editable]="false" (selectItem)="onAssignedToSelectProduct($event)"/>
<input type="hidden" formControlName="product"/>
</div>

<div class="mb-3">
<label for="image" class="form-label">{{ 'form.upload-image' | translate }}:</label>
<input type="file" class="form-control" id="image" (change)="onFileSelected($event)" accept="image/*"/>
</div>

<div class="mb-3" *ngIf="document.documentUrl !== undefined">
<div class="delete-image" (click)="onDeleteFile()">
<p class="mb-0 ms-1">{{ 'system.delete-file' | translate }}</p>
</div>
</div>
1 - selectedFile:{{selectedFile === null}}<br>
2 - documentForm.invalid:{{documentForm.invalid}}<br>
3 - document.id:{{document.id !== undefined}}<br>
4 - documentObject:{{documentForm.get('documentObject')?.value}}<br>
<!-- 5:{{(selectedFile === null || documentForm.invalid)}}<br>-->
<!-- 5:{{(documentForm.invalid && document.id !== undefined)}}-->
<button type="submit" class="btn btn-primary"
[disabled]="(documentForm.invalid && document.id !== undefined) &&
(documentForm.get('documentObject')?.value === null && selectedFile === null)"
>{{ 'form.send' | translate }}
</button>
</form>
</div>

+ 111
- 27
matsen-tool/src/app/documents/new-document/new-document.component.ts Ver fichero

@@ -1,18 +1,16 @@
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {
DocumentJsonldDocumentObjectRead,
DocumentService,
MediaService,
ProductJsonld,
ProductService
DocumentJsonld, DocumentObjectService,
DocumentService, MediaObjectService, PartnerJsonld, PartnerService, ProductService
} from "@app/core/api/v1";
import {ModalStatus} from "@app/_helpers/modal.states";
import {FormGroup} from "@angular/forms";
import {Subscription} from "rxjs";
import {debounceTime, distinctUntilChanged, Observable, OperatorFunction, Subscription, switchMap} from "rxjs";
import {TranslateService} from "@ngx-translate/core";
import {FormGroupInitializer} from "@app/_helpers/formgroup.initializer";
import {documentForm} from "@app/_forms/apiForms";
import {ApiConverter} from "@app/_helpers/api.converter";
import {documentDocumentObjectReadForm} from "@app/_forms/apiForms";
import {filter, map} from "rxjs/operators";

@Component({
selector: 'app-new-document',
@@ -20,51 +18,137 @@ import {documentDocumentObjectReadForm} from "@app/_forms/apiForms";
styleUrl: './new-document.component.scss'
})
export class NewDocumentComponent implements OnInit {
@Input() public document!: DocumentJsonldDocumentObjectRead;
@Input() public document!: DocumentJsonld;
@Output() public submit: EventEmitter<ModalStatus> = new EventEmitter<ModalStatus>();

protected documentForm: FormGroup;
protected documentSub: Subscription;

protected selectedImage: File | null;
protected selectedFile: File | null;
protected mediaSub: Subscription;

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

protected searchPartners: OperatorFunction<string, readonly { id: any; name: any }[]> = (text$: Observable<string>) =>
text$.pipe(
debounceTime(200),
distinctUntilChanged(),
filter((term) => term.length >= 2),
switchMap((term) => this.fetchPartners(term)),
map((partners) => partners.slice(0, 10)),
);

protected searchProducts: OperatorFunction<string, readonly { id: any; name: any }[]> = (text$: Observable<string>) =>
text$.pipe(
debounceTime(200),
distinctUntilChanged(),
filter((term) => term.length >= 2),
switchMap((term) => this.fetchProducts(term)),
map((products) => products.slice(0, 10)),
);

constructor(
private documentService: DocumentService,
private mediaService: MediaService,
private translateService: TranslateService
private documentObjectService: DocumentObjectService,
private translateService: TranslateService,
private partnerService: PartnerService,
private productService: ProductService
) {
this.documentForm = documentDocumentObjectReadForm;
this.documentForm = documentForm;
this.documentSub = new Subscription();

this.selectedImage = null;
this.selectedFile = null;
this.mediaSub = new Subscription();
}

ngOnInit(): void {
this.documentForm = FormGroupInitializer.initFormGroup(this.documentForm, this.document);
console.log(this.document);
console.log(this.documentForm);
if (this.document.documentUrl === undefined) {
this.documentForm.patchValue({"documentObject": "-"});
console.log(this.documentForm);
}
}

protected fetchPartners(term: string): Observable<{ id: any; name: any }[]> {
return this.partnerService.partnersGetCollection(1, 50, undefined, undefined, term).pipe(
map((response) => response['hydra:member'].map(partner => ({ id: partner.id, name: partner.name }))),
);
}

protected fetchProducts(term: string): Observable<{ id: any; name: any }[]> {
return this.productService.productsGetCollection(1, 50, term).pipe(
map((response) => response['hydra:member'].map(product => ({ id: product.id, name: product.name }))),
);
}

protected onAssignedToSelectPartner(selectedItem: any): void {
this.documentForm.get('partner')?.setValue(selectedItem.item.id);
}

protected onAssignedToSelectProduct(selectedItem: any): void {
this.documentForm.get('product')?.setValue(selectedItem.item.id);
}

onSubmit() {
// if (this.documentForm.valid) {
// if (this.document.id === null || this.document.id === undefined) {
// // Create new product
// this.documentSub = this.documentService.documentsPost(
// this.documentForm.value as DocumentJsonldDocumentObjectRead
// ).subscribe(
// data => {
// this.documentForm.reset();
// this.submit.emit(ModalStatus.Submitted);
// }
// );
// }
// }
if (this.selectedFile !== null) {
this.mediaSub = this.documentObjectService.documentObjectsPost(
this.selectedFile
).subscribe(
data => {
this.documentForm.patchValue({"documentObject": data.id});
this.submitForm();
}
);
}
}

submitForm() {
if (this.documentForm.valid) {
if (this.document.id === null || this.document.id === undefined) {
// Create new product
this.documentSub = this.documentService.documentsPost(
this.documentForm.value as DocumentJsonld
).subscribe(
data => {
this.documentForm.reset();
this.submit.emit(ModalStatus.Submitted);
}
);
} else {
// Edit contact
this.documentSub = this.documentService.documentsIdPatch(
ApiConverter.extractId(this.document.id),
this.documentForm.value as DocumentJsonld
).subscribe(
data => {
this.documentForm.reset();
this.submit.emit(ModalStatus.Submitted);
}
);
}
}
}

onFileSelected(event: any) {
console.log(this.documentForm);
const file: File = event.target.files[0];
if (file) {
this.selectedImage = file;
this.selectedFile = file;
console.log(this.selectedFile);
}
}

onDeleteFile() {
let confirmMessage = "";
this.translateService.get('system.confirm-delete-file').subscribe((translation: string) => {
confirmMessage = translation;
});
const userConfirmed = window.confirm(confirmMessage);
if (userConfirmed) {
this.documentForm.patchValue({"documentObject": null});
this.documentForm.patchValue({"documentUrl": null});
}
}
}

+ 70
- 0
matsen-tool/src/app/home/home.component.html Ver fichero

@@ -120,4 +120,74 @@
</mat-paginator>
</div>
</div>

<!-- <div class="container spt-container">-->
<!-- <div class="d-flex justify-content-between align-items-start">-->
<!-- <h2>{{'user.my' | translate}} {{'basic.customer' | translate}}</h2>-->
<!-- </div>-->
<!-- <table mat-table [dataSource]="dataSource" matSort (matSortChange)="onSortChange($event)"-->
<!-- class="mat-elevation-z8 mb-3">-->

<!-- <ng-container matColumnDef="pos">-->
<!-- <th mat-header-cell *matHeaderCellDef>-->
<!-- {{ 'overview.number' | translate }}-->
<!-- </th>-->
<!-- <td mat-cell-->
<!-- *matCellDef="let element">{{ (pageSize * pageIndex) + dataSource.filteredData.indexOf(element) + 1 }}-->
<!-- </td>-->
<!-- </ng-container>-->

<!-- <ng-container matColumnDef="image">-->
<!-- <th mat-header-cell *matHeaderCellDef>-->
<!-- {{ 'overview.logo' | translate }}-->
<!-- </th>-->
<!-- <td mat-cell *matCellDef="let element">-->
<!-- <img role="button" src="{{ element.logoUrl }}" (click)="navigateToPartnerDetails(element)" width="40"-->
<!-- height="40"/>-->
<!-- </td>-->
<!-- </ng-container>-->

<!-- <ng-container matColumnDef="name">-->
<!-- <th mat-header-cell *matHeaderCellDef mat-sort-header-->
<!-- sortActionDescription="{{ 'overview.sort' | translate }}: {{ partnerNameOne }}">-->
<!-- {{ partnerNameOne }}-->
<!-- </th>-->
<!-- <td mat-cell *matCellDef="let element"><span role="button"-->
<!-- (click)="navigateToPartnerDetails(element)">{{ element.name }}</span>-->
<!-- </td>-->
<!-- </ng-container>-->

<!-- <ng-container matColumnDef="address">-->
<!-- <th mat-header-cell *matHeaderCellDef mat-sort-header="address"-->
<!-- sortActionDescription="{{ 'overview.sort' | translate }}: {{ 'overview.address' | translate }}">-->
<!-- {{ 'overview.address' | translate }}-->
<!-- </th>-->
<!-- <td mat-cell *matCellDef="let element">{{ element.street }} {{ element.streetNo }}-->
<!-- <br/>{{ element.zip }} {{ element.city }}-->
<!-- <br/>{{ element.country }}-->
<!-- </td>-->
<!-- </ng-container>-->

<!-- <ng-container matColumnDef="website">-->
<!-- <th mat-header-cell *matHeaderCellDef mat-sort-header-->
<!-- sortActionDescription="{{ 'overview.sort' | translate }}: {{ 'overview.website' | translate }}">-->
<!-- {{ 'overview.website' | translate }}-->
<!-- </th>-->
<!-- <td mat-cell *matCellDef="let element"><a href="{{ element.website }}"-->
<!-- target="_blank">{{ element.website }}</a>-->
<!-- </td>-->
<!-- </ng-container>-->

<!-- <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>-->
<!-- <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>-->
<!-- </table>-->
<!-- <mat-paginator class="rounded-1"-->
<!-- [pageSizeOptions]="[10,25,50]"-->
<!-- [length]="length"-->
<!-- (page)="handlePageEvent($event)"-->
<!-- [pageSize]="pageSize"-->
<!-- [pageIndex]="pageIndex"-->
<!-- showFirstLastButtons>-->
<!-- </mat-paginator>-->
<!-- </div>-->
</div>

+ 0
- 2
matsen-tool/src/app/home/home.component.ts Ver fichero

@@ -107,8 +107,6 @@ export class HomeComponent implements OnInit, AfterViewInit {
this.tasksSub = this.taskService.tasksGetCollection(
this.tasksPageIndex + 1,
this.tasksPageSize,
"",
[],
this.user?.id
).subscribe(
data => {


+ 24
- 23
matsen-tool/src/app/partners/new-partner/new-partner.component.html Ver fichero

@@ -1,58 +1,59 @@
<h2 *ngIf="!partner.id">{{'basic.new' | translate}} {{ partnerNameOne }}</h2>
<h2 *ngIf="partner.id">{{'basic.edit-before' | translate}} {{ partnerNameOne }} {{'basic.edit-after' | translate}}</h2>
<h2 *ngIf="!partner.id">{{ 'basic.new' | translate }} {{ partnerNameOne }}</h2>
<h2 *ngIf="partner.id">{{ 'basic.edit-before' | translate }} {{ partnerNameOne }} {{ 'basic.edit-after' | translate }}</h2>
<div class="spt-form">
<form [formGroup]="partnerForm" (ngSubmit)="onSubmit()">
<div class="mb-3">
<label for="name" class="form-label">{{'form.name' | translate}}:</label>
<input type="text" class="form-control" id="name" formControlName="name" />
<label for="name" class="form-label">{{ 'form.name' | translate }}:</label>
<input type="text" class="form-control" id="name" formControlName="name"/>
<div class="form-text" *ngIf="partnerForm.get('name')?.invalid && partnerForm.get('name')?.touched">
{{'form.name' | translate}} {{'form.mandatory' | translate}}.
{{ 'form.name' | translate }} {{ 'form.mandatory' | translate }}.
</div>
</div>

<div class="mb-3">
<label for="street" class="form-label">{{'form.street' | translate}}:</label>
<input type="text" class="form-control" id="street" formControlName="street" />
<label for="street" class="form-label">{{ 'form.street' | translate }}:</label>
<input type="text" class="form-control" id="street" formControlName="street"/>
</div>

<div class="mb-3">
<label for="streetNo" class="form-label">{{'form.street-no' | translate}}:</label>
<input type="text" class="form-control" id="streetNo" formControlName="streetNo" />
<label for="streetNo" class="form-label">{{ 'form.street-no' | translate }}:</label>
<input type="text" class="form-control" id="streetNo" formControlName="streetNo"/>
</div>

<div class="mb-3">
<label for="zip" class="form-label">{{'form.zip' | translate}}:</label>
<input type="text" class="form-control" id="zip" formControlName="zip" />
<label for="zip" class="form-label">{{ 'form.zip' | translate }}:</label>
<input type="text" class="form-control" id="zip" formControlName="zip"/>
</div>

<div class="mb-3">
<label for="city" class="form-label">{{'form.city' | translate}}:</label>
<input type="text" class="form-control" id="city" formControlName="city" />
<label for="city" class="form-label">{{ 'form.city' | translate }}:</label>
<input type="text" class="form-control" id="city" formControlName="city"/>
</div>

<div class="mb-3">
<label for="country" class="form-label">{{'form.country' | translate}}:</label>
<input type="text" class="form-control" id="country" formControlName="country" />
<label for="country" class="form-label">{{ 'form.country' | translate }}:</label>
<input type="text" class="form-control" id="country" formControlName="country"/>
</div>

<div class="mb-3">
<label for="website" class="form-label">{{'form.website' | translate}}:</label>
<input type="text" class="form-control" id="website" formControlName="website" />
<label for="website" class="form-label">{{ 'form.website' | translate }}:</label>
<input type="text" class="form-control" id="website" formControlName="website"/>
</div>

<div class="mb-3">
<label for="logo" class="form-label">{{'form.upload-image' | translate}}:</label>
<input type="file" class="form-control" id="logo" (change)="onFileSelected($event)" accept="image/*" />
<label for="logo" class="form-label">{{ 'form.upload-image' | translate }}:</label>
<input type="file" class="form-control" id="logo" (change)="onFileSelected($event)" accept="image/*"/>
</div>

<div class="mb-3">
<div class="mb-3" *ngIf="partner.logoUrl !== undefined">
<div class="delete-image" (click)="onDeleteImage()">
<img *ngIf="partner.logoUrl !== null" src="{{partner.logoUrl}}" width="40" height="40" />
<p class="mb-0 ms-3">{{'system.delete-image' | translate}}</p>
<img src="{{partner.logoUrl}}" width="40" height="40"/>
<p class="mb-0 ms-3">{{ 'system.delete-image' | translate }}</p>
</div>
</div>

<button type="submit" class="btn btn-primary" [disabled]="partnerForm.invalid">{{'form.send' | translate}}</button>
<button type="submit" class="btn btn-primary" [disabled]="partnerForm.invalid">{{ 'form.send' | translate }}
</button>
</form>
</div>


+ 6
- 5
matsen-tool/src/app/partners/new-partner/new-partner.component.ts Ver fichero

@@ -1,6 +1,6 @@
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {partnerForm} from "@app/_forms/apiForms";
import {MediaService, PartnerJsonld, PartnerService} from "@app/core/api/v1";
import {MediaObjectService, PartnerJsonld, PartnerService} from "@app/core/api/v1";
import {ModalStatus} from "@app/_helpers/modal.states";
import {FormGroup} from "@angular/forms";
import {Subscription} from "rxjs";
@@ -18,15 +18,16 @@ export class NewPartnerComponent implements OnInit {
@Output() public submit: EventEmitter<ModalStatus> = new EventEmitter<ModalStatus>();

protected partnerForm: FormGroup;
protected selectedImage: File | null;
protected partnerSub: Subscription;

protected selectedImage: File | null;
protected mediaSub: Subscription;

protected partnerNameOne: string;

constructor(
private partnerService: PartnerService,
private mediaService: MediaService,
private mediaObjectService: MediaObjectService,
private translateService: TranslateService
) {
this.partnerForm = partnerForm;
@@ -40,7 +41,7 @@ export class NewPartnerComponent implements OnInit {

ngOnInit(): void {
this.partnerForm = FormGroupInitializer.initFormGroup(this.partnerForm, this.partner);
this.translateService.get('basic.' + this.partner.type + 'One').subscribe((translation: string) => {
this.translateService.get('basic.' + this.partner.partnerType + 'One').subscribe((translation: string) => {
this.partnerNameOne = translation;
});
}
@@ -48,7 +49,7 @@ export class NewPartnerComponent implements OnInit {
// On submit form: Check if image is set
onSubmit() {
if (this.selectedImage !== null) {
this.mediaSub = this.mediaService.mediasPost(
this.mediaSub = this.mediaObjectService.mediaObjectsPost(
this.selectedImage
).subscribe(
data => {


+ 3
- 3
matsen-tool/src/app/partners/partners-detail/partners-detail.component.html Ver fichero

@@ -31,9 +31,9 @@
height="94" alt="{{partner.name}}" title="{{partner.name}}"/>
</div>
<span class="position-absolute bi p-2"
[class.bi-heart]="!userFollows"
[class.bi-heart-fill]="userFollows"
[class.user-follows]="userFollows"
[class.bi-heart]="partnerFollow === null"
[class.bi-heart-fill]="partnerFollow !== null"
[class.user-follows]="partnerFollow !== null"
data-type="user-tool" data-action="follow"
(click)="followPartner($event)"></span>
<span class="position-absolute bi bi-pencil p-2" data-type="user-tool" data-action="edit"


+ 22
- 27
matsen-tool/src/app/partners/partners-detail/partners-detail.component.ts Ver fichero

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

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

protected readonly environment = environment;
@@ -46,7 +45,7 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit {
protected partner: PartnerJsonld;

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

protected contactsSub: Subscription;
protected contacts: Array<ContactJsonld>;
@@ -90,12 +89,11 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit {
private taskService: TaskService
) {
this.id = "";
this.userFollows = false;
this.partnerDetailSub = new Subscription();
this.partner = {} as PartnerJsonld;

this.partnerFollowSub = new Subscription();
this.partnerFollow = {} as PartnerFollowJsonld;
this.partnerFollow = null;

this.user = this.accountService.userValue;

@@ -188,7 +186,8 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit {
this.tasksSub = this.taskService.tasksGetCollection(
this.tasksPageIndex + 1,
this.tasksPageSize,
// TODO: User-ID muss übergeben werden können, damit man nur die Tasks bekommt, die einem User zugewiesen sind
undefined,
undefined,
this.id
).subscribe(
data => {
@@ -366,45 +365,41 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit {
this.partnerFollowSub = this.partnerFollowService.partnerFollowsGetCollection(
1,
50,
this.id
// TODO: Follow für Partner auf User holen
this.id,
undefined,
this.user?.id
).subscribe(
data => {
// this.partnerFollow = data;
// TODO: Einblenden!
if (this.partnerFollow === null) {
this.userFollows == false;
} else {
this.userFollows == true;
let partnerFollows = data["hydra:member"];
if (partnerFollows.length > 0) {
this.partnerFollow = partnerFollows[0];
}
console.log(this.partnerFollow);
}
);
}

followPartner(event: any) {
if (!this.userFollows) {
if (this.partnerFollow === null) {
this.partnerFollowSub = this.partnerFollowService.partnerFollowsPost(
{
partner: this.partner.id
} as PartnerFollowJsonld
).subscribe(
data => {
console.log(data);
this.userFollows = !this.userFollows;
this.partnerFollow = data;
console.log(this.partnerFollow);
}
);
} else {
if (this.partnerFollow.id !== null && this.partnerFollow.id !== undefined) {
this.partnerFollowSub = this.partnerFollowService.partnerFollowsIdDelete(
ApiConverter.extractId(this.partnerFollow.id)
).subscribe(
data => {
console.log(data);
this.userFollows = !this.userFollows;
}
);
}
this.partnerFollowSub = this.partnerFollowService.partnerFollowsIdDelete(
ApiConverter.extractId(this.partnerFollow.id)
).subscribe(
data => {
this.partnerFollow = null;
console.log(this.partnerFollow);
}
);
}
console.log(this.userFollows);
}
}

+ 5
- 5
matsen-tool/src/app/partners/partners.component.html Ver fichero

@@ -5,7 +5,7 @@
(click)="openModalNewPartner()">{{ 'basic.new' | translate }} {{ partnerNameOne }}
</button>
</div>
<table mat-table [dataSource]="dataSource" matSort (matSortChange)="onSortChange($event)"
<table mat-table [dataSource]="partnersDataSource" matSort (matSortChange)="onSortChange($event)"
class="mat-elevation-z8 mb-3">

<ng-container matColumnDef="pos">
@@ -13,7 +13,7 @@
{{ 'overview.number' | translate }}
</th>
<td mat-cell
*matCellDef="let element">{{ (pageSize * pageIndex) + dataSource.filteredData.indexOf(element) + 1 }}
*matCellDef="let element">{{ (partnersPageSize * partnersPageIndex) + partnersDataSource.filteredData.indexOf(element) + 1 }}
</td>
</ng-container>

@@ -63,10 +63,10 @@
</table>
<mat-paginator class="rounded-1"
[pageSizeOptions]="[10,25,50]"
[length]="length"
[length]="partnersLength"
(page)="handlePageEvent($event)"
[pageSize]="pageSize"
[pageIndex]="pageIndex"
[pageSize]="partnersPageSize"
[pageIndex]="partnersPageIndex"
showFirstLastButtons>
</mat-paginator>
</div>

+ 27
- 26
matsen-tool/src/app/partners/partners.component.ts Ver fichero

@@ -22,8 +22,8 @@ import TypeEnum = PartnerJsonld.PartnerTypeEnum;
imports: [MatTableModule, MatSortModule, MatPaginatorModule, RouterLink, RouterLinkActive, NgIf, TranslateModule],
})
export class PartnersComponent implements OnInit, AfterViewInit {
@ViewChild(MatSort) sort;
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) partnersSort;
@ViewChild(MatPaginator) partnersPaginator: MatPaginator;

protected partnersSub: Subscription;
protected partners: Array<PartnerJsonld>;
@@ -37,11 +37,11 @@ export class PartnersComponent implements OnInit, AfterViewInit {
protected partnerNameOne: string;
protected displayedColumns: string[];

protected dataSource;
protected length: number;
protected pageEvent: PageEvent;
protected pageSize: number;
protected pageIndex: number;
protected partnersDataSource;
protected partnersLength: number;
protected partnersPageEvent: PageEvent;
protected partnersPageSize: number;
protected partnersPageIndex: number;

protected modalOptions: NgbModalOptions = {
centered: true
@@ -54,8 +54,8 @@ export class PartnersComponent implements OnInit, AfterViewInit {
private modalService: NgbModal,
private translateService: TranslateService
) {
this.sort = new MatSort();
this.paginator = new MatPaginator(new MatPaginatorIntl(), ChangeDetectorRef.prototype);
this.partnersSort = new MatSort();
this.partnersPaginator = new MatPaginator(new MatPaginatorIntl(), ChangeDetectorRef.prototype);

this.partnersSub = new Subscription();
this.partners = [];
@@ -65,11 +65,11 @@ export class PartnersComponent implements OnInit, AfterViewInit {
this.cityOrderAsc = OrderFilter.Asc;
this.websiteOrderAsc = OrderFilter.Asc;

this.dataSource = new MatTableDataSource<PartnerJsonld>(this.partners);
this.length = 0;
this.pageEvent = new PageEvent();
this.pageSize = 10;
this.pageIndex = 0;
this.partnersDataSource = new MatTableDataSource<PartnerJsonld>(this.partners);
this.partnersLength = 0;
this.partnersPageEvent = new PageEvent();
this.partnersPageSize = 10;
this.partnersPageIndex = 0;

this.partnerName = "";
this.partnerNameOne = "";
@@ -88,25 +88,26 @@ export class PartnersComponent implements OnInit, AfterViewInit {
}

ngAfterViewInit() {
this.dataSource.sort = this.sort;
this.dataSource.paginator = this.paginator;
this.partnersDataSource.sort = this.partnersSort;
this.partnersDataSource.paginator = this.partnersPaginator;
}

getPartnersData() {
this.partnersSub = this.partnerService.partnersGetCollection(
this.pageIndex + 1,
this.pageSize,
this.partnersPageIndex + 1,
this.partnersPageSize,
this.dataType,
undefined,
undefined,
this.nameOrderAsc,
this.cityOrderAsc,
this.websiteOrderAsc
).subscribe(
data => {
this.partners = data["hydra:member"];
this.dataSource = new MatTableDataSource<PartnerJsonld>(this.partners);
this.length = Number(data["hydra:totalItems"]);
this.paginator.length = this.length;
this.partnersDataSource = new MatTableDataSource<PartnerJsonld>(this.partners);
this.partnersLength = Number(data["hydra:totalItems"]);
this.partnersPaginator.length = this.partnersLength;
}
);
// switch over this.dataType (customers, etc.)
@@ -115,7 +116,7 @@ export class PartnersComponent implements OnInit, AfterViewInit {
/** Announce the change in sort state for assistive technology. */
onSortChange(sortState: Sort) {
// Reset page index to first page
this.pageIndex = 0;
this.partnersPageIndex = 0;

let order: OrderFilter;
if (sortState.direction === "") {
@@ -142,10 +143,10 @@ export class PartnersComponent implements OnInit, AfterViewInit {
}

handlePageEvent(e: PageEvent) {
this.pageEvent = e;
this.length = e.length;
this.pageIndex = e.pageIndex.valueOf();
this.pageSize = e.pageSize.valueOf();
this.partnersPageEvent = e;
this.partnersLength = e.length;
this.partnersPageIndex = e.pageIndex.valueOf();
this.partnersPageSize = e.pageSize.valueOf();
this.getPartnersData();
}



+ 2
- 2
matsen-tool/src/app/products/new-product/new-product.component.html Ver fichero

@@ -23,9 +23,9 @@
<input type="file" class="form-control" id="image" (change)="onFileSelected($event)" accept="image/*" />
</div>

<div class="mb-3">
<div class="mb-3" *ngIf="product.imageUrl !== undefined">
<div class="delete-image" (click)="onDeleteImage()">
<img *ngIf="product.imageUrl !== null" src="{{product.imageUrl}}" width="40" height="40" />
<img src="{{product.imageUrl}}" width="40" height="40" />
<p class="mb-0 ms-3">{{'system.delete-image' | translate}}</p>
</div>
</div>


+ 3
- 3
matsen-tool/src/app/products/new-product/new-product.component.ts Ver fichero

@@ -1,5 +1,5 @@
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {MediaService, ProductJsonld, ProductService} from "@app/core/api/v1";
import {MediaObjectService, ProductJsonld, ProductService} from "@app/core/api/v1";
import {ModalStatus} from "@app/_helpers/modal.states";
import {FormGroup} from "@angular/forms";
import {Subscription} from "rxjs";
@@ -25,7 +25,7 @@ export class NewProductComponent implements OnInit {

constructor(
private productService: ProductService,
private mediaService: MediaService,
private mediaObjectService: MediaObjectService,
private translateService: TranslateService
) {
this.productForm = productForm;
@@ -41,7 +41,7 @@ export class NewProductComponent implements OnInit {

onSubmit() {
if (this.selectedImage !== null) {
this.mediaSub = this.mediaService.mediasPost(
this.mediaSub = this.mediaObjectService.mediaObjectsPost(
this.selectedImage
).subscribe(
data => {


+ 7
- 6
matsen-tool/src/app/tasks/new-task-note/new-task-note.component.html Ver fichero

@@ -1,16 +1,17 @@
<h2 *ngIf="!taskNote.id">{{'basic.new-task-note' | translate}}</h2>
<h2 *ngIf="taskNote.id">{{'basic.edit-task-note' | translate}}</h2>
<h2 *ngIf="!taskNote.id">{{ 'basic.new-task-note' | translate }}</h2>
<h2 *ngIf="taskNote.id">{{ 'basic.edit-task-note' | translate }}</h2>
<div class="spt-form">
<form [formGroup]="taskNoteForm" (ngSubmit)="onSubmit()">
<div class="mb-3">
<label for="message" class="form-label">{{'form.comment' | translate}}:</label>
<input type="text" class="form-control" id="message" formControlName="message" />
<label for="message" class="form-label">{{ 'form.comment' | translate }}:</label>
<input type="text" class="form-control" id="message" formControlName="message"/>
<div class="form-text" *ngIf="taskNoteForm.get('message')?.invalid && taskNoteForm.get('message')?.touched">
{{'form.comment' | translate}} {{'form.mandatory' | translate}}.
{{ 'form.comment' | translate }} {{ 'form.mandatory' | translate }}.
</div>
</div>

<button type="submit" class="btn btn-primary" [disabled]="taskNoteForm.invalid">{{'form.send' | translate}}</button>
<button type="submit" class="btn btn-primary" [disabled]="taskNoteForm.invalid">{{ 'form.send' | translate }}
</button>
</form>
</div>


+ 26
- 24
matsen-tool/src/app/tasks/new-task/new-task.component.html Ver fichero

@@ -1,64 +1,66 @@
<h2 *ngIf="!task.id">{{'basic.new-task' | translate}}</h2>
<h2 *ngIf="task.id">{{'basic.edit-task' | translate}}</h2>
<h2 *ngIf="!task.id">{{ 'basic.new-task' | translate }}</h2>
<h2 *ngIf="task.id">{{ 'basic.edit-task' | translate }}</h2>
<div class="spt-form">
<form [formGroup]="taskForm" (ngSubmit)="onSubmit()">
<div class="mb-3">
<label for="headline" class="form-label">{{'form.headline' | translate}}:</label>
<input type="text" class="form-control" id="headline" formControlName="headline" />
<label for="headline" class="form-label">{{ 'form.headline' | translate }}:</label>
<input type="text" class="form-control" id="headline" formControlName="headline"/>
<div class="form-text" *ngIf="taskForm.get('headline')?.invalid && taskForm.get('headline')?.touched">
{{'form.headline' | translate}} {{'form.mandatory' | translate}}.
{{ 'form.headline' | translate }} {{ 'form.mandatory' | translate }}.
</div>
</div>

<div class="mb-3">
<label for="description" class="form-label">{{'form.description' | translate}}:</label>
<input type="text" class="form-control" id="description" formControlName="description" />
<label for="description" class="form-label">{{ 'form.description' | translate }}:</label>
<input type="text" class="form-control" id="description" formControlName="description"/>
<div class="form-text" *ngIf="taskForm.get('description')?.invalid && taskForm.get('description')?.touched">
{{'form.description' | translate}} {{'form.mandatory' | translate}}.
{{ 'form.description' | translate }} {{ 'form.mandatory' | translate }}.
</div>
</div>

<div class="mb-3" *ngIf="task.partner == null">
<label for="partner" class="form-label">{{'form.partner' | translate}}:</label>
<label for="partner" class="form-label">{{ 'form.partner' | translate }}:</label>
<select class="form-control" id="partner" formControlName="partner">
<!-- ALLE PARTNER LADEN ODER BESSER: ELASTIC SEARCH -->
<!-- ALLE PARTNER LADEN ODER BESSER: ELASTIC SEARCH -->
<option value="/api/partners/101">CatalystX SAS</option>
</select>
<div class="form-text" *ngIf="taskForm.get('partner')?.invalid && taskForm.get('partner')?.touched">
{{'form.partner' | translate}} {{'form.mandatory' | translate}}.
{{ 'form.partner' | translate }} {{ 'form.mandatory' | translate }}.
</div>
</div>

<div class="mb-3">
<label for="assignedTo" class="form-label">{{'form.assign-to' | translate}}:</label>
<label for="assignedTo" class="form-label">{{ 'form.assign-to' | translate }}:</label>
<input type="text" class="form-control" id="assignedTo" [ngbTypeahead]="search" [inputFormatter]="formatter"
[resultFormatter]="formatter" [editable]="false" (selectItem)="onAssignedToSelect($event)" />
<input type="hidden" formControlName="assignedTo" />
[resultFormatter]="formatter" [value]="taskForm.get('assignedToName')?.value" [editable]="false" (selectItem)="onAssignedToSelect($event)"/>
<input type="hidden" formControlName="assignedTo"/>
<div class="form-text" *ngIf="taskForm.get('assignedTo')?.invalid && taskForm.get('assignedTo')?.touched">
{{'form.assign-to' | translate}} {{'form.mandatory' | translate}}.
{{ 'form.assign-to' | translate }} {{ 'form.mandatory' | translate }}.
</div>
</div>

<div class="mb-3">
<label for="dueAtValue" class="form-label">{{'form.due-date' | translate}}:</label>
<input type="datetime-local" value="{{ dueAtValue }}" class="form-control" id="dueAtValue" (change)="onDueAtChange($event)" />
<label for="dueAtValue" class="form-label">{{ 'form.due-date' | translate }}:</label>
<input type="datetime-local" value="{{ dueAtValue }}" class="form-control" id="dueAtValue"
(change)="onDueAtChange($event)"/>
<div class="form-text" *ngIf="taskForm.get('dueAt')?.invalid && taskForm.get('dueAt')?.touched">
{{'form.due-date' | translate}} {{'form.mandatory' | translate}}.
{{ 'form.due-date' | translate }} {{ 'form.mandatory' | translate }}.
</div>
</div>

<div class="mb-3">
<label for="prio" class="form-label">{{'form.prio' | translate}}:</label>
<label for="prio" class="form-label">{{ 'form.prio' | translate }}:</label>
<select class="form-control" id="prio" formControlName="prio">
<option value="low" selected>{{'form.prio-low' | translate}}</option>
<option value="medium">{{'form.prio-medium' | translate}}</option>
<option value="high">{{'form.prio-high' | translate}}</option>
<option value="low" selected>{{ 'form.prio-low' | translate }}</option>
<option value="medium">{{ 'form.prio-medium' | translate }}</option>
<option value="high">{{ 'form.prio-high' | translate }}</option>
</select>
<div class="form-text" *ngIf="taskForm.get('prio')?.invalid && taskForm.get('prio')?.touched">
{{'form.prio' | translate}} {{'form.mandatory' | translate}}.
{{ 'form.prio' | translate }} {{ 'form.mandatory' | translate }}.
</div>
</div>

<button type="submit" class="btn btn-primary" [disabled]="taskForm.invalid">{{'form.send' | translate}}</button>
<button type="submit" class="btn btn-primary" [disabled]="taskForm.invalid">{{ 'form.send' | translate }}
</button>
</form>
</div>

+ 11
- 11
matsen-tool/src/app/tasks/new-task/new-task.component.ts Ver fichero

@@ -21,6 +21,17 @@ export class NewTaskComponent implements OnInit {
protected taskSub: Subscription;
protected dueAtValue: string;

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

protected search: OperatorFunction<string, readonly { id: any; name: any }[]> = (text$: Observable<string>) =>
text$.pipe(
debounceTime(200),
distinctUntilChanged(),
filter((term) => term.length >= 2),
switchMap((term) => this.fetchUsers(term)),
map((users) => users.slice(0, 10)),
);

constructor(
private taskService: TaskService,
private userService: UserService
@@ -35,17 +46,6 @@ export class NewTaskComponent implements OnInit {
this.taskForm = FormGroupInitializer.initFormGroup(this.taskForm, this.task);
}

protected search: OperatorFunction<string, readonly { id: any; name: any }[]> = (text$: Observable<string>) =>
text$.pipe(
debounceTime(200),
distinctUntilChanged(),
filter((term) => term.length >= 2),
switchMap((term) => this.fetchUsers(term)),
map((users) => users.slice(0, 10)),
);

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

protected fetchUsers(term: string): Observable<{ id: any; name: any }[]> {
return this.userService.usersGetCollection(1, 50, undefined, term).pipe(
map((response) => response['hydra:member'].map(user => ({ id: user.id, name: user.firstName + ' ' + user.lastName }))),


+ 10
- 2
matsen-tool/src/assets/i18n/de.json Ver fichero

@@ -2,7 +2,9 @@
"system":
{
"delete-image": "Bild löschen",
"confirm-delete-image": "Möchten Sie das Bild wirklich löschen?"
"confirm-delete-image": "Möchten Sie das Bild wirklich löschen?",
"delete-file": "Datei löschen",
"confirm-delete-file": "Möchten Sie die Datei wirklich löschen?"
},
"basic":
{
@@ -61,7 +63,12 @@
"number-long": "Nummer",
"document": "Dokument",
"type": "Typ",
"uploaded": "Hochgeladen am"
"uploaded": "Hochgeladen am",
"description": "Beschreibung",
"createdBy": "Erstellt von",
"download": "Download",
"partner": "Partner",
"product": "Produkt"
},
"form":
{
@@ -92,6 +99,7 @@
"prio-medium": "mittel",
"prio-high": "hoch",
"partner": "Partner",
"product": "Produkt",
"send": "Abschicken"
}
}

Cargando…
Cancelar
Guardar