You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2021/06/14 07:29:57 UTC

[GitHub] [trafficcontrol] mitchell852 opened a new pull request #5934: TP: Adds ability to view/create/delete a cdn lock

mitchell852 opened a new pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934


   <!--
   ************ STOP!! ************
   If this Pull Request is intended to fix a security vulnerability, DO NOT submit it! Instead, contact
   the Apache Software Foundation Security Team at security@trafficcontrol.apache.org and follow the
   guidelines at https://www.apache.org/security/ regarding vulnerability disclosure.
   -->
   ## What does this PR (Pull Request) do?
   <!-- Explain the changes you made here. If this fixes an Issue, identify it by
   replacing the text in the checkbox item with the Issue number e.g.
   
   - [x] This PR fixes #9001 OR is not related to any Issue
   
   ^ This will automatically close Issue number 9001 when the Pull Request is
   merged (The '#' is important).
   
   Be sure you check the box properly, see the "The following criteria are ALL
   met by this PR" section for details.
   -->
   
   - [ ] This PR fixes #REPLACE_ME OR is not related to any Issue <!-- You can check for an issue here: https://github.com/apache/trafficcontrol/issues -->
   
   
   ## Which Traffic Control components are affected by this PR?
   <!-- Please delete all components from this list that are NOT affected by this
   Pull Request. Also, feel free to add the name of a tool or script that is
   affected but not on the list.
   
   Additionally, if this Pull Request does NOT affect documentation, please
   explain why documentation is not required. -->
   
   - CDN in a Box
   - Documentation
   - Grove
   - Traffic Control Client <!-- Please specify which; e.g. 'Python', 'Go', 'Java' -->
   - Traffic Monitor
   - Traffic Ops
   - Traffic Ops ORT
   - Traffic Portal
   - Traffic Router
   - Traffic Stats
   - Traffic Vault
   - CI tests
   
   ## What is the best way to verify this PR?
   <!-- Please include here ALL the steps necessary to test your Pull Request. If
   it includes tests (and most should), outline here the steps needed to run the
   tests. If not, lay out the manual testing procedure and please explain why
   tests are unnecessary for this Pull Request. -->
   
   ## If this is a bug fix, what versions of Traffic Control are affected?
   <!-- If this PR fixes a bug, please list here all of the affected versions - to
   the best of your knowledge. It's also pretty helpful to include a commit hash
   of where 'master' is at the time this PR is opened (if it affects master),
   because what 'master' means will change over time. For example, if this PR
   fixes a bug that's present in master (at commit hash '1df853c8'), in v4.0.0,
   and in the current 4.0.1 Release candidate (e.g. RC1), then this list would
   look like:
   
   - master (1df853c8)
   - 4.0.0
   - 4.0.1 (RC1)
   
   If you don't know what other versions might have this bug, AND don't know how
   to find the commit hash of 'master', then feel free to leave this section
   blank (or, preferably, delete it entirely).
    -->
   
   
   ## The following criteria are ALL met by this PR
   <!-- Check the boxes to signify that the associated statement is true. To
   "check a box", replace the space inside of the square brackets with an 'x'.
   e.g.
   
   - [ x] <- Wrong
   - [x ] <- Wrong
   - [] <- Wrong
   - [*] <- Wrong
   - [x] <- Correct!
   
   -->
   
   - [ ] This PR includes tests OR I have explained why tests are unnecessary
   - [ ] This PR includes documentation OR I have explained why documentation is unnecessary
   - [ ] This PR includes an update to CHANGELOG.md OR such an update is not necessary
   - [ ] This PR includes any and all required license headers
   - [ ] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the Apache Software Foundation's security guidelines](https://www.apache.org/security/) for details)
   
   
   ## Additional Information
   <!-- If you would like to include any additional information on the PR for
   potential reviewers please put it here.
   
   Some examples of this would be:
   
   - Before and after screenshots/gifs of the Traffic Portal if it is affected
   - Links to other dependent Pull Requests
   - References to relevant context (e.g. new/updates to dependent libraries,
   mailing list records, blueprints)
   
   Feel free to leave this section blank (or, preferably, delete it entirely).
   -->
   
   <!--
   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.
   -->
   


-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651138887



##########
File path: traffic_portal/app/src/common/modules/locks/locks.tpl.html
##########
@@ -0,0 +1,23 @@
+<!--
+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 id="locksContainer">
+    <div class="alert alert-dark" ng-repeat="l in locks">
+        <button type="button" class="close" title="Unlock {{l.cdn}}" aria-hidden="true" ng-click="confirmUnlock(l)"><i class="fa fa-unlock"></i></button>
+        <div ng-bind-html="l.cdn + ' is ' + ((l.soft) ? 'soft' : 'hard') + ' locked by ' + l.userName + ' (' + l.message + ')' | linky:'_blank'"></div>

