gbkannan89 commented on code in PR #7434: URL: https://github.com/apache/trafficcontrol/pull/7434#discussion_r1167371480
########## experimental/traffic-portal/src/app/core/profiles/profile-table/profile-table.component.ts: ########## @@ -0,0 +1,148 @@ +/* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import { Component, OnInit } from "@angular/core"; +import { UntypedFormControl } from "@angular/forms"; +import { MatDialog } from "@angular/material/dialog"; +import { ActivatedRoute, Params } from "@angular/router"; +import { BehaviorSubject } from "rxjs"; +import { ResponseProfile } from "trafficops-types"; + +import { ProfileService } from "src/app/api"; +import { CurrentUserService } from "src/app/shared/current-user/current-user.service"; +import { DecisionDialogComponent } from "src/app/shared/dialogs/decision-dialog/decision-dialog.component"; +import { ContextMenuActionEvent, ContextMenuItem } from "src/app/shared/generic-table/generic-table.component"; +import { NavigationService } from "src/app/shared/navigation/navigation.service"; + +/** + * ProfileTableComponent is the controller for the profiles page - which + * principally contains a table. + */ +@Component({ + selector: "tp-profile-table", + styleUrls: ["./profile-table.component.scss"], + templateUrl: "./profile-table.component.html" +}) +export class ProfileTableComponent implements OnInit { + /** All the physical locations which should appear in the table. */ + public profiles: Promise<Array<ResponseProfile>>; + + /** Definitions of the table's columns according to the ag-grid API */ + public columnDefs = [{ + field: "cdnName", + headerName: "CDN" + }, { + field: "description", + headerName: "Description", + }, { + field: "id", + headerName: "ID", + hide: true + }, { + field: "lastUpdated", + headerName: "Last Updated", + hide: true + }, { + field: "name", + headerName: "Name" + }, { + field: "routingDisabled", + headerName: "Routing Disabled" + }, { + field: "type", + headerName: "Type" + }]; + + /** Definitions for the context menu items (which act on augmented cache-group data). */ + public contextMenuItems: Array<ContextMenuItem<ResponseProfile>> = [ + { + action: "delete", + multiRow: false, + name: "Delete" + }, + { + href: "/core/servers", + name: "View Servers", + queryParams: (profile: ResponseProfile): Params => ({profileName: profile.name}) + } + ]; + + /** A subject that child components can subscribe to for access to the fuzzy search query text */ + public fuzzySubject: BehaviorSubject<string>; + + /** Form controller for the user search input. */ + public fuzzControl: UntypedFormControl = new UntypedFormControl(""); Review Comment: thanks for the example, Done. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
