superdesk/superdesk-client-core

View on GitHub
scripts/apps/stream/directives/ActivityStream.ts

Summary

Maintainability
A
0 mins
Test Coverage
import {AuthoringWorkspaceService} from 'apps/authoring/authoring/services/AuthoringWorkspaceService';

ActivityStream.$inject = ['asset', 'authoringWorkspace'];
export function ActivityStream(asset, authoringWorkspace: AuthoringWorkspaceService) {
    return {
        scope: {
            activities: '=',
            max_results: '=maxResults',
            loadMore: '&',
        },
        templateUrl: asset.templateUrl('apps/stream/views/activity-stream.html'),
        link: function(scope, element, attrs) {
            scope.openArticle = function(activity) {
                if (activity.item) {
                    authoringWorkspace.edit({_id: activity.item}, 'edit');
                }
            };
        },
    };
}