2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END============================================
20 * ===================================================================
26 function DashboardCtrl($scope, $rootScope, $resource, $http, $timeout,
27 $location, $interval, $q, Datafactory) {
28 console.log("//////////////DashboardCtrl");
29 $scope.autosaveInterval = 1800000;
30 $rootScope.isModel = false;
31 $rootScope.isPalette = false;
32 $rootScope.isTestSet = false;
33 $rootScope.isRequirementCoverage = false;
34 $rootScope.ispropertyExplorer = false;
35 $rootScope.parameters;
36 $scope.orientation = "horizontal";
37 $rootScope.ispropertyExplorer = false;
38 $rootScope.isActive = true;
39 $rootScope.models = [];
40 $scope.selectedParent = {};
41 $rootScope.utmModels = {};
42 $rootScope.selectedModelName;
43 $rootScope.dialogName = "";
45 $interval(function() {
46 console.log("interval");
48 * AutosaveProject($scope,$rootScope,$resource, $http, $timeout,
49 * $location, $interval, $q, Datafactory);
51 }, $scope.autosaveInterval);
53 $rootScope.onSelectActivityModel = function(obj) {
54 console.log("onSelectActivityModel");
56 $rootScope.isPalette = true;
57 $rootScope.isTestSet = false;
58 $rootScope.isRequirementCoverage = false;
59 $rootScope.ispropertyExplorer = false;
60 // document.getElementById('propertyExplorer').classList.remove('visible');
62 // $( "#propertyExplorer" ).prev().css( "display" ,"block");
63 $("#activity_modeler").prev().css("display", "block");
64 $('div').find('.k-expand-next').click();
66 if (obj == undefined) {
67 document.getElementById("modeler_name").textContent = "Activity Modeler";
70 document.getElementById("modeler_name").textContent = "Activity Modeler"
71 + " - " + selected_model;
74 $rootScope.modelName = selected_model;
76 $rootScope.modeltestset = list_model_test_sets[selected_model];
77 if (list_model_schema_extensions[selected_model] == null) {
78 if (list_model_schema_extensions[$rootScope.utmModels.name] != null) {
79 list_model_schema_extensions[selected_model] = jQuery
83 list_model_schema_extensions[$rootScope.utmModels.name]);
85 list_model_schema_extensions[selected_model] = {};
89 $rootScope.initProjectExplorer();
90 changecolor(selected_model);
92 $scope.selectActivityTestSet = function() {
93 console.log("selectActivityTestSet");
94 $rootScope.isPalette = false;
95 $rootScope.isRequirementCoverage = false;
96 $rootScope.isTestset = true;
97 document.getElementById("modeler_name").textContent = "UTM Test Set";
98 // document.getElementById('propertyExplorer').classList.add('visible');
99 // $( "#propertyExplorer" ).prev().css( "display" ,"none");
100 $('div').find('.k-collapse-next').click();
101 $rootScope.modeltestset = list_model_test_sets[selected_model];
105 $scope.showPalette = function() {
106 console.log("showPalette");
107 // alert("showPalette()");
108 $rootScope.isModel = true;
109 // $rootScope.isPalette = true;
113 $rootScope.filterRouter = 'partials/DashboardFilters.html';
114 $scope.isActivePROD = true;
115 $scope.isActiveQC = false;
116 $rootScope.reload = function(env) {
117 console.log("reload");
120 $scope.showTDSSView = true;
123 function changecolor(selected_model) {
124 console.log("changecolor");
127 // var modelNames =[];
129 $(".models").each(function(i) {
131 var model_value = $(this).text().trim();
132 // modelName.push(model_value);
133 if (model_value == selected_model || model_value == "") {
134 $(this).addClass("selectedcolor");
136 $(this).removeClass("selectedcolor");