Explorar el Código

document sort

master
Daniel hace 1 año
padre
commit
16ac7ce3ed
Se han modificado 16 ficheros con 120 adiciones y 83 borrados
  1. +1
    -1
      matsen-tool/openapi.json
  2. +41
    -10
      matsen-tool/openapi.yaml
  3. +1
    -0
      matsen-tool/src/app/_components/list/list-col-definition.ts
  4. +5
    -1
      matsen-tool/src/app/_components/list/list.component.ts
  5. +2
    -1
      matsen-tool/src/app/_components/paging/paging.component.ts
  6. +0
    -1
      matsen-tool/src/app/_components/search-select/search-select.component.html
  7. +0
    -10
      matsen-tool/src/app/_components/search-select/search-select.component.ts
  8. +1
    -1
      matsen-tool/src/app/_views/documents/document-list/document-list.component.html
  9. +29
    -15
      matsen-tool/src/app/_views/documents/document-list/document-list.component.ts
  10. +16
    -25
      matsen-tool/src/app/_views/partners/partner-list/partner-list.component.ts
  11. +0
    -1
      matsen-tool/src/app/_views/products/product-list/product-list.component.ts
  12. +1
    -0
      matsen-tool/src/app/_views/sales/sale-list/sale-list.component.html
  13. +0
    -1
      matsen-tool/src/app/_views/sales/sale-list/sale-list.component.ts
  14. +0
    -1
      matsen-tool/src/app/_views/user/user-list/user-list.component.ts
  15. +22
    -14
      matsen-tool/src/app/core/api/v1/api/document.service.ts
  16. +1
    -1
      matsen-tool/src/assets/i18n/de.json

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


+ 41
- 10
matsen-tool/openapi.yaml Ver fichero

@@ -1000,7 +1000,19 @@ paths:
explode: false
allowReserved: false
-
name: createdBy
name: name
in: query
description: ''
required: false
deprecated: false
allowEmptyValue: true
schema:
type: string
style: form
explode: false
allowReserved: false
-
name: partner
in: query
description: ''
required: false
@@ -1012,7 +1024,7 @@ paths:
explode: false
allowReserved: false
-
name: 'createdBy[]'
name: 'partner[]'
in: query
description: ''
required: false
@@ -1026,7 +1038,7 @@ paths:
explode: true
allowReserved: false
-
name: partner
name: product
in: query
description: ''
required: false
@@ -1038,7 +1050,7 @@ paths:
explode: false
allowReserved: false
-
name: 'partner[]'
name: 'product[]'
in: query
description: ''
required: false
@@ -1052,7 +1064,7 @@ paths:
explode: true
allowReserved: false
-
name: product
name: 'order[name]'
in: query
description: ''
required: false
@@ -1060,22 +1072,41 @@ paths:
allowEmptyValue: true
schema:
type: string
enum:
- asc
- desc
style: form
explode: false
allowReserved: false
-
name: 'product[]'
name: 'order[partner.name]'
in: query
description: ''
required: false
deprecated: false
allowEmptyValue: true
schema:
type: array
items:
type: string
type: string
enum:
- asc
- desc
style: form
explode: true
explode: false
allowReserved: false
-
name: 'order[product.name]'
in: query
description: ''
required: false
deprecated: false
allowEmptyValue: true
schema:
type: string
enum:
- asc
- desc
style: form
explode: false
allowReserved: false
deprecated: false
post:


+ 1
- 0
matsen-tool/src/app/_components/list/list-col-definition.ts Ver fichero

@@ -1,4 +1,5 @@
import {ListColTypeAddress} from "@app/_components/list/list-col-type-address";
import {OrderFilter} from "@app/_models/orderFilter";

