Skip to content

Commit

Permalink
Remove Image Templates from FeatureToggle
Browse files Browse the repository at this point in the history
As a finished feature, `image template` shouldn't be behind the FeatureToggle.
  • Loading branch information
David Kang committed Jul 10, 2019
1 parent e6f3fd2 commit 7dfeddb
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 56 deletions.
3 changes: 2 additions & 1 deletion ReleaseNotes-2.11
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ Bugfixes:
Intentional changes:
====================


Features enabled by default:
* Image Template
2 changes: 0 additions & 2 deletions src/api/app/controllers/webui/image_templates_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
class Webui::ImageTemplatesController < Webui::WebuiController
before_action -> { feature_active?(:image_templates) }

def index
@projects = Project.image_templates

Expand Down
2 changes: 1 addition & 1 deletion src/api/app/views/webui/main/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
= proceed_link "document-new", 'New Project', controller: 'project', action: 'new', ns: User.session!.home_project_name if User.session
- unless @spider_bot
= proceed_link 'utilities-system-monitor', 'Status Monitor', controller: 'monitor', action: 'index'
= proceed_link 'drive-optical-32', 'New Image', image_templates_path if Feature.active?(:image_templates)
= proceed_link 'drive-optical-32', 'New Image', image_templates_path
= render partial: 'systemstatus'
.grid_5.omega
- if !User.session and can_register
Expand Down
11 changes: 5 additions & 6 deletions src/api/app/views/webui2/webui/main/_user_proceed-list.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
%i.fas.fa-plus-square.fa-2x.text-primary
%br
New Project
- if Feature.active?(:image_templates)
.col
= link_to(image_templates_path, class: 'btn btn-default', title: 'Create a new image') do
%i.fas.fa-compact-disc.fa-2x.text-secondary
%br
New Image
.col
= link_to(image_templates_path, class: 'btn btn-default', title: 'Create a new image') do
%i.fas.fa-compact-disc.fa-2x.text-secondary
%br
New Image
1 change: 0 additions & 1 deletion src/api/config/feature.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
production:
features: &default
image_templates: true
kiwi_image_editor: false
cloud_upload: false
cloud_upload_azure: false
Expand Down
1 change: 0 additions & 1 deletion src/api/lib/feature_switch/obs_repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module Repository
#
class ObsRepository < YamlRepository
DEFAULTS = {
image_templates: true,
cloud_upload: false
}.freeze

Expand Down
44 changes: 0 additions & 44 deletions src/api/spec/controllers/webui/image_templates_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,6 @@

RSpec.describe Webui::ImageTemplatesController, type: :controller do
describe 'GET #index' do
context 'image_templates feature is disabled' do
context 'for an anonymous user' do
before do
Feature.run_with_deactivated(:image_templates) do
get :index
end
end

it { is_expected.to respond_with(:not_found) }
end

context 'for a user' do
before do
login user

Feature.run_with_deactivated(:image_templates) do
get :index
end
end

context 'participating in the beta' do
let(:user) { create(:confirmed_user, :in_beta) }

it { is_expected.to respond_with(:success) }
end

context 'not participating in the beta' do
let(:user) { create(:confirmed_user) }

it { is_expected.to respond_with(:not_found) }
end
end
end

context 'image_templates feature is enabled' do
before do
Feature.run_with_activated(:image_templates) do
get :index
end
end

it { is_expected.to respond_with(:success) }
end

context 'without image templates' do
before do
get :index
Expand Down

0 comments on commit 7dfeddb

Please sign in to comment.