Skip to content

Commit

Permalink
Merge pull request #8252 from eduardoj/adjust_interconnect_controller
Browse files Browse the repository at this point in the history
Replace Bento by Bootstrap for interconnects
  • Loading branch information
vpereira committed Sep 4, 2019
2 parents 0158401 + fc5024a commit 8b54939
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 127 deletions.
10 changes: 0 additions & 10 deletions src/api/app/controllers/webui/interconnects_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ class Webui::InterconnectsController < Webui::WebuiController
before_action :require_admin

def new
@interconnect = RemoteProject.new(default_values)
switch_to_webui2
end

Expand Down Expand Up @@ -41,13 +40,4 @@ def create
def project_params
params.require(:project).permit(:name, :title, :remoteurl, :description)
end

def default_values
return if Project.exists?(name: 'openSUSE.org')

{ name: 'openSUSE.org',
remoteurl: 'https://api.opensuse.org/public',
title: 'Remote OBS instance',
description: 'This project is representing a remote build service instance.' }
end
end
5 changes: 0 additions & 5 deletions src/api/app/controllers/webui2/interconnects_controller.rb

This file was deleted.

25 changes: 17 additions & 8 deletions src/api/app/views/webui/interconnects/_tabs.html.haml
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
.box-header.header-tabs
%ul
= tab 'configuration', 'Configuration', controller: '/webui/configuration', action: :index
= tab 'architectures', 'Architectures', controller: '/webui/architectures', action: :index
= tab 'users', 'Manage Users', controller: '/webui/user', action: :index
= tab 'groups', 'Manage Groups', controller: '/webui/groups', action: :index
= tab 'notifications', 'Notifications', controller: '/webui/subscriptions', action: :index
= tab 'interconnect', 'Interconnect', controller: :interconnects, action: :new
.bg-light
%ul.nav.nav-tabs.pt-2.px-3.flex-nowrap.collapsible{ 'role': 'tablist' }
%li.nav-item
= tab_link('Configuration', configuration_path, false, false)
%li.nav-item
= tab_link('Architectures', architectures_path)
%li.nav-item
= tab_link('Manage Users', users_path)
%li.nav-item
= tab_link('Manage Groups', groups_path)
%li.nav-item
= tab_link('Notifications', notifications_path)
%li.nav-item
= tab_link('Interconnect', new_interconnect_path)
%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
83 changes: 30 additions & 53 deletions src/api/app/views/webui/interconnects/new.html.haml
Original file line number Diff line number Diff line change
@@ -1,56 +1,33 @@
- @pagetitle = "Interconnect"
- @crumb_list = [@pagetitle]
- @layouttype = 'custom'
- @pagetitle = 'Interconnect'

.grid_16.alpha.omega.box.box-shadow
.card.mb-3
= render partial: 'tabs'
%p
Connect a remote Open Build Service instance
%h3
Use a public OBS for default base distributions
.remote-links
= button_tag('openSUSE', class: 'interconnect',
data: { name: 'openSUSE.org',
remoteurl: 'https://api.opensuse.org/public',
title: 'Standard OBS instance at build.opensuse.org',
description: 'This instance delivers the default build targets for OBS.' },
disabled: Project.exists?(name: 'openSUSE.org'))
= button_tag('Tizen', class: 'interconnect',
data: { name: 'tizen.org',
remoteurl: 'https://api.tizen.org/public',
title: 'Official Tizen Project OBS instance at build.tizen.org',
description: 'This instance can be used to access resources from the Tizen project.' },
disabled: Project.exists?(name: 'tizen.org'))
= button_tag('Packman', class: 'interconnect',
data: { name: 'Packman',
remoteurl: 'https://pmbs-api.links2linux.de/public',
title: 'Packman Build Service PMBS',
description: 'This instance can be used to access resources from packman.' },
disabled: Project.exists?(name: 'Packman'))
%h3
Add custom OBS instance
= form_for(@interconnect, as: :project, url: interconnects_path, html: { class: 'interconnect-form' }) do |f|
.form-group
= f.label :name do
%strong Local Project Name
%abbr{ title: 'required' } *
= f.text_field :name, required: true, placeholder: 'Add a name for your project'
.form-group
= f.label :remoteurl do
%strong Remote OBS api url
%abbr{ title: 'required' } *
= f.text_field :remoteurl, required: true, placeholder: 'Add an OBS api url'
.form-group
= f.label :title do
%strong Title
%abbr{ title: 'required' } *
= f.text_field :title, required: true, placeholder: 'Remote OBS instance'
.form-group
= f.label :description do
%strong Description
%abbr{ title: 'required' } *
= f.text_field :description, required: true, placeholder: 'This project is representing a remote build service instance.'
= f.submit data: { disable_with: 'Creating...' }
.card-body
%h3= @pagetitle
%p Connect a remote Open Build Service instance.
.list-group
= render partial: 'interconnect_button', locals: { name: 'openSUSE.org',
remoteurl: 'https://api.opensuse.org/public',
title: 'Standard OBS instance at build.opensuse.org',
description: 'This instance delivers the default build targets for OBS.',
type: 'opensuse',
exists: Project.exists?(name: 'openSUSE.org') }
= render partial: 'interconnect_button', locals: { name: 'tizen.org',
remoteurl: 'https://api.tizen.org/public',
title: 'Standard OBS instance at build.tizen.org',
description: 'This instance can be used to access resources from Tizen.',
type: 'tizen',
exists: Project.exists?(name: 'tizen.org') }
= render partial: 'interconnect_button', locals: { name: 'Packman',
remoteurl: 'https://pmbs-api.links2linux.de/public',
title: 'Packman Build Service PMBS',
description: 'This instance can be used to access resources from Packman.',
type: 'packman',
exists: Project.exists?(name: 'Packman') }
.list-group-item
.d-flex.w-100.justify-content-between
%h5 Custom OBS instance
= button_tag 'Add', class: 'btn btn-primary', data: { toggle: 'modal', target: '#interconnect-modal' }
%div This project is representing a remote build service instance.

:javascript
initInterconnect();
= render partial: 'interconnect_modal'
17 changes: 0 additions & 17 deletions src/api/app/views/webui2/webui/interconnects/_tabs.html.haml

This file was deleted.

33 changes: 0 additions & 33 deletions src/api/app/views/webui2/webui/interconnects/new.html.haml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
post :new
end

it { expect(assigns(:interconnect)).to be_a(RemoteProject) }
it { is_expected.to render_template('webui/interconnects/new') }
end

Expand Down

0 comments on commit 8b54939

Please sign in to comment.