export interface ListColDefinition {
name: string,


+ 5
- 1
matsen-tool/src/app/_components/list/list.component.ts Ver fichero

@@ -119,7 +119,11 @@ export class ListComponent implements OnInit, AfterViewInit {
return null;
}
if (column.field !== undefined) {
if (column.displayedLength !== undefined) {
if (
column.displayedLength !== undefined &&
element[column.field] !== undefined &&
element[column.field].length > column.displayedLength
) {
return element[column.field]?.slice(0, column.displayedLength) + '...';
}
return element[column.field];


+ 2
- 1
matsen-tool/src/app/_components/paging/paging.component.ts Ver fichero

@@ -59,7 +59,8 @@ export class PagingComponent implements OnInit, AfterViewInit {
debounceTime(1000),
distinctUntilChanged()
).subscribe(value => {
this.getData()
this.resetPageIndex();
this.getData();
});
}



+ 0
- 1
matsen-tool/src/app/_components/search-select/search-select.component.html Ver fichero

@@ -6,7 +6,6 @@
<div class="search-toggle" [class.search-box-open]="searchBoxOpen">
<app-list #listComponent
[getDataFunction]="getDataFunction"
[onSortFunction]="onSortChange"
[onRowSelectedFunction]="onRowSelected"
[listColDefinitions]="listColDefinitions"
[showDetailButton]="false"


+ 0
- 10
matsen-tool/src/app/_components/search-select/search-select.component.ts Ver fichero

@@ -51,16 +51,6 @@ export class SearchSelectComponent implements OnInit, AfterViewInit {
}
}

onSortChange = (sortState: Sort) => {
let order: OrderFilter;
if (sortState.direction === "") {
order = OrderFilter.Undefined;
} else {
order = sortState.direction;
}
this.listComponent.getData();
}

onRowSelected = (row: any, index: number) => {
this.selectedRowIndex = index;
this.documentForm.get(this.formId)?.setValue(row.id);


+ 1
- 1
matsen-tool/src/app/_views/documents/document-list/document-list.component.html Ver fichero

@@ -4,7 +4,7 @@
</button>
</div>
<app-list #listComponent
[getDataFunction]="getData"
[getDataFunction]="getDataFunction"
[onSortFunction]="onSortChange"
[onDownloadFunction]="navigateToDocumentFile"
[onEditFunction]="openModalEditDocument"


+ 29
- 15
matsen-tool/src/app/_views/documents/document-list/document-list.component.ts Ver fichero

@@ -18,12 +18,19 @@ export class DocumentListComponent implements OnInit, AfterViewInit {
@Input() public partner!: PartnerJsonld;
@ViewChild("listComponent", {static: false}) listComponent!: ListComponent;

protected listColDefinitions!: ListColDefinition[];
protected nameOrderFilter: OrderFilter;
protected partnerOrderFilter: OrderFilter;
protected productOrderFilter: OrderFilter;
protected listColDefinitions: ListColDefinition[];

constructor(
private documentService: DocumentService,
protected appHelperService: AppHelperService
) {
this.nameOrderFilter = OrderFilter.Asc;
this.partnerOrderFilter = OrderFilter.Asc;
this.productOrderFilter = OrderFilter.Asc;

this.listColDefinitions = [
{
name: 'name',
@@ -37,7 +44,6 @@ export class DocumentListComponent implements OnInit, AfterViewInit {
text: 'overview.description',
type: ListComponent.COLUMN_TYPE_TEXT,
field: 'description',
sortable: true,
displayedLength: 70,
} as ListColDefinition,
{
@@ -61,7 +67,6 @@ export class DocumentListComponent implements OnInit, AfterViewInit {
text: 'overview.createdBy',
type: ListComponent.COLUMN_TYPE_TEXT_LINKED,
field: 'fullName',
sortable: true,
subResource: 'createdBy',
} as ListColDefinition,
{
@@ -82,27 +87,36 @@ export class DocumentListComponent implements OnInit, AfterViewInit {
this.listComponent.getData();
}

getData = (index: number, pageSize: number, term?: string) => {
getDataFunction = (index: number, pageSize: number, term?: string) => {
return this.documentService.documentsGetCollection(
index,
pageSize,
undefined,
undefined,
term,
this.partner !== undefined ? this.partner.id : undefined,
undefined,
this.product !== undefined ? this.product.id : undefined
this.product !== undefined ? this.product.id : undefined,
undefined,
this.nameOrderFilter,
this.partnerOrderFilter,
this.productOrderFilter
);
}

onSortChange(sortState: Sort) {
// Reset page index to first page
let order: OrderFilter;
if (sortState.direction === "") {
order = OrderFilter.Undefined;
} else {
order = sortState.direction;
onSortChange = (sortState: Sort) => {
this.nameOrderFilter = OrderFilter.Undefined;
this.partnerOrderFilter = OrderFilter.Undefined;
this.productOrderFilter = OrderFilter.Undefined;
switch (sortState.active) {
case "name":
this.nameOrderFilter = sortState.direction as OrderFilter;
break;
case "partner":
this.partnerOrderFilter = sortState.direction as OrderFilter;
break;
case "product":
this.productOrderFilter = sortState.direction as OrderFilter;
break;
}
this.listComponent.getData();
}

navigateToDocumentFile(element: DocumentJsonld) {


+ 16
- 25
matsen-tool/src/app/_views/partners/partner-list/partner-list.component.ts Ver fichero

@@ -32,9 +32,9 @@ export class PartnerListComponent implements OnInit, AfterViewInit {
@Input("partnerType") partnerType!: string;
@ViewChild("listComponent", { static: false }) listComponent!: ListComponent;

protected nameOrderAsc: OrderFilter;
protected cityOrderAsc: OrderFilter;
protected websiteOrderAsc: OrderFilter;
protected nameOrderFilter: OrderFilter;
protected cityOrderFilter: OrderFilter;
protected websiteOrderFilter: OrderFilter;
protected partnerColumnHeadline: string;
protected listColDefinitions!: ListColDefinition[];
protected getDataFunction!: ListGetDataFunctionType;
@@ -47,9 +47,9 @@ export class PartnerListComponent implements OnInit, AfterViewInit {
protected appHelperService: AppHelperService,
protected translateService: TranslateService,
) {
this.nameOrderAsc = OrderFilter.Asc;
this.cityOrderAsc = OrderFilter.Asc;
this.websiteOrderAsc = OrderFilter.Asc;
this.nameOrderFilter = OrderFilter.Asc;
this.cityOrderFilter = OrderFilter.Asc;
this.websiteOrderFilter = OrderFilter.Asc;
this.partnerColumnHeadline = "";
}

@@ -73,6 +73,7 @@ export class PartnerListComponent implements OnInit, AfterViewInit {
type: ListComponent.COLUMN_TYPE_TEXT,
field: 'name',
sortable: true,
orderFilter: this.nameOrderFilter,
subResource: withSubResource ? 'partner' : undefined
} as ListColDefinition,
{
@@ -130,9 +131,9 @@ export class PartnerListComponent implements OnInit, AfterViewInit {
this.partnerType,
undefined,
term,
this.nameOrderAsc,
this.cityOrderAsc,
this.websiteOrderAsc
this.nameOrderFilter,
this.cityOrderFilter,
this.websiteOrderFilter
);
}

@@ -164,30 +165,20 @@ export class PartnerListComponent implements OnInit, AfterViewInit {
}

onSortChange = (sortState: Sort) => {
console.log(sortState);
let order: OrderFilter;
if (sortState.direction === "") {
order = OrderFilter.Undefined;
} else {
order = sortState.direction;
}

this.nameOrderAsc = OrderFilter.Undefined;
this.cityOrderAsc = OrderFilter.Undefined;
this.websiteOrderAsc = OrderFilter.Undefined;
console.log(order);
this.nameOrderFilter = OrderFilter.Undefined;
this.cityOrderFilter = OrderFilter.Undefined;
this.websiteOrderFilter = OrderFilter.Undefined;
switch (sortState.active) {
case "name":
this.nameOrderAsc = order;
this.nameOrderFilter = sortState.direction as OrderFilter;
break;
case "address":
this.cityOrderAsc = order;
this.cityOrderFilter = sortState.direction as OrderFilter;
break;
case "website":
this.websiteOrderAsc = order;
this.websiteOrderFilter = sortState.direction as OrderFilter;
break;
}
//this.listComponent.getData();
}

navigateToPartnerDetails = (element: any) => {


+ 0
- 1
matsen-tool/src/app/_views/products/product-list/product-list.component.ts Ver fichero

@@ -156,7 +156,6 @@ export class ProductListComponent implements OnInit, AfterViewInit {
order = sortState.direction;
}
this.nameOrderFilter = order;
this.listComponent.getData();
}

navigateToProductDetails = (element: any, column?: any) => {


+ 1
- 0
matsen-tool/src/app/_views/sales/sale-list/sale-list.component.html Ver fichero

@@ -9,5 +9,6 @@
[onNavigateToDetailsFunction]="navigateToSaleDetails"
[onSortFunction]="onSortChange"
[listColDefinitions]="listColDefinitions"
[searchable]="false"
></app-list>
</div>

+ 0
- 1
matsen-tool/src/app/_views/sales/sale-list/sale-list.component.ts Ver fichero

@@ -106,7 +106,6 @@ export class SaleListComponent implements OnInit, AfterViewInit {
order = sortState.direction;
}

this.listComponent.getData();
}

navigateToSaleDetails = (element: any) => {


+ 0
- 1
matsen-tool/src/app/_views/user/user-list/user-list.component.ts Ver fichero

@@ -80,7 +80,6 @@ export class UserListComponent implements OnInit, AfterViewInit {
} else {
order = sortState.direction;
}
this.listComponent.getData();
}

navigateToUserDetails = (element: any) => {


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

@@ -104,19 +104,21 @@ export class DocumentService {
* Retrieves the collection of Document resources.
* @param page The collection page number
* @param itemsPerPage The number of items per page
* @param createdBy
* @param createdBy2
* @param name
* @param partner
* @param partner2
* @param product
* @param product2
* @param orderName
* @param orderPartnerName
* @param orderProductName
* @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 documentsGetCollection(page?: number, itemsPerPage?: number, createdBy?: string, createdBy2?: Array<string>, partner?: string, partner2?: Array<string>, product?: string, product2?: Array<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiDocumentsGetCollection200Response>;
public documentsGetCollection(page?: number, itemsPerPage?: number, createdBy?: string, createdBy2?: Array<string>, partner?: string, partner2?: Array<string>, product?: string, product2?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiDocumentsGetCollection200Response>>;
public documentsGetCollection(page?: number, itemsPerPage?: number, createdBy?: string, createdBy2?: Array<string>, partner?: string, partner2?: Array<string>, product?: string, product2?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiDocumentsGetCollection200Response>>;
public documentsGetCollection(page?: number, itemsPerPage?: number, createdBy?: string, createdBy2?: Array<string>, partner?: string, partner2?: Array<string>, product?: string, product2?: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
public documentsGetCollection(page?: number, itemsPerPage?: number, name?: string, partner?: string, partner2?: Array<string>, product?: string, product2?: Array<string>, orderName?: 'asc' | 'desc', orderPartnerName?: 'asc' | 'desc', orderProductName?: 'asc' | 'desc', observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiDocumentsGetCollection200Response>;
public documentsGetCollection(page?: number, itemsPerPage?: number, name?: string, partner?: string, partner2?: Array<string>, product?: string, product2?: Array<string>, orderName?: 'asc' | 'desc', orderPartnerName?: 'asc' | 'desc', orderProductName?: 'asc' | 'desc', observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiDocumentsGetCollection200Response>>;
public documentsGetCollection(page?: number, itemsPerPage?: number, name?: string, partner?: string, partner2?: Array<string>, product?: string, product2?: Array<string>, orderName?: 'asc' | 'desc', orderPartnerName?: 'asc' | 'desc', orderProductName?: 'asc' | 'desc', observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiDocumentsGetCollection200Response>>;
public documentsGetCollection(page?: number, itemsPerPage?: number, name?: string, partner?: string, partner2?: Array<string>, product?: string, product2?: Array<string>, orderName?: 'asc' | 'desc', orderPartnerName?: 'asc' | 'desc', orderProductName?: 'asc' | 'desc', observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {

let localVarQueryParameters = new HttpParams({encoder: this.encoder});
if (page !== undefined && page !== null) {
@@ -127,15 +129,9 @@ export class DocumentService {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>itemsPerPage, 'itemsPerPage');
}
if (createdBy !== undefined && createdBy !== null) {
if (name !== undefined && name !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>createdBy, 'createdBy');
}
if (createdBy2) {
createdBy2.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>element, 'createdBy[]');
})
<any>name, 'name');
}
if (partner !== undefined && partner !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
@@ -157,6 +153,18 @@ export class DocumentService {
<any>element, 'product[]');
})
}
if (orderName !== undefined && orderName !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>orderName, 'order[name]');
}
if (orderPartnerName !== undefined && orderPartnerName !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>orderPartnerName, 'order[partner.name]');
}
if (orderProductName !== undefined && orderProductName !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>orderProductName, 'order[product.name]');
}

let localVarHeaders = this.defaultHeaders;



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

@@ -87,7 +87,7 @@
"comment": "Kommentar",
"createdAt": "erstellt am",
"firstName": "Vorname",
"lastName": "Vorname",
"lastName": "Nachname",
"email": "Email",
"unassign": "Zuweisung aufheben",
"compact-view": "Kompaktansicht",


Cargando…
Cancelar
Guardar