Project

General

Profile

Revision 720671b8

Added by Ondřej Pražák about 6 years ago

Fixes #13288 - Fix for pattrenfly UI

View differences:

app/assets/javascripts/foreman_pipeline/jenkins-instances/jenkins-instances.module.js
9 9
    $stateProvider.state('jenkins-instances', {
10 10
        abstract: true,
11 11
        controller: 'JenkinsInstancesController',
12
        templateUrl: 'foreman_pipeline/jenkins-instances/views/jenkins-instances.html'
12
        templateUrl: 'jenkins-instances/views/jenkins-instances.html'
13 13
    })
14 14
    .state('jenkins-instances.index', {
15 15
        url: '/jenkins_instances',
16 16
        permission: 'view_jenkins_instances',
17 17
        views: {
18 18
            'table': {
19
                templateUrl: 'foreman_pipeline/jenkins-instances/views/jenkins-instances-table-full.html'
19
                templateUrl: 'jenkins-instances/views/jenkins-instances-table-full.html'
20 20
            }
21 21
        }
22 22
    })
......
26 26
        collapsed: true,
27 27
        views: {
28 28
            'table': {
29
                templateUrl: 'foreman_pipeline/jenkins-instances/views/jenkins-instances-table-collapsed.html'
29
                templateUrl: 'jenkins-instances/views/jenkins-instances-table-collapsed.html'
30 30
            },
31 31
            'action-panel': {
32 32
                controller: 'NewJenkinsInstanceController',
33
                templateUrl: 'foreman_pipeline/jenkins-instances/new/views/new-jenkins-instance.html'
33
                templateUrl: 'jenkins-instances/new/views/new-jenkins-instance.html'
34 34
            },
35 35
            'jenkins-instance-form@jenkins-instances.new': {
36 36
                controller: 'NewJenkinsInstanceController',
37
                templateUrl: 'foreman_pipeline/jenkins-instances/new/views/new-jenkins-instance-form.html'
37
                templateUrl: 'jenkins-instances/new/views/new-jenkins-instance-form.html'
38 38
            }
39 39
        }
40

  
41 40
    })
42 41
    .state('jenkins-instances.details', {
43 42
        abstract: true,
......
46 45
        collapsed: true,
47 46
        views: {
48 47
            'table': {
49
                templateUrl: 'foreman_pipeline/jenkins-instances/views/jenkins-instances-table-collapsed.html'
48
                templateUrl: 'jenkins-instances/views/jenkins-instances-table-collapsed.html'
50 49
            },
51 50
            'action-panel': {
52 51
                controller: 'JenkinsInstanceDetailsController',
53
                templateUrl: 'foreman_pipeline/jenkins-instances/details/views/jenkins-instance-details.html'
52
                templateUrl: 'jenkins-instances/details/views/jenkins-instance-details.html'
54 53
            }
55 54
        }
56 55
    })
......
59 58
        permission: 'edit_jenkins_instances',
60 59
        collapsed: true,
61 60
        controller: 'JenkinsInstanceDetailsInfoController',
62
        templateUrl: 'foreman_pipeline/jenkins-instances/details/views/jenkins-instance-details-info.html'
61
        templateUrl: 'jenkins-instances/details/views/jenkins-instance-details-info.html'
63 62
    })
64 63

  
65 64
    .state('jenkins-instances.details.users', {
......
72 71
        permission: 'view_jenkins_users',
73 72
        collapsed: true,
74 73
        controller: 'JenkinsInstanceDetailsJenkinsUsersController',
75
        templateUrl: 'foreman_pipeline/jenkins-instances/details/views/jenkins-instance-details-users.html'
74
        templateUrl: 'jenkins-instances/details/views/jenkins-instance-details-users.html'
76 75
    })
77 76
    .state('jenkins-instances.details.users.new', {
78 77
        url: '/jenkins_users/new',
79 78
        permission: 'create_jenkins_users',
80 79
        collapsed: true,
81 80
        controller: 'NewJenkinsUserController',
82
        templateUrl: 'foreman_pipeline/jenkins-users/new/views/new-jenkins-user.html'
81
        templateUrl: 'jenkins-users/new/views/new-jenkins-user.html'
83 82
    })
