-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added HelpCenter to Site Settings (#5594)
* added HelpCenter to Site Settings so user can configure their own help center link * fixed navbar to use non admin useSiteSetting * removing default help center link to greenlight and hiding nav icon if not set * added migration for adding help center to setting and site_setting * fixed rubocop errors for migration * removed helpcenter migration clash from populate setting and site setting data * combined HelpCenter migrations for simplicity --------- Co-authored-by: Ahmad Farhat <[email protected]>
- Loading branch information
1 parent
5da6789
commit 05b144b
Showing
7 changed files
with
58 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddHelpCenterSetting < ActiveRecord::Migration[7.1] | ||
def up | ||
Setting.create!(name: 'HelpCenter') unless Setting.exists?(name: 'HelpCenter') | ||
|
||
return if SiteSetting.exists?(setting: Setting.find_by(name: 'HelpCenter')) | ||
|
||
SiteSetting.create!( | ||
setting: Setting.find_by(name: 'HelpCenter'), | ||
value: '', | ||
provider: 'greenlight' | ||
) | ||
end | ||
|
||
def down | ||
Setting.find_by(name: 'HelpCenter')&.destroy | ||
SiteSetting.find_by(setting: Setting.find_by(name: 'HelpCenter')).destroy | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters