Sha256: ed0775cf5465eab329f7bfdf0742b1380f1183cfe62ebc509e9ead43bbb70f9b

Contents?: true

Size: 799 Bytes

Versions: 53

Compression:

Stored size: 799 Bytes

Contents

# frozen_string_literal: true

module ForemanAnsible
  class ImportPlaybooksSuccessNotification < ::UINotifications::Base
    private

    def create
      ::Notification.create!(
        :audience => Notification::AUDIENCE_USER,
        :notification_blueprint => blueprint,
        :initiator => initiator,
        :message => message,
        :subject => subject,
        :actions => {
          :links => links
        }
      )
    end

    def blueprint
      name = 'Sync_playbooks_successfully'
      @blueprint ||= NotificationBlueprint.unscoped.find_by(:name => name)
    end

    def message
      blueprint.message
    end

    def links
      [{ :href => Rails.application.routes.url_helpers.foreman_tasks_task_path(:id => subject.id), :title => N_('Task Details') }]
    end
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
foreman_ansible-12.0.5 app/services/foreman_ansible/import_playbooks_success_notification.rb
foreman_ansible-10.4.3 app/services/foreman_ansible/import_playbooks_success_notification.rb
foreman_ansible-12.0.4 app/services/foreman_ansible/import_playbooks_success_notification.rb
foreman_ansible-10.4.2 app/services/foreman_ansible/import_playbooks_success_notification.rb
foreman_ansible-12.0.3 app/services/foreman_ansible/import_playbooks_success_notification.rb
foreman_ansible-12.0.2 app/services/foreman_ansible/import_playbooks_success_notification.rb
foreman_ansible-12.0.1 app/services/foreman_ansible/import_playbooks_success_notification.rb
foreman_ansible-12.0.0 app/services/foreman_ansible/import_playbooks_success_notification.rb
foreman_ansible-11.2.1 app/services/foreman_ansible/import_playbooks_success_notification.rb
foreman_ansible-7.1.7 app/services/foreman_ansible/import_playbooks_success_notification.rb
foreman_ansible-11.2.0 app/services/foreman_ansible/import_playbooks_success_notification.rb
foreman_ansible-11.1.2 app/services/foreman_ansible/import_playbooks_success_notification.rb
foreman_ansible-7.1.6 app/services/foreman_ansible/import_playbooks_success_notification.rb
foreman_ansible-11.1.1 app/services/foreman_ansible/import_playbooks_success_notification.rb
foreman_ansible-10.4.1 app/services/foreman_ansible/import_playbooks_success_notification.rb
foreman_ansible-7.1.5 app/services/foreman_ansible/import_playbooks_success_notification.rb
foreman_ansible-11.1.0 app/services/foreman_ansible/import_playbooks_success_notification.rb
foreman_ansible-10.4.0 app/services/foreman_ansible/import_playbooks_success_notification.rb
foreman_ansible-10.3.0 app/services/foreman_ansible/import_playbooks_success_notification.rb
foreman_ansible-11.0.0 app/services/foreman_ansible/import_playbooks_success_notification.rb