mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 09:51:09 +03:00
Turned the activity stream button into a toggle. Removed the dashboard icon that was shown when a state does not have an activity stream.
This commit is contained in:
parent
e32d20b5c4
commit
ecf8d8765d
@ -188,13 +188,14 @@ table, tbody {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.List-auxAction + .List-actions {
|
||||
margin-left: 20px;
|
||||
.List-actions {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.List-auxAction {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.List-auxActionStream {
|
||||
|
@ -11,6 +11,9 @@ export default {
|
||||
route: '/activity_stream?target&id',
|
||||
templateUrl: templateUrl('activity-stream/activitystream'),
|
||||
controller: 'activityStreamController',
|
||||
data: {
|
||||
activityStream: true
|
||||
},
|
||||
ncyBreadcrumb: {
|
||||
label: "ACTIVITY STREAM"
|
||||
},
|
||||
|
@ -20,7 +20,6 @@
|
||||
}
|
||||
.BreadCrumb-menuLink {
|
||||
width: 58px;
|
||||
border-left: 1px solid @bc-link-side;
|
||||
margin-left: auto;
|
||||
color: @bc-link-icon;
|
||||
flex: initial;
|
||||
@ -30,8 +29,7 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
.BreadCrumb-menuLink:hover {
|
||||
background-color: @bc-link-bg-hov;
|
||||
color: @bc-link-icon;
|
||||
color: @bc-link-icon-focus;
|
||||
}
|
||||
.BreadCrumb-menuLink.BreadCrumb-menuLinkActive {
|
||||
color: @bc-link-icon-focus;
|
||||
|
@ -1,5 +1,5 @@
|
||||
export default
|
||||
[ 'templateUrl', '$state', 'FeaturesService', 'ProcessErrors', function(templateUrl, $state, FeaturesService, ProcessErrors) {
|
||||
[ 'templateUrl', '$state', 'FeaturesService', 'ProcessErrors', 'Store', 'Empty', function(templateUrl, $state, FeaturesService, ProcessErrors, Store, Empty) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
templateUrl: templateUrl('bread-crumb/bread-crumb'),
|
||||
@ -10,8 +10,10 @@ export default
|
||||
scope.showActivityStreamButton = false;
|
||||
scope.loadingLicense = true;
|
||||
|
||||
scope.openActivityStream = function() {
|
||||
scope.toggleActivityStream = function() {
|
||||
|
||||
// If the user is not already on the activity stream then they want to navigate to it
|
||||
if(!scope.activityStreamActive) {
|
||||
var stateGoParams = {};
|
||||
|
||||
if(streamConfig && streamConfig.activityStream) {
|
||||
@ -24,9 +26,35 @@ export default
|
||||
}
|
||||
|
||||
$state.go('activityStream', stateGoParams);
|
||||
}
|
||||
// The user is navigating away from the activity stream - take them back from whence they came
|
||||
else {
|
||||
// Pull the previous state out of local storage
|
||||
var previousState = Store('previous_state');
|
||||
|
||||
if(previousState && !Empty(previousState.name)) {
|
||||
$state.go(previousState.name, previousState.fromParams);
|
||||
}
|
||||
else {
|
||||
// If for some reason something went wrong (like local storage was wiped, etc) take the
|
||||
// user back to the dashboard
|
||||
$state.go('dashboard');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
scope.$on("$stateChangeSuccess", function updateActivityStreamButton(event, toState) {
|
||||
scope.$on("$stateChangeSuccess", function updateActivityStreamButton(event, toState, toParams, fromState, fromParams) {
|
||||
|
||||
if(fromState && !Empty(fromState.name)) {
|
||||
// Go ahead and attach the from params to the state object so that it can all be stored together
|
||||
fromState.fromParams = fromParams ? fromParams : {};
|
||||
|
||||
// Store the state that we're coming from in local storage to be accessed when navigating away from the
|
||||
// activity stream
|
||||
Store('previous_state', fromState);
|
||||
}
|
||||
|
||||
streamConfig = (toState && toState.data) ? toState.data : {};
|
||||
|
||||
@ -41,13 +69,10 @@ export default
|
||||
FeaturesService.get()
|
||||
.then(function() {
|
||||
scope.loadingLicense = false;
|
||||
if(FeaturesService.featureEnabled('activity_streams')) {
|
||||
scope.showActivityStreamButton = true;
|
||||
}
|
||||
else {
|
||||
scope.showActivityStreamButton = false;
|
||||
}
|
||||
scope.licenseType = FeaturesService.getLicenseInfo()['license_type'];
|
||||
scope.activityStreamActive = (toState.name === 'activityStream') ? true : false;
|
||||
scope.showActivityStreamButton = (FeaturesService.featureEnabled('activity_streams') || toState.name === 'activityStream') ? true : false;
|
||||
var licenseInfo = FeaturesService.getLicenseInfo();
|
||||
scope.licenseType = licenseInfo.license_type;
|
||||
})
|
||||
.catch(function (response) {
|
||||
ProcessErrors(null, response.data, response.status, null, {
|
||||
|
@ -9,22 +9,9 @@
|
||||
ng-class="{'BreadCrumb-menuLinkActive' : activityStreamActive}"
|
||||
ng-if="showActivityStreamButton"
|
||||
ng-hide= "loadingLicense || licenseMissing || licenseType == 'basic'"
|
||||
ng-click="openActivityStream()">
|
||||
ng-click="toggleActivityStream()">
|
||||
<i class="BreadCrumb-menuLinkImage icon-activity-stream"
|
||||
alt="Activity Stream">
|
||||
</i>
|
||||
</div>
|
||||
<a class="BreadCrumb-menuLink"
|
||||
id="bread_crumb_dashboard"
|
||||
ui-sref="dashboard"
|
||||
aw-tool-tip="View Dashboard"
|
||||
data-placement="left"
|
||||
data-trigger="hover"
|
||||
data-container="body"
|
||||
ng-hide="loadingLicense || licenseMissing || licenseType == 'basic'"
|
||||
ng-if="!showActivityStreamButton">
|
||||
<i class="BreadCrumb-menuLinkImage fa fa-tachometer"
|
||||
alt="Dashboard">
|
||||
</i>
|
||||
</a>
|
||||
</div>
|
||||
|
@ -323,11 +323,6 @@ export default ['$location', '$compile', '$rootScope', 'SearchWidget', 'Paginate
|
||||
html += "</button></div>\n";
|
||||
}
|
||||
html += "<div class=\"List-actionHolder\">";
|
||||
if(list.toolbarAuxAction) {
|
||||
html += "<div class=\"List-auxAction\">";
|
||||
html += list.toolbarAuxAction;
|
||||
html += "</div>";
|
||||
}
|
||||
html += "<div class=\"List-actions\">";
|
||||
html += "<div ng-include=\"'" +
|
||||
templateUrl('shared/list-generator/list-actions') +
|
||||
@ -337,8 +332,13 @@ export default ['$location', '$compile', '$rootScope', 'SearchWidget', 'Paginate
|
||||
list.actions[action] = _.defaults(list.actions[action], { dataPlacement: "top" });
|
||||
}
|
||||
|
||||
html += "</div>\n";
|
||||
html += "</div>";
|
||||
if(list.toolbarAuxAction) {
|
||||
html += "<div class=\"List-auxAction\">";
|
||||
html += list.toolbarAuxAction;
|
||||
html += "</div>";
|
||||
}
|
||||
html += "\n</div>";
|
||||
html += "</div>";
|
||||
html += "</div>";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user