Florian Eisenmenger пре 2 година
родитељ
комит
17eef87fde
6 измењених фајлова са 77 додато и 8 уклоњено
  1. +3
    -0
      README.md
  2. +41
    -0
      matsen-tool/openapi.yaml
  3. +0
    -1
      matsen-tool/src/app/core/api/v1/.openapi-generator/FILES
  4. +21
    -4
      matsen-tool/src/app/core/api/v1/api/partner.service.ts
  5. +5
    -0
      matsen-tool/src/app/partners/partners.component.html
  6. +7
    -3
      matsen-tool/src/app/partners/partners.component.ts

+ 3
- 0
README.md Прегледај датотеку

@@ -38,6 +38,9 @@
- Wenn es nicht geht: brew install java
- sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
- java -version)
- ACHTUNG: In Datei src/app/core/api/v1/model/partnerJsonId.ts diese zwei Zeilen löschen:
- readonly id?: string;
- readonly type?: string;

## Module anlegen
- cd app


+ 41
- 0
matsen-tool/openapi.yaml Прегледај датотеку

@@ -420,6 +420,47 @@ paths:
style: form
explode: false
allowReserved: false
-
name: 'order[name]'
in: query
description: ''
required: false
deprecated: false
allowEmptyValue: true
schema:
type: string
enum:
- asc
- desc
style: form
explode: false
allowReserved: false
-
name: type
in: query
description: ''
required: false
deprecated: false
allowEmptyValue: true
schema:
type: string
style: form
explode: false
allowReserved: false
-
name: 'type[]'
in: query
description: ''
required: false
deprecated: false
allowEmptyValue: true
schema:
type: array
items:
type: string
style: form
explode: true
allowReserved: false
deprecated: false
post:
operationId: api_partners_post


+ 0
- 1
matsen-tool/src/app/core/api/v1/.openapi-generator/FILES Прегледај датотеку

@@ -1,5 +1,4 @@
.gitignore
.openapi-generator-ignore
README.md
api.module.ts
api/api.ts


+ 21
- 4
matsen-tool/src/app/core/api/v1/api/partner.service.ts Прегледај датотеку

@@ -103,19 +103,36 @@ export class PartnerService {
* Retrieves the collection of Partner resources.
* Retrieves the collection of Partner resources.
* @param page The collection page number
* @param orderName
* @param type
* @param type2
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public partnersGetCollection(page?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable<ApiPartnersGetCollection200Response>;
public partnersGetCollection(page?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable<HttpResponse<ApiPartnersGetCollection200Response>>;
public partnersGetCollection(page?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable<HttpEvent<ApiPartnersGetCollection200Response>>;
public partnersGetCollection(page?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable<any> {
public partnersGetCollection(page?: number, orderName?: 'asc' | 'desc', type?: string, type2?: Array<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable<ApiPartnersGetCollection200Response>;
public partnersGetCollection(page?: number, orderName?: 'asc' | 'desc', type?: string, type2?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable<HttpResponse<ApiPartnersGetCollection200Response>>;
public partnersGetCollection(page?: number, orderName?: 'asc' | 'desc', type?: string, type2?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable<HttpEvent<ApiPartnersGetCollection200Response>>;
public partnersGetCollection(page?: number, orderName?: 'asc' | 'desc', type?: string, type2?: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable<any> {

let localVarQueryParameters = new HttpParams({encoder: this.encoder});
if (page !== undefined && page !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>page, 'page');
}
if (orderName !== undefined && orderName !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>orderName, 'order[name]');
}
if (type !== undefined && type !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>type, 'type');
}
if (type2) {
type2.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>element, 'type[]');
})
}

let localVarHeaders = this.defaultHeaders;



+ 5
- 0
matsen-tool/src/app/partners/partners.component.html Прегледај датотеку

@@ -35,3 +35,8 @@
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>

<mat-paginator [pageSizeOptions]="[5, 10, 20]"
showFirstLastButtons
aria-label="Select page of periodic elements">
</mat-paginator>

+ 7
- 3
matsen-tool/src/app/partners/partners.component.ts Прегледај датотеку

@@ -1,20 +1,22 @@
import {AfterViewInit, Component, OnInit, ViewChild} from '@angular/core';
import {AfterViewInit, ChangeDetectorRef, Component, OnInit, ViewChild} from '@angular/core';
import {MatSort, Sort, MatSortModule} from "@angular/material/sort";
import {LiveAnnouncer} from "@angular/cdk/a11y";
import {MatTableDataSource, MatTableModule} from "@angular/material/table";
import {ActivatedRoute, RouterLink, RouterLinkActive} from "@angular/router";
import {Subscription} from "rxjs";
import {PartnerJsonld, PartnerService} from "@app/core/api/v1";
import {MatPaginator, MatPaginatorIntl, MatPaginatorModule} from "@angular/material/paginator";

@Component({
selector: 'app-partners',
templateUrl: './partners.component.html',
styleUrl: './partners.component.scss',
standalone: true,
imports: [MatTableModule, MatSortModule, RouterLink, RouterLinkActive],
imports: [MatTableModule, MatSortModule, MatPaginatorModule, RouterLink, RouterLinkActive],
})
export class PartnersComponent implements OnInit, AfterViewInit {
@ViewChild(MatSort) sort;
@ViewChild(MatPaginator) paginator: MatPaginator;

protected partnersSub: Subscription;
protected partners: Array<PartnerJsonld> = [];
@@ -29,6 +31,7 @@ export class PartnersComponent implements OnInit, AfterViewInit {
private partnerService: PartnerService
) {
this.sort = new MatSort();
this.paginator = new MatPaginator(new MatPaginatorIntl(), ChangeDetectorRef.prototype);

this.partnersSub = new Subscription();
this.partners = [];
@@ -38,7 +41,7 @@ export class PartnersComponent implements OnInit, AfterViewInit {
this.dataType = this.route.snapshot.data['dataType'];
console.log('Data Type:', this.dataType);

this.partnersSub = this.partnerService.partnersGetCollection().subscribe(
this.partnersSub = this.partnerService.partnersGetCollection(1, "asc", this.dataType).subscribe(
data => {
this.partners = data["hydra:member"];

@@ -51,6 +54,7 @@ export class PartnersComponent implements OnInit, AfterViewInit {

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

/** Announce the change in sort state for assistive technology. */


Loading…
Откажи
Сачувај