84 83
    .state('jenkins-instances.details.users.info', {
85 84
        url: '/jenkins_users/:jenkinsUserId',
86 85
        permission: 'edit_jenkins_users',
87 86
        collapsed: true,
88 87
        controller: 'JenkinsUserInfoController',
89
        templateUrl: 'foreman_pipeline/jenkins-users/details/views/jenkins-user-info.html'
88
        templateUrl: 'jenkins-users/details/views/jenkins-user-info.html'
90 89
    })
91
    
92

  
93 90
}]);
app/assets/javascripts/foreman_pipeline/jenkins-users/details/views/jenkins-user-info.html
28 28
            on-save="save(jenkinsUser)">
29 29
      </span>
30 30
    </div>
31
       
31

  
32 32
        <p class="alert alert-info" translate>
33 33
          The token is not displayed for security reasons. Type in the new one or leave blank to keep the current token.
34
        </p>     
34
        </p>
35 35

  
36 36
  </section>
37
</div>
37
</div>
app/assets/javascripts/foreman_pipeline/jobs/details/views/job-details-hostgroups.html
1 1
<span page-title ng-model="job">{{ 'Job: ' | translate }} {{ job.name }}</span>
2 2

  
3
<div class="details details-full">
3
<section class="details details-full">
4 4
  <div bst-alerts success-messages="successMessages" error-messages="errorMessages"></div>
5 5

  
6 6
  <h4>
7 7
    <span translate>Current Hostgroup: </span>
8 8
    <a ng-click="transitionToHostgroup(job.hostgroup)" ng-show="job.hostgroup.name">
9 9
      <span class="no-capitalize"  ng-bind="job.hostgroup.name"></span>
10
    </a> 
10
    </a>
11 11
    <span class="no-capitalize" ng-show="!job.hostgroup.name" translate>none</span>
12 12
  </h4>
13 13

  
......
21 21

  
22 22
    <p class="alert alert-info"
23 23
       ng-hide="hostgroupsTable.working"
24
       translate> No Hostgroups to show.          
25
    </p>        
24
       translate> No Hostgroups to show.
25
    </p>
26 26
  </div>
27 27

  
28 28
  <section ng-show="hostgroupsTable.rows.length > 0">
......
40 40
                  ng-hide="edit_jobs"
41 41
                  ng-disabled="!hostgroupsTable.chosenRow || hostgroupsTable.working"
42 42
                  ng-click="setHostgroup()">
43
            <i class="fa fa-pencil" ng-hide="hostgroupsTable.working"></i>      
44
            <i class="fa fa-spinner fa-spin" ng-show="hostgroupsTable.working"></i>      
43
            <i class="fa fa-pencil" ng-hide="hostgroupsTable.working"></i>
44
            <i class="fa fa-spinner fa-spin" ng-show="hostgroupsTable.working"></i>
45 45
            {{ 'Set Hostgroup' | translate }}
46 46
          </button>
47 47
      </div>
......
50 50
    <div bst-table="hostgroupsTable" class="nutupane">
51 51
      <div bst-container-scroll bst-infinite-scroll="hostgroupsTable.nextPage()">
52 52

  
53
        <table 
53
        <table
54 54
               ng-class="{'table-mask': hostgroupsTable.working}"
55 55
               class="table table-striped table-full">
56 56

  
......
63 63

  
64 64
          <tbody>
65 65
            <tr bst-table-row ng-repeat="hostgroup in hostgroupsTable.rows | filter:hostgroupFilter" row-choice="hostgroup">
66
              
66

  
67 67
              <td bst-table-cell>
68 68
                <a ng-click="transitionToHostgroup(hostgroup)">
69 69
                  {{ hostgroup.name }}
......
73 73

  
74 74
            </tr>
75 75
          </tbody>
76
          
76

  
77 77
        </table>
78 78
      </div>
79 79
    </div>
80 80
  </section>
81
</div>
81
</section>
app/assets/javascripts/foreman_pipeline/jobs/details/views/job-details-jenkins-projects.html
6 6
  <h4>
