Skip to content

Commit

Permalink
refactor: changed env var to PG_CARTRIDGE=RDKit
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Herrmann committed Aug 6, 2024
1 parent ef96b43 commit e461766
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/api/chemotion/ui_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class UiAPI < Grape::API
has_converter: converter_config.present?,
has_radar: radar_config.present?,
collector_address: collector_address.presence,
pg_cartridge_installed: Chemotion::Application.config.pg_cartridge_installed || false,
pg_cartridge: Chemotion::Application.config.pg_cartridge,
}
end
end
Expand Down
1 change: 0 additions & 1 deletion app/packs/src/components/navigation/search/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export default class Search extends React.Component {
queryMolfile: null,
searchType: 'sub',
tanimotoThreshold: 0.7,
pgcartridge: false,
};
this.handleClearSearchSelection = this.handleClearSearchSelection.bind( this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function KetcherRailsform() {

const searchStore = useContext(StoreContext).search;
const panelVars = panelVariables(searchStore);
const { pgCartridgeInstalled } = UIStore.getState();
const { pgCartridge } = UIStore.getState();
let iframe;

const searchValuesByMolfile = () => {
Expand Down Expand Up @@ -174,9 +174,9 @@ function KetcherRailsform() {
value="subRDKit"
checked={searchStore.ketcherRailsValues.searchType === 'subRDKit'}
onChange={handleSearchTypeChange}
hidden={!pgCartridgeInstalled}
hidden={!pgCartridge}
>
{pgCartridgeInstalled ? 'Substructure Search with RDKit' : ''}
{pgCartridge ? `Substructure Search with ${pgCartridge}` : ''}
</Radio>
</Col>
</Row>
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Application < Rails::Application
'version' => 'v0', 'base_revision' => '0', 'current_revision' => '0'
}
config.version['current_revision'] = File.read('REVISION') if File.exist?('REVISION')
config.pg_cartridge_installed = ENV['PG_CARTRIDGE_INSTALLED'] == 'true'
config.pg_cartridge = ENV.fetch('PG_CARTRIDGE')
config.action_dispatch.perform_deep_munge = false

# TODO: Update autoload configuration to current rails standards
Expand Down
2 changes: 1 addition & 1 deletion db/seeds/shared/rdkit.seed.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

if Chemotion::Application.config.pg_cartridge_installed
if Chemotion::Application.config.pg_cartridge == 'RDKit'
mols = ActiveRecord::Base.connection.exec_query('select count(*) c from information_schema.tables
where table_schema = \'rdk\' AND table_name = \'mols\';')

Expand Down
3 changes: 1 addition & 2 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ services:
dockerfile: 'Dockerfile.RDKit'
environment:
- 'POSTGRES_HOST_AUTH_METHOD=trust'
- 'PG_CARTRIDGE_INSTALLED=true'
expose: # expose port to app container
- '5432'
ports: # expose port to host machine in case we want to use external db gui tools
Expand All @@ -35,7 +34,7 @@ services:
interval: 30s
timeout: 10s
environment:
- 'PG_CARTRIDGE_INSTALLED=true'
- 'PG_CARTRIDGE=RDKit'
- 'WEBPACKER_DEV_SERVER_HOST=webpacker'
- 'WEBPACKER_DEV_SERVER_PORT=3035'
- 'NODE_MODULES_PATH=/home/chemotion-dev/node_modules/' # required for the asset pipeline to find the node modules
Expand Down

0 comments on commit e461766

Please sign in to comment.