summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-FE-os/client/src/views/applications
diff options
context:
space:
mode:
authorChristopher Lott (cl778h) <clott@research.att.com>2017-08-23 18:27:19 -0400
committerChristopher Lott (cl778h) <clott@research.att.com>2017-08-23 21:12:56 -0400
commit978dbcf0a196acbafad72fe1e2478ec0e384f02f (patch)
tree17e1ceaa4a12a599320cbb317947e990bf1a5383 /ecomp-portal-FE-os/client/src/views/applications
parentbc7350dce5b7b1dcd1c472a3922b42c4ea99809d (diff)
Deliver centralized role management feature
Repair multiple defects also. Revise deployment to use docker-compose. Remove all zip archives. Issue: PORTAL-21, PORTAL-25, PORTAL-28, PORTAL-52, PORTAL-69, PORTAL-74, PORTAL-76, PORTAL-80, PORTAL-82 Change-Id: Ie72fec7d35ba78beb162bba6ed27b2caee340c61 Signed-off-by: Christopher Lott (cl778h) <clott@research.att.com>
Diffstat (limited to 'ecomp-portal-FE-os/client/src/views/applications')
-rw-r--r--ecomp-portal-FE-os/client/src/views/applications/application-details-dialog/application-details.controller.js31
-rw-r--r--ecomp-portal-FE-os/client/src/views/applications/application-details-dialog/application-details.modal.html78
-rw-r--r--ecomp-portal-FE-os/client/src/views/applications/applications.controller.js34
-rw-r--r--ecomp-portal-FE-os/client/src/views/applications/applications.tpl.html6
4 files changed, 108 insertions, 41 deletions
diff --git a/ecomp-portal-FE-os/client/src/views/applications/application-details-dialog/application-details.controller.js b/ecomp-portal-FE-os/client/src/views/applications/application-details-dialog/application-details.controller.js
index da7cd4a4..550b9faf 100644
--- a/ecomp-portal-FE-os/client/src/views/applications/application-details-dialog/application-details.controller.js
+++ b/ecomp-portal-FE-os/client/src/views/applications/application-details-dialog/application-details.controller.js
@@ -21,12 +21,12 @@
(function () {
class AppDetailsModalCtrl {
constructor($scope, $log, applicationsService, errorMessageByCode,
- ECOMP_URL_REGEX,userProfileService, $cookies, confirmBoxService) {
+ ECOMP_URL_REGEX,userProfileService, $cookies, confirmBoxService,items) {
// let emptyImg = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
// empty image should really be empty, or it causes problems for the back end
let emptyImg = null;
this.emptyImgForPreview = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
-
+ $scope.ngDialogData=items;
let newAppModel = {
'id': null,
'name': null,
@@ -41,7 +41,9 @@
'appPassword': null,
'thumbnail': emptyImg,
'isEnabled': true,
- 'restrictedApp': false
+ 'restrictedApp': false,
+ 'nameSpace': null,
+ 'isCentralAuth': false
};
let init = () => {
@@ -71,6 +73,7 @@
this.app.thumbnail = emptyImg;
this.originalImage = null;
this.app.imageUrl = null;
+ this.app.imageLink = null;
}
}).catch(err => {
$log.error('AppDetailsModalCtrl:removeImage error:: ',err);
@@ -152,9 +155,14 @@
this.saveChanges = () => {
//if valid..
- if($scope.appForm.$invalid){
- return;
- }
+ if(((angular.isUndefined(this.app.name) || !this.app.name)&&(angular.isUndefined(this.app.url) || !this.app.url)
+ &&(angular.isUndefined(this.app.username) || !this.app.username)&&(angular.isUndefined(this.app.appPassword) || !this.app.appPassword))) {
+ confirmBoxService.showInformation('Please fill in all required fields').then(isConfirmed => {});
+ return;
+ }else if(!((angular.isUndefined(this.app.name) || !!this.app.name)&&(angular.isUndefined(this.app.url) || !!this.app.url))){
+ confirmBoxService.showInformation('Please fill in all required fields').then(isConfirmed => {});
+ return;
+ }
this.isSaving = true;
// For a restricted app, null out all irrelevant fields
if (this.app.restrictedApp) {
@@ -167,10 +175,12 @@
this.app.uebSecret = null;
}
if(this.isEditMode){
+ if (this.app.nameSpace=="") {this.app.nameSpace = null;}
applicationsService.updateOnboardingApp(this.app)
.then(() => {
$log.debug('AppDetailsModalCtrl:updateOnboardingApp:: App update succeeded!');
- $scope.closeThisDialog(true);
+ // $scope.closeThisDialog(true);
+ $scope.$dismiss('cancel');
emptyCookies();
}).catch(err => {
switch (err.status) {
@@ -204,7 +214,8 @@
applicationsService.addOnboardingApp(this.app)
.then(() => {
$log.debug('App creation succeeded!');
- $scope.closeThisDialog(true);
+ //$scope.closeThisDialog(true);
+ $scope.$dismiss('cancel');
emptyCookies();
}).catch(err => {
switch (err.status) {
@@ -232,6 +243,7 @@
// for bug in IE 11
});
}
+
};
@@ -252,6 +264,7 @@
if(!(_.isEqual(newVal, oldVal))){
$log.debug('applicationsService:$scope.$watch:: thumbnail updated!');
this.app.imageUrl = null;
+ this.app.imageLink = null;
this.app.thumbnail = newVal.resized.dataURL;
}
});
@@ -263,6 +276,6 @@
}
}
AppDetailsModalCtrl.$inject = ['$scope', '$log', 'applicationsService', 'errorMessageByCode',
- 'ECOMP_URL_REGEX','userProfileService','$cookies', 'confirmBoxService'];
+ 'ECOMP_URL_REGEX','userProfileService','$cookies', 'confirmBoxService','items'];
angular.module('ecompApp').controller('AppDetailsModalCtrl', AppDetailsModalCtrl);
})(); \ No newline at end of file
diff --git a/ecomp-portal-FE-os/client/src/views/applications/application-details-dialog/application-details.modal.html b/ecomp-portal-FE-os/client/src/views/applications/application-details-dialog/application-details.modal.html
index ad659aa8..d90c35ec 100644
--- a/ecomp-portal-FE-os/client/src/views/applications/application-details-dialog/application-details.modal.html
+++ b/ecomp-portal-FE-os/client/src/views/applications/application-details-dialog/application-details.modal.html
@@ -18,20 +18,32 @@
================================================================================
-->
<div class="application-details-modal">
- <div id="title" class="title">Application Details</div>
+ <div class="b2b-modal-header">
+ <h2 class="account-details-title" id="application-details-title">Application Details</h2>
+
+ <div class="corner-button in">
+ <button type="button" class="close" aria-label="Closhhhe"
+ ng-click="$dismiss('cancel')"></button>
+ </div>
+ </div>
+
+ <div class="b2b-modal-body">
<div class="app-properties-main" scroll-top="appDetails.scrollApi">
<form name="appForm" novalidate autocomplete="off">
- <!-- We can remove this script once we get to AT&T Corporate Firefox version 47
+ <!-- We can remove this script once we get to Firefox version 47
autocomplete="off" won't work until v47 -->
- <script type="text/javascript">
+ <!-- <script type="text/javascript">
document.getElementById("appForm").reset();
- </script>
+ </script> -->
<div id="app-left-container" class="left-container">
- <div class="property">
- <input id="checkbox-app-is-restricted" type="checkbox" class="checkbox-field checkbox-field-openSRC" ng-disabled="appDetails.isEditMode" ng-model="appDetails.app.restrictedApp" ng-checked="appDetails.app.restrictedApp"/>
- <div class="property-label checkbox-label">Hyperlink only application</div>
- </div>
+ <div class="property-label checkbox-label">
+ <label for="checkbox-app-is-restricted" class="checkbox">
+ <input type="checkbox" ng-model="appDetails.app.restrictedApp" id="checkbox-app-is-restricted" ng-disabled="appDetails.isEditMode" ng-checked="appDetails.app.restrictedApp"/>
+ <i class="skin"></i>
+ <span>Hyperlink only application</span>
+ </label>
+ </div>
<div class="property required">
<div class="property-label">Application Name</div>
<input id="input-app-name" type="text"
@@ -123,6 +135,14 @@
<small id="error-mylogins-password-reqd" class="err-message" ng-message="required">My Logins App Password is required</small>
</div>
</div>
+
+ <div class="property" ng-show="!appDetails.app.restrictedApp">
+ <div id="pwd-property-label" class="property-label">Name Space</div>
+ <input type="text" id="input-mylogins-auth-namespace"
+ ng-model="appDetails.app.nameSpace"
+ name="appAuthNameSpace"
+ maxlength="256"/>
+ </div>
</div>
</div>
<div class="right-container">
@@ -173,12 +193,25 @@
</div>
<div id="property-guest-access" class="property">
- <input id="checkbox-app-is-open" type="checkbox" class="checkbox-field checkbox-field-openSRC" ng-model="appDetails.app.isOpen" ng-checked="appDetails.app.isOpen || appDetails.app.restrictedApp" ng-disabled="appDetails.app.restrictedApp"/>
- <div id="property-guest-checkbox-label" class="property-label checkbox-label">Allow guest access</div>
+ <label for="checkbox-app-is-open" class="checkbox">
+ <input type="checkbox" ng-model="appDetails.app.isOpen" id="checkbox-app-is-open" ng-checked="appDetails.app.isOpen || appDetails.app.restrictedApp" ng-disabled="appDetails.app.restrictedApp"/>
+ <i class="skin"></i>
+ <span>Allow guest access</span>
+ </label>
</div>
<div id="property-active" class="property">
- <input id="checkbox-app-is-enabled" type="checkbox" class=" checkbox-field checkbox-field-openSRC " ng-model="appDetails.app.isEnabled"/>
- <div id="property-active-checkbox-label" class="property-label checkbox-label">Active</div>
+ <label for="checkbox-app-is-enabled" class="checkbox">
+ <input type="checkbox" ng-model="appDetails.app.isEnabled" id="checkbox-app-is-enabled"/>
+ <i class="skin"></i>
+ <span>Active</span>
+ </label>
+ </div> <br/>
+ <div id="property-is-central-auth" class="property" ng-show="!appDetails.app.restrictedApp">
+ <label for="checkbox-app-is-central-auth" class="checkbox">
+ <input type="checkbox" ng-model="appDetails.app.isCentralAuth" id="checkbox-app-is-central-auth"/>
+ <i class="skin"></i>
+ <span>Centralized</span>
+ </label>
</div>
</div>
@@ -186,14 +219,25 @@
</div>
</form>
</div>
+ </div>
+
+ <br>
+ <div class="b2b-modal-footer">
+ <div class="dialog-control">
+ <span class="ecomp-save-spinner" ng-show="appDetails.isSaving"></span>
+ <button id="button-save-app" class="btn btn-alt btn-small" ng-class="{disabled: appForm.$invalid}" ng-click="appDetails.saveChanges()">Save</button>
+ <button id="button-notification-cancel" class="btn btn-alt btn-small" ng-click="$dismiss('cancel')"role="button" tabindex="0">Cancel</button>
+
+
+ </div>
+ </div>
+
+
+
- <div class="dialog-control">
- <span class="ecomp-save-spinner" ng-show="appDetails.isSaving"></span>
- <button id="button-save-app" class="btn btn-alt btn-small" ng-class="{disabled: appForm.$invalid}" ng-click="appDetails.saveChanges()">Save</button>
- <button id="button-app-cancel" class="btn btn-alt btn-small" ng-click="closeThisDialog()">Cancel</button>
- </div>
</div>
+
<script type="application/javascript">
$(document).ready(function(){
$(".ngdialog-content").css("top","-150px")
diff --git a/ecomp-portal-FE-os/client/src/views/applications/applications.controller.js b/ecomp-portal-FE-os/client/src/views/applications/applications.controller.js
index 08f00669..d1c2b091 100644
--- a/ecomp-portal-FE-os/client/src/views/applications/applications.controller.js
+++ b/ecomp-portal-FE-os/client/src/views/applications/applications.controller.js
@@ -22,7 +22,7 @@
class ApplicationsCtrl {
constructor($log, $cookies, conf, ngDialog,
- applicationsService, confirmBoxService, userProfileService, utilsService) {
+ applicationsService, confirmBoxService, userProfileService, utilsService,$modal) {
this.emptyImgForPreview = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
let getOnboardingApps = () => {
this.isLoadingTable = true;
@@ -31,8 +31,10 @@
// Use proper back-end URL to load image
for (var i = 0; i < appsList.length; i++) {
appsList[i].imageLink = '';
- if (appsList[i].imageUrl)
+ if (appsList[i].imageUrl){
appsList[i].imageLink = conf.api.appThumbnail.replace(':appId', appsList[i].id);
+ appsList[i].imageLink = appsList[i].imageLink+'?' + new Date().getTime();
+ }
}
this.appsList = appsList;
}).catch(err => {
@@ -58,6 +60,8 @@
{name: 'Communication Topic', value: 'uebTopicName', isSortable: true},
{name: 'Communication Key', value: 'uebKey', isSortable: true},
{name: 'Communication Secret', value: 'uebSecret', isSortable: true},
+ {name: 'Application Namespace', value: 'nameSpace', isSortable: true},
+ {name: 'Central Access Type', value: 'isCentralAuth', isSortable: true}
];
this.appsList = [];
};
@@ -75,18 +79,20 @@
app: selectedApp
}
}
- ngDialog.open({
+ var modalInstance = $modal.open({
templateUrl: 'app/views/applications/application-details-dialog/application-details.modal.html',
- controller: 'AppDetailsModalCtrl',
- controllerAs: 'appDetails',
- data: data
- }).closePromise.then(needUpdate => {
- if (needUpdate.value === true) {
- $log.debug('ApplicationsCtrl:openAddNewAppModal: updating table data...');
- getOnboardingApps();
- }
- });
-
+ controller: 'AppDetailsModalCtrl as appDetails',
+ sizeClass: 'modal-large',
+ resolve: {
+ items: function () {
+ return data;
+ }
+ }
+ })
+
+ modalInstance.result.finally(function (){
+ getOnboardingApps();
+ });
};
@@ -118,6 +124,6 @@
}
}
ApplicationsCtrl.$inject = ['$log', '$cookies', 'conf', 'ngDialog',
- 'applicationsService', 'confirmBoxService', 'userProfileService', 'utilsService'];
+ 'applicationsService', 'confirmBoxService', 'userProfileService', 'utilsService','$modal'];
angular.module('ecompApp').controller('ApplicationsCtrl', ApplicationsCtrl);
})();
diff --git a/ecomp-portal-FE-os/client/src/views/applications/applications.tpl.html b/ecomp-portal-FE-os/client/src/views/applications/applications.tpl.html
index fa61e554..6016a2b1 100644
--- a/ecomp-portal-FE-os/client/src/views/applications/applications.tpl.html
+++ b/ecomp-portal-FE-os/client/src/views/applications/applications.tpl.html
@@ -51,6 +51,8 @@
<th b2b-table-header id="app-header-Topic" sortable="false">Communication Topic</th>
<th b2b-table-header id="app-header-CommKey" sortable="false">Communication Key</th>
<th b2b-table-header id="app-header-Secret" sortable="false">Communication Secret</th>
+ <th b2b-table-header id="app-header-namespace" sortable="false">Application Namespace</th>
+ <th b2b-table-header id="app-header-central-auth" sortable="false">Central Auth Access</th>
<th b2b-table-header id="app-header-delete" sortable="false">Delete</th>
</tr>
</thead>
@@ -68,7 +70,9 @@
<td b2b-table-body headers="rowheader_t1_{{$index}} col11" ng-click="apps.openAddNewAppModal(rowData)"ng-bind="rowData.uebTopicName"></td>
<td b2b-table-body headers="rowheader_t1_{{$index}} col12" ng-click="apps.openAddNewAppModal(rowData)"ng-bind="rowData.uebKey"></td>
<td b2b-table-body headers="rowheader_t1_{{$index}} col13" ng-click="apps.openAddNewAppModal(rowData)"ng-bind="rowData.uebSecret"></td>
- <td b2b-table-body headers="rowheader_t1_{{$index}} col14" >
+ <td b2b-table-body headers="rowheader_t1_{{$index}} col14" ng-click="apps.openAddNewAppModal(rowData)"ng-bind="rowData.nameSpace"></td>
+ <td b2b-table-body headers="rowheader_t1_{{$index}} col15" ng-click="apps.openAddNewAppModal(rowData)">{{(rowData.isCentralAuth) ? 'yes' : 'no'}}</td>
+ <td b2b-table-body headers="rowheader_t1_{{$index}} col16" >
<span class="icon-misc-trash" ng-click="apps.deleteApp(rowData)"></span>
</td>
</tr>