diff options
Diffstat (limited to 'app/presenters/pages_domain_presenter.rb')
-rw-r--r-- | app/presenters/pages_domain_presenter.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/presenters/pages_domain_presenter.rb b/app/presenters/pages_domain_presenter.rb new file mode 100644 index 00000000000..6b74983d932 --- /dev/null +++ b/app/presenters/pages_domain_presenter.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class PagesDomainPresenter < Gitlab::View::Presenter::Delegated + presents :pages_domain + + def needs_verification? + Gitlab::CurrentSettings.pages_domain_verification_enabled? && unverified? + end + + def show_auto_ssl_failed_warning? + return false unless Feature.enabled?(:pages_letsencrypt_errors, pages_domain.project) + + # validations prevents auto ssl from working, so there is no need to show that warning until + return false if needs_verification? + + ::Gitlab::LetsEncrypt.enabled? && auto_ssl_failed + end +end |