7 7
    <span translate>Current Jenkins Projects: </span>
8 8
  </h4>
9
      
10
    <input type="text"
11
            class="form-control filter-input"  
12
            placeholder="{{ 'Filter' | translate }}"
13
            ng-model="jenkinsFilter"/>
14
      
15
      
16
      <span class="pull-right">
17
        <button class="btn btn-default"
18
                ng-disabled="projectsTable.numSelected === 0 || projectsTable.working"
19
                ng-show="isState('jobs.details.jenkins-projects.list') && permitted('edit_jobs', job) && projectsTable.rows.length > 0"
20
                ng-click="removeProjects()">
21
          <i class="fa fa-minus" ng-hide="projectsTable.working"></i>
22
          <i class="fa fa-spinner fa-spin" ng-show="projectsTable.working"></i>      
23
          <span translate>Remove Projects</span>
24
        </button>
25
        
26
        <button class="btn btn-default"
27
                ng-show="isState('jobs.details.jenkins-projects.list') 
28
                         && permitted('edit_jobs', job) 
29
                         && job.jenkins_instance !== null
30
                         && job.jenkins_user !== null"
31
                ui-sref="jobs.details.jenkins-projects.discovery({jobId: job.id})"
32
                translate>
33
                <i class="fa fa-eye"></i>
34
                Find more...
35
        </button>
36
      </span>  
37 9

  
38
      
39
    
40
      
41
      <table bst-table="projectsTable"
42
             class="table table-striped"
43
             ng-show="projectsTable.rows.length > 0 && !projectsTable.working"
44
             ng-class="{'table-mask': projectsTable.working}">
45
        <thead>
46
          <tr bst-table-head row-select="jenkinsProject">
47
            <th bst-table-column="name" translate>Name</th>
48
          </tr>
49
        </thead>
10
  </br>
50 11

  
51
        <tbody>
52
          <tr bst-table-row ng-repeat="jenkinsProject in projectsTable.rows | filter:jenkinsFilter" row-select="jenkinsProject">
53
            <td bst-table-cell>
54
              <a href="" ui-sref="jobs.details.jenkins-projects.parameters({ projectId: jenkinsProject.id })">
55
                {{ jenkinsProject.name }}
56
              </a>
57
            </td>
58
          </tr>
59
        </tbody>
12
  <div class="details-header row">
13
    <div class="col-sm-3">
14
      <input type="text"
15
              class="form-control filter-input"
16
              placeholder="{{ 'Filter' | translate }}"
17
              ng-model="jenkinsFilter"/>
18
    </div>
60 19

  
61
      </table>   
62 20

  
63
</section>
21
    <div class="fr select-action">
22
      <button class="btn btn-default"
23
              ng-disabled="projectsTable.numSelected === 0 || projectsTable.working"
24
              ng-show="isState('jobs.details.jenkins-projects.list') && permitted('edit_jobs', job) && projectsTable.rows.length > 0"
25
              ng-click="removeProjects()">
26
        <i class="fa fa-minus" ng-hide="projectsTable.working"></i>
27
        <i class="fa fa-spinner fa-spin" ng-show="projectsTable.working"></i>
28
        <span translate>Remove Projects</span>
29
      </button>
30

  
31
      <button class="btn btn-default"
32
              ng-show="isState('jobs.details.jenkins-projects.list')
33
                       && permitted('edit_jobs', job)
34
                       && job.jenkins_instance !== null
35
                       && job.jenkins_user !== null"
36
              ui-sref="jobs.details.jenkins-projects.discovery({jobId: job.id})"
37
              translate>
38
              <i class="fa fa-eye"></i>
39
              Find more...
40
      </button>
41
    </div>
42
  </div>
43

  
44
  <table bst-table="projectsTable"
45
         class="table table-striped"
46
         ng-show="projectsTable.rows.length > 0 && !projectsTable.working"
47
         ng-class="{'table-mask': projectsTable.working}">
48
    <thead>
49
      <tr bst-table-head row-select="jenkinsProject">
