| @@ -68,29 +68,72 @@ export const contactJsonldForm = new FormGroup({ | |||||
| createdAt: new FormControl(null, []) | 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, []) | contentUrl: new FormControl(null, []) | ||||
| }); | }); | ||||
| export const documentJsonhalDocumentObjectReadForm = new FormGroup({ | |||||
| export const documentObjectJsonhalDocumentObjectReadForm = new FormGroup({ | |||||
| _links: new FormControl(null, []), | _links: new FormControl(null, []), | ||||
| contentUrl: new FormControl(null, []) | contentUrl: new FormControl(null, []) | ||||
| }); | }); | ||||
| export const documentJsonldDocumentObjectReadForm = new FormGroup({ | |||||
| export const documentObjectJsonldDocumentObjectReadForm = new FormGroup({ | |||||
| contentUrl: new FormControl(null, []) | contentUrl: new FormControl(null, []) | ||||
| }); | }); | ||||
| export const mediaMediaObjectReadForm = new FormGroup({ | |||||
| export const mediaObjectMediaObjectReadForm = new FormGroup({ | |||||
| contentUrl: new FormControl(null, []) | contentUrl: new FormControl(null, []) | ||||
| }); | }); | ||||
| export const mediaJsonhalMediaObjectReadForm = new FormGroup({ | |||||
| export const mediaObjectJsonhalMediaObjectReadForm = new FormGroup({ | |||||
| _links: new FormControl(null, []), | _links: new FormControl(null, []), | ||||
| contentUrl: new FormControl(null, []) | contentUrl: new FormControl(null, []) | ||||
| }); | }); | ||||
| export const mediaJsonldMediaObjectReadForm = new FormGroup({ | |||||
| export const mediaObjectJsonldMediaObjectReadForm = new FormGroup({ | |||||
| contentUrl: new FormControl(null, []) | contentUrl: new FormControl(null, []) | ||||
| }); | }); | ||||
| @@ -42,6 +42,7 @@ import {MatAutocompleteModule} from "@angular/material/autocomplete"; | |||||
| import {MatFormFieldModule} from "@angular/material/form-field"; | import {MatFormFieldModule} from "@angular/material/form-field"; | ||||
| import {MatInputModule} from "@angular/material/input"; | import {MatInputModule} from "@angular/material/input"; | ||||
| import { NewTaskNoteComponent } from './tasks/new-task-note/new-task-note.component'; | import { NewTaskNoteComponent } from './tasks/new-task-note/new-task-note.component'; | ||||
| import { DocumentsDetailComponent } from './documents/documents-detail/documents-detail.component'; | |||||
| export function apiConfigFactory(): Configuration { | export function apiConfigFactory(): Configuration { | ||||
| const params: ConfigurationParameters = { | const params: ConfigurationParameters = { | ||||
| @@ -104,7 +105,8 @@ export function HttpLoaderFactory(http: HttpClient) { | |||||
| NewDocumentComponent, | NewDocumentComponent, | ||||
| NewProductComponent, | NewProductComponent, | ||||
| NewCommentComponent, | NewCommentComponent, | ||||
| NewTaskNoteComponent | |||||
| NewTaskNoteComponent, | |||||
| DocumentsDetailComponent | |||||
| ], | ], | ||||
| providers: [ | providers: [ | ||||
| {provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true}, | {provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true}, | ||||
| @@ -46,9 +46,9 @@ | |||||
| <input type="file" class="form-control" id="image" (change)="onFileSelected($event)" accept="image/*" /> | <input type="file" class="form-control" id="image" (change)="onFileSelected($event)" accept="image/*" /> | ||||
| </div> | </div> | ||||
| <div class="mb-3"> | |||||
| <div class="mb-3" *ngIf="contact.imageUrl !== undefined"> | |||||
| <div class="delete-image" (click)="onDeleteImage()"> | <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> | <p class="mb-0 ms-3">{{'system.delete-image' | translate}}</p> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| @@ -1,7 +1,7 @@ | |||||
| import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; | import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; | ||||
| import {FormGroup} from "@angular/forms"; | import {FormGroup} from "@angular/forms"; | ||||
| import {contactForm} from "@app/_forms/apiForms"; | 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 {Subscription} from "rxjs"; | ||||
| import {ModalStatus} from "@app/_helpers/modal.states"; | import {ModalStatus} from "@app/_helpers/modal.states"; | ||||
| import {FormGroupInitializer} from "@app/_helpers/formgroup.initializer"; | import {FormGroupInitializer} from "@app/_helpers/formgroup.initializer"; | ||||
| @@ -26,7 +26,7 @@ export class NewContactComponent implements OnInit { | |||||
| constructor( | constructor( | ||||
| private contactService: ContactService, | private contactService: ContactService, | ||||
| private mediaService: MediaService, | |||||
| private mediaObjectService: MediaObjectService, | |||||
| private translateService: TranslateService | private translateService: TranslateService | ||||
| ) { | ) { | ||||
| this.contactForm = contactForm; | this.contactForm = contactForm; | ||||
| @@ -43,7 +43,7 @@ export class NewContactComponent implements OnInit { | |||||
| // On submit form: Check if image is set | // On submit form: Check if image is set | ||||
| onSubmit() { | onSubmit() { | ||||
| if (this.selectedImage !== null) { | if (this.selectedImage !== null) { | ||||
| this.mediaSub = this.mediaService.mediasPost( | |||||
| this.mediaSub = this.mediaObjectService.mediaObjectsPost( | |||||
| this.selectedImage | this.selectedImage | ||||
| ).subscribe( | ).subscribe( | ||||
| data => { | data => { | ||||
| @@ -5,8 +5,9 @@ api/api.ts | |||||
| api/comment.service.ts | api/comment.service.ts | ||||
| api/contact.service.ts | api/contact.service.ts | ||||
| api/document.service.ts | api/document.service.ts | ||||
| api/documentObject.service.ts | |||||
| api/loginCheck.service.ts | api/loginCheck.service.ts | ||||
| api/media.service.ts | |||||
| api/mediaObject.service.ts | |||||
| api/partner.service.ts | api/partner.service.ts | ||||
| api/partnerFollow.service.ts | api/partnerFollow.service.ts | ||||
| api/post.service.ts | api/post.service.ts | ||||
| @@ -29,10 +30,12 @@ model/apiCommentsGetCollection200ResponseHydraSearchHydraMappingInner.ts | |||||
| model/apiCommentsGetCollection200ResponseHydraView.ts | model/apiCommentsGetCollection200ResponseHydraView.ts | ||||
| model/apiContactsGetCollection200Response.ts | model/apiContactsGetCollection200Response.ts | ||||
| model/apiContactsGetCollection200Response1.ts | model/apiContactsGetCollection200Response1.ts | ||||
| model/apiDocumentObjectsGetCollection200Response.ts | |||||
| model/apiDocumentObjectsGetCollection200Response1.ts | |||||
| model/apiDocumentsGetCollection200Response.ts | model/apiDocumentsGetCollection200Response.ts | ||||
| model/apiDocumentsGetCollection200Response1.ts | model/apiDocumentsGetCollection200Response1.ts | ||||
| model/apiMediasGetCollection200Response.ts | |||||
| model/apiMediasGetCollection200Response1.ts | |||||
| model/apiMediaObjectsGetCollection200Response.ts | |||||
| model/apiMediaObjectsGetCollection200Response1.ts | |||||
| model/apiPartnerFollowsGetCollection200Response.ts | model/apiPartnerFollowsGetCollection200Response.ts | ||||
| model/apiPartnerFollowsGetCollection200Response1.ts | model/apiPartnerFollowsGetCollection200Response1.ts | ||||
| model/apiPartnersGetCollection200Response.ts | model/apiPartnersGetCollection200Response.ts | ||||
| @@ -60,14 +63,17 @@ model/commentJsonldContextOneOf.ts | |||||
| model/contact.ts | model/contact.ts | ||||
| model/contactJsonhal.ts | model/contactJsonhal.ts | ||||
| model/contactJsonld.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/loginCheckPost200Response.ts | ||||
| model/loginCheckPostRequest.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/models.ts | ||||
| model/partner.ts | model/partner.ts | ||||
| model/partnerFollow.ts | model/partnerFollow.ts | ||||
| @@ -4,10 +4,12 @@ export * from './contact.service'; | |||||
| import { ContactService } from './contact.service'; | import { ContactService } from './contact.service'; | ||||
| export * from './document.service'; | export * from './document.service'; | ||||
| import { DocumentService } from './document.service'; | import { DocumentService } from './document.service'; | ||||
| export * from './documentObject.service'; | |||||
| import { DocumentObjectService } from './documentObject.service'; | |||||
| export * from './loginCheck.service'; | export * from './loginCheck.service'; | ||||
| import { LoginCheckService } 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'; | export * from './partner.service'; | ||||
| import { PartnerService } from './partner.service'; | import { PartnerService } from './partner.service'; | ||||
| export * from './partnerFollow.service'; | export * from './partnerFollow.service'; | ||||
| @@ -26,4 +28,4 @@ export * from './taskNote.service'; | |||||
| import { TaskNoteService } from './taskNote.service'; | import { TaskNoteService } from './taskNote.service'; | ||||
| export * from './user.service'; | export * from './user.service'; | ||||
| import { UserService } from './user.service'; | import { UserService } from './user.service'; | ||||
| export const APIS = [CommentService, ContactService, 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]; | |||||
| @@ -23,11 +23,11 @@ import { ApiDocumentsGetCollection200Response } from '../model/apiDocumentsGetCo | |||||
| // @ts-ignore | // @ts-ignore | ||||
| import { ApiDocumentsGetCollection200Response1 } from '../model/apiDocumentsGetCollection200Response1'; | import { ApiDocumentsGetCollection200Response1 } from '../model/apiDocumentsGetCollection200Response1'; | ||||
| // @ts-ignore | // @ts-ignore | ||||
| import { DocumentDocumentObjectRead } from '../model/documentDocumentObjectRead'; | |||||
| import { Document } from '../model/document'; | |||||
| // @ts-ignore | // @ts-ignore | ||||
| import { DocumentJsonhalDocumentObjectRead } from '../model/documentJsonhalDocumentObjectRead'; | |||||
| import { DocumentJsonhal } from '../model/documentJsonhal'; | |||||
| // @ts-ignore | // @ts-ignore | ||||
| import { DocumentJsonldDocumentObjectRead } from '../model/documentJsonldDocumentObjectRead'; | |||||
| import { DocumentJsonld } from '../model/documentJsonld'; | |||||
| // @ts-ignore | // @ts-ignore | ||||
| import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; | import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; | ||||
| @@ -62,19 +62,6 @@ export class DocumentService { | |||||
| this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); | 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 | // @ts-ignore | ||||
| private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { | private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { | ||||
| @@ -223,7 +210,7 @@ export class DocumentService { | |||||
| /** | /** | ||||
| * Removes the Document resource. | * Removes the Document resource. | ||||
| * 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 observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| @@ -294,13 +281,13 @@ export class DocumentService { | |||||
| /** | /** | ||||
| * Retrieves a Document resource. | * Retrieves a Document resource. | ||||
| * 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 observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| 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> { | 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) { | if (id === null || id === undefined) { | ||||
| throw new Error('Required parameter id was null or undefined when calling documentsIdGet.'); | 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})}`; | 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, | context: localVarHttpContext, | ||||
| responseType: <any>responseType_, | 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 observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| 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; | let localVarHeaders = this.defaultHeaders; | ||||
| @@ -414,33 +406,102 @@ export class DocumentService { | |||||
| localVarTransferCache = true; | localVarTransferCache = true; | ||||
| } | } | ||||
| // to determine the Content-Type header | // to determine the Content-Type header | ||||
| const consumes: string[] = [ | 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'; | let responseType_: 'text' | 'json' | 'blob' = 'json'; | ||||
| @@ -455,10 +516,10 @@ export class DocumentService { | |||||
| } | } | ||||
| let localVarPath = `/api/documents`; | 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, | context: localVarHttpContext, | ||||
| body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, | |||||
| body: documentJsonld, | |||||
| responseType: <any>responseType_, | responseType: <any>responseType_, | ||||
| withCredentials: this.configuration.withCredentials, | withCredentials: this.configuration.withCredentials, | ||||
| headers: localVarHeaders, | headers: localVarHeaders, | ||||
| @@ -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 | |||||
| } | |||||
| ); | |||||
| } | |||||
| } | |||||
| @@ -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 | |||||
| } | |||||
| ); | |||||
| } | |||||
| } | |||||
| @@ -106,16 +106,17 @@ export class PartnerService { | |||||
| * @param itemsPerPage The number of items per page | * @param itemsPerPage The number of items per page | ||||
| * @param type | * @param type | ||||
| * @param type2 | * @param type2 | ||||
| * @param name | |||||
| * @param orderName | * @param orderName | ||||
| * @param orderCity | * @param orderCity | ||||
| * @param orderWebsite | * @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 observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| 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}); | let localVarQueryParameters = new HttpParams({encoder: this.encoder}); | ||||
| if (page !== undefined && page !== null) { | if (page !== undefined && page !== null) { | ||||
| @@ -136,6 +137,10 @@ export class PartnerService { | |||||
| <any>element, 'type[]'); | <any>element, 'type[]'); | ||||
| }) | }) | ||||
| } | } | ||||
| if (name !== undefined && name !== null) { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | |||||
| <any>name, 'name'); | |||||
| } | |||||
| if (orderName !== undefined && orderName !== null) { | if (orderName !== undefined && orderName !== null) { | ||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | ||||
| <any>orderName, 'order[name]'); | <any>orderName, 'order[name]'); | ||||
| @@ -106,13 +106,15 @@ export class PartnerFollowService { | |||||
| * @param itemsPerPage The number of items per page | * @param itemsPerPage The number of items per page | ||||
| * @param partner | * @param partner | ||||
| * @param partner2 | * @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 observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| 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}); | let localVarQueryParameters = new HttpParams({encoder: this.encoder}); | ||||
| if (page !== undefined && page !== null) { | if (page !== undefined && page !== null) { | ||||
| @@ -133,6 +135,16 @@ export class PartnerFollowService { | |||||
| <any>element, 'partner[]'); | <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; | let localVarHeaders = this.defaultHeaders; | ||||
| @@ -104,14 +104,15 @@ export class ProductService { | |||||
| * Retrieves the collection of Product resources. | * Retrieves the collection of Product resources. | ||||
| * @param page The collection page number | * @param page The collection page number | ||||
| * @param itemsPerPage The number of items per page | * @param itemsPerPage The number of items per page | ||||
| * @param name | |||||
| * @param orderName | * @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 observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| 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}); | let localVarQueryParameters = new HttpParams({encoder: this.encoder}); | ||||
| if (page !== undefined && page !== null) { | if (page !== undefined && page !== null) { | ||||
| @@ -122,6 +123,10 @@ export class ProductService { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | ||||
| <any>itemsPerPage, 'itemsPerPage'); | <any>itemsPerPage, 'itemsPerPage'); | ||||
| } | } | ||||
| if (name !== undefined && name !== null) { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | |||||
| <any>name, 'name'); | |||||
| } | |||||
| if (orderName !== undefined && orderName !== null) { | if (orderName !== undefined && orderName !== null) { | ||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | ||||
| <any>orderName, 'order[name]'); | <any>orderName, 'order[name]'); | ||||
| @@ -104,6 +104,8 @@ export class TaskService { | |||||
| * Retrieves the collection of Task resources. | * Retrieves the collection of Task resources. | ||||
| * @param page The collection page number | * @param page The collection page number | ||||
| * @param itemsPerPage The number of items per page | * @param itemsPerPage The number of items per page | ||||
| * @param assignedTo | |||||
| * @param assignedTo2 | |||||
| * @param partner | * @param partner | ||||
| * @param partner2 | * @param partner2 | ||||
| * @param contact | * @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 observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| 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}); | let localVarQueryParameters = new HttpParams({encoder: this.encoder}); | ||||
| if (page !== undefined && page !== null) { | if (page !== undefined && page !== null) { | ||||
| @@ -125,6 +127,16 @@ export class TaskService { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | ||||
| <any>itemsPerPage, 'itemsPerPage'); | <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) { | if (partner !== undefined && partner !== null) { | ||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | ||||
| <any>partner, 'partner'); | <any>partner, 'partner'); | ||||
| @@ -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; | |||||
| } | |||||
| @@ -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; | |||||
| } | |||||
| @@ -9,13 +9,13 @@ | |||||
| * https://openapi-generator.tech | * https://openapi-generator.tech | ||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { DocumentJsonld } from './documentJsonld'; | |||||
| import { ApiCommentsGetCollection200ResponseHydraSearch } from './apiCommentsGetCollection200ResponseHydraSearch'; | import { ApiCommentsGetCollection200ResponseHydraSearch } from './apiCommentsGetCollection200ResponseHydraSearch'; | ||||
| import { ApiCommentsGetCollection200ResponseHydraView } from './apiCommentsGetCollection200ResponseHydraView'; | import { ApiCommentsGetCollection200ResponseHydraView } from './apiCommentsGetCollection200ResponseHydraView'; | ||||
| import { DocumentJsonldDocumentObjectRead } from './documentJsonldDocumentObjectRead'; | |||||
| export interface ApiDocumentsGetCollection200Response { | export interface ApiDocumentsGetCollection200Response { | ||||
| 'hydra:member': Array<DocumentJsonldDocumentObjectRead>; | |||||
| 'hydra:member': Array<DocumentJsonld>; | |||||
| 'hydra:totalItems'?: number; | 'hydra:totalItems'?: number; | ||||
| 'hydra:view'?: ApiCommentsGetCollection200ResponseHydraView; | 'hydra:view'?: ApiCommentsGetCollection200ResponseHydraView; | ||||
| 'hydra:search'?: ApiCommentsGetCollection200ResponseHydraSearch; | 'hydra:search'?: ApiCommentsGetCollection200ResponseHydraSearch; | ||||
| @@ -9,12 +9,12 @@ | |||||
| * https://openapi-generator.tech | * https://openapi-generator.tech | ||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { DocumentJsonhalDocumentObjectRead } from './documentJsonhalDocumentObjectRead'; | |||||
| import { DocumentJsonhal } from './documentJsonhal'; | |||||
| import { ApiCommentsGetCollection200Response1Links } from './apiCommentsGetCollection200Response1Links'; | import { ApiCommentsGetCollection200Response1Links } from './apiCommentsGetCollection200Response1Links'; | ||||
| export interface ApiDocumentsGetCollection200Response1 { | export interface ApiDocumentsGetCollection200Response1 { | ||||
| _embedded: Array<DocumentJsonhalDocumentObjectRead>; | |||||
| _embedded: Array<DocumentJsonhal>; | |||||
| totalItems?: number; | totalItems?: number; | ||||
| itemsPerPage?: number; | itemsPerPage?: number; | ||||
| _links: ApiCommentsGetCollection200Response1Links; | _links: ApiCommentsGetCollection200Response1Links; | ||||
| @@ -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; | |||||
| } | |||||
| @@ -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; | |||||
| } | |||||
| @@ -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; | |||||
| } | |||||
| @@ -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; | |||||
| } | |||||
| @@ -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; | |||||
| } | |||||
| @@ -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; | |||||
| } | |||||
| @@ -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; | |||||
| } | |||||
| @@ -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; | |||||
| } | |||||
| @@ -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; | |||||
| } | |||||
| @@ -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; | |||||
| } | |||||
| @@ -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; | |||||
| } | |||||
| @@ -7,10 +7,12 @@ export * from './apiCommentsGetCollection200ResponseHydraSearchHydraMappingInner | |||||
| export * from './apiCommentsGetCollection200ResponseHydraView'; | export * from './apiCommentsGetCollection200ResponseHydraView'; | ||||
| export * from './apiContactsGetCollection200Response'; | export * from './apiContactsGetCollection200Response'; | ||||
| export * from './apiContactsGetCollection200Response1'; | export * from './apiContactsGetCollection200Response1'; | ||||
| export * from './apiDocumentObjectsGetCollection200Response'; | |||||
| export * from './apiDocumentObjectsGetCollection200Response1'; | |||||
| export * from './apiDocumentsGetCollection200Response'; | export * from './apiDocumentsGetCollection200Response'; | ||||
| export * from './apiDocumentsGetCollection200Response1'; | export * from './apiDocumentsGetCollection200Response1'; | ||||
| export * from './apiMediasGetCollection200Response'; | |||||
| export * from './apiMediasGetCollection200Response1'; | |||||
| export * from './apiMediaObjectsGetCollection200Response'; | |||||
| export * from './apiMediaObjectsGetCollection200Response1'; | |||||
| export * from './apiPartnerFollowsGetCollection200Response'; | export * from './apiPartnerFollowsGetCollection200Response'; | ||||
| export * from './apiPartnerFollowsGetCollection200Response1'; | export * from './apiPartnerFollowsGetCollection200Response1'; | ||||
| export * from './apiPartnersGetCollection200Response'; | export * from './apiPartnersGetCollection200Response'; | ||||
| @@ -38,14 +40,17 @@ export * from './commentJsonldContextOneOf'; | |||||
| export * from './contact'; | export * from './contact'; | ||||
| export * from './contactJsonhal'; | export * from './contactJsonhal'; | ||||
| export * from './contactJsonld'; | 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 './loginCheckPost200Response'; | ||||
| export * from './loginCheckPostRequest'; | 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 './partner'; | ||||
| export * from './partnerFollow'; | export * from './partnerFollow'; | ||||
| export * from './partnerFollowJsonhal'; | export * from './partnerFollowJsonhal'; | ||||
| @@ -0,0 +1 @@ | |||||
| <p>documents-detail works!</p> | |||||
| @@ -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(); | |||||
| }); | |||||
| }); | |||||
| @@ -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 { | |||||
| } | |||||
| @@ -1,7 +1,7 @@ | |||||
| <div class="spt-container"> | <div class="spt-container"> | ||||
| <div class="d-flex justify-content-between align-items-start"> | <div class="d-flex justify-content-between align-items-start"> | ||||
| <h2>{{ 'basic.documents' | translate }}</h2> | <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> | </div> | ||||
| <table mat-table [dataSource]="documentsDataSource" matSort (matSortChange)="onSortChange($event)" | <table mat-table [dataSource]="documentsDataSource" matSort (matSortChange)="onSortChange($event)" | ||||
| class="mat-elevation-z8 mb-3"> | class="mat-elevation-z8 mb-3"> | ||||
| @@ -16,26 +16,71 @@ | |||||
| </ng-container> | </ng-container> | ||||
| <ng-container matColumnDef="name"> | <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 }} | {{ 'overview.document' | translate }} | ||||
| </th> | </th> | ||||
| <td mat-cell *matCellDef="let element"><span (click)="navigateToDocumentFile(element)">{{ element.name }}</span> | |||||
| <td mat-cell *matCellDef="let element">{{ element.name }} | |||||
| </td> | </td> | ||||
| </ng-container> | </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> | </th> | ||||
| <td mat-cell *matCellDef="let element">{{ element.storage }} | |||||
| <td mat-cell *matCellDef="let element">{{ element.partnerName }} | |||||
| </td> | </td> | ||||
| </ng-container> | </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 }} | {{ 'overview.uploaded' | translate }} | ||||
| </th> | </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> | </td> | ||||
| </ng-container> | </ng-container> | ||||
| @@ -2,22 +2,23 @@ import {ChangeDetectorRef, Component, ViewChild} from '@angular/core'; | |||||
| import {MatSort, MatSortModule, Sort} from "@angular/material/sort"; | import {MatSort, MatSortModule, Sort} from "@angular/material/sort"; | ||||
| import {MatPaginator, MatPaginatorIntl, MatPaginatorModule, PageEvent} from "@angular/material/paginator"; | import {MatPaginator, MatPaginatorIntl, MatPaginatorModule, PageEvent} from "@angular/material/paginator"; | ||||
| import {Subscription} from "rxjs"; | 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 {Router, RouterLink, RouterLinkActive} from "@angular/router"; | ||||
| import {MatTableDataSource, MatTableModule} from "@angular/material/table"; | import {MatTableDataSource, MatTableModule} from "@angular/material/table"; | ||||
| import {OrderFilter} from "@app/_models/orderFilter"; | 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 {NgbModal, NgbModalOptions} from "@ng-bootstrap/ng-bootstrap"; | ||||
| import {NewDocumentComponent} from "@app/documents/new-document/new-document.component"; | import {NewDocumentComponent} from "@app/documents/new-document/new-document.component"; | ||||
| import {TranslateModule} from "@ngx-translate/core"; | import {TranslateModule} from "@ngx-translate/core"; | ||||
| import {ModalStatus} from "@app/_helpers/modal.states"; | import {ModalStatus} from "@app/_helpers/modal.states"; | ||||
| import {NewCommentComponent} from "@app/postings/new-comment/new-comment.component"; | |||||
| @Component({ | @Component({ | ||||
| selector: 'app-documents', | selector: 'app-documents', | ||||
| templateUrl: './documents.component.html', | templateUrl: './documents.component.html', | ||||
| styleUrl: './documents.component.scss', | styleUrl: './documents.component.scss', | ||||
| standalone: true, | standalone: true, | ||||
| imports: [MatTableModule, MatSortModule, MatPaginatorModule, RouterLink, RouterLinkActive, NgIf, TranslateModule], | |||||
| imports: [MatTableModule, MatSortModule, MatPaginatorModule, RouterLink, RouterLinkActive, NgIf, TranslateModule, DatePipe], | |||||
| }) | }) | ||||
| export class DocumentsComponent { | export class DocumentsComponent { | ||||
| @ViewChild(MatSort) sort; | @ViewChild(MatSort) sort; | ||||
| @@ -26,7 +27,7 @@ export class DocumentsComponent { | |||||
| protected displayedColumns: string[]; | protected displayedColumns: string[]; | ||||
| protected documentsSub: Subscription; | protected documentsSub: Subscription; | ||||
| protected documents: Array<DocumentJsonldDocumentObjectRead>; | |||||
| protected documents: Array<DocumentJsonld>; | |||||
| protected documentsDataSource; | protected documentsDataSource; | ||||
| protected documentsLength: number; | protected documentsLength: number; | ||||
| protected documentsPageEvent: PageEvent; | protected documentsPageEvent: PageEvent; | ||||
| @@ -43,12 +44,12 @@ export class DocumentsComponent { | |||||
| private documentService: DocumentService | private documentService: DocumentService | ||||
| ) { | ) { | ||||
| this.sort = new MatSort(); | 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.documentsSub = new Subscription(); | ||||
| this.documents = []; | this.documents = []; | ||||
| this.documentsPaginator = new MatPaginator(new MatPaginatorIntl(), ChangeDetectorRef.prototype); | 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.documentsLength = 0; | ||||
| this.documentsPageEvent = new PageEvent(); | this.documentsPageEvent = new PageEvent(); | ||||
| this.documentsPageSize = 10; | this.documentsPageSize = 10; | ||||
| @@ -71,7 +72,8 @@ export class DocumentsComponent { | |||||
| ).subscribe( | ).subscribe( | ||||
| data => { | data => { | ||||
| this.documents = data["hydra:member"]; | 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.documentsLength = Number(data["hydra:totalItems"]); | ||||
| this.documentsPaginator.length = this.documentsLength; | this.documentsPaginator.length = this.documentsLength; | ||||
| } | } | ||||
| @@ -115,18 +117,13 @@ export class DocumentsComponent { | |||||
| this.getDocumentsData(); | 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() { | openModalNewDocument() { | ||||
| const modalRefDocument = this.modalService.open(NewDocumentComponent, this.modalOptions); | 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.document = document; | ||||
| modalRefDocument.componentInstance.submit.subscribe((modalStatus: ModalStatus) => { | modalRefDocument.componentInstance.submit.subscribe((modalStatus: ModalStatus) => { | ||||
| if (modalStatus === ModalStatus.Submitted) { | 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(); | |||||
| } | |||||
| }); | |||||
| } | |||||
| } | } | ||||
| @@ -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"> | <div class="spt-form"> | ||||
| <form [formGroup]="documentForm" (ngSubmit)="onSubmit()"> | <form [formGroup]="documentForm" (ngSubmit)="onSubmit()"> | ||||
| <div class="mb-3"> | <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> | </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> | </form> | ||||
| </div> | </div> | ||||
| @@ -1,18 +1,16 @@ | |||||
| import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; | import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; | ||||
| import { | import { | ||||
| DocumentJsonldDocumentObjectRead, | |||||
| DocumentService, | |||||
| MediaService, | |||||
| ProductJsonld, | |||||
| ProductService | |||||
| DocumentJsonld, DocumentObjectService, | |||||
| DocumentService, MediaObjectService, PartnerJsonld, PartnerService, ProductService | |||||
| } from "@app/core/api/v1"; | } from "@app/core/api/v1"; | ||||
| import {ModalStatus} from "@app/_helpers/modal.states"; | import {ModalStatus} from "@app/_helpers/modal.states"; | ||||
| import {FormGroup} from "@angular/forms"; | import {FormGroup} from "@angular/forms"; | ||||
| import {Subscription} from "rxjs"; | |||||
| import {debounceTime, distinctUntilChanged, Observable, OperatorFunction, Subscription, switchMap} from "rxjs"; | |||||
| import {TranslateService} from "@ngx-translate/core"; | import {TranslateService} from "@ngx-translate/core"; | ||||
| import {FormGroupInitializer} from "@app/_helpers/formgroup.initializer"; | import {FormGroupInitializer} from "@app/_helpers/formgroup.initializer"; | ||||
| import {documentForm} from "@app/_forms/apiForms"; | |||||
| import {ApiConverter} from "@app/_helpers/api.converter"; | import {ApiConverter} from "@app/_helpers/api.converter"; | ||||
| import {documentDocumentObjectReadForm} from "@app/_forms/apiForms"; | |||||
| import {filter, map} from "rxjs/operators"; | |||||
| @Component({ | @Component({ | ||||
| selector: 'app-new-document', | selector: 'app-new-document', | ||||
| @@ -20,51 +18,137 @@ import {documentDocumentObjectReadForm} from "@app/_forms/apiForms"; | |||||
| styleUrl: './new-document.component.scss' | styleUrl: './new-document.component.scss' | ||||
| }) | }) | ||||
| export class NewDocumentComponent implements OnInit { | export class NewDocumentComponent implements OnInit { | ||||
| @Input() public document!: DocumentJsonldDocumentObjectRead; | |||||
| @Input() public document!: DocumentJsonld; | |||||
| @Output() public submit: EventEmitter<ModalStatus> = new EventEmitter<ModalStatus>(); | @Output() public submit: EventEmitter<ModalStatus> = new EventEmitter<ModalStatus>(); | ||||
| protected documentForm: FormGroup; | protected documentForm: FormGroup; | ||||
| protected documentSub: Subscription; | protected documentSub: Subscription; | ||||
| protected selectedImage: File | null; | |||||
| protected selectedFile: File | null; | |||||
| protected mediaSub: Subscription; | 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( | constructor( | ||||
| private documentService: DocumentService, | 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.documentSub = new Subscription(); | ||||
| this.selectedImage = null; | |||||
| this.selectedFile = null; | |||||
| this.mediaSub = new Subscription(); | this.mediaSub = new Subscription(); | ||||
| } | } | ||||
| ngOnInit(): void { | ngOnInit(): void { | ||||
| this.documentForm = FormGroupInitializer.initFormGroup(this.documentForm, this.document); | 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() { | 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) { | onFileSelected(event: any) { | ||||
| console.log(this.documentForm); | |||||
| const file: File = event.target.files[0]; | const file: File = event.target.files[0]; | ||||
| if (file) { | 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}); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -120,4 +120,74 @@ | |||||
| </mat-paginator> | </mat-paginator> | ||||
| </div> | </div> | ||||
| </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> | </div> | ||||
| @@ -107,8 +107,6 @@ export class HomeComponent implements OnInit, AfterViewInit { | |||||
| this.tasksSub = this.taskService.tasksGetCollection( | this.tasksSub = this.taskService.tasksGetCollection( | ||||
| this.tasksPageIndex + 1, | this.tasksPageIndex + 1, | ||||
| this.tasksPageSize, | this.tasksPageSize, | ||||
| "", | |||||
| [], | |||||
| this.user?.id | this.user?.id | ||||
| ).subscribe( | ).subscribe( | ||||
| data => { | data => { | ||||
| @@ -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"> | <div class="spt-form"> | ||||
| <form [formGroup]="partnerForm" (ngSubmit)="onSubmit()"> | <form [formGroup]="partnerForm" (ngSubmit)="onSubmit()"> | ||||
| <div class="mb-3"> | <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"> | <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> | </div> | ||||
| <div class="mb-3"> | <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> | ||||
| <div class="mb-3"> | <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> | ||||
| <div class="mb-3"> | <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> | ||||
| <div class="mb-3"> | <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> | ||||
| <div class="mb-3"> | <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> | ||||
| <div class="mb-3"> | <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> | ||||
| <div class="mb-3"> | <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> | ||||
| <div class="mb-3"> | |||||
| <div class="mb-3" *ngIf="partner.logoUrl !== undefined"> | |||||
| <div class="delete-image" (click)="onDeleteImage()"> | <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> | ||||
| </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> | </form> | ||||
| </div> | </div> | ||||
| @@ -1,6 +1,6 @@ | |||||
| import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; | import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; | ||||
| import {partnerForm} from "@app/_forms/apiForms"; | 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 {ModalStatus} from "@app/_helpers/modal.states"; | ||||
| import {FormGroup} from "@angular/forms"; | import {FormGroup} from "@angular/forms"; | ||||
| import {Subscription} from "rxjs"; | import {Subscription} from "rxjs"; | ||||
| @@ -18,15 +18,16 @@ export class NewPartnerComponent implements OnInit { | |||||
| @Output() public submit: EventEmitter<ModalStatus> = new EventEmitter<ModalStatus>(); | @Output() public submit: EventEmitter<ModalStatus> = new EventEmitter<ModalStatus>(); | ||||
| protected partnerForm: FormGroup; | protected partnerForm: FormGroup; | ||||
| protected selectedImage: File | null; | |||||
| protected partnerSub: Subscription; | protected partnerSub: Subscription; | ||||
| protected selectedImage: File | null; | |||||
| protected mediaSub: Subscription; | protected mediaSub: Subscription; | ||||
| protected partnerNameOne: string; | protected partnerNameOne: string; | ||||
| constructor( | constructor( | ||||
| private partnerService: PartnerService, | private partnerService: PartnerService, | ||||
| private mediaService: MediaService, | |||||
| private mediaObjectService: MediaObjectService, | |||||
| private translateService: TranslateService | private translateService: TranslateService | ||||
| ) { | ) { | ||||
| this.partnerForm = partnerForm; | this.partnerForm = partnerForm; | ||||
| @@ -40,7 +41,7 @@ export class NewPartnerComponent implements OnInit { | |||||
| ngOnInit(): void { | ngOnInit(): void { | ||||
| this.partnerForm = FormGroupInitializer.initFormGroup(this.partnerForm, this.partner); | 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; | this.partnerNameOne = translation; | ||||
| }); | }); | ||||
| } | } | ||||
| @@ -48,7 +49,7 @@ export class NewPartnerComponent implements OnInit { | |||||
| // On submit form: Check if image is set | // On submit form: Check if image is set | ||||
| onSubmit() { | onSubmit() { | ||||
| if (this.selectedImage !== null) { | if (this.selectedImage !== null) { | ||||
| this.mediaSub = this.mediaService.mediasPost( | |||||
| this.mediaSub = this.mediaObjectService.mediaObjectsPost( | |||||
| this.selectedImage | this.selectedImage | ||||
| ).subscribe( | ).subscribe( | ||||
| data => { | data => { | ||||
| @@ -31,9 +31,9 @@ | |||||
| height="94" alt="{{partner.name}}" title="{{partner.name}}"/> | height="94" alt="{{partner.name}}" title="{{partner.name}}"/> | ||||
| </div> | </div> | ||||
| <span class="position-absolute bi p-2" | <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" | data-type="user-tool" data-action="follow" | ||||
| (click)="followPartner($event)"></span> | (click)="followPartner($event)"></span> | ||||
| <span class="position-absolute bi bi-pencil p-2" data-type="user-tool" data-action="edit" | <span class="position-absolute bi bi-pencil p-2" data-type="user-tool" data-action="edit" | ||||
| @@ -36,7 +36,6 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { | |||||
| @ViewChild(MatPaginator) postsPaginator: MatPaginator; | @ViewChild(MatPaginator) postsPaginator: MatPaginator; | ||||
| protected user: User | null; | protected user: User | null; | ||||
| protected userFollows: boolean; | |||||
| protected readonly ApiConverter = ApiConverter; | protected readonly ApiConverter = ApiConverter; | ||||
| protected readonly environment = environment; | protected readonly environment = environment; | ||||
| @@ -46,7 +45,7 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { | |||||
| protected partner: PartnerJsonld; | protected partner: PartnerJsonld; | ||||
| protected partnerFollowSub: Subscription; | protected partnerFollowSub: Subscription; | ||||
| protected partnerFollow: PartnerFollowJsonld | |||||
| protected partnerFollow: PartnerFollowJsonld | null; | |||||
| protected contactsSub: Subscription; | protected contactsSub: Subscription; | ||||
| protected contacts: Array<ContactJsonld>; | protected contacts: Array<ContactJsonld>; | ||||
| @@ -90,12 +89,11 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { | |||||
| private taskService: TaskService | private taskService: TaskService | ||||
| ) { | ) { | ||||
| this.id = ""; | this.id = ""; | ||||
| this.userFollows = false; | |||||
| this.partnerDetailSub = new Subscription(); | this.partnerDetailSub = new Subscription(); | ||||
| this.partner = {} as PartnerJsonld; | this.partner = {} as PartnerJsonld; | ||||
| this.partnerFollowSub = new Subscription(); | this.partnerFollowSub = new Subscription(); | ||||
| this.partnerFollow = {} as PartnerFollowJsonld; | |||||
| this.partnerFollow = null; | |||||
| this.user = this.accountService.userValue; | this.user = this.accountService.userValue; | ||||
| @@ -188,7 +186,8 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { | |||||
| this.tasksSub = this.taskService.tasksGetCollection( | this.tasksSub = this.taskService.tasksGetCollection( | ||||
| this.tasksPageIndex + 1, | this.tasksPageIndex + 1, | ||||
| this.tasksPageSize, | 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 | this.id | ||||
| ).subscribe( | ).subscribe( | ||||
| data => { | data => { | ||||
| @@ -366,45 +365,41 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { | |||||
| this.partnerFollowSub = this.partnerFollowService.partnerFollowsGetCollection( | this.partnerFollowSub = this.partnerFollowService.partnerFollowsGetCollection( | ||||
| 1, | 1, | ||||
| 50, | 50, | ||||
| this.id | |||||
| // TODO: Follow für Partner auf User holen | |||||
| this.id, | |||||
| undefined, | |||||
| this.user?.id | |||||
| ).subscribe( | ).subscribe( | ||||
| data => { | 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) { | followPartner(event: any) { | ||||
| if (!this.userFollows) { | |||||
| if (this.partnerFollow === null) { | |||||
| this.partnerFollowSub = this.partnerFollowService.partnerFollowsPost( | this.partnerFollowSub = this.partnerFollowService.partnerFollowsPost( | ||||
| { | { | ||||
| partner: this.partner.id | partner: this.partner.id | ||||
| } as PartnerFollowJsonld | } as PartnerFollowJsonld | ||||
| ).subscribe( | ).subscribe( | ||||
| data => { | data => { | ||||
| console.log(data); | |||||
| this.userFollows = !this.userFollows; | |||||
| this.partnerFollow = data; | |||||
| console.log(this.partnerFollow); | |||||
| } | } | ||||
| ); | ); | ||||
| } else { | } 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,7 +5,7 @@ | |||||
| (click)="openModalNewPartner()">{{ 'basic.new' | translate }} {{ partnerNameOne }} | (click)="openModalNewPartner()">{{ 'basic.new' | translate }} {{ partnerNameOne }} | ||||
| </button> | </button> | ||||
| </div> | </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"> | class="mat-elevation-z8 mb-3"> | ||||
| <ng-container matColumnDef="pos"> | <ng-container matColumnDef="pos"> | ||||
| @@ -13,7 +13,7 @@ | |||||
| {{ 'overview.number' | translate }} | {{ 'overview.number' | translate }} | ||||
| </th> | </th> | ||||
| <td mat-cell | <td mat-cell | ||||
| *matCellDef="let element">{{ (pageSize * pageIndex) + dataSource.filteredData.indexOf(element) + 1 }} | |||||
| *matCellDef="let element">{{ (partnersPageSize * partnersPageIndex) + partnersDataSource.filteredData.indexOf(element) + 1 }} | |||||
| </td> | </td> | ||||
| </ng-container> | </ng-container> | ||||
| @@ -63,10 +63,10 @@ | |||||
| </table> | </table> | ||||
| <mat-paginator class="rounded-1" | <mat-paginator class="rounded-1" | ||||
| [pageSizeOptions]="[10,25,50]" | [pageSizeOptions]="[10,25,50]" | ||||
| [length]="length" | |||||
| [length]="partnersLength" | |||||
| (page)="handlePageEvent($event)" | (page)="handlePageEvent($event)" | ||||
| [pageSize]="pageSize" | |||||
| [pageIndex]="pageIndex" | |||||
| [pageSize]="partnersPageSize" | |||||
| [pageIndex]="partnersPageIndex" | |||||
| showFirstLastButtons> | showFirstLastButtons> | ||||
| </mat-paginator> | </mat-paginator> | ||||
| </div> | </div> | ||||
| @@ -22,8 +22,8 @@ import TypeEnum = PartnerJsonld.PartnerTypeEnum; | |||||
| imports: [MatTableModule, MatSortModule, MatPaginatorModule, RouterLink, RouterLinkActive, NgIf, TranslateModule], | imports: [MatTableModule, MatSortModule, MatPaginatorModule, RouterLink, RouterLinkActive, NgIf, TranslateModule], | ||||
| }) | }) | ||||
| export class PartnersComponent implements OnInit, AfterViewInit { | export class PartnersComponent implements OnInit, AfterViewInit { | ||||
| @ViewChild(MatSort) sort; | |||||
| @ViewChild(MatPaginator) paginator: MatPaginator; | |||||
| @ViewChild(MatSort) partnersSort; | |||||
| @ViewChild(MatPaginator) partnersPaginator: MatPaginator; | |||||
| protected partnersSub: Subscription; | protected partnersSub: Subscription; | ||||
| protected partners: Array<PartnerJsonld>; | protected partners: Array<PartnerJsonld>; | ||||
| @@ -37,11 +37,11 @@ export class PartnersComponent implements OnInit, AfterViewInit { | |||||
| protected partnerNameOne: string; | protected partnerNameOne: string; | ||||
| protected displayedColumns: 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 = { | protected modalOptions: NgbModalOptions = { | ||||
| centered: true | centered: true | ||||
| @@ -54,8 +54,8 @@ export class PartnersComponent implements OnInit, AfterViewInit { | |||||
| private modalService: NgbModal, | private modalService: NgbModal, | ||||
| private translateService: TranslateService | 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.partnersSub = new Subscription(); | ||||
| this.partners = []; | this.partners = []; | ||||
| @@ -65,11 +65,11 @@ export class PartnersComponent implements OnInit, AfterViewInit { | |||||
| this.cityOrderAsc = OrderFilter.Asc; | this.cityOrderAsc = OrderFilter.Asc; | ||||
| this.websiteOrderAsc = 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.partnerName = ""; | ||||
| this.partnerNameOne = ""; | this.partnerNameOne = ""; | ||||
| @@ -88,25 +88,26 @@ export class PartnersComponent implements OnInit, AfterViewInit { | |||||
| } | } | ||||
| ngAfterViewInit() { | ngAfterViewInit() { | ||||
| this.dataSource.sort = this.sort; | |||||
| this.dataSource.paginator = this.paginator; | |||||
| this.partnersDataSource.sort = this.partnersSort; | |||||
| this.partnersDataSource.paginator = this.partnersPaginator; | |||||
| } | } | ||||
| getPartnersData() { | getPartnersData() { | ||||
| this.partnersSub = this.partnerService.partnersGetCollection( | this.partnersSub = this.partnerService.partnersGetCollection( | ||||
| this.pageIndex + 1, | |||||
| this.pageSize, | |||||
| this.partnersPageIndex + 1, | |||||
| this.partnersPageSize, | |||||
| this.dataType, | this.dataType, | ||||
| undefined, | undefined, | ||||
| undefined, | |||||
| this.nameOrderAsc, | this.nameOrderAsc, | ||||
| this.cityOrderAsc, | this.cityOrderAsc, | ||||
| this.websiteOrderAsc | this.websiteOrderAsc | ||||
| ).subscribe( | ).subscribe( | ||||
| data => { | data => { | ||||
| this.partners = data["hydra:member"]; | 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.) | // 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. */ | /** Announce the change in sort state for assistive technology. */ | ||||
| onSortChange(sortState: Sort) { | onSortChange(sortState: Sort) { | ||||
| // Reset page index to first page | // Reset page index to first page | ||||
| this.pageIndex = 0; | |||||
| this.partnersPageIndex = 0; | |||||
| let order: OrderFilter; | let order: OrderFilter; | ||||
| if (sortState.direction === "") { | if (sortState.direction === "") { | ||||
| @@ -142,10 +143,10 @@ export class PartnersComponent implements OnInit, AfterViewInit { | |||||
| } | } | ||||
| handlePageEvent(e: PageEvent) { | 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(); | this.getPartnersData(); | ||||
| } | } | ||||
| @@ -23,9 +23,9 @@ | |||||
| <input type="file" class="form-control" id="image" (change)="onFileSelected($event)" accept="image/*" /> | <input type="file" class="form-control" id="image" (change)="onFileSelected($event)" accept="image/*" /> | ||||
| </div> | </div> | ||||
| <div class="mb-3"> | |||||
| <div class="mb-3" *ngIf="product.imageUrl !== undefined"> | |||||
| <div class="delete-image" (click)="onDeleteImage()"> | <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> | <p class="mb-0 ms-3">{{'system.delete-image' | translate}}</p> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| @@ -1,5 +1,5 @@ | |||||
| import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; | 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 {ModalStatus} from "@app/_helpers/modal.states"; | ||||
| import {FormGroup} from "@angular/forms"; | import {FormGroup} from "@angular/forms"; | ||||
| import {Subscription} from "rxjs"; | import {Subscription} from "rxjs"; | ||||
| @@ -25,7 +25,7 @@ export class NewProductComponent implements OnInit { | |||||
| constructor( | constructor( | ||||
| private productService: ProductService, | private productService: ProductService, | ||||
| private mediaService: MediaService, | |||||
| private mediaObjectService: MediaObjectService, | |||||
| private translateService: TranslateService | private translateService: TranslateService | ||||
| ) { | ) { | ||||
| this.productForm = productForm; | this.productForm = productForm; | ||||
| @@ -41,7 +41,7 @@ export class NewProductComponent implements OnInit { | |||||
| onSubmit() { | onSubmit() { | ||||
| if (this.selectedImage !== null) { | if (this.selectedImage !== null) { | ||||
| this.mediaSub = this.mediaService.mediasPost( | |||||
| this.mediaSub = this.mediaObjectService.mediaObjectsPost( | |||||
| this.selectedImage | this.selectedImage | ||||
| ).subscribe( | ).subscribe( | ||||
| data => { | data => { | ||||
| @@ -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"> | <div class="spt-form"> | ||||
| <form [formGroup]="taskNoteForm" (ngSubmit)="onSubmit()"> | <form [formGroup]="taskNoteForm" (ngSubmit)="onSubmit()"> | ||||
| <div class="mb-3"> | <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"> | <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> | ||||
| </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> | </form> | ||||
| </div> | </div> | ||||
| @@ -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"> | <div class="spt-form"> | ||||
| <form [formGroup]="taskForm" (ngSubmit)="onSubmit()"> | <form [formGroup]="taskForm" (ngSubmit)="onSubmit()"> | ||||
| <div class="mb-3"> | <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"> | <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> | </div> | ||||
| <div class="mb-3"> | <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"> | <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> | </div> | ||||
| <div class="mb-3" *ngIf="task.partner == null"> | <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"> | <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> | <option value="/api/partners/101">CatalystX SAS</option> | ||||
| </select> | </select> | ||||
| <div class="form-text" *ngIf="taskForm.get('partner')?.invalid && taskForm.get('partner')?.touched"> | <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> | </div> | ||||
| <div class="mb-3"> | <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" | <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"> | <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> | </div> | ||||
| <div class="mb-3"> | <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"> | <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> | </div> | ||||
| <div class="mb-3"> | <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"> | <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> | </select> | ||||
| <div class="form-text" *ngIf="taskForm.get('prio')?.invalid && taskForm.get('prio')?.touched"> | <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> | ||||
| </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> | </form> | ||||
| </div> | </div> | ||||
| @@ -21,6 +21,17 @@ export class NewTaskComponent implements OnInit { | |||||
| protected taskSub: Subscription; | protected taskSub: Subscription; | ||||
| protected dueAtValue: string; | 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( | constructor( | ||||
| private taskService: TaskService, | private taskService: TaskService, | ||||
| private userService: UserService | private userService: UserService | ||||
| @@ -35,17 +46,6 @@ export class NewTaskComponent implements OnInit { | |||||
| this.taskForm = FormGroupInitializer.initFormGroup(this.taskForm, this.task); | 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 }[]> { | protected fetchUsers(term: string): Observable<{ id: any; name: any }[]> { | ||||
| return this.userService.usersGetCollection(1, 50, undefined, term).pipe( | return this.userService.usersGetCollection(1, 50, undefined, term).pipe( | ||||
| map((response) => response['hydra:member'].map(user => ({ id: user.id, name: user.firstName + ' ' + user.lastName }))), | map((response) => response['hydra:member'].map(user => ({ id: user.id, name: user.firstName + ' ' + user.lastName }))), | ||||
| @@ -2,7 +2,9 @@ | |||||
| "system": | "system": | ||||
| { | { | ||||
| "delete-image": "Bild löschen", | "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": | "basic": | ||||
| { | { | ||||
| @@ -61,7 +63,12 @@ | |||||
| "number-long": "Nummer", | "number-long": "Nummer", | ||||
| "document": "Dokument", | "document": "Dokument", | ||||
| "type": "Typ", | "type": "Typ", | ||||
| "uploaded": "Hochgeladen am" | |||||
| "uploaded": "Hochgeladen am", | |||||
| "description": "Beschreibung", | |||||
| "createdBy": "Erstellt von", | |||||
| "download": "Download", | |||||
| "partner": "Partner", | |||||
| "product": "Produkt" | |||||
| }, | }, | ||||
| "form": | "form": | ||||
| { | { | ||||
| @@ -92,6 +99,7 @@ | |||||
| "prio-medium": "mittel", | "prio-medium": "mittel", | ||||
| "prio-high": "hoch", | "prio-high": "hoch", | ||||
| "partner": "Partner", | "partner": "Partner", | ||||
| "product": "Produkt", | |||||
| "send": "Abschicken" | "send": "Abschicken" | ||||
| } | } | ||||
| } | } | ||||