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 2018/06/01 16:26:00 UTC

[GitHub] mitchell852 closed pull request #2348: Implement Traffic Portal Coordinates CRUD

mitchell852 closed pull request #2348: Implement Traffic Portal Coordinates CRUD
URL: https://github.com/apache/incubator-trafficcontrol/pull/2348
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/traffic_portal/app/src/app.js b/traffic_portal/app/src/app.js
index 161c73c2d..d41d49747 100644
--- a/traffic_portal/app/src/app.js
+++ b/traffic_portal/app/src/app.js
@@ -84,6 +84,10 @@ var trafficPortal = angular.module('trafficPortal', [
         require('./modules/private/cdns/servers').name,
         require('./modules/private/changeLogs').name,
         require('./modules/private/changeLogs/list').name,
+        require('./modules/private/coordinates').name,
+        require('./modules/private/coordinates/edit').name,
+        require('./modules/private/coordinates/list').name,
+        require('./modules/private/coordinates/new').name,
         require('./modules/private/dashboard').name,
         require('./modules/private/dashboard/view').name,
         require('./modules/private/deliveryServiceRequests').name,
@@ -229,6 +233,9 @@ var trafficPortal = angular.module('trafficPortal', [
         require('./common/modules/form/cdn/new').name,
         require('./common/modules/form/cdnDnssecKeys').name,
         require('./common/modules/form/cdnDnssecKeys/generate').name,
+        require('./common/modules/form/coordinate').name,
+        require('./common/modules/form/coordinate/edit').name,
+        require('./common/modules/form/coordinate/new').name,
         require('./common/modules/form/deliveryService').name,
         require('./common/modules/form/deliveryService/clone').name,
         require('./common/modules/form/deliveryService/edit').name,
@@ -302,6 +309,7 @@ var trafficPortal = angular.module('trafficPortal', [
         require('./common/modules/table/cdnFederationUsers').name,
         require('./common/modules/table/cdnProfiles').name,
         require('./common/modules/table/cdnServers').name,
+        require('./common/modules/table/coordinates').name,
         require('./common/modules/table/deliveryServices').name,
         require('./common/modules/table/deliveryServiceJobs').name,
         require('./common/modules/table/deliveryServiceRegexes').name,
diff --git a/traffic_portal/app/src/common/api/CoordinateService.js b/traffic_portal/app/src/common/api/CoordinateService.js
new file mode 100644
index 000000000..5aa714691
--- /dev/null
+++ b/traffic_portal/app/src/common/api/CoordinateService.js
@@ -0,0 +1,82 @@
+/*
+ * 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 CoordinateService = function($http, $q, Restangular, locationUtils, messageModel, ENV) {
+
+    this.getCoordinates = function(queryParams) {
+        return Restangular.all('coordinates').getList(queryParams);
+    };
+
+	this.createCoordinate = function(coordinate) {
+		var request = $q.defer();
+
+		$http.post(ENV.api['root'] + "coordinates", coordinate)
+			.then(
+				function(response) {
+                    messageModel.setMessages(response.data.alerts, true);
+                    locationUtils.navigateToPath('/coordinates');
+					request.resolve(result);
+				},
+				function(fault) {
+                    messageModel.setMessages(fault.data.alerts, false)
+					request.reject(fault);
+				}
+			);
+
+		return request.promise;
+	};
+
+    this.updateCoordinate = function(id, coordinate) {
+        var request = $q.defer();
+
+        $http.put(ENV.api['root'] + "coordinates?id=" + id, coordinate)
+            .then(
+                function(response) {
+                    messageModel.setMessages(response.data.alerts, false);
+                    request.resolve();
+                },
+                function(fault) {
+                    messageModel.setMessages(fault.data.alerts, false);
+                    request.reject();
+                }
+            );
+        return request.promise;
+    };
+
+    this.deleteCoordinate = function(id) {
+        var deferred = $q.defer();
+
+        $http.delete(ENV.api['root'] + "coordinates?id=" + id)
+            .then(
+                function(response) {
+                    messageModel.setMessages(response.data.alerts, true);
+                    deferred.resolve(response);
+                },
+                function(fault) {
+                    messageModel.setMessages(fault.data.alerts, false);
+                    deferred.reject(fault);
+                }
+            );
+        return deferred.promise;
+    };
+
+};
+
+CoordinateService.$inject = ['$http', '$q', 'Restangular', 'locationUtils', 'messageModel', 'ENV'];
+module.exports = CoordinateService;
diff --git a/traffic_portal/app/src/common/api/index.js b/traffic_portal/app/src/common/api/index.js
index aa7ee5928..771faa59a 100644
--- a/traffic_portal/app/src/common/api/index.js
+++ b/traffic_portal/app/src/common/api/index.js
@@ -26,6 +26,7 @@ module.exports = angular.module('trafficPortal.api', [])
 	.service('capabilityService', require('./CapabilityService'))
 	.service('cdnService', require('./CDNService'))
     .service('changeLogService', require('./ChangeLogService'))
+    .service('coordinateService', require('./CoordinateService'))
     .service('deliveryServiceService', require('./DeliveryServiceService'))
 	.service('deliveryServiceRegexService', require('./DeliveryServiceRegexService'))
 	.service('deliveryServiceRequestService', require('./DeliveryServiceRequestService'))
diff --git a/traffic_portal/app/src/common/modules/form/cacheGroup/form.cacheGroup.tpl.html b/traffic_portal/app/src/common/modules/form/cacheGroup/form.cacheGroup.tpl.html
index 292897091..fb0aa1a98 100644
--- a/traffic_portal/app/src/common/modules/form/cacheGroup/form.cacheGroup.tpl.html
+++ b/traffic_portal/app/src/common/modules/form/cacheGroup/form.cacheGroup.tpl.html
@@ -85,18 +85,20 @@
             <div class="form-group" ng-class="{'has-error': hasError(cacheGroupForm.latitude), 'has-feedback': hasError(cacheGroupForm.latitude)}">
                 <label class="control-label col-md-2 col-sm-2 col-xs-12">Geo Magnetic Latitude *</label>
                 <div class="col-md-10 col-sm-10 col-xs-12">
-                    <input name="latitude" type="number" class="form-control" ng-model="cacheGroup.latitude" ng-pattern="/^[-+]?[0-9]*\.?[0-9]+$/" required autofocus>
-                    <small class="input-error" ng-show="hasPropertyError(cacheGroupForm.latitude, 'required')">Required Coordinate</small>
-                    <small class="input-error" ng-show="hasPropertyError(cacheGroupForm.latitude, 'pattern')">Invalid Coordinate</small>
+                    <input name="latitude" type="number" class="form-control" ng-model="cacheGroup.latitude" ng-min="-90.0" ng-max="90.0" required autofocus>
+                    <small class="input-error" ng-show="hasPropertyError(cacheGroupForm.latitude, 'required')">Required latitude</small>
+                    <small class="input-error" ng-show="hasPropertyError(cacheGroupForm.latitude, 'min')">Invalid latitude. Must be between -90.0 and 90.0</small>
+                    <small class="input-error" ng-show="hasPropertyError(cacheGroupForm.latitude, 'max')">Invalid latitude. Must be between -90.0 and 90.0</small>
                     <span ng-show="hasError(cacheGroupForm.latitude)" class="form-control-feedback"><i class="fa fa-times"></i></span>
                 </div>
             </div>
             <div class="form-group" ng-class="{'has-error': hasError(cacheGroupForm.longitude), 'has-feedback': hasError(cacheGroupForm.longitude)}">
                 <label class="control-label col-md-2 col-sm-2 col-xs-12">Geo Magnetic Longitude *</label>
                 <div class="col-md-10 col-sm-10 col-xs-12">
-                    <input name="longitude" type="number" class="form-control" ng-model="cacheGroup.longitude" ng-pattern="/^[-+]?[0-9]*\.?[0-9]+$/" required autofocus>
-                    <small class="input-error" ng-show="hasPropertyError(cacheGroupForm.longitude, 'required')">Required Coordinate</small>
-                    <small class="input-error" ng-show="hasPropertyError(cacheGroupForm.longitude, 'pattern')">Invalid Coordinate</small>
+                    <input name="longitude" type="number" class="form-control" ng-model="cacheGroup.longitude" ng-min="-180.0" ng-max="180.0" required autofocus>
+                    <small class="input-error" ng-show="hasPropertyError(cacheGroupForm.longitude, 'required')">Required longitude</small>
+                    <small class="input-error" ng-show="hasPropertyError(cacheGroupForm.longitude, 'min')">Invalid longitude. Must be between -180.0 and 180.0</small>
+                    <small class="input-error" ng-show="hasPropertyError(cacheGroupForm.longitude, 'max')">Invalid longitude. Must be between -180.0 and 180.0</small>
                     <span ng-show="hasError(cacheGroupForm.longitude)" class="form-control-feedback"><i class="fa fa-times"></i></span>
                 </div>
             </div>
diff --git a/traffic_portal/app/src/common/modules/form/coordinate/FormCoordinateController.js b/traffic_portal/app/src/common/modules/form/coordinate/FormCoordinateController.js
new file mode 100644
index 000000000..e4d265450
--- /dev/null
+++ b/traffic_portal/app/src/common/modules/form/coordinate/FormCoordinateController.js
@@ -0,0 +1,45 @@
+/*
+ * 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 FormCoordinateController = function(coordinate, $scope, $location, formUtils, locationUtils, coordinateService) {
+
+    var getCoordinates = function() {
+        coordinateService.getCoordinates({ orderby: 'name' })
+            .then(function(result) {
+                $scope.coordinates = result;
+            });
+    };
+
+    $scope.coordinate = coordinate;
+
+    $scope.navigateToPath = locationUtils.navigateToPath;
+
+    $scope.hasError = formUtils.hasError;
+
+    $scope.hasPropertyError = formUtils.hasPropertyError;
+
+    var init = function () {
+        getCoordinates();
+    };
+    init();
+
+};
+
+FormCoordinateController.$inject = ['coordinate', '$scope', '$location', 'formUtils', 'locationUtils', 'coordinateService'];
+module.exports = FormCoordinateController;
diff --git a/traffic_portal/app/src/common/modules/form/coordinate/edit/FormEditCoordinateController.js b/traffic_portal/app/src/common/modules/form/coordinate/edit/FormEditCoordinateController.js
new file mode 100644
index 000000000..1b346385c
--- /dev/null
+++ b/traffic_portal/app/src/common/modules/form/coordinate/edit/FormEditCoordinateController.js
@@ -0,0 +1,73 @@
+/*
+ * 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 FormEditCoordinateController = function(coordinate, $scope, $controller, $uibModal, $anchorScroll, locationUtils, coordinateService) {
+
+    $scope.coordinate = coordinate[0]
+
+    // extends the FormCoordinateController to inherit common methods
+    angular.extend(this, $controller('FormCoordinateController', { coordinate: $scope.coordinate, $scope: $scope }));
+
+    $scope.coordinateName = angular.copy($scope.coordinate.name);
+
+    $scope.settings = {
+        isNew: false,
+        saveLabel: 'Update'
+    };
+
+    var deleteCoordinate = function(coordinate) {
+        coordinateService.deleteCoordinate(coordinate.id)
+            .then(function() {
+                locationUtils.navigateToPath('/coordinates');
+            });
+    };
+
+    $scope.save = function(coordinate) {
+        coordinateService.updateCoordinate(coordinate.id, coordinate).
+            then(function() {
+                $scope.coordinateName = angular.copy(coordinate.name);
+                $anchorScroll(); // scrolls window to top
+            });
+    };
+
+    $scope.confirmDelete = function(coordinate) {
+        var params = {
+            title: 'Delete Coordinate: ' + coordinate.name,
+            key: coordinate.name
+        };
+        var modalInstance = $uibModal.open({
+            templateUrl: 'common/modules/dialog/delete/dialog.delete.tpl.html',
+            controller: 'DialogDeleteController',
+            size: 'md',
+            resolve: {
+                params: function () {
+                    return params;
+                }
+            }
+        });
+        modalInstance.result.then(function() {
+            deleteCoordinate(coordinate);
+        }, function () {
+            // do nothing
+        });
+    };
+};
+
+FormEditCoordinateController.$inject = ['coordinate', '$scope', '$controller', '$uibModal', '$anchorScroll', 'locationUtils', 'coordinateService'];
+module.exports = FormEditCoordinateController;
diff --git a/traffic_portal/app/src/common/modules/form/coordinate/edit/index.js b/traffic_portal/app/src/common/modules/form/coordinate/edit/index.js
new file mode 100644
index 000000000..c4187ccfe
--- /dev/null
+++ b/traffic_portal/app/src/common/modules/form/coordinate/edit/index.js
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+
+module.exports = angular.module('trafficPortal.form.coordinate.edit', [])
+    .controller('FormEditCoordinateController', require('./FormEditCoordinateController'));
diff --git a/traffic_portal/app/src/common/modules/form/coordinate/form.coordinate.tpl.html b/traffic_portal/app/src/common/modules/form/coordinate/form.coordinate.tpl.html
new file mode 100644
index 000000000..7371bafcb
--- /dev/null
+++ b/traffic_portal/app/src/common/modules/form/coordinate/form.coordinate.tpl.html
@@ -0,0 +1,67 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<div class="x_panel">
+    <div class="x_title">
+        <ol class="breadcrumb pull-left">
+            <li><a ng-click="navigateToPath('/coordinates')">Coordinates</a></li>
+            <li class="active">{{coordinateName}}</li>
+        </ol>
+        <div class="clearfix"></div>
+    </div>
+    <div class="x_content">
+        <br>
+        <form name="coordinateForm" class="form-horizontal form-label-left" novalidate>
+            <div class="form-group" ng-class="{'has-error': hasError(coordinateForm.name), 'has-feedback': hasError(coordinateForm.name)}">
+                <label class="control-label col-md-2 col-sm-2 col-xs-12">Name *</label>
+                <div class="col-md-10 col-sm-10 col-xs-12">
+                    <input name="name" type="text" class="form-control" ng-model="coordinate.name" ng-maxlength="45" ng-pattern="/^\S*$/" required autofocus>
+                    <small class="input-error" ng-show="hasPropertyError(coordinateForm.name, 'required')">Required</small>
+                    <small class="input-error" ng-show="hasPropertyError(coordinateForm.name, 'maxlength')">Too Long</small>
+                    <small class="input-error" ng-show="hasPropertyError(coordinateForm.name, 'pattern')">No spaces</small>
+                    <span ng-show="hasError(coordinateForm.name)" class="form-control-feedback"><i class="fa fa-times"></i></span>
+                </div>
+            </div>
+            <div class="form-group" ng-class="{'has-error': hasError(coordinateForm.latitude), 'has-feedback': hasError(coordinateForm.latitude)}">
+                <label class="control-label col-md-2 col-sm-2 col-xs-12">Geo Magnetic Latitude *</label>
+                <div class="col-md-10 col-sm-10 col-xs-12">
+                    <input name="latitude" type="number" class="form-control" ng-model="coordinate.latitude" ng-min="-90.0" ng-max="90.0" required autofocus>
+                    <small class="input-error" ng-show="hasPropertyError(coordinateForm.latitude, 'required')">Required latitude</small>
+                    <small class="input-error" ng-show="hasPropertyError(coordinateForm.latitude, 'min')">Invalid latitude. Must be between -90.0 and 90.0</small>
+                    <small class="input-error" ng-show="hasPropertyError(coordinateForm.latitude, 'max')">Invalid latitude. Must be between -90.0 and 90.0</small>
+                    <span ng-show="hasError(coordinateForm.latitude)" class="form-control-feedback"><i class="fa fa-times"></i></span>
+                </div>
+            </div>
+            <div class="form-group" ng-class="{'has-error': hasError(coordinateForm.longitude), 'has-feedback': hasError(coordinateForm.longitude)}">
+                <label class="control-label col-md-2 col-sm-2 col-xs-12">Geo Magnetic Longitude *</label>
+                <div class="col-md-10 col-sm-10 col-xs-12">
+                    <input name="longitude" type="number" class="form-control" ng-model="coordinate.longitude" ng-min="-180.0" ng-max="180.0" required autofocus>
+                    <small class="input-error" ng-show="hasPropertyError(coordinateForm.longitude, 'required')">Required longitude</small>
+                    <small class="input-error" ng-show="hasPropertyError(coordinateForm.longitude, 'min')">Invalid longitude. Must be between -180.0 and 180.0</small>
+                    <small class="input-error" ng-show="hasPropertyError(coordinateForm.longitude, 'max')">Invalid longitude. Must be between -180.0 and 180.0</small>
+                    <span ng-show="hasError(coordinateForm.longitude)" class="form-control-feedback"><i class="fa fa-times"></i></span>
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-danger" ng-show="!settings.isNew" ng-click="confirmDelete(coordinate)">Delete</button>
+                <button type="button" class="btn btn-success" ng-disabled="coordinateForm.$pristine || coordinateForm.$invalid" ng-click="save(coordinate)">{{settings.saveLabel}}</button>
+            </div>
+        </form>
+    </div>
+</div>
diff --git a/traffic_portal/app/src/common/modules/form/coordinate/index.js b/traffic_portal/app/src/common/modules/form/coordinate/index.js
new file mode 100644
index 000000000..cb5a3ebc8
--- /dev/null
+++ b/traffic_portal/app/src/common/modules/form/coordinate/index.js
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+
+module.exports = angular.module('trafficPortal.form.coordinate', [])
+    .controller('FormCoordinateController', require('./FormCoordinateController'));
diff --git a/traffic_portal/app/src/common/modules/form/coordinate/new/FormNewCoordinateController.js b/traffic_portal/app/src/common/modules/form/coordinate/new/FormNewCoordinateController.js
new file mode 100644
index 000000000..a398a64af
--- /dev/null
+++ b/traffic_portal/app/src/common/modules/form/coordinate/new/FormNewCoordinateController.js
@@ -0,0 +1,39 @@
+/*
+ * 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 FormNewCoordinateController = function(coordinate, $scope, $controller, coordinateService) {
+
+    // extends the FormCoordinateController to inherit common methods
+    angular.extend(this, $controller('FormCoordinateController', { coordinate: coordinate, $scope: $scope }));
+
+    $scope.coordinateName = 'New';
+
+    $scope.settings = {
+        isNew: true,
+        saveLabel: 'Create'
+    };
+
+    $scope.save = function(coordinate) {
+        coordinateService.createCoordinate(coordinate);
+    };
+
+};
+
+FormNewCoordinateController.$inject = ['coordinate', '$scope', '$controller', 'coordinateService'];
+module.exports = FormNewCoordinateController;
diff --git a/traffic_portal/app/src/common/modules/form/coordinate/new/index.js b/traffic_portal/app/src/common/modules/form/coordinate/new/index.js
new file mode 100644
index 000000000..8bd46a032
--- /dev/null
+++ b/traffic_portal/app/src/common/modules/form/coordinate/new/index.js
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+
+module.exports = angular.module('trafficPortal.form.coordinate.new', [])
+    .controller('FormNewCoordinateController', require('./FormNewCoordinateController'));
diff --git a/traffic_portal/app/src/common/modules/navigation/navigation.tpl.html b/traffic_portal/app/src/common/modules/navigation/navigation.tpl.html
index d57ef47e8..bcd7bc5c0 100644
--- a/traffic_portal/app/src/common/modules/navigation/navigation.tpl.html
+++ b/traffic_portal/app/src/common/modules/navigation/navigation.tpl.html
@@ -51,6 +51,7 @@
                 <li class="side-menu-category"><a href="javascript:void(0);"><i class="fa fa-sm fa-chevron-right"></i> Topology</span></a>
                     <ul class="nav child_menu" style="display: none">
                         <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficPortal.private.cacheGroups')}"><a href="/#!/cache-groups">Cache Groups</a></li>
+                        <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficPortal.private.coordinates')}"><a href="/#!/coordinates">Coordinates</a></li>
                         <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficPortal.private.physLocations')}"><a href="/#!/phys-locations">Phys Locations</a></li>
                         <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficPortal.private.divisions')}"><a href="/#!/divisions">Divisions</a></li>
                         <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficPortal.private.regions')}"><a href="/#!/regions">Regions</a></li>
diff --git a/traffic_portal/app/src/common/modules/table/coordinates/TableCoordinatesController.js b/traffic_portal/app/src/common/modules/table/coordinates/TableCoordinatesController.js
new file mode 100644
index 000000000..612370190
--- /dev/null
+++ b/traffic_portal/app/src/common/modules/table/coordinates/TableCoordinatesController.js
@@ -0,0 +1,47 @@
+/*
+ * 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 TableCoordinatesController = function(coordinates, $scope, $state, locationUtils) {
+
+    $scope.coordinates = coordinates;
+
+    $scope.editCoordinate = function(id) {
+        locationUtils.navigateToPath('/coordinates/' + id);
+    };
+
+    $scope.createCoordinate = function() {
+        locationUtils.navigateToPath('/coordinates/new');
+    };
+
+    $scope.refresh = function() {
+        $state.reload(); // reloads all the resolves for the view
+    };
+
+    angular.element(document).ready(function () {
+        $('#coordinatesTable').dataTable({
+            "aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]],
+            "iDisplayLength": 25,
+            "aaSorting": []
+        });
+    });
+
+};
+
+TableCoordinatesController.$inject = ['coordinates', '$scope', '$state', 'locationUtils'];
+module.exports = TableCoordinatesController;
diff --git a/traffic_portal/app/src/common/modules/table/coordinates/index.js b/traffic_portal/app/src/common/modules/table/coordinates/index.js
new file mode 100644
index 000000000..10016bd9d
--- /dev/null
+++ b/traffic_portal/app/src/common/modules/table/coordinates/index.js
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+
+module.exports = angular.module('trafficPortal.table.coordinates', [])
+    .controller('TableCoordinatesController', require('./TableCoordinatesController'));
diff --git a/traffic_portal/app/src/common/modules/table/coordinates/table.coordinates.tpl.html b/traffic_portal/app/src/common/modules/table/coordinates/table.coordinates.tpl.html
new file mode 100644
index 000000000..2b57d2aca
--- /dev/null
+++ b/traffic_portal/app/src/common/modules/table/coordinates/table.coordinates.tpl.html
@@ -0,0 +1,50 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<div class="x_panel">
+    <div class="x_title">
+        <ol class="breadcrumb pull-left">
+            <li class="active">Coordinates</li>
+        </ol>
+        <div class="pull-right" role="group" ng-if="!settings.isNew">
+            <button class="btn btn-primary" title="Create Coordinate" ng-click="createCoordinate()"><i class="fa fa-plus"></i></button>
+            <button class="btn btn-default" title="Refresh" ng-click="refresh()"><i class="fa fa-refresh"></i></button>
+        </div>
+        <div class="clearfix"></div>
+    </div>
+    <div class="x_content">
+        <br>
+        <table id="coordinatesTable" class="table responsive-utilities jambo_table">
+            <thead>
+            <tr class="headings">
+                <th>Name</th>
+                <th>Latitude</th>
+                <th>Longitude</th>
+            </tr>
+            </thead>
+            <tbody>
+            <tr ng-click="editCoordinate(c.id)" ng-repeat="c in ::coordinates">
+                <td data-search="^{{::c.name}}$">{{::c.name}}</td>
+                <td data-search="^{{::c.latitude}}$">{{::c.latitude}}</td>
+                <td data-search="^{{::c.longitude}}$">{{::c.longitude}}</td>
+            </tr>
+            </tbody>
+        </table>
+    </div>
+</div>
diff --git a/traffic_portal/app/src/modules/private/coordinates/coordinates.tpl.html b/traffic_portal/app/src/modules/private/coordinates/coordinates.tpl.html
new file mode 100644
index 000000000..c0280f876
--- /dev/null
+++ b/traffic_portal/app/src/modules/private/coordinates/coordinates.tpl.html
@@ -0,0 +1,22 @@
+<!--
+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="coordinatesContainer">
+    <div ui-view="coordinatesContent"></div>
+</div>
diff --git a/traffic_portal/app/src/modules/private/coordinates/edit/index.js b/traffic_portal/app/src/modules/private/coordinates/edit/index.js
new file mode 100644
index 000000000..307c1fa72
--- /dev/null
+++ b/traffic_portal/app/src/modules/private/coordinates/edit/index.js
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+module.exports = angular.module('trafficPortal.private.coordinates.edit', [])
+    .config(function($stateProvider, $urlRouterProvider) {
+        $stateProvider
+            .state('trafficPortal.private.coordinates.edit', {
+                url: '/{coordinateId:[0-9]{1,8}}',
+                views: {
+                    coordinatesContent: {
+                        templateUrl: 'common/modules/form/coordinate/form.coordinate.tpl.html',
+                        controller: 'FormEditCoordinateController',
+                        resolve: {
+                            coordinate: function($stateParams, coordinateService) {
+                                return coordinateService.getCoordinates({ id: $stateParams.coordinateId });
+                            }
+                        }
+                    }
+                }
+            })
+        ;
+        $urlRouterProvider.otherwise('/');
+    });
diff --git a/traffic_portal/app/src/modules/private/coordinates/index.js b/traffic_portal/app/src/modules/private/coordinates/index.js
new file mode 100644
index 000000000..c9a7abe2a
--- /dev/null
+++ b/traffic_portal/app/src/modules/private/coordinates/index.js
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+module.exports = angular.module('trafficPortal.private.coordinates', [])
+    .config(function($stateProvider, $urlRouterProvider) {
+        $stateProvider
+            .state('trafficPortal.private.coordinates', {
+                url: 'coordinates',
+                abstract: true,
+                views: {
+                    privateContent: {
+                        templateUrl: 'modules/private/coordinates/coordinates.tpl.html'
+                    }
+                }
+            })
+        ;
+        $urlRouterProvider.otherwise('/');
+    });
diff --git a/traffic_portal/app/src/modules/private/coordinates/list/index.js b/traffic_portal/app/src/modules/private/coordinates/list/index.js
new file mode 100644
index 000000000..b53be9eb1
--- /dev/null
+++ b/traffic_portal/app/src/modules/private/coordinates/list/index.js
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+module.exports = angular.module('trafficPortal.private.coordinates.list', [])
+    .config(function($stateProvider, $urlRouterProvider) {
+        $stateProvider
+            .state('trafficPortal.private.coordinates.list', {
+                url: '',
+                views: {
+                    coordinatesContent: {
+                        templateUrl: 'common/modules/table/coordinates/table.coordinates.tpl.html',
+                        controller: 'TableCoordinatesController',
+                        resolve: {
+                            coordinates: function(coordinateService) {
+                                return coordinateService.getCoordinates({ orderby: 'name' });
+                            }
+                        }
+                    }
+                }
+            })
+        ;
+        $urlRouterProvider.otherwise('/');
+    });
diff --git a/traffic_portal/app/src/modules/private/coordinates/new/index.js b/traffic_portal/app/src/modules/private/coordinates/new/index.js
new file mode 100644
index 000000000..7eb607395
--- /dev/null
+++ b/traffic_portal/app/src/modules/private/coordinates/new/index.js
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+module.exports = angular.module('trafficPortal.private.coordinates.new', [])
+    .config(function($stateProvider, $urlRouterProvider) {
+        $stateProvider
+            .state('trafficPortal.private.coordinates.new', {
+                url: '/new',
+                views: {
+                    coordinatesContent: {
+                        templateUrl: 'common/modules/form/coordinate/form.coordinate.tpl.html',
+                        controller: 'FormNewCoordinateController',
+                        resolve: {
+                            coordinate: function() {
+                                return {};
+                            }
+                        }
+                    }
+                }
+            })
+        ;
+        $urlRouterProvider.otherwise('/');
+    });


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services