mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 09:27:36 -02:30
fix add/edit/delete behavior across tower ui
This commit is contained in:
@@ -102,9 +102,10 @@ export function CredentialsList($scope, $rootScope, $location, $log,
|
|||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
.success(function () {
|
.success(function () {
|
||||||
$scope.search(list.iterator);
|
if (parseInt($state.params.credential_id) === id) {
|
||||||
if (new RegExp('/' + id + '$').test($location.$$url)) {
|
$state.go("^", null, {reload: true});
|
||||||
$state.go('^');
|
} else {
|
||||||
|
$scope.search(list.iterator);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
|
|||||||
@@ -244,11 +244,13 @@ export function ProjectsList ($scope, $rootScope, $location, $log, $stateParams,
|
|||||||
Wait('start');
|
Wait('start');
|
||||||
var url = defaultUrl + id + '/';
|
var url = defaultUrl + id + '/';
|
||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
|
console.log($state);
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
.success(function () {
|
.success(function () {
|
||||||
$scope.search(list.iterator);
|
if (parseInt($state.params.id) === id) {
|
||||||
if (new RegExp('/' + id + '$').test($location.$$url)) {
|
$state.go("^", null, {reload: true});
|
||||||
$state.go('^');
|
} else {
|
||||||
|
$scope.search(list.iterator);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
@@ -802,13 +804,7 @@ export function ProjectsEdit($scope, $rootScope, $compile, $location, $log,
|
|||||||
Rest.put(params)
|
Rest.put(params)
|
||||||
.success(function() {
|
.success(function() {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
/*$scope.scm_update_tooltip = "Start an SCM update";
|
$state.go($state.current, {}, {reload: true});
|
||||||
$scope.scm_type_class = "";
|
|
||||||
if (Empty($scope.scm_type)) {
|
|
||||||
$scope.scm_update_tooltip = 'Manual projects do not require an SCM update';
|
|
||||||
$scope.scm_type_class = "btn-disabled";
|
|
||||||
}*/
|
|
||||||
ReturnToCaller();
|
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
ProcessErrors($scope, data, status, form, { hdr: 'Error!', msg: 'Failed to update project: ' + id + '. PUT status: ' + status });
|
ProcessErrors($scope, data, status, form, { hdr: 'Error!', msg: 'Failed to update project: ' + id + '. PUT status: ' + status });
|
||||||
|
|||||||
@@ -97,9 +97,10 @@ export function TeamsList($scope, $rootScope, $location, $log, $stateParams,
|
|||||||
.success(function () {
|
.success(function () {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
$scope.search(list.iterator);
|
if (parseInt($state.params.team_id) === id) {
|
||||||
if (new RegExp('/' + id + '$').test($location.$$url)) {
|
$state.go("^", null, {reload: true});
|
||||||
$state.go('^');
|
} else {
|
||||||
|
$scope.search(list.iterator);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
@@ -297,7 +298,7 @@ export function TeamsEdit($scope, $rootScope, $location,
|
|||||||
Rest.setUrl(defaultUrl + id + '/');
|
Rest.setUrl(defaultUrl + id + '/');
|
||||||
var data = processNewData(form.fields);
|
var data = processNewData(form.fields);
|
||||||
Rest.put(data).success(function(){
|
Rest.put(data).success(function(){
|
||||||
$state.go('teams', null, {reload: true});
|
$state.go($state.current, null, {reload: true});
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to retrieve user: ' +
|
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to retrieve user: ' +
|
||||||
|
|||||||
@@ -111,9 +111,10 @@ export function UsersList($scope, $rootScope, $location, $log, $stateParams,
|
|||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
.success(function () {
|
.success(function () {
|
||||||
$scope.search(list.iterator);
|
if (parseInt($state.params.user_id) === id) {
|
||||||
if (new RegExp('/' + id + '$').test($location.$$url)) {
|
$state.go("^", null, {reload: true});
|
||||||
$state.go('^');
|
} else {
|
||||||
|
$scope.search(list.iterator);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
@@ -391,7 +392,7 @@ export function UsersEdit($scope, $rootScope, $location,
|
|||||||
Rest.setUrl(defaultUrl + id + '/');
|
Rest.setUrl(defaultUrl + id + '/');
|
||||||
var data = processNewData(form.fields);
|
var data = processNewData(form.fields);
|
||||||
Rest.put(data).success(function(){
|
Rest.put(data).success(function(){
|
||||||
$state.go('users', null, {reload: true});
|
$state.go($state.current, null, {reload: true});
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to retrieve user: ' +
|
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to retrieve user: ' +
|
||||||
|
|||||||
@@ -307,14 +307,7 @@ angular.module('CredentialsHelper', ['Utilities'])
|
|||||||
Rest.put(data)
|
Rest.put(data)
|
||||||
.success(function () {
|
.success(function () {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
var base = $location.path().replace(/^\//, '').split('/')[0];
|
$state.go($state.current, {}, {reload: true});
|
||||||
if (base === 'credentials') {
|
|
||||||
ReturnToCaller();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ReturnToCaller(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ function InventoriesEdit($scope, $rootScope, $compile, $location,
|
|||||||
Rest.put(data)
|
Rest.put(data)
|
||||||
.success(function () {
|
.success(function () {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
$location.path('/inventories/');
|
$state.go($state.current, {}, {reload: true});
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
ProcessErrors($scope, data, status, form, { hdr: 'Error!',
|
ProcessErrors($scope, data, status, form, { hdr: 'Error!',
|
||||||
|
|||||||
@@ -322,9 +322,10 @@ function InventoriesList($scope, $rootScope, $location, $log,
|
|||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
.success(function () {
|
.success(function () {
|
||||||
$scope.search(list.iterator);
|
if (parseInt($state.params.inventory_id) === id) {
|
||||||
if (new RegExp('/' + id + '$').test($location.$$url)) {
|
$state.go("^", null, {reload: true});
|
||||||
$state.go('^');
|
} else {
|
||||||
|
$scope.search(list.iterator);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
|
|||||||
@@ -52,14 +52,14 @@
|
|||||||
// no inventory source set, just create a new group
|
// no inventory source set, just create a new group
|
||||||
// '' is the value supplied for Manual source type
|
// '' is the value supplied for Manual source type
|
||||||
case null || '':
|
case null || '':
|
||||||
GroupManageService.put(group).then(() => $state.go('^', null, {reload: true}));
|
GroupManageService.put(group).then(() => $state.go($state.current, null, {reload: true}));
|
||||||
break;
|
break;
|
||||||
// create a new group and create/associate an inventory source
|
// create a new group and create/associate an inventory source
|
||||||
// equal to case 'rax' || 'ec2' || 'azure' || 'azure_rm' || 'vmware' || 'foreman' || 'cloudforms' || 'openstack' || 'custom'
|
// equal to case 'rax' || 'ec2' || 'azure' || 'azure_rm' || 'vmware' || 'foreman' || 'cloudforms' || 'openstack' || 'custom'
|
||||||
default:
|
default:
|
||||||
GroupManageService.put(group)
|
GroupManageService.put(group)
|
||||||
.then(() => GroupManageService.putInventorySource(params, groupData.related.inventory_source))
|
.then(() => GroupManageService.putInventorySource(params, groupData.related.inventory_source))
|
||||||
.then(() => $state.go('^', null, {reload: true}));
|
.then(() => $state.go($state.current, null, {reload: true}));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -48,12 +48,26 @@
|
|||||||
case 'promote':
|
case 'promote':
|
||||||
GroupManageService.promote($scope.toDelete.id, $stateParams.inventory_id)
|
GroupManageService.promote($scope.toDelete.id, $stateParams.inventory_id)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
if (parseInt($state.params.group_id) === $scope.toDelete.id) {
|
||||||
|
$state.go("inventoryManage", null, {reload: true});
|
||||||
|
} else {
|
||||||
|
$state.go($state.current, null, {reload: true});
|
||||||
|
}
|
||||||
$('#group-delete-modal').modal('hide');
|
$('#group-delete-modal').modal('hide');
|
||||||
|
$('body').removeClass('modal-open');
|
||||||
|
$('.modal-backdrop').remove();
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'delete':
|
default:
|
||||||
GroupManageService.delete($scope.toDelete.id).then(() => {
|
GroupManageService.delete($scope.toDelete.id).then(() => {
|
||||||
|
if (parseInt($state.params.group_id) === $scope.toDelete.id) {
|
||||||
|
$state.go("inventoryManage", null, {reload: true});
|
||||||
|
} else {
|
||||||
|
$state.go($state.current, null, {reload: true});
|
||||||
|
}
|
||||||
$('#group-delete-modal').modal('hide');
|
$('#group-delete-modal').modal('hide');
|
||||||
|
$('body').removeClass('modal-open');
|
||||||
|
$('.modal-backdrop').remove();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -29,11 +29,11 @@
|
|||||||
// assign the host to current group if not at the root level
|
// assign the host to current group if not at the root level
|
||||||
if ($stateParams.group){
|
if ($stateParams.group){
|
||||||
HostManageService.associateGroup(res.data, _.last($stateParams.group)).then(function(){
|
HostManageService.associateGroup(res.data, _.last($stateParams.group)).then(function(){
|
||||||
$state.go('inventoryManage', null, {reload: true});
|
$state.go('inventoryManage.editHost', {host_id: res.data.id}, {reload: true});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$state.go('inventoryManage', null, {reload: true});
|
$state.go('inventoryManage.editHost', {host_id: res.data.id}, {reload: true});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
enabled: $scope.host.enabled
|
enabled: $scope.host.enabled
|
||||||
};
|
};
|
||||||
HostManageService.put(host).then(function(){
|
HostManageService.put(host).then(function(){
|
||||||
$state.go('^', null, {reload: true});
|
$state.go($state.current, null, {reload: true});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
var init = function(){
|
var init = function(){
|
||||||
|
|||||||
@@ -24,7 +24,11 @@
|
|||||||
Wait('start');
|
Wait('start');
|
||||||
HostManageService.delete(id).then(() => {
|
HostManageService.delete(id).then(() => {
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
$state.go($state.current.name, null, {reload: true});
|
if (parseInt($state.params.host_id) === id) {
|
||||||
|
$state.go("inventoryManage", null, {reload: true});
|
||||||
|
} else {
|
||||||
|
$state.go($state.current.name, null, {reload: true});
|
||||||
|
}
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -81,4 +85,4 @@
|
|||||||
$scope.search(list.iterator);
|
$scope.search(list.iterator);
|
||||||
};
|
};
|
||||||
init();
|
init();
|
||||||
}];
|
}];
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ export default
|
|||||||
organization: scope.organization,
|
organization: scope.organization,
|
||||||
script: scope.script
|
script: scope.script
|
||||||
})
|
})
|
||||||
.success(function () {
|
.success(function (data) {
|
||||||
$state.go('inventoryScripts', {}, {reload: true});
|
$state.go('inventoryScripts.edit', {inventory_script_id: data.id}, {reload: true});
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ export default
|
|||||||
script: $scope.script
|
script: $scope.script
|
||||||
})
|
})
|
||||||
.success(function () {
|
.success(function () {
|
||||||
$state.transitionTo('inventoryScripts');
|
$state.go($state.current, null, {reload: true});
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
|
|||||||
@@ -7,11 +7,11 @@
|
|||||||
export default
|
export default
|
||||||
[ '$rootScope','Wait', 'generateList', 'inventoryScriptsListObject',
|
[ '$rootScope','Wait', 'generateList', 'inventoryScriptsListObject',
|
||||||
'GetBasePath' , 'SearchInit' , 'PaginateInit',
|
'GetBasePath' , 'SearchInit' , 'PaginateInit',
|
||||||
'Rest' , 'ProcessErrors', 'Prompt', '$state', '$location',
|
'Rest' , 'ProcessErrors', 'Prompt', '$state',
|
||||||
function(
|
function(
|
||||||
$rootScope,Wait, GenerateList, inventoryScriptsListObject,
|
$rootScope,Wait, GenerateList, inventoryScriptsListObject,
|
||||||
GetBasePath, SearchInit, PaginateInit,
|
GetBasePath, SearchInit, PaginateInit,
|
||||||
Rest, ProcessErrors, Prompt, $state, $location
|
Rest, ProcessErrors, Prompt, $state
|
||||||
) {
|
) {
|
||||||
var scope = $rootScope.$new(),
|
var scope = $rootScope.$new(),
|
||||||
defaultUrl = GetBasePath('inventory_scripts'),
|
defaultUrl = GetBasePath('inventory_scripts'),
|
||||||
@@ -58,9 +58,10 @@ export default
|
|||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
.success(function () {
|
.success(function () {
|
||||||
scope.search(list.iterator);
|
if (parseInt($state.params.inventory_script_id) === id) {
|
||||||
if (new RegExp('/' + id + '$').test($location.$$url)) {
|
$state.go("^", null, {reload: true});
|
||||||
$state.go('^');
|
} else {
|
||||||
|
scope.search(list.iterator);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
|
|||||||
@@ -480,7 +480,7 @@ export default
|
|||||||
});
|
});
|
||||||
|
|
||||||
function saveCompleted() {
|
function saveCompleted() {
|
||||||
$state.go('jobTemplates', null, {reload: true});
|
$state.go($state.current, {}, {reload: true});
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($scope.removeTemplateSaveSuccess) {
|
if ($scope.removeTemplateSaveSuccess) {
|
||||||
|
|||||||
@@ -77,9 +77,10 @@ export default
|
|||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
.success(function () {
|
.success(function () {
|
||||||
$scope.search(list.iterator);
|
if (parseInt($state.params.template_id) === id) {
|
||||||
if (new RegExp('/' + id + '$').test($location.$$url)) {
|
$state.go("^", null, {reload: true});
|
||||||
$state.go('^');
|
} else {
|
||||||
|
$scope.search(list.iterator);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.error(function (data) {
|
.error(function (data) {
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ export default
|
|||||||
Rest.setUrl(url+ id+'/');
|
Rest.setUrl(url+ id+'/');
|
||||||
Rest.put(params)
|
Rest.put(params)
|
||||||
.success(function () {
|
.success(function () {
|
||||||
$state.go('notifications', {}, {reload: true});
|
$state.go($state.current, null, {reload: true});
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ export default
|
|||||||
[ '$rootScope','Wait', 'generateList', 'NotificationTemplatesList',
|
[ '$rootScope','Wait', 'generateList', 'NotificationTemplatesList',
|
||||||
'GetBasePath' , 'SearchInit' , 'PaginateInit', 'Rest' ,
|
'GetBasePath' , 'SearchInit' , 'PaginateInit', 'Rest' ,
|
||||||
'ProcessErrors', 'Prompt', '$state', 'GetChoices', 'Empty', 'Find',
|
'ProcessErrors', 'Prompt', '$state', 'GetChoices', 'Empty', 'Find',
|
||||||
'ngToast', '$compile', '$filter', '$location',
|
'ngToast', '$compile', '$filter',
|
||||||
function(
|
function(
|
||||||
$rootScope,Wait, GenerateList, NotificationTemplatesList,
|
$rootScope,Wait, GenerateList, NotificationTemplatesList,
|
||||||
GetBasePath, SearchInit, PaginateInit, Rest,
|
GetBasePath, SearchInit, PaginateInit, Rest,
|
||||||
ProcessErrors, Prompt, $state, GetChoices, Empty, Find, ngToast,
|
ProcessErrors, Prompt, $state, GetChoices, Empty, Find, ngToast,
|
||||||
$compile, $filter, $location) {
|
$compile, $filter) {
|
||||||
var scope = $rootScope.$new(),
|
var scope = $rootScope.$new(),
|
||||||
defaultUrl = GetBasePath('notification_templates'),
|
defaultUrl = GetBasePath('notification_templates'),
|
||||||
list = NotificationTemplatesList,
|
list = NotificationTemplatesList,
|
||||||
@@ -182,9 +182,10 @@ export default
|
|||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
.success(function () {
|
.success(function () {
|
||||||
scope.search(list.iterator);
|
if (parseInt($state.params.notification_template_id) === id) {
|
||||||
if (new RegExp('/' + id + '$').test($location.$$url)) {
|
$state.go("^", null, {reload: true});
|
||||||
$state.go('^');
|
} else {
|
||||||
|
scope.search(list.iterator);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {templateUrl} from '../../shared/template-url/template-url.factory';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'notifications',
|
name: 'notifications',
|
||||||
route: '/notifications',
|
route: '/notification_templates',
|
||||||
templateUrl: templateUrl('notifications/notification-templates-list/list'),
|
templateUrl: templateUrl('notifications/notification-templates-list/list'),
|
||||||
controller: 'notificationTemplatesListController'
|
controller: 'notificationTemplatesListController'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -41,13 +41,8 @@ export default ['$scope', '$rootScope', '$compile', '$location',
|
|||||||
})
|
})
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
$scope.$emit("ReloadOrganzationCards", data.id);
|
$rootScope.$broadcast("EditIndicatorChange", "organizations", data.id);
|
||||||
if (base === 'organizations') {
|
$state.go('organizations.edit', {organization_id: data.id}, {reload: true});
|
||||||
$rootScope.flashMessage = "New organization successfully created!";
|
|
||||||
$location.path('/organizations/' + data.id);
|
|
||||||
} else {
|
|
||||||
ReturnToCaller(1);
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.error(function(data, status) {
|
.error(function(data, status) {
|
||||||
ProcessErrors($scope, data, status, form, {
|
ProcessErrors($scope, data, status, form, {
|
||||||
@@ -58,7 +53,6 @@ export default ['$scope', '$rootScope', '$compile', '$location',
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.formCancel = function() {
|
$scope.formCancel = function() {
|
||||||
$scope.$emit("ReloadOrganzationCards");
|
|
||||||
$scope.$emit("ShowOrgListHeader");
|
$scope.$emit("ShowOrgListHeader");
|
||||||
$state.transitionTo('organizations');
|
$state.transitionTo('organizations');
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -27,9 +27,9 @@ export default ['$scope', '$rootScope', '$compile', '$location',
|
|||||||
|
|
||||||
$scope.$parent.activeMode = 'edit';
|
$scope.$parent.activeMode = 'edit';
|
||||||
|
|
||||||
$scope.$emit("HideOrgListHeader");
|
$scope.$parent.activeCard = parseInt(id);
|
||||||
|
|
||||||
$scope.$emit("ReloadOrganzationCards", id);
|
$scope.$emit("HideOrgListHeader");
|
||||||
|
|
||||||
$scope.organization_id = id;
|
$scope.organization_id = id;
|
||||||
|
|
||||||
@@ -116,12 +116,11 @@ export default ['$scope', '$rootScope', '$compile', '$location',
|
|||||||
}
|
}
|
||||||
Rest.setUrl(defaultUrl + id + '/');
|
Rest.setUrl(defaultUrl + id + '/');
|
||||||
Rest.put(params)
|
Rest.put(params)
|
||||||
.success(function (data) {
|
.success(function () {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
$scope.organization_name = $scope.name;
|
$scope.organization_name = $scope.name;
|
||||||
master = params;
|
master = params;
|
||||||
$rootScope.flashMessage = "Your changes were successfully saved!";
|
$state.go($state.current, {}, {reload: true});
|
||||||
$scope.$emit("ReloadOrganzationCards", data.id);
|
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
ProcessErrors($scope, data, status, OrganizationForm, { hdr: 'Error!',
|
ProcessErrors($scope, data, status, OrganizationForm, { hdr: 'Error!',
|
||||||
@@ -130,26 +129,22 @@ export default ['$scope', '$rootScope', '$compile', '$location',
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.formCancel = function () {
|
$scope.formCancel = function () {
|
||||||
$scope.$emit("ReloadOrganzationCards");
|
|
||||||
$scope.$emit("ShowOrgListHeader");
|
|
||||||
$state.transitionTo('organizations');
|
$state.transitionTo('organizations');
|
||||||
|
$scope.$emit("ShowOrgListHeader");
|
||||||
};
|
};
|
||||||
|
|
||||||
// Related set: Add button
|
// Related set: Add button
|
||||||
$scope.add = function (set) {
|
$scope.add = function (set) {
|
||||||
$rootScope.flashMessage = null;
|
|
||||||
$location.path('/' + base + '/' + $stateParams.organization_id + '/' + set);
|
$location.path('/' + base + '/' + $stateParams.organization_id + '/' + set);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Related set: Edit button
|
// Related set: Edit button
|
||||||
$scope.edit = function (set, id) {
|
$scope.edit = function (set, id) {
|
||||||
$rootScope.flashMessage = null;
|
|
||||||
$location.path('/' + set + '/' + id);
|
$location.path('/' + set + '/' + id);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Related set: Delete button
|
// Related set: Delete button
|
||||||
$scope['delete'] = function (set, itm_id, name, title) {
|
$scope['delete'] = function (set, itm_id, name, title) {
|
||||||
$rootScope.flashMessage = null;
|
|
||||||
|
|
||||||
var action = function () {
|
var action = function () {
|
||||||
Wait('start');
|
Wait('start');
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ export default ['$scope', '$rootScope', 'ProcessErrors', 'UserList', 'generateLi
|
|||||||
$q.all(requests)
|
$q.all(requests)
|
||||||
.then(function () {
|
.then(function () {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
$scope.$emit('ReloadOrganzationCards', $scope.$parent.org_id);
|
|
||||||
$scope.$parent.search('user');
|
$scope.$parent.search('user');
|
||||||
$scope.closeModal();
|
$scope.closeModal();
|
||||||
}, function (error) {
|
}, function (error) {
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ export default ['$stateParams', '$scope', 'UserList', 'Rest', '$state', 'generat
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.formCancel = function(){
|
$scope.formCancel = function(){
|
||||||
|
$scope.$emit("ReloadOrgListView");
|
||||||
$state.go('organizations');
|
$state.go('organizations');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -336,6 +336,7 @@ export default ['$scope', '$rootScope', '$location', '$log',
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.formCancel = function(){
|
$scope.formCancel = function(){
|
||||||
|
$scope.$parent.activeCard = null;
|
||||||
$state.go('organizations');
|
$state.go('organizations');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ export default ['$scope', '$rootScope', '$location', '$log',
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.formCancel = function(){
|
$scope.formCancel = function(){
|
||||||
|
$scope.$parent.activeCard = null;
|
||||||
$state.go('organizations');
|
$state.go('organizations');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -343,6 +343,7 @@ export default ['$scope', '$rootScope', '$location', '$log',
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.formCancel = function(){
|
$scope.formCancel = function(){
|
||||||
|
$scope.$parent.activeCard = null;
|
||||||
$state.go('organizations');
|
$state.go('organizations');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ export default ['$scope', '$rootScope', '$location', '$log', '$stateParams',
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.formCancel = function(){
|
$scope.formCancel = function(){
|
||||||
|
$scope.$parent.activeCard = null;
|
||||||
$state.go('organizations');
|
$state.go('organizations');
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,6 +92,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.formCancel = function(){
|
$scope.formCancel = function(){
|
||||||
|
$scope.$parent.activeCard = null;
|
||||||
$state.go('organizations');
|
$state.go('organizations');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -27,9 +27,6 @@ export default ['$stateParams', '$scope', '$rootScope', '$location',
|
|||||||
var val = {}, url = '/#/organizations/' + card.id + '/';
|
var val = {}, url = '/#/organizations/' + card.id + '/';
|
||||||
val.name = card.name;
|
val.name = card.name;
|
||||||
val.id = card.id;
|
val.id = card.id;
|
||||||
if (card.id + "" === cards.activeCard) {
|
|
||||||
val.isActiveCard = true;
|
|
||||||
}
|
|
||||||
val.description = card.description || undefined;
|
val.description = card.description || undefined;
|
||||||
val.links = [];
|
val.links = [];
|
||||||
val.links.push({
|
val.links.push({
|
||||||
@@ -73,14 +70,9 @@ export default ['$stateParams', '$scope', '$rootScope', '$location',
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.$on("ReloadOrgListView", function() {
|
$scope.$on("ReloadOrgListView", function() {
|
||||||
if ($state.$current.self.name === "organizations") {
|
if ($state.$current.self.name === "organizations" ||
|
||||||
delete $scope.activeCard;
|
$state.$current.self.name === "organizations.add") {
|
||||||
if ($scope.orgCards) {
|
$scope.activeCard = null;
|
||||||
$scope.orgCards = $scope.orgCards.map(function(card) {
|
|
||||||
delete card.isActiveCard;
|
|
||||||
return card;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -118,10 +110,19 @@ export default ['$stateParams', '$scope', '$rootScope', '$location',
|
|||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
.success(function() {
|
.success(function() {
|
||||||
if ($state.current.name !== "organzations") {
|
Wait('stop');
|
||||||
$state.transitionTo("organizations");
|
if ($state.current.name !== "organizations") {
|
||||||
|
if ($state.current
|
||||||
|
.name === 'organizations.edit' &&
|
||||||
|
id === parseInt($state.params
|
||||||
|
.organization_id)) {
|
||||||
|
$state.go("organizations", {}, {reload: true});
|
||||||
|
} else {
|
||||||
|
$state.go($state.current, {}, {reload: true});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$state.go($state.current, {}, {reload: true});
|
||||||
}
|
}
|
||||||
$scope.$emit("ReloadOrganzationCards");
|
|
||||||
})
|
})
|
||||||
.error(function(data, status) {
|
.error(function(data, status) {
|
||||||
ProcessErrors($scope, data, status, null, {
|
ProcessErrors($scope, data, status, null, {
|
||||||
|
|||||||
@@ -19,6 +19,11 @@
|
|||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.OrgCards-search .TagSearch-bar {
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
.OrgCards .List-pagination{
|
.OrgCards .List-pagination{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,8 +172,12 @@ export default ['$location', '$compile', '$rootScope', 'SearchWidget', 'Paginate
|
|||||||
// respond to changes to the edit indicator from
|
// respond to changes to the edit indicator from
|
||||||
// the stateChangeStart event in app.js
|
// the stateChangeStart event in app.js
|
||||||
this.scope.$on("EditIndicatorChange", function(e, list, id) {
|
this.scope.$on("EditIndicatorChange", function(e, list, id) {
|
||||||
e.targetScope.listBeingEdited = list;
|
if (list === "organizations") {
|
||||||
e.targetScope.rowBeingEdited = id;
|
e.targetScope.activeCard = parseInt(id);
|
||||||
|
} else {
|
||||||
|
e.targetScope.listBeingEdited = list;
|
||||||
|
e.targetScope.rowBeingEdited = id;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.scope.$on("RemoveIndicator", function(e) {
|
this.scope.$on("RemoveIndicator", function(e) {
|
||||||
@@ -364,6 +368,9 @@ export default ['$location', '$compile', '$rootScope', 'SearchWidget', 'Paginate
|
|||||||
}
|
}
|
||||||
|
|
||||||
html += (list.searchRowActions) ? "<div class='row'><div class=\"col-lg-8 col-md-8 col-sm-8 col-xs-12\">" : "";
|
html += (list.searchRowActions) ? "<div class='row'><div class=\"col-lg-8 col-md-8 col-sm-8 col-xs-12\">" : "";
|
||||||
|
if (list.searchRowActions && !list.searchSize) {
|
||||||
|
list.searchSize = 'col-lg-7 col-md-12 col-sm-12 col-xs-12';
|
||||||
|
}
|
||||||
if (options.showSearch=== undefined || options.showSearch === true) {
|
if (options.showSearch=== undefined || options.showSearch === true) {
|
||||||
var tagSearch = getSearchHtml
|
var tagSearch = getSearchHtml
|
||||||
.inject(getSearchHtml.getList(list),
|
.inject(getSearchHtml.getList(list),
|
||||||
|
|||||||
Reference in New Issue
Block a user