ocket8888 commented on code in PR #7459:
URL: https://github.com/apache/trafficcontrol/pull/7459#discussion_r1192545234


##########
experimental/traffic-portal/src/app/core/cdns/cdn-table/cdn-table.component.ts:
##########
@@ -0,0 +1,261 @@
+/*
+* 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 { FormControl } from "@angular/forms";
+import { MatDialog } from "@angular/material/dialog";
+import { ActivatedRoute } from "@angular/router";
+import { ColDef } from "ag-grid-community";
+import { BehaviorSubject } from "rxjs";
+import { AlertLevel, ResponseCDN } from "trafficops-types";
+
+import { CDNService } from "src/app/api";
+import { AlertService } from "src/app/shared/alert/alert.service";
+import { CurrentUserService } from 
"src/app/shared/current-user/current-user.service";
+import {
+       DecisionDialogComponent,
+       DecisionDialogData
+} from "src/app/shared/dialogs/decision-dialog/decision-dialog.component";
+import type { ContextMenuActionEvent, ContextMenuItem } from 
"src/app/shared/generic-table/generic-table.component";
+
+/**
+ * CDNTableComponent is the controller for the "CDNs" table.
+ */
+@Component({
+       selector: "tp-cdn-table",
+       styleUrls: ["./cdn-table.component.scss"],
+       templateUrl: "./cdn-table.component.html",
+})
+export class CDNTableComponent implements OnInit {
+       public cdns: Promise<ResponseCDN[]>;
+
+       /* Definitions of the table's columns according to the ag-grid API */
+       public columnDefs: ColDef[] = [
+               {
+                       field: "dnssecEnabled",
+                       filter: "tpBooleanFilter",
+                       headerName: "DNSSEC Enabled",
+                       hide: false
+               },
+               {
+                       field: "domain",
+                       filter: "agTextColumnFilter",
+                       headerName: "Domain",
+                       hide: false,
+               },
+               {
+                       field: "id",
+                       filter: "agNumberColumnFilter",
+                       headerName: "ID",
+                       hide: true,
+               },
+               {
+                       field: "lastUpdated",
+                       filter: "agDateColumnFilter",
+                       headerName: "Last Updated",
+                       hide: true
+               },
+               {
+                       field: "name",
+                       filter: "agTextColumnFilter",
+                       headerName: "Name",
+                       hide: false,
+               },
+       ];
+
+       /**
+        * Definitions for the context menu items (which act on augmented
+        * CDN data).
+        */
+       public contextMenuItems: Array<ContextMenuItem<ResponseCDN>> = [
+               {
+                       href: (selectedRow): string => 
`/core/cdns/${selectedRow.id}`,
+                       name: "Open in New Tab",
+                       newTab: true
+               },
+               {
+                       href: (selectedRow): string => 
`/core/cdns/${selectedRow.id}` ,
+                       name: "Edit"
+               },
+               {
+                       action: "delete",
+                       multiRow: false,
+                       name: "Delete",
+               },
+               {
+                       action: "snapshot-diff",
+                       multiRow: false,
+                       name: "Diff Snapshot",
+               },

Review Comment:
   A lot of the unimplemented context menu actions are disabled, but not this 
one - why not?



-- 
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: issues-unsubscr...@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to