ocket8888 commented on a change in pull request #4518: URL: https://github.com/apache/trafficcontrol/pull/4518#discussion_r428354302
########## File path: traffic_portal/app/src/common/modules/form/serviceCategory/form.serviceCategory.tpl.html ########## @@ -0,0 +1,58 @@ +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you 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. +--> + +<div class="x_panel"> + <div class="x_title"> + <ol class="breadcrumb pull-left"> + <li><a ng-click="navigateToPath('/servicecategories')">Service Categories</a></li> + <li class="active">{{serviceCategoryName}}</li> + </ol> + <div class="pull-right" role="group" ng-show="!settings.isNew"> + <button class="btn btn-primary" title="View Delivery Services" ng-click="viewDSs()">View Delivery Services</button> Review comment: The default for buttons with no type is `button[type=submit]` which submits the form containing the button. Instead, this should be `button[type=button]` so that it can be semantically recognized as a button that's handled by client scripting. ########## File path: traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.HTTP.tpl.html ########## @@ -228,6 +228,22 @@ <h3>Current Value</h3> </aside> </div> </div> + <div class="form-group" ng-class="{'has-error': hasError(generalConfig.serviceCategory), 'has-feedback': hasError(generalConfig.serviceCategory)}"> + <label class="has-tooltip control-label col-md-2 col-sm-2 col-xs-12" for="serviceCategory">Service Category<div class="helptooltip"> + <div class="helptext">The type of content being delivered. Some examples are linear, ott, and vod.</div> Review comment: (pls get rid of comcast-specific terms) ########## File path: traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.DNS.tpl.html ########## @@ -228,6 +228,22 @@ <h3>Current Value</h3> </aside> </div> </div> + <div class="form-group" ng-class="{'has-error': hasError(generalConfig.serviceCategory), 'has-feedback': hasError(generalConfig.serviceCategory)}"> + <label class="has-tooltip control-label col-md-2 col-sm-2 col-xs-12" for="serviceCategory">Service Category<div class="helptooltip"> + <div class="helptext">The type of content being delivered. Some examples are linear, ott, and vod.</div> + </div> + </label> + <div class="col-md-10 col-sm-10 col-xs-12"> + <select id="serviceCategory" name="serviceCategory" class="form-control" ng-model="deliveryService.serviceCategory" ng-options="serviceCategory.id as serviceCategory.name for serviceCategory in serviceCategories"> + <option hidden disabled selected value="">Select...</option> + </select> + <small ng-show="deliveryService.serviceCategory"><a href="/#!/servicecategories/{{deliveryService.serviceCategory}}" target="_blank">View Details <i class="fa fs-xs fa-external-link"></i></a></small> Review comment: What's with the double ` `? Is that how all forms are doing it? We shouldn't do that; if spacing is needed for styling reasons then it should be present in the styling. ########## File path: traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.Steering.tpl.html ########## @@ -208,6 +208,22 @@ <h3>Current Value</h3> </aside> </div> </div> + <div class="form-group" ng-class="{'has-error': hasError(generalConfig.serviceCategory), 'has-feedback': hasError(generalConfig.serviceCategory)}"> + <label class="has-tooltip control-label col-md-2 col-sm-2 col-xs-12" for="serviceCategory">Service Category<div class="helptooltip"> + <div class="helptext">The type of content being delivered. Some examples are linear, ott, and vod.</div> Review comment: Same as above RE: comcast-specific terms ########## File path: traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.DNS.tpl.html ########## @@ -228,6 +228,22 @@ <h3>Current Value</h3> </aside> </div> </div> + <div class="form-group" ng-class="{'has-error': hasError(generalConfig.serviceCategory), 'has-feedback': hasError(generalConfig.serviceCategory)}"> + <label class="has-tooltip control-label col-md-2 col-sm-2 col-xs-12" for="serviceCategory">Service Category<div class="helptooltip"> + <div class="helptext">The type of content being delivered. Some examples are linear, ott, and vod.</div> Review comment: Same as above RE: comcast-specific terms ########## File path: traffic_portal/app/src/common/modules/form/serviceCategory/form.serviceCategory.tpl.html ########## @@ -0,0 +1,58 @@ +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you 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. +--> + +<div class="x_panel"> + <div class="x_title"> + <ol class="breadcrumb pull-left"> + <li><a ng-click="navigateToPath('/servicecategories')">Service Categories</a></li> + <li class="active">{{serviceCategoryName}}</li> + </ol> + <div class="pull-right" role="group" ng-show="!settings.isNew"> + <button class="btn btn-primary" title="View Delivery Services" ng-click="viewDSs()">View Delivery Services</button> + </div> + <div class="clearfix"></div> + </div> + <div class="x_content"> + <br> + <form name="serviceCategoryForm" class="form-horizontal form-label-left" novalidate> + <div class="form-group" ng-class="{'has-error': hasError(serviceCategoryForm.name), 'has-feedback': hasError(serviceCategoryForm.name)}"> + <label for="name" class="control-label col-md-2 col-sm-2 col-xs-12">Category Name *</label> + <div class="col-md-10 col-sm-10 col-xs-12"> + <input id="name" name="name" type="text" class="form-control" ng-model="serviceCategory.name" required autofocus> + <small class="input-error" ng-show="hasPropertyError(serviceCategoryForm.name, 'required')">Required</small> + <span ng-show="hasError(serviceCategoryForm.name)" class="form-control-feedback"><i class="fa fa-times"></i></span> + </div> + </div> + <div class="form-group" ng-class="{'has-error': hasError(serviceCategoryForm.tenantId), 'has-feedback': hasError(serviceCategoryForm.tenantId)}"> + <label class="control-label col-md-2 col-sm-2 col-xs-12">Tenant</label> + <div class="col-md-10 col-sm-10 col-xs-12"> + <select name="tenantId" class="form-control" ng-model="serviceCategory.tenantId" ng-options="tenant.id as tenantLabel(tenant) for tenant in tenants" required> + <option value="">Select...</option> Review comment: This should be hidden and disabled, since it's not a valid option. It should then also be selected so that it appears as the initially selected option. ########## File path: traffic_portal/app/src/common/modules/table/serviceCategories/table.serviceCategories.tpl.html ########## @@ -0,0 +1,49 @@ +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you 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. +--> + +<div class="x_panel"> + <div class="x_title"> + <ol class="breadcrumb pull-left"> + <li class="active">Service Categories</li> + </ol> + <div class="pull-right"> + <button name="createServiceCategoryButton" class="btn btn-primary" title="Create Service Category" ng-click="createServiceCategory()"><i class="fa fa-plus"></i></button> + <button class="btn btn-default" title="Refresh" ng-click="refresh()"><i class="fa fa-refresh"></i></button> Review comment: Same as above RE: button type ########## File path: traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.anyMap.tpl.html ########## @@ -167,6 +167,22 @@ <h3>Current Value</h3> </aside> </div> </div> + <div class="form-group" ng-class="{'has-error': hasError(generalConfig.serviceCategory), 'has-feedback': hasError(generalConfig.serviceCategory)}"> + <label class="has-tooltip control-label col-md-2 col-sm-2 col-xs-12" for="serviceCategory">Service Category<div class="helptooltip"> + <div class="helptext">The type of content being delivered. Some examples are linear, ott, and vod.</div> Review comment: Same as above RE: comcast-specific terms ########## File path: traffic_portal/app/src/common/modules/table/serviceCategoryDeliveryServices/table.serviceCategoryDeliveryServices.tpl.html ########## @@ -0,0 +1,173 @@ +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you 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. +--> + +<div class="x_panel"> + <div class="x_title"> + <ol class="breadcrumb pull-left"> + <li><a ng-click="navigateToPath('/servicecategories')">Service Categories</a></li> + <li><a ng-click="navigateToPath('/servicecategories/' + serviceCategory.id)">{{serviceCategory.name}}</a></li> Review comment: Same as above RE: links without `href` ########## File path: traffic_portal/app/src/common/modules/form/serviceCategory/FormServiceCategoryController.js ########## @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +var FormServiceCategoryController = function(serviceCategory, $scope, $location, formUtils, stringUtils, locationUtils, tenantService, tenantUtils) { + + var getTenants = function() { + tenantService.getTenant() Review comment: I think you forgot to pass this an ID ########## File path: traffic_portal/app/src/common/modules/form/serviceCategory/form.serviceCategory.tpl.html ########## @@ -0,0 +1,58 @@ +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you 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. +--> + +<div class="x_panel"> + <div class="x_title"> + <ol class="breadcrumb pull-left"> + <li><a ng-click="navigateToPath('/servicecategories')">Service Categories</a></li> Review comment: An anchor with no `href` is not semantically recognized as a link - it's also not very accessible and leads to an overall worse UX (e.g. because I can't right-click -> Open in New Tab). Instead this should utilize [`ngHref`](https://docs.angularjs.org/api/ng/directive/ngHref#!) to provide an actual link without reloading the entire webpack'd SPA. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
