<commit_before>angular.module('superdesk.apps.dashboard.widgets.relatedItem', [
    'superdesk.apps.dashboard.widgets.base',
    'superdesk.apps.authoring.widgets'
])
    .controller('relatedItemController', RelatedItemController)
    .config(['authoringWidgetsProvider', function(authoringWidgets) {
        authoringWidgets.widget('related-item', {
            label: gettext('Related Item'),
            icon: 'related',
            template: 'scripts/apps/archive/related-item-widget/widget-relatedItem.html',
            order: 7,
            side: 'right',
            display: {authoring: true, packages: false, killedItem: true, legalArchive: false, archived: false},
            configurationTemplate: 'scripts/apps/archive/related-item-widget/relatedItem-configuration.html',
            configurable: true,
            configuration: {
                sluglineMatch: 'EXACT',
                modificationDateAfter: 'today'
            }
        });
    }]);

RelatedItemController.$inject = [
    '$scope',
    'api',
    'BaseWidgetController',
    'notify',
    'superdesk',
    '$q',
    'authoringWorkspace',
    'authoring',
    'privileges',
    'config',
    'storage'
];

function RelatedItemController(
    $scope,
    api,
    BaseWidgetController,
    notify,
    superdesk,
    $q,
    authoringWorkspace,
    authoring,
    privileges,
    config,
    storage
) {
    $scope.type = 'archiveWidget';
    $scope.itemListOptions = {
        endpoint: 'search',
        repo: ['archive', 'published'],
        notStates: ['spiked'],
        types: ['text', 'composite'],
        page: 1,
        modificationDateAfter: storage.getItem('modificationDateAfter') || today(),
        sluglineMatch: storage.getItem('sluglineMatch') || 'EXACT'<commit_msg>Fixing the query for the related-item widget.<commit_after>angular.module('superdesk.apps.dashboard.widgets.relatedItem', [
    'superdesk.apps.dashboard.widgets.base',
    'superdesk.apps.authoring.widgets'
])
    .controller('relatedItemController', RelatedItemController)
    .config(['authoringWidgetsProvider', function(authoringWidgets) {
        authoringWidgets.widget('related-item', {
            label: gettext('Related Item'),
            icon: 'related',
            template: 'scripts/apps/archive/related-item-widget/widget-relatedItem.html',
            order: 7,
            side: 'right',
            display: {authoring: true, packages: false, killedItem: true, legalArchive: false, archived: false},
            configurationTemplate: 'scripts/apps/archive/related-item-widget/relatedItem-configuration.html',
            configurable: true,
            configuration: {
                sluglineMatch: 'EXACT',
                modificationDateAfter: 'today'
            }
        });
    }]);

RelatedItemController.$inject = [
    '$scope',
    'api',
    'BaseWidgetController',
    'notify',
    'superdesk',
    '$q',
    'authoringWorkspace',
    'authoring',
    'privileges',
    'config',
    'storage'
];

function RelatedItemController(
    $scope,
    api,
    BaseWidgetController,
    notify,
    superdesk,
    $q,
    authoringWorkspace,
    authoring,
    privileges,
    config,
    storage
) {
    $scope.type = 'archiveWidget';
    $scope.itemListOptions = {
        endpoint: 'search',
        repo: ['archive', 'published'],
        notStates: ['spiked'],
        types: ['text', 'composite'],
        page: 1,
        modificationDateAfter: storage.getItem('modificationDateAfter') === 'today' ? today() :
            storage.getItem('modificationDateAfter') || today(),
        sluglineMatch: storage.getItem('sluglineMatch') || 'EXACT'
{'fraction_non_alphanumeric': 0.13428336530556317, 'fraction_numerical': 0.0010961907371882709, 'mean_word_length': 2.686868686868687, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4437635', 'n_tokens_mistral': 1040, 'n_tokens_neox': 1037, 'n_words': 178}