esgf-subscriptions v0.4.13
This project was bootstrapped with Create React App.
Using drop-down components in your project
Install the components:
npm install --save esgf-subscriptions
Then implement in your project using example: ESGF-Subscriptions App
Developer Initial Setup
Clone esgf-subscriptions repo and COG fork, they should be in the same directory:
git clone https://github.com/downiec/COG
git clone https://github.com/downiec/esgf-subscriptions.git
Developing as NPM package
After making changes, build package using:
npm run build
Builds the app as an NPM package for publication using Rollup.js. The package is then ready to be published or tested!
Integrating with COG
To install as an app within the COG repo, do the following:
# Within esgf-subscriptions repo
npm install
./COG_tasks.sh --build #May need sudo privileges
You should now be able to run scripts as described below.
Available Scripts (run from the esgf-subscriptions repo)
npm start
Command above runs the app in the development mode. This will only show the esgf-subscriptions front-end as it looks and behaves OUTSIDE of COG. Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits. You will also see any lint errors in the console.
npm test
Launches the test runner in the interactive watch mode. See the section about running tests for more information.
COG Integration and Testing
Before starting, make sure the 'cog_build.config' file has the appropriate parameters set. Otherwise you will get error messages indicating issues.
Note: You may need to run some of the script for copying over files into the COG installation directory using sudo
privileges if the target directory requires.
npm run build-cog
The above command will first build the front-end, then copy it into the COG application; combining the two commands described below.
./COG_tasks.sh --copy
The above command will copy over static files from current front-end to place them in the appropriate COG installation directory. You can specify the location within the cog_build.config file (default), or you can set the path as an argument: ./COG_tasks.sh --copy <path_to_copy_to>
NOTE: This command may be necessary if sudo privileges are needed to copy.
./COG_tasks.sh --build
Above command will build the esgf-subscriptions application for legacy COG integration. The build is minified and the filenames include the hashes.
./COG_tasks.sh --run
Above command starts up a forked instance of the COG Django application. Once the service is started, you can view the page here: http://localhost:8000/subscription/
IMPORTANT: You will need the COG setup files (for the COG installation) containing config files in order to interact with COG server. Make sure you already built the application previously with: ./COG_tasks.sh --build
After cog service starts if you are routed to the login screen, you can login by:
- Click the button near the ‘OpenID’ label.
- Select ‘LLNL Test Dev IDP’ from the drop down. *Or use the other LLNL option if Test Dev doesn't work.
- Click ‘login’
- Enter username and password.
- Click ‘SUBMIT’