From 69b4c6c5e374dfc0a5f0e20d62a89462846c7d0f Mon Sep 17 00:00:00 2001 From: Ridhwana Date: Thu, 16 Sep 2021 12:56:59 +0200 Subject: [PATCH] Fix Forem Ownership Field (#14730) * fix: mistakenly renamed forem_owner_secret to owner_secret * chore: revert change from merge * refactor: use the Forem Instance model * extra . --- .github/PULL_REQUEST_TEMPLATE.md | 6 +++++- app/javascript/chat/chat.jsx | 5 ++++- app/models/forem_instance.rb | 4 ++++ .../authentication/_forem_creator_signup.html.erb | 11 +++++------ 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 02e80aee4..e195fe146 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -58,7 +58,11 @@ will share this change with the people who need to know about it._ - [ ] I've updated the [Developer Docs](https://developers.forem.com) or [Storybook](https://storybook.forem.com/) (for Crayons components) -- [ ] This PR changes the Forem platform and our documentation needs to be updated. I have filled out the [Changes Requested](https://github.com/forem/admin-docs/issues/new?assignees=&labels=&template=changes_requested.md) issue template so Community Success can help update the Admin Docs appropriately. +- [ ] This PR changes the Forem platform and our documentation needs to be + updated. I have filled out the + [Changes Requested](https://github.com/forem/admin-docs/issues/new?assignees=&labels=&template=changes_requested.md) + issue template so Community Success can help update the Admin Docs + appropriately. - [ ] I've updated the README or added inline documentation - [ ] I've added an entry to [`CHANGELOG.md`](https://github.com/forem/forem/tree/main/CHANGELOG.md) diff --git a/app/javascript/chat/chat.jsx b/app/javascript/chat/chat.jsx index fdaef2df5..38232ba8e 100644 --- a/app/javascript/chat/chat.jsx +++ b/app/javascript/chat/chat.jsx @@ -1494,7 +1494,10 @@ export class Chat extends Component { ? state.activeChannel.channel_name : ' '; const connectAnnouncement = ( -
+
We have made the decision to deprecate Connect as core functionality from the application.   Minimum 8 characters

- <% needs_owner_secret_field = ENV["FOREM_OWNER_SECRET"].present? && Settings::General.waiting_on_first_user %> - <% if needs_owner_secret_field %> - <% if params[:owner_secret].present? %> - <%= f.hidden_field :owner_secret, value: params[:owner_secret] %> + <% if ForemInstance.needs_owner_secret? %> + <% if params[:forem_owner_secret].present? %> + <%= f.hidden_field :forem_owner_secret, value: params[:forem_owner_secret] %> <% else %>
- <%= f.label :owner_secret, "New Forem Secret", class: "crayons-field__label" %> - <%= f.password_field :owner_secret, class: "crayons-textfield", required: needs_owner_secret_field, placeholder: "As provided by your Forem host" %> + <%= f.label :forem_owner_secret, "New Forem Secret", class: "crayons-field__label" %> + <%= f.password_field :forem_owner_secret, class: "crayons-textfield", required: ForemInstance.needs_owner_secret?, placeholder: "As provided by your Forem host" %>
<% end %> <% end %>