Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Remove unused code

Oliver Güntheref3070f4c47a
diff --git a/app/controllers/enterprise_tokens_controller.rb b/app/controllers/enterprise_tokens_controller.rb
index b2d19d79c67..c7a0adfd14e 100644
--- a/app/controllers/enterprise_tokens_controller.rb
+++ b/app/controllers/enterprise_tokens_controller.rb
@@ -39,11 +39,7 @@ class EnterpriseTokensController < ApplicationController
before_action :find_token, only: %i[destroy destroy_dialog]
before_action :check_trial_status, only: [:index]
- def index
- # TODO: delete next line. @current_token is used in the old angular thingy.
- # It should not be needed anymore then.
- @current_token = EnterpriseToken.active_tokens.first
- end
+ def index; end
def new
respond_with_dialog Admin::EnterpriseTokens::CreateDialogComponent.new(EnterpriseToken.new)
@@ -63,7 +59,6 @@ class EnterpriseTokensController < ApplicationController
# restore the old token
if saved_encoded_token
@token.encoded_token = saved_encoded_token
- @current_token = @token || EnterpriseToken.new
end
respond_to do |format|
format.html { render action: :index, status: :unprocessable_entity }
diff --git a/app/views/enterprise_tokens/_form.html.erb b/app/views/enterprise_tokens/_form.html.erb
deleted file mode 100644
index 12fe979200d..00000000000
--- a/app/views/enterprise_tokens/_form.html.erb
+++ /dev/null
@@ -1,23 +0,0 @@
-<% title = @current_token.present? ? t('admin.enterprise.replace_token') : t('admin.enterprise.add_token') %>
-<%= augmented_collapsible_section initiallyExpanded: !@current_token.present?,
- title: title do %>
- <%= labelled_tabular_form_for EnterpriseToken.new,
- url: { action: :create },
- html: { class: 'token-form form -vertical' },
- method: :post do |f| %>
-
- <%= f.text_area :encoded_token,
- value: nil,
- cols: 60,
- rows: 15,
- placeholder: t('admin.enterprise.paste'),
- autocomplete: "off",
- autocorrect: "off",
- autocapitalize: "off",
- spellcheck: false %>
-
- <div class="form--space"></div>
- <%= styled_button_tag t(:button_save), id: 'token-submit-button', class: '-primary -with-icon icon-checkmark' %>
- <%= link_to t(:button_cancel), { action: :index }, class: 'button -with-icon icon-cancel' %>
- <% end %>
-<% end %>