From 615137a883d9182b4864d06d6c2959a1e44f6928 Mon Sep 17 00:00:00 2001 From: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com> Date: Thu, 20 Jan 2022 07:31:35 -0700 Subject: [PATCH] Remove the "Getting Started" Section from the Config (#16033) * Removes the Getting Started section and related code from the config * Removes the admin_manages_configuration_spec.rb * Removes "Required" tags from Config * Reverts removal of activateMissingKeysModal * Removes mandatory.rb --- app/helpers/application_helper.rb | 6 -- .../admin/controllers/config_controller.js | 3 +- app/models/settings/mandatory.rb | 29 ------ app/validators/bytesize_validator.rb | 1 - .../admin/settings/forms/_mandatory.html.erb | 45 --------- app/views/admin/settings/show.html.erb | 29 ------ .../config/getStartedSection.spec.js | 92 ------------------- .../admin/admin_manages_configuration_spec.rb | 17 ---- 8 files changed, 1 insertion(+), 221 deletions(-) delete mode 100644 app/models/settings/mandatory.rb delete mode 100644 app/views/admin/settings/forms/_mandatory.html.erb delete mode 100644 cypress/integration/seededFlows/adminFlows/config/getStartedSection.spec.js delete mode 100644 spec/system/admin/admin_manages_configuration_spec.rb diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7dec2afce..6144ab32e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -270,12 +270,6 @@ module ApplicationHelper def admin_config_label(method, content = nil, model: Settings::General) content ||= tag.span(method.to_s.humanize) - if method.to_sym.in?(Settings::Mandatory.keys) - required = tag.span(I18n.t("helpers.application_helper.required"), - class: "c-indicator c-indicator--danger") - content = safe_join([content, required]) - end - label_prefix = model.name.split("::").map(&:underscore).join("_") tag.label(content, class: "site-config__label crayons-field__label", for: "#{label_prefix}_#{method}") end diff --git a/app/javascript/admin/controllers/config_controller.js b/app/javascript/admin/controllers/config_controller.js index e206cf618..fc4f3ba4a 100644 --- a/app/javascript/admin/controllers/config_controller.js +++ b/app/javascript/admin/controllers/config_controller.js @@ -158,7 +158,6 @@ export default class ConfigController extends Controller { communityName.parentNode.replaceChild(newLogo, communityName); } else { for (const logo of document.querySelectorAll('.site-logo__img')) { - if (logo !== previewLogo) { logo.src = previewLogo.src; } @@ -417,7 +416,7 @@ export default class ConfigController extends Controller { activateMissingKeysModal(providers) { this.configModalAnchorTarget.innerHTML = adminModal({ - title: 'Getting started', + title: 'Setup not complete', controllerName: 'config', closeModalFunction: 'closeAdminModal', body: this.missingAuthKeysModalBody(providers), diff --git a/app/models/settings/mandatory.rb b/app/models/settings/mandatory.rb deleted file mode 100644 index 19c316b7a..000000000 --- a/app/models/settings/mandatory.rb +++ /dev/null @@ -1,29 +0,0 @@ -module Settings - # We use this model to back the "Get Started" form of the config admin page. - class Mandatory - include ActiveModel::Naming - - MAPPINGS = { - community_name: Settings::Community, - community_description: Settings::Community, - - suggested_tags: Settings::General, - suggested_users: Settings::General - }.freeze - MAPPING_KEYS = MAPPINGS.keys - - MAPPINGS.each do |setting, settings_model| - delegate setting, "#{setting}=", to: settings_model - end - - def self.keys - MAPPING_KEYS - end - - def self.missing - MAPPINGS.reject do |settings, settings_model| - settings_model.public_send(settings).present? - end.keys - end - end -end diff --git a/app/validators/bytesize_validator.rb b/app/validators/bytesize_validator.rb index 0be8cccac..081dd89c6 100644 --- a/app/validators/bytesize_validator.rb +++ b/app/validators/bytesize_validator.rb @@ -7,7 +7,6 @@ class BytesizeValidator < ActiveModel::EachValidator CHECKS = { maximum: :<= }.freeze RESERVED_OPTIONS = %i[maximum too_long].freeze - def check_validity! raise ArgumentError, ERROR_MESSAGE unless options.key?(:maximum) diff --git a/app/views/admin/settings/forms/_mandatory.html.erb b/app/views/admin/settings/forms/_mandatory.html.erb deleted file mode 100644 index fde7cb6d7..000000000 --- a/app/views/admin/settings/forms/_mandatory.html.erb +++ /dev/null @@ -1,45 +0,0 @@ -<%= form_with(url: admin_settings_mandatory_settings_path, data: { action: "submit->config#updateConfigurationSettings", testid: "getStartedSectionForm" }) do |f| %> -
- <%= render "update_setting_button", f: f %> -<% end %> diff --git a/app/views/admin/settings/show.html.erb b/app/views/admin/settings/show.html.erb index 16c6656a6..c396e0639 100644 --- a/app/views/admin/settings/show.html.erb +++ b/app/views/admin/settings/show.html.erb @@ -7,35 +7,6 @@ <% end %> -