Skip to content

unepwcmc/tradetool-navigator

Repository files navigation

Setup

###Local

nvm use 14.7.0
  • Install dependencies and imports and run the server
bundle install
bundle exec rake db:create
bundle exec rake db:migrate
bundle exec rake import:tools['tools-june-2022-updated.csv'] 

# any new csv file must be stored in /lib/data/seeds. Move any old files into the /lib/data/seeds/old_seed_files directory.

bundle exec rails s
  • new CSV import
bundle exec rake db:reset
bundle exec rake import:tools['tools-navigator.csv']
  • Install JS dependencies and run webpack
yarn install
bin/webpack-dev-server

CSV download configuration

In order to choose if you want a column (table_attr) to be in the CSV download (when the user click DOWNLOAD CSV) the property show_in_csv in the table_attr must be set. For intance, in the tool.rb file you must set the property to true if you want to have the url column in the CSV download and false otherwise.

table_attr :url,
    title: 'URL',
    type: 'single',
    show_in_table: true,
    show_in_modal: true,
    show_in_csv: true or false

Deployment

bundle exec cap staging deploy

log in to the server

ssh -i  ~/.ssh/{your-key} [email protected]
cd tradehub-navigator/current
RAILS_ENV=staging bundle exec rake db:drop
RAILS_ENV=staging bundle exec rake db:create
RAILS_ENV=staging bundle exec rake db:migrate
RAILS_ENV=staging bundle exec rake import:tools['tools-navigator.csv']
# on zsh, you may have to escape the brackets e.g.: \['tools-navigator.csv'\]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors