mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 20:30:46 -03:30
Merge pull request #4738 from chrismeyersfsu/fix-4185
activity stream, display name of resource as title
This commit is contained in:
commit
4fdc8f6d35
@ -12,6 +12,7 @@
|
||||
function activityStreamController($scope, $state, subTitle, Stream, GetTargetTitle, list, Dataset) {
|
||||
|
||||
init();
|
||||
initOmitSmartTags();
|
||||
|
||||
function init() {
|
||||
// search init
|
||||
@ -33,6 +34,20 @@ function activityStreamController($scope, $state, subTitle, Stream, GetTargetTit
|
||||
});
|
||||
}
|
||||
|
||||
// Specification of smart-tags omission from the UI is done in the route/state init.
|
||||
// A limitation is that this specficiation is static and the key for which to be omitted from
|
||||
// the smart-tags must be known at that time.
|
||||
// In the case of activity stream, we won't to dynamically ommit the resource for which we are
|
||||
// displaying the activity stream for. i.e. 'project', 'credential', etc.
|
||||
function initOmitSmartTags() {
|
||||
let defaults, route = _.find($state.$current.path, (step) => {
|
||||
return step.params.hasOwnProperty('activity_search');
|
||||
});
|
||||
if (route && $state.params.target !== undefined) {
|
||||
defaults = route.params.activity_search.config.value;
|
||||
defaults[$state.params.target] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default ['$scope', '$state', 'subTitle', 'Stream', 'GetTargetTitle', 'StreamList', 'Dataset', activityStreamController];
|
||||
|
||||
@ -47,6 +47,9 @@ export default
|
||||
order_by: '-timestamp',
|
||||
page_size: '20',
|
||||
};
|
||||
if (streamConfig.activityStreamTarget && streamConfig.activityStreamId) {
|
||||
stateGoParams.activity_search[streamConfig.activityStreamTarget] = $state.params[streamConfig.activityStreamId];
|
||||
}
|
||||
}
|
||||
else {
|
||||
stateGoParams.activity_search = {
|
||||
|
||||
@ -177,7 +177,7 @@ export default ['$injector', '$stateExtender', '$log', function($injector, $stat
|
||||
break;
|
||||
case 'edit':
|
||||
url = params.urls && params.urls.edit ? params.urls.edit : (params.url ? params.url : `/:${form.name}_id`);
|
||||
formNode = $stateExtender.buildDefinition({
|
||||
let formNodeState = {
|
||||
name: params.name || `${params.parent}.edit`,
|
||||
url: url,
|
||||
ncyBreadcrumb: {
|
||||
@ -215,8 +215,15 @@ export default ['$injector', '$stateExtender', '$log', function($injector, $stat
|
||||
return Rest.get();
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
if (params.data && params.data.activityStreamTarget) {
|
||||
formNodeState.data = {};
|
||||
formNodeState.data.activityStreamId = params.data.activityStreamTarget + '_id';
|
||||
|
||||
}
|
||||
formNode = $stateExtender.buildDefinition(formNodeState);
|
||||
|
||||
if (params.resolve && params.resolve.edit) {
|
||||
formNode.resolve = _.merge(formNode.resolve, params.resolve.edit);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user