docbrown/app/views/admin/settings/forms/_smtp.html.erb
Mac Siri afa73e06e3
Replace Webpacker with Esbuild (#20470)
* Migrate to esbuild WIP

* Add exclude

* Remove redundant file

* Move file

* Move to javascript_include_tag

* Lint fix

* WIP

* WIP

* Add watch mode to esbuild WIP

* Get jest working

* Remove babel

* Revert "Remove babel"

This reverts commit 6da35260aa19d6f97f586deb66c0ecaf48433b73.

* More WIP

* Got image to load

* WIP

* Resolve audit

* Lint fix

* WIP

* Fix jest spec

* [CI] Remove asset-restore for test build stage

* Production compliant

* Temp disable sourcemap

* Update glob

* Add esbuild helper to stimulus

* Import fragment

* Temp disable coverage to see failing tests

* Fix broken spec

* Address lint

* Set proper es6 target

* Use esbuild for everything

* wait what

* Revert "Set proper es6 target"

This reverts commit 98f5278093421baa8ffe2ca580845b01c1a1eadf.

* Revert "Use esbuild for everything"

This reverts commit 0ac46738f07ffcb6af095ccb1ffa5e439b7fefa3.

* Replace uglifier with terser

* New compiled assets version

* Remvoe honeybadger-io/webpack

* Remove cypress coverage checks for now

* Update jsconfig.json

* Update docker-compose

* Remove public/packs-test from ci cache
2024-01-25 20:29:21 +00:00

48 lines
2.2 KiB
Text

<%= javascript_include_tag "admin/config/smtp", defer: true %>
<%= form_for(Settings::SMTP.new,
url: admin_settings_smtp_settings_path,
html: { data: {
action: "submit->config#updateConfigurationSettings",
testid: "emailServerSettings"
} }) do |f| %>
<details class="crayons-card" id="smtp-section">
<summary class="crayons-subtitle-2 p-6">Email Server Settings (SMTP)</summary>
<div class="p-6 pt-0">
<fieldset class="grid gap-4">
<% if ForemInstance.sendgrid_enabled? %>
<div class="crayons-field crayons-field--checkbox mt-3">
<%= f.check_box :own_email_server,
checked: Settings::SMTP.provided_minimum_settings?,
class: "crayons-checkbox" %>
<%= f.label :own_email_server, class: "crayons-field__label" do %>
Use my own email server
<% end %>
</div>
<% end %>
<% if ForemInstance.only_sendgrid_enabled? %>
<p class="mb-3">
As a Forem Cloud client, we provide an email server managed by the Forem team. All settings are managed by us and the from and reply email addresses are set as <%= ForemInstance.email %>. However, you can override this to use your own email server.
</p>
<% end %>
<div class="js-custom-smtp-section <%= "hidden" if ForemInstance.only_sendgrid_enabled? %>">
<% smpt_options.each do |config_key| %>
<div class="crayons-field mt-3">
<%= admin_config_label config_key, model: Settings::SMTP %>
<%= admin_config_description Constants::Settings::SMTP.details[config_key][:description] %>
<%= f.text_field config_key,
class: "crayons-textfield",
value: Settings::SMTP.public_send(config_key),
placeholder: Constants::Settings::SMTP.details[config_key][:placeholder],
"data-config-target": "smtpSetting#{config_key.to_s.camelize(:upper)}" %>
</div>
<% end %>
</div>
</fieldset>
<%= render "update_setting_button", f: f %>
</div>
</details>
<% end %>