50
        <th bst-table-column="name" translate>Name</th>
51
      </tr>
52
    </thead>
64 53

  
65
<div ng-show="projectsTable.rows.length === 0">
66
        <div class="loading-mask loading-mask-panel" ng-show="projectsTable.working">
67
          <i class="fa fa-spinner fa-spin"></i>
68
            {{ "Loading..." | translate }}          
69
        </div>
54
    <tbody>
55
      <tr bst-table-row ng-repeat="jenkinsProject in projectsTable.rows | filter:jenkinsFilter" row-select="jenkinsProject">
56
        <td bst-table-cell>
57
          <a href="" ui-sref="jobs.details.jenkins-projects.parameters({ projectId: jenkinsProject.id })">
58
            {{ jenkinsProject.name }}
59
          </a>
60
        </td>
61
      </tr>
62
    </tbody>
63

  
64
  </table>
65

  
66
</section>
70 67

  
71
        <p class="alert alert-info"
72
           ng-hide="projectsTable.working"
73
           translate> No Jenkins Projects to show.
74
        </p>
75
      </div>
app/assets/javascripts/foreman_pipeline/jobs/jobs.module.js
9 9
    $stateProvider.state('jobs', {
10 10
        abstract: true,
11 11
        controller: 'JobsController',
12
        templateUrl: 'foreman_pipeline/jobs/views/jobs.html'    
12
        templateUrl: 'jobs/views/jobs.html'
13 13
    })
14 14
    .state('jobs.index', {
15
      url: '/jobs',
16
      permission: 'view_jobs',
17
      views: {
18
          'table': {
19
              templateUrl: 'foreman_pipeline/jobs/views/jobs-table-full.html'
20
              }
21
          }
15
        url: '/jobs',
16
        permission: 'view_jobs',
17
        views: {
18
            'table': {
19
                templateUrl: 'jobs/views/jobs-table-full.html'
20
            }
21
        }
22 22
    })
23 23
    .state('jobs.new', {
24 24
        url: '/jobs/new',
......
26 26
        collapsed: true,
27 27
        views: {
28 28
            'table': {
29
                templateUrl: 'foreman_pipeline/jobs/views/jobs-table-collapsed.html'
29
                templateUrl: 'jobs/views/jobs-table-collapsed.html'
30 30
            },
31 31
            'action-panel': {
32 32
                controller: 'NewJobController',
33
                templateUrl: 'foreman_pipeline/jobs/new/views/new-job.html'
33
                templateUrl: 'jobs/new/views/new-job.html'
34 34
            },
35 35
            'job-form@jobs.new': {
36 36
                controller: 'NewJobController',
37
                templateUrl: 'foreman_pipeline/jobs/new/views/new-job-form.html'
37
                templateUrl: 'jobs/new/views/new-job-form.html'
38 38
            }
39 39
        }
40 40
    })
......
45 45
        collapsed: true,
46 46
        views: {
47 47
            'table': {
48
                  templateUrl: 'foreman_pipeline/jobs/views/jobs-table-collapsed.html'
48
                  templateUrl: 'jobs/views/jobs-table-collapsed.html'
49 49
            },
50 50
            'action-panel': {
51 51
                  controller: 'JobDetailsController',
52
                  templateUrl: 'foreman_pipeline/jobs/details/views/job-details.html' 
52
                  templateUrl: 'jobs/details/views/job-details.html'
53 53
            }
54 54
        }
55 55
    })
......
58 58
        permission: 'edit_jobs',
59 59
        collapsed: true,
60 60
        controller: 'JobDetailsInfoController',
61
        templateUrl: 'foreman_pipeline/jobs/details/views/job-details-info.html'
61
        templateUrl: 'jobs/details/views/job-details-info.html'
62 62
    })
63 63
    .state('jobs.details.content-views', {
64 64
        url: '/content_views',
65 65
        permission: 'edit_jobs',
66 66
        collapsed: true,
67 67
        controller: 'JobDetailsContentViewsController',
68
        templateUrl: 'foreman_pipeline/jobs/details/views/job-details-content-views.html'
68
        templateUrl: 'jobs/details/views/job-details-content-views.html'
69 69
    })
