mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-05 05:42:16 +00:00
fix(console): migrate from tslint to eslint, project delete from table (#2490)
* es lint * modify tsconfig, auto lint some stuff * lint * lint * lint * lint * html ts lint * lint * lint, tsconfig * fix project delete, state table * eslint config, remove cnslHint directive * mfa selector, info row fixes * lint * fix login policy, granted orgs table state, lint Co-authored-by: Florian Forster <[email protected]>
This commit is contained in:
co-authored by
Florian Forster
parent
bdf63800f7
commit
b1caef81da
@@ -2,56 +2,56 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { Timestamp } from 'src/app/proto/generated/google/protobuf/timestamp_pb';
|
||||
|
||||
export interface PageEvent {
|
||||
length: number;
|
||||
pageSize: number;
|
||||
pageIndex: number;
|
||||
pageSizeOptions: Array<number>;
|
||||
length: number;
|
||||
pageSize: number;
|
||||
pageIndex: number;
|
||||
pageSizeOptions: Array<number>;
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'cnsl-paginator',
|
||||
templateUrl: './paginator.component.html',
|
||||
styleUrls: ['./paginator.component.scss'],
|
||||
selector: 'cnsl-paginator',
|
||||
templateUrl: './paginator.component.html',
|
||||
styleUrls: ['./paginator.component.scss'],
|
||||
})
|
||||
export class PaginatorComponent {
|
||||
@Input() public timestamp!: Timestamp.AsObject;
|
||||
@Input() public length: number = 0;
|
||||
@Input() public pageSize: number = 10;
|
||||
@Input() public pageIndex: number = 0;
|
||||
@Input() public pageSizeOptions: Array<number> = [10, 25, 50];
|
||||
@Output() public page: EventEmitter<PageEvent> = new EventEmitter();
|
||||
constructor() { }
|
||||
@Input() public timestamp: Timestamp.AsObject | undefined = undefined;
|
||||
@Input() public length: number = 0;
|
||||
@Input() public pageSize: number = 10;
|
||||
@Input() public pageIndex: number = 0;
|
||||
@Input() public pageSizeOptions: Array<number> = [10, 25, 50];
|
||||
@Output() public page: EventEmitter<PageEvent> = new EventEmitter();
|
||||
constructor() { }
|
||||
|
||||
public previous(): void {
|
||||
if (this.previousPossible) {
|
||||
this.pageIndex = this.pageIndex - 1;
|
||||
this.emitChange();
|
||||
}
|
||||
public previous(): void {
|
||||
if (this.previousPossible) {
|
||||
this.pageIndex = this.pageIndex - 1;
|
||||
this.emitChange();
|
||||
}
|
||||
}
|
||||
|
||||
public next(): void {
|
||||
if (this.nextPossible) {
|
||||
this.pageIndex = this.pageIndex + 1;
|
||||
this.emitChange();
|
||||
}
|
||||
public next(): void {
|
||||
if (this.nextPossible) {
|
||||
this.pageIndex = this.pageIndex + 1;
|
||||
this.emitChange();
|
||||
}
|
||||
}
|
||||
|
||||
get previousPossible(): boolean {
|
||||
const temp = this.pageIndex - 1;
|
||||
return (temp >= 0);
|
||||
}
|
||||
get previousPossible(): boolean {
|
||||
const temp = this.pageIndex - 1;
|
||||
return (temp >= 0);
|
||||
}
|
||||
|
||||
get nextPossible(): boolean {
|
||||
const temp = this.pageIndex + 1;
|
||||
return (temp <= (this.length / this.pageSize));
|
||||
}
|
||||
get nextPossible(): boolean {
|
||||
const temp = this.pageIndex + 1;
|
||||
return (temp <= (this.length / this.pageSize));
|
||||
}
|
||||
|
||||
public emitChange(): void {
|
||||
this.page.emit({
|
||||
length: this.length,
|
||||
pageSize: this.pageSize,
|
||||
pageIndex: this.pageIndex,
|
||||
pageSizeOptions: this.pageSizeOptions,
|
||||
});
|
||||
}
|
||||
public emitChange(): void {
|
||||
this.page.emit({
|
||||
length: this.length,
|
||||
pageSize: this.pageSize,
|
||||
pageIndex: this.pageIndex,
|
||||
pageSizeOptions: this.pageSizeOptions,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user