-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: default ketcher2 configs in UI Feature (#1843)
- The default editor id for ketcher2 config is missing. Although the ELN Admin can set it, this migration set the default value. NB: a missing or wrong `editor` value will prevent the option to show up in the Structure Editor Modal - Also updated the yml example file on pair with the doc (ComPlat/chemotion_saurus#321)
- Loading branch information
Showing
3 changed files
with
13 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class UpdateEditorFeat < ActiveRecord::Migration[6.1] | ||
def change | ||
m = Matrice.find_by(name: 'ketcher2Editor') | ||
# update the feature config unless it is already set | ||
m && m.configs&.fetch('editor', nil).blank? && m.update_columns(configs: { editor: 'ketcher2' }) | ||
rescue StandardError => e | ||
Rails.logger.error "Error updating editor feature: #{e.message}" | ||
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