70
    
70

  
71 71
    .state('jobs.details.hostgroups', {
72 72
        url: '/hostgroups',
73 73
        permission: 'edit_jobs',
74 74
        collapsed: true,
75 75
        controller: 'JobDetailsHostgroupsController',
76
        templateUrl: 'foreman_pipeline/jobs/details/views/job-details-hostgroups.html'
76
        templateUrl: 'jobs/details/views/job-details-hostgroups.html'
77 77
    })
78 78

  
79 79
    .state('jobs.details.resources', {
......
81 81
        collapsed: true,
82 82
        permission: 'edit_jobs',
83 83
        controller: 'JobDetailsResourcesController',
84
        templateUrl: 'foreman_pipeline/jobs/details/views/job-details-resources.html'
84
        templateUrl: 'jobs/details/views/job-details-resources.html'
85 85
    })
86 86

  
87 87
    .state('jobs.details.environments', {
......
94 94
        collapsed: true,
95 95
        permission: 'edit_jobs',
96 96
        controller: 'JobDetailsEnvironmentsController',
97
        templateUrl: 'foreman_pipeline/jobs/details/views/job-details-environments.html'
97
        templateUrl: 'jobs/details/views/job-details-environments.html'
98 98
    })
99 99

  
100 100
    .state('jobs.details.environments.to-environments', {
......
102 102
        collapsed: true,
103 103
        permission: 'edit_jobs',
104 104
        controller: 'JobDetailsToEnvironmentsController',
105
        templateUrl: 'foreman_pipeline/jobs/details/views/job-details-to-environments.html' 
105
        templateUrl: 'jobs/details/views/job-details-to-environments.html'
106 106
    })
107 107

  
108 108
    .state('jobs.details.jenkins-instances', {
......
110 110
        collapsed: true,
111 111
        permission: 'edit_jobs',
112 112
        controller: 'JobDetailsJenkinsController',
113
        templateUrl: 'foreman_pipeline/jobs/details/views/job-details-jenkins.html'
113
        templateUrl: 'jobs/details/views/job-details-jenkins.html'
114 114
    })
115 115
    .state('jobs.details.jenkins-projects', {
116 116
        abstract: true,
117 117
        collapsed: true,
118
        templateUrl: 'foreman_pipeline/jobs/details/project-discovery/views/job-jenkins-projects.html'
118
        templateUrl: 'jobs/details/project-discovery/views/job-jenkins-projects.html'
119 119
    })
120 120

  
121 121
    .state('jobs.details.jenkins-projects.list', {
......
123 123
        collapsed: true,
124 124
        permission: 'edit_jobs',
125 125
        controller: 'JobDetailsJenkinsProjectsController',
126
        templateUrl: 'foreman_pipeline/jobs/details/views/job-details-jenkins-projects.html'
126
        templateUrl: 'jobs/details/views/job-details-jenkins-projects.html'
127 127
    })
128 128
    .state('jobs.details.jenkins-projects.discovery', {
129 129
        url: '/jenkins_projects/discovery',
130 130
        collapsed: true,
131 131
        permission: 'edit_jobs',
132 132
        controller: 'JobProjectsDiscoveryController',
133
        templateUrl: 'foreman_pipeline/jobs/details/project-discovery/views/job-projects-discovery.html'
133
        templateUrl: 'jobs/details/project-discovery/views/job-projects-discovery.html'
134 134
    })
135 135
    .state('jobs.details.jenkins-projects.parameters', {
136 136
        url: '/jenkins_projects/:projectId',
137 137
        collapsed: true,
138 138
        permission: 'edit_jobs',
139
        controller: 'JobProjectsParametersController', 
140
        templateUrl: 'foreman_pipeline/jobs/details/project-discovery/views/job-projects-parameters.html'
139
        controller: 'JobProjectsParametersController',
140
        templateUrl: 'jobs/details/project-discovery/views/job-projects-parameters.html'
141 141
    })
142
}]);
142
}]);
app/assets/javascripts/foreman_pipeline/jobs/views/jobs-table-full.html
14 14
      <th bst-table-column="hostgroup"><span translate>Hostgroup</span></th>
