<commit_before>'use strict';

(function() {
  angular.module('ncsaas')
    .service('eventsService', ['baseServiceClass', 'ENV', 'EVENT_FEATURES', eventsService]);

  function eventsService(baseServiceClass, ENV, EVENT_FEATURES) {
    /*jshint validthis: true */
    var ServiceClass = baseServiceClass.extend({
      init:function() {
        this._super();
        this.endpoint = '/events/';
        this.filterByCustomer = false;

        if (!ENV.featuresVisible) {
            var event_types = [];
            for(var feature in EVENT_FEATURES) {
                if (ENV.toBeFeatures.indexOf(feature) == -1) {
                    var events = EVENT_FEATURES[feature];
                    for (var i = 0; i < events.length; i++) {
                        event_types.push(events[i]);
                    }
                }
            }
            this.enabled_event_types = event_types;
        }
      },
      getList: function(filter, endpointUrl) {
        if (!this.defaultFilter.event_type) {
            this.defaultFilter.event_type = this.enabled_event_types;
        }
        return this._super(filter, endpointUrl);
      }
    });
    return new ServiceClass();
  }

})();

(function() {
    var templates = {
        'auth_logged_in_with_username': 'User {user_full_name} authenticated successfully with username and password.',
        'customer_account_credited': 'Balance has been increased by {amount} for customer {customer_name}.',
        'customer_account_debited': 'Balance has been decreased by {amount} for customer {customer_name}.',
        'customer_creation_succeeded': 'Organization {customer_name} has been created.',
        'customer_deletion_succeeded': 'Organization {customer_name} has been deleted.',
        'customer_update_succeeded': 'Organization {customer_name} has been updated.',
        'iaas_backup_creation_failed': 'Backup creation for {iaas_instance_name} has failed.',
        'iaas_backup_creation_scheduled': 'Backup for {iaas_instance_name} has been scheduled.',
        'iaas_backup_creation_succeeded': 'Backup for {iaas_instance_name} has been created.',
        'iaas_backup_deletion_failed': 'Backup deletion for {iaas_instance_name} has failed.',
        'iaas_backup_deletion_scheduled': 'Backup deletion for {iaas_instance_name} has been scheduled.',
        'iaas_backup_deletion_succeeded': 'Backup for {iaas_instance_name} has been deleted.',
        'iaas_backup_restoration_failed': 'Backup restoration for {iaas_instance_name} has failed.',
        'iaas_backup_restoration_scheduled': 'Backup restoration for {iaas_instance_name} has been scheduled.',
        'iaas_backup_restoration_succeeded': 'Backup for {iaas_instance_name} has been restored.',
        'iaas_backup_schedule_activated': 'Backup schedule for {iaas_instance_name} has been activated.',
        'iaas_backup_schedule_creation_succeeded': 'Backup schedule for {iaas_instance_name} has been created.',
        'iaas_backup_schedule_deactivated': 'Backup schedule for {iaas_instance_name} has been deactivated.',
        'iaas_backup_schedule_deletion_succeeded': 'Backup schedule for {iaas_instance_name} has been deleted.',
        'iaas_backup_schedule_update_succeeded': 'Backup schedule for {iaas_instance_name} has been updated.',
        'iaas_instance_application_became_available': 'Application has become available on {instance_name}.',
        'iaas_instance_application_deployment_succeeded': 'Application has been deployed on {instance_name}.',
        'iaas_instance_application_failed': 'Application has failed on {instance_name}.',
        'iaas_instance_creation_failed': 'Virtual machine {instance_name} creation has failed.',
        'iaas_instance_creation_scheduled': 'Virtual machine {instance_name} creation has been scheduled.',
        'iaas_instance_creation_succeeded': 'Virtual machine {instance_name} has been created.',
        'iaas_instance_deletion_failed': 'Virtual machine {instance_name} deletion has failed.',
        'iaas_instance_deletion_succeeded': 'Virtual machine {instance_name} has been deleted.',
        'iaas_instance_flavor_change_failed': 'Virtual machine {instance_name} flavor change has failed.',
        'iaas_instance_flavor_change_scheduled': 'Virtual machine {instance_name} has been scheduled to change flavor.',
        'iaas_instance_flavor_change_succeeded': 'Virtual machine {instance_name} flavor has been changed to {flavor_name}.',
        'iaas_instance_import_failed': 'Import of a virtual machine with backend id {instance_id} has failed.',
        'iaas_instance_import_scheduled': 'Virtual machine with backend id {instance_id} has been scheduled for import.',
        'iaas_instance_import_succeeded': 'Virtual machine {instance_id} has been imported.',
        'iaas_instance_licenses_added': 'Licenses added to VM with name {instance_name}.',
        'iaas_instance_restart_failed': 'Virtual machine {instance_name} restart has failed.',
        'iaas_instance_restart_succeeded': 'Virtual machine {instance_name} has been restarted.',
        'iaas_instance_start_failed': 'Virtual machine {instance_name} start has failed.',
        'iaas_instance_start_succeeded': 'Virtual machine {instance_name} has been started.',
        'iaas_instance_stop_failed': 'Virtual machine {instance_name} stop has failed.',
        'iaas_instance_stop_succeeded': 'Virtual machine {instance_name} has been stopped.',
        'iaas_instance_update_succeeded': 'Virtual machine {instance_name} has been updated.',
        'iaas_instance_volume_extension_scheduled': 'Virtual machine {instance_name} has been scheduled to extend disk.',
        'iaas_membership_sync_failed': 'Failed to sync cloud membership {cloud_name}.',
        'iaas_service_sync_failed': 'OpenStack cloud {cloud_name} has failed to sync.',
        'invoice_creation_succeeded': 'Invoice for organization {customer_name} for the period of {invoice_date} has been created.',
        'invoice_deletion_succeeded': 'Invoice for organization {customer_name} for the period of {invoice_date} has been deleted.',
        'invoice_update_succeeded': 'Invoice for organization {customer_name} for the period of {invoice_date} has been updated.',
        'payment_approval_succeeded': 'Payment for {customer_name} has been approved',
        'payment_cancel_succeeded': 'Payment for {customer_name} has been cancelled',
        'payment_creation_succeeded': 'Created new payment for {customer_name}',
        'project_added_to_project_group': 'Project {project_name} has been added to project group {project_group_name}.',
        'project_creation_succeeded': 'Project {project_name} has been created.',
        'project_deletion_succeeded': 'Project {project_name} has been deleted.',
        'project_group_creation_succeeded': 'Project group {project_group_name} has been created.',
        'project_group_deletion_succeeded': 'Project group {project_group_name} has been deleted.',
        'project_group_update_succeeded': 'Project group {project_group_name} has been updated.',
        'project_removed_from_project_group': 'Project {project_name} has been removed from project group {project_group_name}.',
        'project_update_succeeded': 'Project {project_name} has been updated.',
        'quota_threshold_reached': '{quota_name} quota threshold has been reached for project {project_name}.',
        'resource_created': 'Resource {resource_name} has been created.',
        'resource_deleted': 'Resource {resource_name} has been deleted.',
        'resource_imported': 'Resource {resource_name} has been imported.',
        'role_granted': 'User {affected_user_full_name} has gained role of {role_name} in {project_name} {customer_name}.',
        'role_revoked': 'User {affected_user_full_name} has revoked role of {role_name} in {project_name} {customer_name}.',
        'ssh_key_creation_succeeded': 'SSH key {ssh_key_name} has been created in {project_name}.',
        'ssh_key_deletion_succeeded': 'SSH key {ssh_key_name} has been deleted from {project_name}.',
        'ssh_key_push_succeeded': 'SSH key {ssh_key_name} has been pushed to {service_name} in {project_name}.',
        'ssh_key_push_failed': 'Failed to push SSH key {ssh_key_name} to {service_name} in {project_name}.',
        'ssh_key_remove_succeeded': 'SSH key {ssh_key_name} has been removed from {service_name} in {project_name}.',
        'ssh_key_remove_failed': 'Failed to delete SSH key {ssh_key_name} from {service_name} in {project_name}.',
        'template_creation_succeeded': 'Template {template_name} has been created.',
        'template_deletion_succeeded': 'Template {template_name} has been deleted.',
        'template_service_creation_succeeded': 'Template {template_service_name} has been created.',
        'template_service_deletion_succeeded': 'Template {template_service_name} has been deleted.',
        'template_service_update_succeeded': 'Template {template_service_name} has been updated.',
        'template_update_succeeded': 'Template {template_name} has been updated.',
        'user_activated': 'User {affected_user_full_name} has been activated.',
        'user_creation_succeeded': 'User {affected_user_full_name} has been created.',
        'user_deactivated': 'User {affected_user_full_name} has been deactivated.',
        'user_deletion_succeeded': 'User {affected_user_full_name} has been deleted.',
        'user_organization_approved': 'User {affected_user_full_name} has been approved for organization {affected_organization}.',
        'user_organization_claimed': 'User {affected_user_full_name} has claimed organization {affected_organization}.',
        'user_organization_rejected': 'User {affected_user_full_name} claim for organization {affected_organization} has been rejected.',
        'user_organization_removed': 'User {affected_user_full_name} has been removed from organization {affected_organization}.',
        'user_password_updated': 'Password has been changed for user {affected_user_full_name}.',
        'user_update_succeeded': 'User {affected_user_full_name} has been updated.',
        'zabbix_host_creation_failed': 'Unable to add instance {instance_name} to Zabbix',
        'zabbix_host_creation_succeeded': 'Added instance {instance_name} to Zabbix',
        'zabbix_host_deletion_failed': 'Unable to delete instance {instance_name} from Zabbix',
        'zabbix_host_deletion_succeeded': 'Deleted instance {instance_name} from Zabbix'
    };
    angular.module('ncsaas').constant('EVENT_TEMPLATES', templates);

    angular.module('ncsaas').constant('EVENT_FEATURES', {
        'users': [<commit_msg>SSH key event formatting (SAAS-711)<commit_after>'use strict';

(function() {
  angular.module('ncsaas')
    .service('eventsService', ['baseServiceClass', 'ENV', 'EVENT_FEATURES', eventsService]);

  function eventsService(baseServiceClass, ENV, EVENT_FEATURES) {
    /*jshint validthis: true */
    var ServiceClass = baseServiceClass.extend({
      init:function() {
        this._super();
        this.endpoint = '/events/';
        this.filterByCustomer = false;

        if (!ENV.featuresVisible) {
            var event_types = [];
            for(var feature in EVENT_FEATURES) {
                if (ENV.toBeFeatures.indexOf(feature) == -1) {
                    var events = EVENT_FEATURES[feature];
                    for (var i = 0; i < events.length; i++) {
                        event_types.push(events[i]);
                    }
                }
            }
            this.enabled_event_types = event_types;
        }
      },
      getList: function(filter, endpointUrl) {
        if (!this.defaultFilter.event_type) {
            this.defaultFilter.event_type = this.enabled_event_types;
        }
        return this._super(filter, endpointUrl);
      }
    });
    return new ServiceClass();
  }

})();

(function() {
    var templates = {
        'auth_logged_in_with_username': 'User {user_full_name} authenticated successfully with username and password.',
        'customer_account_credited': 'Balance has been increased by {amount} for customer {customer_name}.',
        'customer_account_debited': 'Balance has been decreased by {amount} for customer {customer_name}.',
        'customer_creation_succeeded': 'Organization {customer_name} has been created.',
        'customer_deletion_succeeded': 'Organization {customer_name} has been deleted.',
        'customer_update_succeeded': 'Organization {customer_name} has been updated.',
        'iaas_backup_creation_failed': 'Backup creation for {iaas_instance_name} has failed.',
        'iaas_backup_creation_scheduled': 'Backup for {iaas_instance_name} has been scheduled.',
        'iaas_backup_creation_succeeded': 'Backup for {iaas_instance_name} has been created.',
        'iaas_backup_deletion_failed': 'Backup deletion for {iaas_instance_name} has failed.',
        'iaas_backup_deletion_scheduled': 'Backup deletion for {iaas_instance_name} has been scheduled.',
        'iaas_backup_deletion_succeeded': 'Backup for {iaas_instance_name} has been deleted.',
        'iaas_backup_restoration_failed': 'Backup restoration for {iaas_instance_name} has failed.',
        'iaas_backup_restoration_scheduled': 'Backup restoration for {iaas_instance_name} has been scheduled.',
        'iaas_backup_restoration_succeeded': 'Backup for {iaas_instance_name} has been restored.',
        'iaas_backup_schedule_activated': 'Backup schedule for {iaas_instance_name} has been activated.',
        'iaas_backup_schedule_creation_succeeded': 'Backup schedule for {iaas_instance_name} has been created.',
        'iaas_backup_schedule_deactivated': 'Backup schedule for {iaas_instance_name} has been deactivated.',
        'iaas_backup_schedule_deletion_succeeded': 'Backup schedule for {iaas_instance_name} has been deleted.',
        'iaas_backup_schedule_update_succeeded': 'Backup schedule for {iaas_instance_name} has been updated.',
        'iaas_instance_application_became_available': 'Application has become available on {instance_name}.',
        'iaas_instance_application_deployment_succeeded': 'Application has been deployed on {instance_name}.',
        'iaas_instance_application_failed': 'Application has failed on {instance_name}.',
        'iaas_instance_creation_failed': 'Virtual machine {instance_name} creation has failed.',
        'iaas_instance_creation_scheduled': 'Virtual machine {instance_name} creation has been scheduled.',
        'iaas_instance_creation_succeeded': 'Virtual machine {instance_name} has been created.',
        'iaas_instance_deletion_failed': 'Virtual machine {instance_name} deletion has failed.',
        'iaas_instance_deletion_succeeded': 'Virtual machine {instance_name} has been deleted.',
        'iaas_instance_flavor_change_failed': 'Virtual machine {instance_name} flavor change has failed.',
        'iaas_instance_flavor_change_scheduled': 'Virtual machine {instance_name} has been scheduled to change flavor.',
        'iaas_instance_flavor_change_succeeded': 'Virtual machine {instance_name} flavor has been changed to {flavor_name}.',
        'iaas_instance_import_failed': 'Import of a virtual machine with backend id {instance_id} has failed.',
        'iaas_instance_import_scheduled': 'Virtual machine with backend id {instance_id} has been scheduled for import.',
        'iaas_instance_import_succeeded': 'Virtual machine {instance_id} has been imported.',
        'iaas_instance_licenses_added': 'Licenses added to VM with name {instance_name}.',
        'iaas_instance_restart_failed': 'Virtual machine {instance_name} restart has failed.',
        'iaas_instance_restart_succeeded': 'Virtual machine {instance_name} has been restarted.',
        'iaas_instance_start_failed': 'Virtual machine {instance_name} start has failed.',
        'iaas_instance_start_succeeded': 'Virtual machine {instance_name} has been started.',
        'iaas_instance_stop_failed': 'Virtual machine {instance_name} stop has failed.',
        'iaas_instance_stop_succeeded': 'Virtual machine {instance_name} has been stopped.',
        'iaas_instance_update_succeeded': 'Virtual machine {instance_name} has been updated.',
        'iaas_instance_volume_extension_scheduled': 'Virtual machine {instance_name} has been scheduled to extend disk.',
        'iaas_membership_sync_failed': 'Failed to sync cloud membership {cloud_name}.',
        'iaas_service_sync_failed': 'OpenStack cloud {cloud_name} has failed to sync.',
        'invoice_creation_succeeded': 'Invoice for organization {customer_name} for the period of {invoice_date} has been created.',
        'invoice_deletion_succeeded': 'Invoice for organization {customer_name} for the period of {invoice_date} has been deleted.',
        'invoice_update_succeeded': 'Invoice for organization {customer_name} for the period of {invoice_date} has been updated.',
        'payment_approval_succeeded': 'Payment for {customer_name} has been approved',
        'payment_cancel_succeeded': 'Payment for {customer_name} has been cancelled',
        'payment_creation_succeeded': 'Created new payment for {customer_name}',
        'project_added_to_project_group': 'Project {project_name} has been added to project group {project_group_name}.',
        'project_creation_succeeded': 'Project {project_name} has been created.',
        'project_deletion_succeeded': 'Project {project_name} has been deleted.',
        'project_group_creation_succeeded': 'Project group {project_group_name} has been created.',
        'project_group_deletion_succeeded': 'Project group {project_group_name} has been deleted.',
        'project_group_update_succeeded': 'Project group {project_group_name} has been updated.',
        'project_removed_from_project_group': 'Project {project_name} has been removed from project group {project_group_name}.',
        'project_update_succeeded': 'Project {project_name} has been updated.',
        'quota_threshold_reached': '{quota_name} quota threshold has been reached for project {project_name}.',
        'resource_created': 'Resource {resource_name} has been created.',
        'resource_deleted': 'Resource {resource_name} has been deleted.',
        'resource_imported': 'Resource {resource_name} has been imported.',
        'role_granted': 'User {affected_user_full_name} has gained role of {role_name} in {project_name} {customer_name}.',
        'role_revoked': 'User {affected_user_full_name} has revoked role of {role_name} in {project_name} {customer_name}.',
        'ssh_key_creation_succeeded': 'SSH key {ssh_key_name} has been created.',
        'ssh_key_deletion_succeeded': 'SSH key {ssh_key_name} has been deleted.',
        'ssh_key_push_succeeded': 'SSH key {ssh_key_name} has been pushed to {service_name} in {project_name}.',
        'ssh_key_push_failed': 'Failed to push SSH key {ssh_key_name} to {service_name} in {project_name}.',
        'ssh_key_remove_succeeded': 'SSH key {ssh_key_name} has been removed from {service_name} in {project_name}.',
        'ssh_key_remove_failed': 'Failed to delete SSH key {ssh_key_name} from {service_name} in {project_name}.',
        'template_creation_succeeded': 'Template {template_name} has been created.',
        'template_deletion_succeeded': 'Template {template_name} has been deleted.',
        'template_service_creation_succeeded': 'Template {template_service_name} has been created.',
        'template_service_deletion_succeeded': 'Template {template_service_name} has been deleted.',
        'template_service_update_succeeded': 'Template {template_service_name} has been updated.',
        'template_update_succeeded': 'Template {template_name} has been updated.',
        'user_activated': 'User {affected_user_full_name} has been activated.',
        'user_creation_succeeded': 'User {affected_user_full_name} has been created.',
        'user_deactivated': 'User {affected_user_full_name} has been deactivated.',
        'user_deletion_succeeded': 'User {affected_user_full_name} has been deleted.',
        'user_organization_approved': 'User {affected_user_full_name} has been approved for organization {affected_organization}.',
        'user_organization_claimed': 'User {affected_user_full_name} has claimed organization {affected_organization}.',
        'user_organization_rejected': 'User {affected_user_full_name} claim for organization {affected_organization} has been rejected.',
        'user_organization_removed': 'User {affected_user_full_name} has been removed from organization {affected_organization}.',
        'user_password_updated': 'Password has been changed for user {affected_user_full_name}.',
        'user_update_succeeded': 'User {affected_user_full_name} has been updated.',
        'zabbix_host_creation_failed': 'Unable to add instance {instance_name} to Zabbix',
        'zabbix_host_creation_succeeded': 'Added instance {instance_name} to Zabbix',
        'zabbix_host_deletion_failed': 'Unable to delete instance {instance_name} from Zabbix',
        'zabbix_host_deletion_succeeded': 'Deleted instance {instance_name} from Zabbix'
    };
    angular.module('ncsaas').constant('EVENT_TEMPLATES', templates);

    angular.module('ncsaas').constant('EVENT_FEATURES', {
        'users': [
{'fraction_non_alphanumeric': 0.09931248822753815, 'fraction_numerical': 0.0003296289320022603, 'mean_word_length': 4.360171630489652, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5309666', 'n_tokens_mistral': 6224, 'n_tokens_neox': 5874, 'n_words': 1570}