Review comment:
       because of the linky directive which i suppose is not really necessary but kinda cool imo.




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r650205133



##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>
+                        <option value="">Select...</option>
+                    </select>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.message), 'has-feedback': hasError(lockForm.message)}">
+                    <label class="control-label" for="message">Message *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.message, 'maxlength')">Too Long</small>
+                    </label>
+                    <input id="message" name="message" type="text" class="form-control" ng-model="lock.message" ng-maxlength="256" required autofocus>
+                    <span ng-show="hasError(lockForm.message)" class="form-control-feedback"><i class="fa fa-times"></i></span>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+                <div class="col-sm-12 col-md-12">
+                    <div class="form-group">
+                        <p>Type *</p>

Review comment:
       I think this should properly be a `legend` child of a `fieldset` element for proper labeling with assistive technologies.

##########
File path: traffic_portal/app/src/common/modules/locks/locks.tpl.html
##########
@@ -0,0 +1,23 @@
+<!--
+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 id="locksContainer">
+    <div class="alert alert-dark" ng-repeat="l in locks">
+        <button type="button" class="close" title="Unlock {{l.cdn}}" aria-hidden="true" ng-click="confirmUnlock(l)"><i class="fa fa-unlock"></i></button>

Review comment:
       this shouldn't have `aria-hidden`, that makes it invisible to users using assistive technologies.

##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>
+                        <option value="">Select...</option>
+                    </select>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.message), 'has-feedback': hasError(lockForm.message)}">
+                    <label class="control-label" for="message">Message *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.message, 'maxlength')">Too Long</small>
+                    </label>
+                    <input id="message" name="message" type="text" class="form-control" ng-model="lock.message" ng-maxlength="256" required autofocus>
+                    <span ng-show="hasError(lockForm.message)" class="form-control-feedback"><i class="fa fa-times"></i></span>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+                <div class="col-sm-12 col-md-12">
+                    <div class="form-group">
+                        <p>Type *</p>
+                        <input id="soft" type="radio" data-ng-model="lock.soft" data-ng-value="true">
+                        <label class="has-tooltip" for="soft">&nbsp;Soft<div class="helptooltip">
+                            <div class="helptext">A soft lock will prevent others from queueing server updates or snapshotting the locked CDN.</div>
+                        </div>
+                        </label><br>
+                        <input id="hard" type="radio" data-ng-model="lock.soft" data-ng-value="false">
+                        <label class="has-tooltip" for="soft">&nbsp;Hard<div class="helptooltip">
+                            <div class="helptext">A hard lock will prevent others from queueing server updates or snapshotting the locked CDN. It will also block others from making changes that would change the state of the locked CDN.</div>
+                        </div>
+                        </label>
+                    </div>
+            </div>
+        </div>
+    </form>
+</div>
+<div class="modal-footer">
+    <button class="btn action-btn" ng-click="cancel()">Cancel</button>
+    <button class="btn btn-link" ng-disabled="lockForm.$invalid" ng-click="select()">Submit</button>

Review comment:
       `button`s that don't submit containing `form`s should be `button[type=button]`s, as the implicit default is `button[type=submit]`.

##########
File path: traffic_portal/app/src/common/modules/locks/locks.tpl.html
##########
@@ -0,0 +1,23 @@
+<!--
+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 id="locksContainer">
+    <div class="alert alert-dark" ng-repeat="l in locks">
+        <button type="button" class="close" title="Unlock {{l.cdn}}" aria-hidden="true" ng-click="confirmUnlock(l)"><i class="fa fa-unlock"></i></button>
+        <div ng-bind-html="l.cdn + ' is ' + ((l.soft) ? 'soft' : 'hard') + ' locked by ' + l.userName + ' (' + l.message + ')' | linky:'_blank'"></div>

Review comment:
       Why use `ng-bind-html` instead of just a regular template?

