Skip to content

Commit

Permalink
Merge pull request #6191 from dmarcoux/staging-workflow
Browse files Browse the repository at this point in the history
Add back removed files after rebase of staging-workflow
  • Loading branch information
Dany Marcoux committed Nov 6, 2018
2 parents f39168d + 341f8d5 commit d84215d
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/api/app/models/obs_factory/distribution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ def published_version
#
# @return [Array] array of StagingProject objects
def staging_projects
@staging_projects ||= StagingProject.for(self)
@staging_projects ||= ObsFactory::StagingProject.for(self)
end

# Staging projects associated to the distribution, including non-letter
#
# @return [Array] array of StagingProject objects
def staging_projects_all
@staging_projects ||= StagingProject.for(self, false)
@staging_projects ||= ObsFactory::StagingProject.for(self, false)
end

# Version of the distribution used as source
Expand Down
4 changes: 2 additions & 2 deletions src/api/app/models/obs_factory/staging_project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class StagingProject
def self.for(distribution, only_letter = true)
wildcard = only_letter ? "_" : "%"
::Project.where(["name like ?", "#{distribution.root_project_name}#{NAME_PREFIX}#{wildcard}"]).
map { |project| StagingProject.new(project: project, distribution: distribution) }
map { |project| ObsFactory::StagingProject.new(project: project, distribution: distribution) }
end

# Find a staging project by distribution and id
Expand All @@ -30,7 +30,7 @@ def self.for(distribution, only_letter = true)
def self.find(distribution, id)
project = ::Project.find_by_name("#{distribution.root_project_name}#{NAME_PREFIX}#{id}")
if project
StagingProject.new(project: project, distribution: distribution)
ObsFactory::StagingProject.new(project: project, distribution: distribution)
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
= link_to 'Projects', projects_path
%li.breadcrumb-item
= link_to @project, project_show_path(@project)
- if current_page?(project_requests_path)
- if current_page?(project_requests_path(@project))
%li.breadcrumb-item.active{ 'aria-current' => 'page' }
Requests
10 changes: 5 additions & 5 deletions src/api/app/views/webui2/webui/project/_tabs.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
= tab_link('Maintained Projects', project_maintained_projects_path)
- unless project.defines_remote_instance? || project.is_maintenance?
%li.nav-item
= tab_link('Repositories', repositories_path)
= tab_link('Repositories', repositories_path(project))
%li.nav-item
= tab_link('Requests', project_requests_path)
= tab_link('Requests', project_requests_path(project))
- unless project.defines_remote_instance?
%li.nav-item
= tab_link('Users', project_users_path(project))
Expand All @@ -25,16 +25,16 @@
%li.nav-item
= tab_link('Subprojects', project_subprojects_path(project))
%li.nav-item
= tab_link('Project Config', project_config_path)
= tab_link('Project Config', project_config_path(project))
%li.nav-item
= tab_link('Attributes', index_attribs_path(project))
%li.nav-item
= tab_link('Meta', project_meta_path)
= tab_link('Meta', project_meta_path(project))
- unless project.defines_remote_instance? || project.is_maintenance?
%li.nav-item
= tab_link('Status', project_status_path(project))
%li.nav-item
= tab_link('Pulse', project_pulse_path)
= tab_link('Pulse', project_pulse_path(project))
%li.nav-item.dropdown
%a.nav-link.dropdown-toggle{ href: '#', 'data-toggle': 'dropdown', 'role': 'button', 'aria-expanded': 'false', 'aria-haspopup': 'true' }
.dropdown-menu.dropdown-menu-right
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
= render partial: 'webui/project/breadcrumb_items'
%li.breadcrumb-item.active{ 'aria-current' => 'page' }
Staging Projects
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.card.mb-3
%h5.card-header Infos
.card-body
Placeholder for the content
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.card.mb-3
%h5.card-header Legend
.card-body
Placeholder for the content
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
= project.name
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Placeholder for the content
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Placeholder for the content
11 changes: 11 additions & 0 deletions src/api/db/migrate/20181008150453_create_staging_workflows.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class CreateStagingWorkflows < ActiveRecord::Migration[5.2]
def change
create_table :staging_workflows, id: :integer do |t|
t.references :project, index: { unique: true }, type: :integer
t.timestamps
end
change_table :projects do |t|
t.references :staging_workflow, index: true, type: :integer
end
end
end

0 comments on commit d84215d

Please sign in to comment.