15 15
      <th bst-table-column="environment"><span translate>Environment</span></th>
16 16
      <th bst-table-column="jenkinsInstance"><span translate>Jenkins Instance</span></th>
17

  
18 17
    </tr>
19 18
  </thead>
20 19

  
......
29 28
      </td>
30 29
      <td bst-table-cell>
31 30
        <a ng-show="{{ job.content_view !== null }}"
32
           ui-sref="content-views.details.info({ contentViewId: job.content_view.id })">                    
31
           ui-sref="content-views.details.info({ contentViewId: job.content_view.id })">
33 32
          <div>{{ job.content_view.name }}</div>
34 33
        </a>
35 34
        <div ng-show="{{ job.content_view === null }}" translate>none</div>
......
39 38
           ng-click="transitionToHostgroup(job.hostgroup)">
40 39
          <div>{{ job.hostgroup.name }}</div>
41 40
        </a>
42
                
41

  
43 42
        <div ng-show="{{ job.hostgroup === null }}" translate>none</div>
44
        
43

  
45 44
      </td>
46 45
      <td bst-table-cell>
47 46
        <a ng-show="{{ job.environment !== null }}"
48 47
           ui-sref="environments.environment.details({ environmentId: job.environment.id })">
49 48
          <div>{{ job.environment.name }}</div>
50 49
        </a>
51
                
50

  
52 51
        <div ng-show="{{ job.environment === null }}" translate>none</div>
53
        
52

  
54 53
      </td>
55 54
      <td bst-table-cell>
56 55
        <a ng-show="{{ job.jenkins_instance !== null }}"
57 56
           ui-sref="jenkins-instances.details.info({ jenkinsInstanceId: job.jenkins_instance.id })">
58 57
          <div>{{ job.jenkins_instance.name }}</div>
59 58
        </a>
60
                
59

  
61 60
        <div ng-show="{{ job.jenkins_instance === null }}" translate>none</div>
62
        
61

  
63 62
      </td>
64 63
    </tr>
65
  </tbody> 
66
</table>
64
  </tbody>
65
</table>
app/models/foreman_pipeline/authorization/base_model.rb
22 22
        authorized(normalize_name("view"))
23 23
      end
24 24

  
25
      # TODO: remove argument
26 25
      def normalize_name(action_string)
27 26
        (action_string + self.class.name.demodulize.pluralize).underscore.to_sym
28 27
      end
app/models/foreman_pipeline/jenkins_instance.rb
14 14
    has_many :jobs, :class_name => "ForemanPipeline::Job", :dependent => :nullify
15 15
    belongs_to :jenkins_user, :class_name => "ForemanPipeline::JenkinsUser"
16 16

  
17
    FILEPATH_REGEX = /^(\/|~)[a-z0-9\-_.\/]*[^\/]$/i
17
    FILEPATH_REGEX = /\A(\/|~)[a-z0-9\-_.\/]*[^\/]\z/i
18 18

  
19 19
    validates :name, :presence => true
20 20
    validates :cert_path, :format => {:with => FILEPATH_REGEX }
21
    validates :url, :uniqueness => true, :format => { :with => /^(http|https):\/\/\S+:\d{1,4}$/}
21
    validates :url, :uniqueness => true, :format => { :with => /\A(http|https):\/\/\S+:\d{1,4}\z/}
22 22
    validates :organization, :presence => true
23 23
    validates :jenkins_home, :format => { :with => FILEPATH_REGEX }
24 24

  
app/models/foreman_pipeline/job.rb
14 14
    belongs_to :environment, :class_name => 'Katello::KTEnvironment'
15 15

  
16 16
    has_many :job_jenkins_projects, :dependent => :destroy
17
    has_many :jenkins_projects, :through => :job_jenkins_projects, :class_name => 'ForemanPipeline::JenkinsProject', :dependent => :restrict
18

  
17
    has_many :jenkins_projects, :through => :job_jenkins_projects, :class_name => 'ForemanPipeline::JenkinsProject'
