summaryrefslogtreecommitdiffstats
path: root/3rd_party/static/onap-ui/shared/alerts
diff options
context:
space:
mode:
authorpkaralis <pkaralis@intracom-telecom.com>2018-12-06 00:43:12 +0200
committerPanagiotis Karalis <pkaralis@intracom-telecom.com>2019-03-20 15:28:23 +0200
commitd0bbf3b8952379883550c6eb2062476a6d15043e (patch)
tree106f65b223054077279bda7ff988a73bea314a34 /3rd_party/static/onap-ui/shared/alerts
parent5f20495d6e3ec984c4e86fd76399ddf0d042b336 (diff)
Enable Web Portal for ONAP results
The web portal needs to be able to read test results of the ONAP compliance program and display them. In order for the above goal to be achieved, the following two parts should be impacted: 1- A new front-end should be prepared in order to handle and display the results 2- The REST API should be extended in order to support the aforementioned operation. JIRA: DOVETAIL-669 Change-Id: I36bbb6e602a67020d7e27aedbfc776f5cf4f3dc3 Signed-off-by: pkaralis <pkaralis@intracom-telecom.com> Co-Authored-By: Stamatis Katsaounis <mokats@intracom-telecom.com>
Diffstat (limited to '3rd_party/static/onap-ui/shared/alerts')
-rw-r--r--3rd_party/static/onap-ui/shared/alerts/alertModal.html8
-rw-r--r--3rd_party/static/onap-ui/shared/alerts/alertModalFactory.js74
2 files changed, 82 insertions, 0 deletions
diff --git a/3rd_party/static/onap-ui/shared/alerts/alertModal.html b/3rd_party/static/onap-ui/shared/alerts/alertModal.html
new file mode 100644
index 0000000..5d1a097
--- /dev/null
+++ b/3rd_party/static/onap-ui/shared/alerts/alertModal.html
@@ -0,0 +1,8 @@
+<div class="modal-body" style="padding:0px">
+ <div class="alert alert-{{alert.data.mode}}" style="margin-bottom:0px">
+ <button type="button" class="close" data-ng-click="alert.close()" >
+ <span class="glyphicon glyphicon-remove-circle"></span>
+ </button>
+ <strong>{{alert.data.title}}</strong> {{alert.data.text}}
+ </div>
+</div>
diff --git a/3rd_party/static/onap-ui/shared/alerts/alertModalFactory.js b/3rd_party/static/onap-ui/shared/alerts/alertModalFactory.js
new file mode 100644
index 0000000..49dd5fa
--- /dev/null
+++ b/3rd_party/static/onap-ui/shared/alerts/alertModalFactory.js
@@ -0,0 +1,74 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+(function () {
+ 'use strict';
+
+ angular
+ .module('testapiApp')
+ .factory('raiseAlert', raiseAlert);
+
+ raiseAlert.$inject = ['$uibModal'];
+
+ /**
+ * This allows alert pop-ups to be raised. Just inject it as a dependency
+ * in the calling controller.
+ */
+ function raiseAlert($uibModal) {
+ return function(mode, title, text) {
+ $uibModal.open({
+ templateUrl: 'onap-ui/shared/alerts/alertModal.html',
+ controller: 'RaiseAlertModalController as alert',
+ backdrop: true,
+ keyboard: true,
+ backdropClick: true,
+ size: 'md',
+ resolve: {
+ data: function () {
+ return {
+ mode: mode,
+ title: title,
+ text: text
+ };
+ }
+ }
+ });
+ };
+ }
+
+ angular
+ .module('testapiApp')
+ .controller('RaiseAlertModalController', RaiseAlertModalController);
+
+ RaiseAlertModalController.$inject = ['$uibModalInstance', 'data'];
+
+ /**
+ * This is the controller for the alert pop-up.
+ */
+ function RaiseAlertModalController($uibModalInstance, data) {
+ var ctrl = this;
+
+ ctrl.close = close;
+ ctrl.data = data;
+
+ /**
+ * This method will close the alert modal. The modal will close
+ * when the user clicks the close button or clicks outside of the
+ * modal.
+ */
+ function close() {
+ $uibModalInstance.close();
+ }
+ }
+})();