mirror of
https://github.com/ZwareBear/awx.git
synced 2026-04-15 04:21:49 -05:00
awLicenseFeature with show/hide changed file locations changing file location adjusting controller logic to only return list of features leveraging $rootScope instead of local storage adding awFeature directive for lists/forms for activity stream button Adding route resolvers and service for getting license In order to get the license info from the API and not from local storage, the UI needs to hit hte API before loading any pages, therefore I've added route resolvers that will ensure that we have the appropriate data (license features) before navigating to a new page. I've also added the awFeature directive to the organizations list -> add-button and the ldap checkbox on the user form page. adjusting alignment fixing jshint errors commting file for testings adding tests for features service and features controller adding features controller unit test
78 lines
2.3 KiB
JavaScript
78 lines
2.3 KiB
JavaScript
/*********************************************
|
|
* Copyright (c) 2014 AnsibleWorks, Inc.
|
|
*
|
|
* Users.js
|
|
* List view object for Users data model.
|
|
*
|
|
*/
|
|
|
|
|
|
|
|
export default
|
|
angular.module('UserListDefinition', [])
|
|
.value('UserList', {
|
|
|
|
name: 'users',
|
|
iterator: 'user',
|
|
selectTitle: 'Add Users',
|
|
editTitle: 'Users',
|
|
selectInstructions: '<p>Select existing users by clicking each user or checking the related checkbox. When finished, click the blue ' +
|
|
'<em>Select</em> button, located bottom right.</p> <p>When available, a brand new user can be created by clicking the ' +
|
|
'<i class=\"fa fa-plus\"></i> button.</p>',
|
|
index: false,
|
|
hover: true,
|
|
|
|
fields: {
|
|
username: {
|
|
key: true,
|
|
label: 'Username',
|
|
columnClass: 'col-md-3 col-sm-3 col-xs-9'
|
|
},
|
|
first_name: {
|
|
label: 'First Name',
|
|
columnClass: 'col-md-3 col-sm-3 hidden-xs'
|
|
},
|
|
last_name: {
|
|
label: 'Last Name',
|
|
columnClass: 'col-md-3 col-sm-3 hidden-xs'
|
|
}
|
|
},
|
|
|
|
actions: {
|
|
add: {
|
|
label: 'Create New',
|
|
mode: 'all', // One of: edit, select, all
|
|
ngClick: 'addUser()',
|
|
basePaths: ['organizations', 'users'], // base path must be in list, or action not available
|
|
"class": 'btn-xs',
|
|
awToolTip: 'Create a new user'
|
|
},
|
|
stream: {
|
|
ngClick: "showActivity()",
|
|
awToolTip: "View Activity Stream",
|
|
mode: 'edit',
|
|
awFeature: 'activity_streams'
|
|
}
|
|
},
|
|
|
|
fieldActions: {
|
|
edit: {
|
|
label: 'Edit',
|
|
ngClick: "editUser(user.id)",
|
|
icon: 'icon-edit',
|
|
"class": 'btn-xs btn-default',
|
|
awToolTip: 'Edit user',
|
|
dataPlacement: 'top'
|
|
},
|
|
|
|
"delete": {
|
|
label: 'Delete',
|
|
ngClick: "deleteUser(user.id, user.username)",
|
|
icon: 'icon-trash',
|
|
"class": 'btn-xs btn-danger',
|
|
awToolTip: 'Delete user',
|
|
dataPlacement: 'top'
|
|
}
|
|
}
|
|
});
|