Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
selector: 'tba-feed-health-table-card',
templateUrl:'js/ops-mgr/overview/feed-health/feed-health-table-card-template.html'
})
export class FeedHealthTableCardComponent extends BaseFilteredPaginatedTableView {
pageName: string;
fetchFeedHealthPromise: any;
paginationData: any;
tabNames:any[];
tabs: any;
tabMetadata: any;
dataMap: any = {};
data: any;
filterFeed: string = "";
loaded: boolean = false;
showProgress: any = false;
sortFeed: any = {sortBy: "feed", sortOrder: TdDataTableSortingOrder.Ascending};
@Input() cardTitle: string = "";
columns: ITdDataTableColumn[] = [
{ name: 'feed', label: 'Feed', sortable: true, filter: true },
{ name: 'healthText', label: 'Health', sortable: true, filter: true },
{ name: 'displayStatus', label: 'Status', sortable: true, filter: true},
{ name: 'timeSinceEndTime', label: 'Since', sortable: true, filter: true},
{ name: 'runTime', label: 'Last Run Time', sortable: true, filter: true}
];
ngOnInit() {
this.pageName="feed-health";
this.fetchFeedHealthPromise = null;
//Pagination and view Type (list or table)
this.paginationData = this.paginationDataService.paginationData(this.pageName);
import {ITdDataTableColumn, ITdDataTableSortChangeEvent, TdDataTableComponent, TdDataTableSortingOrder, TdDataTableTemplateDirective} from "@covalent/core/data-table";
import {IPageChangeEvent} from "@covalent/core/paging";
@Component({
selector: 'filtered-paginated-table-view',
templateUrl: 'js/common/filtered-paginated-table-view/filteredPaginatedTableView.html'
})
export class FilteredPaginatedTableViewComponent implements AfterViewInit {
@ContentChildren(TdDataTableTemplateDirective) templates: QueryList;
@Input() cardTitle: string = "";
@Input() filteredData: any[];
@Input() columns: ITdDataTableColumn[];
@Input() clickable: boolean = true;
@Input() sortable: boolean = true;
@Input() sortOrder: TdDataTableSortingOrder = TdDataTableSortingOrder.Ascending;
@Input() sortBy: string = "";
@Input() firstLast: boolean = false;
@Input() pageSize: number = 5;
@Input() filteredTotal: number = 0;
@Input() allowedPageSize: number[] = [5, 10, 20, 50];
@ViewChild(TdDataTableComponent) dataTable: TdDataTableComponent;
@Input() showToolbar: boolean = true;
@Input() showTotal: boolean = true;
@Output() searchDebounced: EventEmitter = new EventEmitter();
@Output() sortChanged: EventEmitter = new EventEmitter();
@Output() rowClicked: EventEmitter = new EventEmitter();
@Output() pageSizeChanged: EventEmitter = new EventEmitter();
pageSizeChange(pagingEvent: IPageChangeEvent): void {
this.pageSizeChanged.emit(pagingEvent);
sort(sortEvent: ITdDataTableSortChangeEvent): void {
this.sortBy = sortEvent.name;
this.sortOrder = sortEvent.order === TdDataTableSortingOrder.Descending ? TdDataTableSortingOrder.Ascending : TdDataTableSortingOrder.Descending;
this.filter();
}
sort(sortEvent: ITdDataTableSortChangeEvent): void {
this.sortBy = sortEvent.name;
this.sortOrder = sortEvent.order === TdDataTableSortingOrder.Descending ? TdDataTableSortingOrder.Ascending : TdDataTableSortingOrder.Descending;
this.filter();
}
import { TdDataTableSortingOrder, ITdDataTableSortChangeEvent, ITdDataTableColumn, TdDataTableService } from "@covalent/core/data-table";
import { IPageChangeEvent } from "@covalent/core/paging";
export class BaseFilteredPaginatedTableView {
filteredData: any[];
filteredTotal: number = 0;
sortBy: string;
sortOrder: TdDataTableSortingOrder = TdDataTableSortingOrder.Ascending;
pageSize: number = 5;
fromRow: number = 1;
searchTerm: string = '';
currentPage: number = 1;
public data : any[] = [];
public columns : ITdDataTableColumn[];
public _dataTableService : TdDataTableService;
constructor(_dataTableService: TdDataTableService){
this._dataTableService = _dataTableService;
}
setDataAndColumnSchema(data : any[], columns : ITdDataTableColumn[]) : void {
this.data = data;
this.columns = columns;
displayInCard?:boolean = true;
tableTemplate:string = "NameLinkTableTemplate";
showSelectionSummary:boolean = true;
/**
* Use ui-router state to track navigation between paths and folders
* @type {boolean} default true
*/
@Input()
useRouterStates:boolean = true;
columns: BrowserColumn[];
sortBy: string;
sortOrder: TdDataTableSortingOrder = TdDataTableSortingOrder.Ascending;
searchTerm: string = '';
filteredFiles: BrowserObject[] = [];
filteredTotal = 0;
fromRow: number = 1;
currentPage: number = 1;
pageSize: number = 50;
selected: Node[] = [];
selectAll: boolean = false;
isParentSelected: boolean = false;
selectedDescendantCounts: Map = new Map();
files: BrowserObject[] = [];
private root: Node;
private node: Node;
pathNodes: Node[];
errorMsg: undefined;
import {ITdDataTableColumn, ITdDataTableSortChangeEvent, TdDataTableComponent, TdDataTableSortingOrder, TdDataTableTemplateDirective} from "@covalent/core/data-table";
import {IPageChangeEvent} from "@covalent/core/paging";
@Component({
selector: 'filtered-paginated-table-view',
templateUrl: 'js/common/filtered-paginated-table-view/filtered-paginated-table-view.component.html'
})
export class FilteredPaginatedTableViewComponent implements AfterViewInit {
@ContentChildren(TdDataTableTemplateDirective) templates: QueryList;
@Input() cardTitle: string = "";
@Input() filteredData: any[];
@Input() columns: ITdDataTableColumn[];
@Input() clickable: boolean = true;
@Input() sortable: boolean = true;
@Input() sortOrder: TdDataTableSortingOrder = TdDataTableSortingOrder.Ascending;
@Input() sortBy: string = "";
@Input() firstLast: boolean = false;
@Input() pageSize: number = 5;
@Input() filteredTotal: number = 0;
@Input() allowedPageSize: number[] = [5, 10, 20, 50];
@ViewChild(TdDataTableComponent) dataTable: TdDataTableComponent;
@Input() showToolbar: boolean = true;
@Input() showTotal: boolean = true;
@Output() searchDebounced: EventEmitter = new EventEmitter();
@Output() sortChanged: EventEmitter = new EventEmitter();
@Output() rowClicked: EventEmitter = new EventEmitter();
@Output() pageSizeChanged: EventEmitter = new EventEmitter();
/**
* Should the view be rendered in a card
constructor(path: string, node: Node) {
this.node = node;
this.path = path;
}
}
@Component({
selector: 'selection-dialog',
styleUrls: ['js/feed-mgr/catalog/datasource/api/dialog/selection-dialog.component.css'],
templateUrl: 'js/feed-mgr/catalog/datasource/api/dialog/selection-dialog.component.html',
})
export class SelectionDialogComponent implements OnInit {
sortBy = 'path';
sortOrder: TdDataTableSortingOrder = TdDataTableSortingOrder.Ascending;
searchTerm: string = '';
filteredFiles: SelectedItem[] = [];
filteredTotal = 0;
fromRow: number = 1;
currentPage: number = 1;
pageSize: number = 10;
columns: ITdDataTableColumn[] = [
{name: "remove", label: "", sortable: false, width: 15},
{name: "path", label: "Path", sortable: false, width: 1250},
];
datasourceId: string;
selected: SelectedItem[] = [];
removed: SelectedItem[] = [];
initialItemCount: number = 0;
constructor(private selfReference: MatDialogRef, private dataTableService: TdDataTableService,