cleanup activity stream

This commit is contained in:
John Mitchell
2017-03-02 12:54:54 -05:00
parent a6c57fc060
commit e784dba612
14 changed files with 404 additions and 414 deletions

View File

@@ -16,9 +16,7 @@
* @description This form is for activity detail modal that can be shown on most pages.
*/
export default
angular.module('ActivityDetailDefinition', [])
.factory('ActivityDetailForm', ['i18n', function(i18n) {
export default ['i18n', function(i18n) {
return {
name: 'activity',
@@ -48,4 +46,4 @@ export default
}
}
};}]); //Form
};}];

View File

@@ -9,7 +9,10 @@
* @name controllers.function:Activity Stream
* @description This controller controls the activity stream.
*/
function activityStreamController($scope, $state, subTitle, Stream, GetTargetTitle, list, Dataset) {
export default ['$scope', '$state', 'subTitle', 'Stream', 'GetTargetTitle',
'StreamList', 'Dataset',
function activityStreamController($scope, $state, subTitle, Stream,
GetTargetTitle, list, Dataset) {
init();
initOmitSmartTags();
@@ -48,6 +51,5 @@ function activityStreamController($scope, $state, subTitle, Stream, GetTargetTit
defaults[$state.params.target] = null;
}
}
}
export default ['$scope', '$state', 'subTitle', 'Stream', 'GetTargetTitle', 'StreamList', 'Dataset', activityStreamController];
}
];

View File