19 18
    has_many :content_view_repositories, :class_name=> 'Katello::ContentViewRepository',
20 19
     :primary_key => :content_view_id, :foreign_key => :content_view_id
21 20
    has_many :repositories, :through => :content_view_repositories
app/models/foreman_pipeline/job_jenkins_project.rb
20 20
    end
21 21

  
22 22
    def remove_orphaned_projects
23
      JenkinsProject.find(:all).map { |p| p.destroy if p.jobs.empty? }
23
      JenkinsProject.all.map { |p| p.destroy if p.jobs.empty? }
24 24
    end
25 25

  
26 26
  end
lib/foreman_pipeline/engine.rb
8 8
  class Engine < ::Rails::Engine
9 9
    isolate_namespace ForemanPipeline
10 10

  
11
    initializer 'foreman_pipeline.assets_dispatcher', :before => :build_middleware_stack do |app|
12
      app.middleware.use ::ActionDispatch::Static, "#{ForemanPipeline::Engine.root}/app/assets/javascripts/foreman_pipeline"
13
    end
14

  
11 15
    initializer 'foreman_pipeline.mount_engine', :after => :build_middleware_stack do |app|
12 16
      app.routes_reloader.paths << "#{ForemanPipeline::Engine.root}/config/mount_engine.rb"
13 17
    end
......
20 24
      app.config.autoload_paths += Dir["#{config.root}/app/views/foreman"]
21 25
    end
22 26

  
23
    initializer 'foreman_pipeline.register_plugin', :after => :finisher_hook do
27
    initializer 'foreman_pipeline.register_plugin', :before => :finisher_hook do
24 28
      require 'foreman_pipeline/plugin'
25 29
      require 'foreman_pipeline/permissions'
26 30
      require 'foreman_pipeline/roles'
27 31
    end
28 32

  
29
    initializer 'foreman_pipeline.assets', :group => :all do |app|
33
    initializer 'foreman_pipeline.assets.precompile' do |app|
34
       app.config.assets.precompile += %w(foreman_pipeline/foreman_pipeline.js
35
                                          foreman_pipeline/foreman_pipeline.css)
36
    end
37

  
38
    initializer 'foreman_pipeline.configure_assets', :group => :assets do |app|
30 39
      SETTINGS[:foreman_pipeline] = {
31 40
        :assets => {
32 41
          :precompile => [
33
            'foreman_pipeline/foreman_pipeline.js'
42
            'foreman_pipeline/foreman_pipeline.js',
43
            'foreman_pipeline/foreman_pipeline.css'
34 44
          ]
35 45
        }
36 46
      }
......
69 79
      ::ComputeResource.send :include, ForemanPipeline::Concerns::ComputeResourceExtension
70 80
    end
71 81

  
82

  
72 83
    rake_tasks do
73 84
      load "#{ForemanPipeline::Engine.root}/lib/foreman_pipeline/tasks/foreman_pipeline_seed.rake"
74 85
      load "#{ForemanPipeline::Engine.root}/lib/foreman_pipeline/tasks/foreman_pipeline_test.rake"
lib/foreman_pipeline/plugin.rb
7 7
         :caption => N_("Jobs"),
8 8
         :url => '/jobs',
9 9
         :url_hash => {:controller => 'foreman_pipeline/api/jobs', :action => 'index'},
10
         :engine => ForemanPipeline::Engine
10
         :engine => ForemanPipeline::Engine,
11
         :turbolinks => false
11 12
    menu :top_menu,
12 13
         :jenkins_instances,
13 14
         :caption => N_("Jenkins Instances"),
14 15
         :url => '/jenkins_instances',
15 16
         :url_hash => {:controller => 'foreman_pipeline/api/jenkins_instances', :action => 'index'},
16
         :engine => ForemanPipeline::Engine
17
         :engine => ForemanPipeline::Engine,
18
         :turbolinks => false
17 19

  
18 20
    #skipping Bastion routes as they have no permissions
19 21
    tests_to_skip({"AccessPermissionsTest" => ["route bastion/bastion/index should have a permission that grants access",

Also available in: Unified diff