Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngel Avila2015-08-07 15:44:00 -0400
committerAngel Avila2015-09-09 15:31:59 -0400
commitdd13054d5755f6402e6194d472f1c6ac1c362c9e (patch)
tree2ab4a1e173679aa788e476bc753476e62b83e8ab /plugins/org.eclipse.osee.web.ui
parenta9acf02eb6c936cde057a6e2095db9fcdaf04dfe (diff)
downloadorg.eclipse.osee-dd13054d5755f6402e6194d472f1c6ac1c362c9e.tar.gz
org.eclipse.osee-dd13054d5755f6402e6194d472f1c6ac1c362c9e.tar.xz
org.eclipse.osee-dd13054d5755f6402e6194d472f1c6ac1c362c9e.zip
refinement: Fix minor Dispo GUI issues
Diffstat (limited to 'plugins/org.eclipse.osee.web.ui')
-rw-r--r--plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js74
-rw-r--r--plugins/org.eclipse.osee.web.ui/src/dispo/js/userController.js3
-rw-r--r--plugins/org.eclipse.osee.web.ui/src/dispo/views/admin.html11
3 files changed, 75 insertions, 13 deletions
diff --git a/plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js b/plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js
index 3c6b5a439c..5eceaf326c 100644
--- a/plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js
+++ b/plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js
@@ -5,7 +5,10 @@
$scope.modalShown = false;
$scope.primarySet = "";
$scope.secondarySet = "";
- $scope.sets = [];
+ $scope.sets = {};
+ $scope.addNew = false;
+ $scope.newProgramName = ""
+ $scope.isCopying = false;
$scope.cachedValue = "";
@@ -90,6 +93,33 @@
width: 57,
cellTemplate: dellCellTmpl
}];
+
+ $scope.createNewProgram = function() {
+ if ($scope.newProgramName != "") {
+ var loadingModal = $scope.showLoadingModal();
+ var newProgram = new Program;
+ newProgram.name = $scope.newProgramName;
+ newProgram.$save({
+ name: $scope.newProgramName
+ }, function() {
+ $scope.newProgramName = "";
+ $scope.addNew = false;
+ loadingModal.close();
+ $scope.programs = Program.query();
+ }, function() {
+ loadingModal.close();
+ alert("Oops...Something went wrong");
+ });
+ }
+ }
+
+ $scope.toggleAddNew = function() {
+ if($scope.addNew) {
+ $scope.addNew = false;
+ } else {
+ $scope.addNew = true;
+ }
+ }
$scope.columnDefs = $scope.columnDefs1;
@@ -128,16 +158,19 @@
$scope.updateProgram = function updateProgram() {
+ var loadingModal = $scope.showLoadingModal();
$scope.loading = true;
- $scope.items = {};
- $scope.sets = {};
- Set.query({
- programId: $scope.programSelection,
- type: $rootScope.type
- }, function(data) {
- $scope.loading = false;
- $scope.sets = data;
- });
+ $scope.items = {};
+ Set.query({
+ programId: $scope.programSelection,
+ type: $rootScope.type
+ }, function(data) {
+ loadingModal.close();
+ $scope.sets = data;
+ }, function(data) {
+ loadingModal.close();
+ alert(data.statusText);
+ });
};
$scope.editSet = function editSet(set) {
@@ -204,13 +237,14 @@
newSet.dispoType = $rootScope.type;
newSet.$save({
programId: $scope.programSelection
- }, function() {
- $scope.sets.push(newSet);
+ }, function(data) {
+ $scope.sets.push(data);
});
}
};
$scope.copySet = function(inputs) {
+ $scope.isCopying = true;
var copySetOp = new CopySet;
copySetOp.annotationParam = inputs.annotationParam;
copySetOp.categoryParam = inputs.categoryParam;
@@ -222,11 +256,27 @@
destinationSet: inputs.destinationSet,
sourceSet: inputs.sourceSet,
}, function(data) {
+ $scope.isCopying = false;
var reportUrl = data.operationStatus;
window.open(reportUrl);
console.log(data);
+ }, function(data) {
+ $scope.isCopying = false;
+ alert("Oops...Something went wrong");
});
}
+
+ // Loading Modal
+ $scope.showLoadingModal = function() {
+ var modalInstance = $modal.open({
+ templateUrl: 'loadingModal.html',
+ size: 'sm',
+ windowClass: 'needsRerunModal',
+ backdrop: 'static'
+ });
+
+ return modalInstance;
+ }
// Create Set Modal
$scope.createNewSetModal = function() {
diff --git a/plugins/org.eclipse.osee.web.ui/src/dispo/js/userController.js b/plugins/org.eclipse.osee.web.ui/src/dispo/js/userController.js
index 038ad48057..9fe767fdcd 100644
--- a/plugins/org.eclipse.osee.web.ui/src/dispo/js/userController.js
+++ b/plugins/org.eclipse.osee.web.ui/src/dispo/js/userController.js
@@ -70,6 +70,9 @@ app.controller('userController', [
}, function(data) {
loadingModal.close();
$scope.sets = data;
+ }, function(data) {
+ loadingModal.close();
+ alert(data.statusText);
});
};
diff --git a/plugins/org.eclipse.osee.web.ui/src/dispo/views/admin.html b/plugins/org.eclipse.osee.web.ui/src/dispo/views/admin.html
index cc0115743c..4e3232f990 100644
--- a/plugins/org.eclipse.osee.web.ui/src/dispo/views/admin.html
+++ b/plugins/org.eclipse.osee.web.ui/src/dispo/views/admin.html
@@ -7,6 +7,9 @@
<div class="row">
<h5>Select ATS Version</h5>
<select class="form-control" ng-model="programSelection" ng-change="updateProgram()" ng-options="obj.value as obj.text for obj in programs"></select>
+ <div>
+ <u ng-click="toggleAddNew()">Add New</u> <div ng-show="addNew"><input class="form-control" ng-model="newProgramName" type="text" name="newProgram"><button ng-click="createNewProgram()" class="form-control">Submit</button></div>
+ </div>
</div>
<div class="row" id=reportRow>
<div ng-show="sets.length > 0" class="col-sm-10 col-sm-offset-2" id=reportContainer>
@@ -21,7 +24,7 @@
<div class="row" id=setCopyRow>
<div class="col-sm-10 col-sm-offset-2" id=setCopyContainer>
- <button ng-click="openCopySetModal()" ng-show="sets.length > 0" class="btn btn-primary active" id=generateReportBtn>Merge Annotations</button>
+ <button ng-disabled="isCopying" ng-click="openCopySetModal()" ng-show="sets.length > 0" class="btn btn-primary active" id=generateReportBtn>Merge Annotations</button>
</div>
</div>
@@ -95,6 +98,12 @@
</script>
+ <script type="text/ng-template" id="loadingModal.html">
+ <div id="loadingModal" class="alert alert-info">
+ Loading...
+ </div>
+ </script>
+
</body>
</html>

Back to the top