@@ -60,8 +60,8 @@ export default {
return qs.search(path, stateParams);
}
],
features: ['FeaturesService', 'ProcessErrors', '$state', '$rootScope',
function(FeaturesService, ProcessErrors, $state, $rootScope) {
features: ['FeaturesService', '$state', '$rootScope',
function(FeaturesService, $state, $rootScope) {
var features = FeaturesService.get();
if (features) {
if (FeaturesService.featureEnabled('activity_streams')) {
@@ -81,12 +81,10 @@ export default {
});
}
],
subTitle: ['$stateParams',
'Rest',
'ModelToBasePathKey',
'GetBasePath',
subTitle: ['$stateParams', 'Rest', 'ModelToBasePathKey', 'GetBasePath',
'ProcessErrors',
function($stateParams, rest, ModelToBasePathKey, getBasePath, ProcessErrors) {
function($stateParams, rest, ModelToBasePathKey, getBasePath,
ProcessErrors) {
// If we have a target and an ID then we want to go grab the name of the object
// that we're examining with the activity stream. This name will be used in the
// subtitle.

View File

@@ -1,5 +1,4 @@
export default
function BuildAnchor($log, $filter) {
export default function BuildAnchor($log, $filter) {
// Returns a full <a href=''>resource_name</a> HTML string if link can be derived from supplied context
// returns name of resource if activity stream object doesn't contain enough data to build a UI url
// arguments are: a summary_field object, a resource type, an activity stream object
@@ -73,6 +72,6 @@ export default
return ' ' + $filter('sanitize')(obj.name || obj.username || '') + ' ';
}
};
}
}
BuildAnchor.$inject = ['$log', '$filter'];

View File

@@ -1,5 +1,4 @@
export default
function BuildDescription(BuildAnchor, $log, i18n) {
export default function BuildDescription(BuildAnchor, $log, i18n) {
return function (activity) {
var pastTense = function(operation){
@@ -123,4 +122,4 @@ export default
};
}
BuildDescription.$inject = ['BuildAnchor', '$log', 'i18n'];
BuildDescription.$inject = ['BuildAnchor', '$log', 'i18n'];

View File

@@ -1,5 +1,6 @@
export default
function ShowDetail($filter, $rootScope, Rest, Alert, GenerateForm, ProcessErrors, GetBasePath, FormatDate, ActivityDetailForm, Empty, Find) {
export default function ShowDetail($filter, $rootScope, Rest, Alert,
GenerateForm, ProcessErrors, GetBasePath, FormatDate, ActivityDetailForm,
Empty, Find) {
return function (params, scope) {
var activity_id = params.activity_id,

View File

@@ -1,7 +1,6 @@
export default
function Stream($rootScope, $location, $state, Rest, GetBasePath, ProcessErrors,
Wait, StreamList, GenerateList, FormatDate,
BuildDescription, ShowDetail) {
export default function Stream($rootScope, $location, $state, Rest, GetBasePath,
ProcessErrors, Wait, StreamList, GenerateList, FormatDate, BuildDescription,
ShowDetail) {
return function (params) {
var scope = params.scope;

View File

@@ -1,5 +1,4 @@
export default
function GetTargetTitle(i18n) {
export default function GetTargetTitle(i18n) {
return function (target) {
var rtnTitle = i18n._('ALL ACTIVITY');
@@ -46,6 +45,6 @@ export default
return rtnTitle;
};
}
}
GetTargetTitle.$inject = ['i18n'];

View File

@@ -14,6 +14,8 @@ import ShowDetail from './factories/show-detail.factory';
import Stream from './factories/stream.factory';
import GetTargetTitle from './get-target-title.factory';
import ModelToBasePathKey from './model-to-base-path-key.factory';
import ActivityDetailForm from './activity-detail.form';
import StreamList from './streams.list';
export default angular.module('activityStream', [streamDetailModal.name])
.controller('activityStreamController', activityStreamController)
@@ -24,6 +26,8 @@ export default angular.module('activityStream', [streamDetailModal.name])
.factory('Stream', Stream)
.factory('GetTargetTitle', GetTargetTitle)
.factory('ModelToBasePathKey', ModelToBasePathKey)
.factory('ActivityDetailForm', ActivityDetailForm)
.factory('StreamList', StreamList)
.run(['$stateExtender', function($stateExtender) {
$stateExtender.addState(activityStreamRoute);
}]);

View File

@@ -10,8 +10,7 @@
* @description Helper functions to convert singular/plural versions of our models to the opposite
*/
export default
function ModelToBasePathKey() {
export default function ModelToBasePathKey() {
return function(model) {
// This function takes in the singular model string and returns the key needed
// to get the base path from $rootScope/local storage.
@@ -56,4 +55,4 @@ export default
return basePathKey;
};
}
}

View File

@@ -5,9 +5,7 @@
*************************************************/
export default
angular.module('StreamListDefinition', [])
.factory('StreamList', ['i18n', function(i18n) {
export default ['i18n', function(i18n) {
return {
name: 'activities',
@@ -72,4 +70,4 @@ export default
}
}
};}]);
};}];

View File

@@ -143,8 +143,6 @@ var tower = angular.module('Tower', [
'AllJobsDefinition',
'JobSummaryDefinition',
'HostGroupsFormDefinition',
'StreamListDefinition',
'ActivityDetailDefinition',
'ScheduledJobsDefinition',
'JobsListDefinition',
'LogViewerStatusDefinition',

View File

@@ -4,7 +4,6 @@
* All Rights Reserved
*************************************************/
import ActivityDetail from "./forms/ActivityDetail";
import EventsViewer from "./forms/EventsViewer";
import Groups from "./forms/Groups";
import HostGroups from "./forms/HostGroups";
@@ -23,8 +22,7 @@ import Workflows from "./forms/Workflows";
export
{ ActivityDetail,
EventsViewer,
{ EventsViewer,
Groups,
HostGroups,
Hosts,

View File

@@ -19,7 +19,6 @@ import Organizations from "./lists/Organizations";
import PortalJobTemplates from "./lists/PortalJobTemplates";
import PortalJobs from "./lists/PortalJobs";
import ScheduledJobs from "./lists/ScheduledJobs";
import Streams from "./lists/Streams";
import Templates from "./lists/Templates";
export
@@ -38,6 +37,5 @@ export
PortalJobTemplates,
PortalJobs,
ScheduledJobs,
Streams,
Templates
};