##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/DialogSelectLockController.js
##########
@@ -0,0 +1,46 @@
+/*
+ * 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 DialogSelectLockController = function(cdns, $scope, $uibModalInstance) {
+
+	$scope.cdns = cdns.filter(
+		function (cdn) {
+			// you cannot apply a lock to the 'ALL' cdn
+			return cdn.name != 'ALL';

Review comment:
       comparisons should use `!==`/`===`

##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>
+                        <option value="">Select...</option>

Review comment:
       `Select...` is not a valid CDN name, should be `hidden` and `disabled` (and then also `selected` so that it actually shows up by default)

##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>
+                        <option value="">Select...</option>
+                    </select>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.message), 'has-feedback': hasError(lockForm.message)}">
+                    <label class="control-label" for="message">Message *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.message, 'maxlength')">Too Long</small>
+                    </label>
+                    <input id="message" name="message" type="text" class="form-control" ng-model="lock.message" ng-maxlength="256" required autofocus>
+                    <span ng-show="hasError(lockForm.message)" class="form-control-feedback"><i class="fa fa-times"></i></span>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+                <div class="col-sm-12 col-md-12">
+                    <div class="form-group">
+                        <p>Type *</p>
+                        <input id="soft" type="radio" data-ng-model="lock.soft" data-ng-value="true">
+                        <label class="has-tooltip" for="soft">&nbsp;Soft<div class="helptooltip">
+                            <div class="helptext">A soft lock will prevent others from queueing server updates or snapshotting the locked CDN.</div>
+                        </div>
+                        </label><br>
+                        <input id="hard" type="radio" data-ng-model="lock.soft" data-ng-value="false">

Review comment:
       Does this work with the `data-` prefixes? At the least it's unnecessary. Also, in order to make the browser recognize these as mutually exclusive options, they should have the same `name` attribute. Finally, these should have the `required` attribute to make it clear that a selection must be made (it's best to put it on both, IMO, for clarity, but when they have the same `name` only one _needs_ to have it for it to work strictly speaking)

##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>
+                        <option value="">Select...</option>
+                    </select>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.message), 'has-feedback': hasError(lockForm.message)}">
+                    <label class="control-label" for="message">Message *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.message, 'maxlength')">Too Long</small>
+                    </label>
+                    <input id="message" name="message" type="text" class="form-control" ng-model="lock.message" ng-maxlength="256" required autofocus>
+                    <span ng-show="hasError(lockForm.message)" class="form-control-feedback"><i class="fa fa-times"></i></span>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+                <div class="col-sm-12 col-md-12">
+                    <div class="form-group">
+                        <p>Type *</p>
+                        <input id="soft" type="radio" data-ng-model="lock.soft" data-ng-value="true">
+                        <label class="has-tooltip" for="soft">&nbsp;Soft<div class="helptooltip">
+                            <div class="helptext">A soft lock will prevent others from queueing server updates or snapshotting the locked CDN.</div>
+                        </div>
+                        </label><br>
+                        <input id="hard" type="radio" data-ng-model="lock.soft" data-ng-value="false">
+                        <label class="has-tooltip" for="soft">&nbsp;Hard<div class="helptooltip">
+                            <div class="helptext">A hard lock will prevent others from queueing server updates or snapshotting the locked CDN. It will also block others from making changes that would change the state of the locked CDN.</div>
+                        </div>
+                        </label>
+                    </div>
+            </div>
+        </div>
+    </form>
+</div>
+<div class="modal-footer">

Review comment:
       nit but there's a native [`<footer>` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/footer) - although we don't do a lot of sectioning so it won't really do much to use it here.

##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>
+                        <option value="">Select...</option>
+                    </select>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.message), 'has-feedback': hasError(lockForm.message)}">
+                    <label class="control-label" for="message">Message *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.message, 'maxlength')">Too Long</small>
+                    </label>
+                    <input id="message" name="message" type="text" class="form-control" ng-model="lock.message" ng-maxlength="256" required autofocus>
+                    <span ng-show="hasError(lockForm.message)" class="form-control-feedback"><i class="fa fa-times"></i></span>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+                <div class="col-sm-12 col-md-12">
+                    <div class="form-group">
+                        <p>Type *</p>
+                        <input id="soft" type="radio" data-ng-model="lock.soft" data-ng-value="true">
+                        <label class="has-tooltip" for="soft">&nbsp;Soft<div class="helptooltip">
+                            <div class="helptext">A soft lock will prevent others from queueing server updates or snapshotting the locked CDN.</div>
+                        </div>
+                        </label><br>
+                        <input id="hard" type="radio" data-ng-model="lock.soft" data-ng-value="false">
+                        <label class="has-tooltip" for="soft">&nbsp;Hard<div class="helptooltip">

Review comment:
       spacing should be achieved with CSS - this makes the input labeled as literally "&nbsp;Hard" instead of just "Hard".




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651135153



##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>
+                        <option value="">Select...</option>
+                    </select>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.message), 'has-feedback': hasError(lockForm.message)}">
+                    <label class="control-label" for="message">Message *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.message, 'maxlength')">Too Long</small>
+                    </label>
+                    <input id="message" name="message" type="text" class="form-control" ng-model="lock.message" ng-maxlength="256" required autofocus>
+                    <span ng-show="hasError(lockForm.message)" class="form-control-feedback"><i class="fa fa-times"></i></span>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+                <div class="col-sm-12 col-md-12">
+                    <div class="form-group">
+                        <p>Type *</p>
+                        <input id="soft" type="radio" data-ng-model="lock.soft" data-ng-value="true">
+                        <label class="has-tooltip" for="soft">&nbsp;Soft<div class="helptooltip">
+                            <div class="helptext">A soft lock will prevent others from queueing server updates or snapshotting the locked CDN.</div>
+                        </div>
+                        </label><br>
+                        <input id="hard" type="radio" data-ng-model="lock.soft" data-ng-value="false">

Review comment:
       i added the data- prefixes because the google told me to because it wasn't binding to ng-model or something like that. tbh, can't remember the last time i used a radio button. you want to take a stab at writing that radio buttons block? 




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651136736



##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>
+                        <option value="">Select...</option>
+                    </select>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.message), 'has-feedback': hasError(lockForm.message)}">
+                    <label class="control-label" for="message">Message *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.message, 'maxlength')">Too Long</small>
+                    </label>
+                    <input id="message" name="message" type="text" class="form-control" ng-model="lock.message" ng-maxlength="256" required autofocus>
+                    <span ng-show="hasError(lockForm.message)" class="form-control-feedback"><i class="fa fa-times"></i></span>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+                <div class="col-sm-12 col-md-12">
+                    <div class="form-group">
+                        <p>Type *</p>
+                        <input id="soft" type="radio" data-ng-model="lock.soft" data-ng-value="true">
+                        <label class="has-tooltip" for="soft">&nbsp;Soft<div class="helptooltip">
+                            <div class="helptext">A soft lock will prevent others from queueing server updates or snapshotting the locked CDN.</div>
+                        </div>
+                        </label><br>
+                        <input id="hard" type="radio" data-ng-model="lock.soft" data-ng-value="false">
+                        <label class="has-tooltip" for="soft">&nbsp;Hard<div class="helptooltip">
+                            <div class="helptext">A hard lock will prevent others from queueing server updates or snapshotting the locked CDN. It will also block others from making changes that would change the state of the locked CDN.</div>
+                        </div>
+                        </label>
+                    </div>
+            </div>
+        </div>
+    </form>
+</div>
+<div class="modal-footer">

Review comment:
       taking that out will require me to style that and who wants to do that :)




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651144939



##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>
+                        <option value="">Select...</option>
+                    </select>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.message), 'has-feedback': hasError(lockForm.message)}">
+                    <label class="control-label" for="message">Message *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.message, 'maxlength')">Too Long</small>
+                    </label>
+                    <input id="message" name="message" type="text" class="form-control" ng-model="lock.message" ng-maxlength="256" required autofocus>
+                    <span ng-show="hasError(lockForm.message)" class="form-control-feedback"><i class="fa fa-times"></i></span>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+                <div class="col-sm-12 col-md-12">
+                    <div class="form-group">
+                        <p>Type *</p>

Review comment:
       example please :)




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r652039521



##########
File path: traffic_portal/app/src/common/modules/dialog/_dialog.scss
##########
@@ -45,3 +45,16 @@
 .dialog-20 .modal-dialog {
   width: 20%;
 }
+
+.fieldset-body {
+  display: grid;
+  grid-template-columns: auto 1fr;
+  grid-column-gap: 1.5em;
+  grid-row-gap: 5px;
+  justify-items: start;
+  align-items: center;
+  ​

Review comment:
       invalid US-ASCII byte on this line. I think Slack did it to you, they do a lot of dumb things with copy/paste. Try deleting this line and re-inserting it.




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651235682



##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>

Review comment:
       i think it has something to do with these modal dialogs. doesn't seem to work on dialog.select.status.tpl.html either...but at least the submit button is disabled until all required fields are filled in...




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651185722



##########
File path: traffic_portal/app/src/common/modules/locks/locks.tpl.html
##########
@@ -0,0 +1,23 @@
+<!--
+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 id="locksContainer">
+    <div class="alert alert-dark" ng-repeat="l in locks">
+        <button type="button" class="close" title="Unlock {{l.cdn}}" aria-hidden="true" ng-click="confirmUnlock(l)"><i class="fa fa-unlock"></i></button>
+        <div ng-bind-html="l.cdn + ' is ' + ((l.soft) ? 'soft' : 'hard') + ' locked by ' + l.userName + ' (' + l.message + ')' | linky:'_blank'"></div>

Review comment:
       I guess you can't do like `{{l.message | linky:_blank}}`?




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651282951



##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>

Review comment:
       Alternatively, you could just let the browser handle showing errors, since there are no non-standard constraints being placed on the inputs. All I had to do was move the footer inside the form, swap the nesting of the form and the modal body, and switch the handler from a `button[type="button"]` click event to the submit event of the form, then make that button `type="submit"` (which can be done implicitly). So:
   ```html
   <div class="modal-header">
       <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
       <h4 class="modal-title">Create CDN Lock</h4>
   </div>
   <form ng-submit="select()">
       <div class="modal-body">
           <div class="row">
               <div class="col-sm-12 col-md-12">
                   <div class="form-group">
                       <label class="control-label" for="cdn">CDN</label>
                       <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>
                           <option disabled hidden selected value="">Select...</option>
                       </select>
                   </div>
               </div>
           </div>
           <div class="row">
               <div class="col-sm-12 col-md-12">
                   <div class="form-group">
                       <label class="control-label" for="message">Message *</label>
                       <input id="message" name="message" type="text" class="form-control" ng-model="lock.message" maxlength="256" required autofocus>
                   </div>
               </div>
           </div>
           <div class="row">
               <div class="col-sm-12 col-md-12">
                   <fieldset class="form-group" ng-class="{'has-error': hasError(lockform.lockType)}">
                       <legend>
                           <label class="has-tooltip" for="soft">Type <i class="fa fa-info-circle has-tooltip"></i><div class="helptooltip">
                               <div class="helptext">
                                   <dl>
                                       <dt>soft</dt>
                                       <dd>A <dfn>soft</dfn> lock will prevent others from queueing server updates or snapshotting the locked CDN.</dd>
                                       <dt>hard</dt>
                                       <dd>A <dfn>hard</dfn> lock will prevent others from queueing server updates or snapshotting the locked CDN. It will also block others from making changes that would change the state of the locked CDN.</dd>
                                   </dl>
                               </div>
                           </div>
                           </label>
                       </legend>
                       <div style="display: grid; grid-template-columns: auto 1fr; justify-items: start; grid-column-gap: 1.5em; grid-row-gap: 5px;">
                           <div class="row">
                               <label for="soft">Soft</label>
                               <input id="soft" name="lockType" type="radio" ng-model="lock.soft" ng-value="true" required>
                           </div>
                           <div class="row">
                               <label for="hard">Hard</label>
                               <input id="hard" name="lockType" type="radio" ng-model="lock.soft" ng-value="false" required>
                           </div>
                       </div>
                   </fieldset>
               </div>
           </div>
       </div>
       <div class="modal-footer">
           <button type="button" class="btn action-btn" ng-click="cancel()">Cancel</button>
           <button class="btn btn-link">Submit</button>
       </div>
   </form>
   ```
   also puts labels on each radio-button control, rather than just text next to them that isn't related in the DOM, which should be done. But it makes some changes to the help tooltip that don't work without extra effort, so ignore those.
   
   With those changes, when I click "Submit" without entering a message, I see:
   ![image](https://user-images.githubusercontent.com/6013378/121960516-6e1ee500-cd23-11eb-8e8a-1f7a1bfc0edd.png)
   




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651210253



##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>

Review comment:
       > I can't figure out why, but none of your error messages are showing up. Like if I leave the message blank the `small` element that says it's required doesn't show up, same if I don't select a CDN, and if I set the message to e.g. `"msg".repeat(500)` it doesn't tell me the input is too long etc.
   
   hmm. good catch...




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651195662



##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>
+                        <option disabled hidden selected value="">Select...</option>
+                    </select>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.message), 'has-feedback': hasError(lockForm.message)}">
+                    <label class="control-label" for="message">Message *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.message, 'maxlength')">Too Long</small>
+                    </label>
+                    <input id="message" name="message" type="text" class="form-control" ng-model="lock.message" ng-maxlength="256" required autofocus>

Review comment:
       `ng-maxlength` with a constant value adds an unnecessary event listener, html-native `maxlength` works just fine.




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651208570



##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>

Review comment:
       that's true but i hate having to grab extra info to figure that out...and it makes the code messier.




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651235682



##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>

Review comment:
       i think it has something to do with these modal dialogs. doesn't seem to work on dialog.select.status.tpl.html either...




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651215189



##########
File path: traffic_portal/app/src/common/modules/locks/locks.tpl.html
##########
@@ -0,0 +1,23 @@
+<!--
+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 id="locksContainer">
+    <div class="alert alert-dark" ng-repeat="l in locks">
+        <button type="button" class="close" title="Unlock {{l.cdn}}" aria-hidden="true" ng-click="confirmUnlock(l)"><i class="fa fa-unlock"></i></button>
+        <div ng-bind-html="l.cdn + ' is ' + ((l.soft) ? 'soft' : 'hard') + ' locked by ' + l.userName + ' (' + l.message + ')' | linky:'_blank'"></div>

Review comment:
       I couldn't find any examples anywhere that didn't use `ng-bind-html`, so it probably won't work without it. But I didn't actually try it.




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r652051036



##########
File path: traffic_portal/app/src/common/modules/dialog/_dialog.scss
##########
@@ -45,3 +45,16 @@
 .dialog-20 .modal-dialog {
   width: 20%;
 }
+
+.fieldset-body {
+  display: grid;
+  grid-template-columns: auto 1fr;
+  grid-column-gap: 1.5em;
+  grid-row-gap: 5px;
+  justify-items: start;
+  align-items: center;
+  ​

Review comment:
       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.

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



[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651206943



##########
File path: traffic_portal/app/src/common/modules/locks/locks.tpl.html
##########
@@ -0,0 +1,23 @@
+<!--
+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 id="locksContainer">
+    <div class="alert alert-dark" ng-repeat="l in locks">
+        <button type="button" class="close" title="Unlock {{l.cdn}}" aria-hidden="true" ng-click="confirmUnlock(l)"><i class="fa fa-unlock"></i></button>
+        <div ng-bind-html="l.cdn + ' is ' + ((l.soft) ? 'soft' : 'hard') + ' locked by ' + l.userName + ' (' + l.message + ')' | linky:'_blank'"></div>

Review comment:
       i can try. tbh, i just copied this from notifications.tpl.html which was copied from messages.tpl.html :)




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651197793



##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>
+                        <option value="">Select...</option>
+                    </select>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.message), 'has-feedback': hasError(lockForm.message)}">
+                    <label class="control-label" for="message">Message *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.message, 'maxlength')">Too Long</small>
+                    </label>
+                    <input id="message" name="message" type="text" class="form-control" ng-model="lock.message" ng-maxlength="256" required autofocus>
+                    <span ng-show="hasError(lockForm.message)" class="form-control-feedback"><i class="fa fa-times"></i></span>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+                <div class="col-sm-12 col-md-12">
+                    <div class="form-group">
+                        <p>Type *</p>

Review comment:
       thanks. that looks much better and i updated the tooltip a bit to look like this:
   
   ![image](https://user-images.githubusercontent.com/251272/121944379-d9f75280-cd0f-11eb-9e46-7b39c8462686.png)
   
   but it could use some tooltip style love i think
   




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651177239



##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>
+                        <option value="">Select...</option>
+                    </select>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.message), 'has-feedback': hasError(lockForm.message)}">
+                    <label class="control-label" for="message">Message *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.message, 'maxlength')">Too Long</small>
+                    </label>
+                    <input id="message" name="message" type="text" class="form-control" ng-model="lock.message" ng-maxlength="256" required autofocus>
+                    <span ng-show="hasError(lockForm.message)" class="form-control-feedback"><i class="fa fa-times"></i></span>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+                <div class="col-sm-12 col-md-12">
+                    <div class="form-group">
+                        <p>Type *</p>

Review comment:
       ```html
   <div class="modal-header">
       <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
       <h4 class="modal-title">Create CDN Lock</h4>
   </div>
   <div class="modal-body">
       <form name="lockForm" novalidate>
           <div class="row">
               <div class="col-sm-12 col-md-12">
                   <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
                       <label class="control-label" for="cdn">CDN *
                           <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
                       </label>
                       <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>
                           <option disabled hidden selected value="">Select...</option>
                       </select>
                   </div>
               </div>
           </div>
           <div class="row">
               <div class="col-sm-12 col-md-12">
                   <div class="form-group" ng-class="{'has-error': hasError(lockForm.message), 'has-feedback': hasError(lockForm.message)}">
                       <label class="control-label" for="message">Message *
                           <small class="input-error" ng-show="hasPropertyError(lockForm.message, 'maxlength')">Too Long</small>
                       </label>
                       <input id="message" name="message" type="text" class="form-control" ng-model="lock.message" maxlength="256" required autofocus>
                       <span ng-show="hasError(lockForm.message)" class="form-control-feedback"><i class="fa fa-times"></i></span>
                   </div>
               </div>
           </div>
           <div class="row">
               <div class="col-sm-12 col-md-12">
                   <fieldset class="form-group" ng-class="{'has-error': hasError(lockform.lockType)}">
                       <legend>Type</legend>
                       <input id="soft" name="lockType" type="radio" ng-model="lock.soft" ng-value="true" required>
                       <label class="has-tooltip" for="soft">Soft<div class="helptooltip">
                           <div class="helptext">A soft lock will prevent others from queueing server updates or snapshotting the locked CDN.</div>
                       </div>
                       </label><br>
                       <input id="hard" name="lockType" type="radio" ng-model="lock.soft" ng-value="false" required>
                       <label class="has-tooltip" for="soft">Hard<div class="helptooltip">
                           <div class="helptext">A hard lock will prevent others from queueing server updates or snapshotting the locked CDN. It will also block others from making changes that would change the state of the locked CDN.</div>
                       </div>
                       </label>
                   </fieldset>
               </div>
           </div>
       </form>
   </div>
   <div class="modal-footer">
       <button type="button" class="btn action-btn" ng-click="cancel()">Cancel</button>
       <button type="button" class="btn btn-link" ng-disabled="lockForm.$invalid" ng-click="select()">Submit</button>
   </div>
   ```




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651162261



##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>
+                        <option value="">Select...</option>
+                    </select>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.message), 'has-feedback': hasError(lockForm.message)}">
+                    <label class="control-label" for="message">Message *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.message, 'maxlength')">Too Long</small>
+                    </label>
+                    <input id="message" name="message" type="text" class="form-control" ng-model="lock.message" ng-maxlength="256" required autofocus>
+                    <span ng-show="hasError(lockForm.message)" class="form-control-feedback"><i class="fa fa-times"></i></span>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+                <div class="col-sm-12 col-md-12">
+                    <div class="form-group">
+                        <p>Type *</p>
+                        <input id="soft" type="radio" data-ng-model="lock.soft" data-ng-value="true">
+                        <label class="has-tooltip" for="soft">&nbsp;Soft<div class="helptooltip">
+                            <div class="helptext">A soft lock will prevent others from queueing server updates or snapshotting the locked CDN.</div>
+                        </div>
+                        </label><br>
+                        <input id="hard" type="radio" data-ng-model="lock.soft" data-ng-value="false">
+                        <label class="has-tooltip" for="soft">&nbsp;Hard<div class="helptooltip">
+                            <div class="helptext">A hard lock will prevent others from queueing server updates or snapshotting the locked CDN. It will also block others from making changes that would change the state of the locked CDN.</div>
+                        </div>
+                        </label>
+                    </div>
+            </div>
+        </div>
+    </form>
+</div>
+<div class="modal-footer">

Review comment:
       you shouldn't have to do any styling - although you're right that you would. The `modal-footer` class should handle all the necessary styling, but there's some specific styling for `footer` elements in `theme.scss` that would interfere - which really ought to not be doing that.




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651934987



##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>

Review comment:
       hmm. that seemed to have issues for me. tooltip cutoff on top. bad styling on radio buttons (chrome). i pushed something else. check it out. submit button is enabled/disabled when missing form values which seems pretty good and maybe good enough considering how simple this form is. also, made separate tooltip for each to prevent cutoff.




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651177446



##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>
+                        <option value="">Select...</option>
+                    </select>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.message), 'has-feedback': hasError(lockForm.message)}">
+                    <label class="control-label" for="message">Message *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.message, 'maxlength')">Too Long</small>
+                    </label>
+                    <input id="message" name="message" type="text" class="form-control" ng-model="lock.message" ng-maxlength="256" required autofocus>
+                    <span ng-show="hasError(lockForm.message)" class="form-control-feedback"><i class="fa fa-times"></i></span>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+                <div class="col-sm-12 col-md-12">
+                    <div class="form-group">
+                        <p>Type *</p>
+                        <input id="soft" type="radio" data-ng-model="lock.soft" data-ng-value="true">
+                        <label class="has-tooltip" for="soft">&nbsp;Soft<div class="helptooltip">
+                            <div class="helptext">A soft lock will prevent others from queueing server updates or snapshotting the locked CDN.</div>
+                        </div>
+                        </label><br>
+                        <input id="hard" type="radio" data-ng-model="lock.soft" data-ng-value="false">

Review comment:
       seems you got it to work without `data-`




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651189271



##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>

Review comment:
       I think this shouldn't show CDNs that are already locked, since that couldn't possibly succeed




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651135791



##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>
+                        <option value="">Select...</option>
+                    </select>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.message), 'has-feedback': hasError(lockForm.message)}">
+                    <label class="control-label" for="message">Message *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.message, 'maxlength')">Too Long</small>
+                    </label>
+                    <input id="message" name="message" type="text" class="form-control" ng-model="lock.message" ng-maxlength="256" required autofocus>
+                    <span ng-show="hasError(lockForm.message)" class="form-control-feedback"><i class="fa fa-times"></i></span>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+                <div class="col-sm-12 col-md-12">
+                    <div class="form-group">
+                        <p>Type *</p>
+                        <input id="soft" type="radio" data-ng-model="lock.soft" data-ng-value="true">
+                        <label class="has-tooltip" for="soft">&nbsp;Soft<div class="helptooltip">
+                            <div class="helptext">A soft lock will prevent others from queueing server updates or snapshotting the locked CDN.</div>
+                        </div>
+                        </label><br>
+                        <input id="hard" type="radio" data-ng-model="lock.soft" data-ng-value="false">
+                        <label class="has-tooltip" for="soft">&nbsp;Hard<div class="helptooltip">

Review comment:
       i'll just lose the hardcoded space




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651279600



##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>
+                        <option value="">Select...</option>
+                    </select>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.message), 'has-feedback': hasError(lockForm.message)}">
+                    <label class="control-label" for="message">Message *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.message, 'maxlength')">Too Long</small>
+                    </label>
+                    <input id="message" name="message" type="text" class="form-control" ng-model="lock.message" ng-maxlength="256" required autofocus>
+                    <span ng-show="hasError(lockForm.message)" class="form-control-feedback"><i class="fa fa-times"></i></span>
+                </div>
+            </div>
+        </div>
+        <div class="row">
+                <div class="col-sm-12 col-md-12">
+                    <div class="form-group">
+                        <p>Type *</p>

Review comment:
       yeah, I think ideally that would be off to the side or underneath. The modal is too close to the top, seems like certain font settings might cut it off. Also, seems like that's making a definition list, so `<dl>`/`<dt>`/`<dd>` might be more appropriate than `<ul>`/`<li>`, though I tried that out and that **did** get cut off at the top.




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651934987



##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>

Review comment:
       hmm. that seemed to have issues for me. tooltip cutoff on top. bad styling on radio buttons (chrome). i pushed something else. check it out. submit button is enabled/disabled when missing form values which seems pretty good and maybe good enough considering how simple this form is. also, made separate tooltip for each to prevent cutoff.
   
   ![image](https://user-images.githubusercontent.com/251272/122086423-edaec180-cdc0-11eb-8659-289c2c6913aa.png)
   




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651239837



##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>

Review comment:
       i just removed the errors from the form. i don't think they are necessary. the submit button is only enabled when you fill out the form right.




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651934987



##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>

Review comment:
       hmm. that seemed to have issues for me. tooltip cutoff on top. bad styling on radio buttons (chrome). i pushed something else. check it out. submit button is enabled/disabled when missing form values which seems pretty good.




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] mitchell852 commented on pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#issuecomment-861852221


   rebased to master


-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651138887



##########
File path: traffic_portal/app/src/common/modules/locks/locks.tpl.html
##########
@@ -0,0 +1,23 @@
+<!--
+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 id="locksContainer">
+    <div class="alert alert-dark" ng-repeat="l in locks">
+        <button type="button" class="close" title="Unlock {{l.cdn}}" aria-hidden="true" ng-click="confirmUnlock(l)"><i class="fa fa-unlock"></i></button>
+        <div ng-bind-html="l.cdn + ' is ' + ((l.soft) ? 'soft' : 'hard') + ' locked by ' + l.userName + ' (' + l.message + ')' | linky:'_blank'"></div>

Review comment:
       because of the linky directive




-- 
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:
users@infra.apache.org



[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #5934: TP: Adds ability to view/create/delete a cdn lock

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on a change in pull request #5934:
URL: https://github.com/apache/trafficcontrol/pull/5934#discussion_r651208570



##########
File path: traffic_portal/app/src/common/modules/dialog/select/lock/dialog.select.lock.tpl.html
##########
@@ -0,0 +1,69 @@
+<!--
+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="modal-header">
+    <button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+    <h4 class="modal-title">Create CDN Lock</h4>
+</div>
+<div class="modal-body">
+    <form name="lockForm" novalidate>
+        <div class="row">
+            <div class="col-sm-12 col-md-12">
+                <div class="form-group" ng-class="{'has-error': hasError(lockForm.cdn), 'has-feedback': hasError(lockForm.cdn)}">
+                    <label class="control-label" for="cdn">CDN *
+                        <small class="input-error" ng-show="hasPropertyError(lockForm.cdn, 'required')">Required</small>
+                    </label>
+                    <select id="cdn" name="cdn" class="form-control" ng-model="lock.cdn" ng-options="cdn.name as cdn.name for cdn in cdns" required>

Review comment:
       that's true but i hate having to grab extra info to figure that out...and it makes the code messier. unfortunately if a cdn is locked/not-locked is not part of the cdn object.




-- 
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:
users@infra.apache.org