Embeds the React USMetadata App using custom paths
Tested with GSA Inventory App and CKAN 2.5 and greater
The CKAN extension installs like a regular CKAN extension.
To update the embedded react application:
- Backup and remove this public folder
- Go to the react application directory
- yarn build
- `cp -r build/static/* /path/to/ckanext-react_usmetadata/ckanext/react_usmetadata/public/
- type ls public/js. The file names contain a hash value for example:
- runtime~main.7ba465df.js
- main.b0613878.chunk.js
- 2.758f1cc0.chunk.js
(Note that you can ignore the .js.map files. Just leave them alone) Copy the updated filenames for future reference.
- Do the same for the public/css folder, recording the new filenames
- Open /path/to/ckanext-react_usmetadata/templates/snippets/usmetadata_app.html
- Replace the <script> and <link> tags with the new filenames from the previous steps.
- Test and commit the changes.
To install ckanext-react_usmetadata for development, activate your CKAN virtualenv and do:
git clone https://github.com/datopian/ckanext-react_usmetadata.git cd ckanext-react_usmetadata python setup.py develop pip install -r dev-requirements.txt
To run the tests, do:
nosetests --nologcapture --with-pylons=test.ini
To run the tests and produce a coverage report, first make sure you have
coverage installed in your virtualenv (pip install coverage) then run:
nosetests --nologcapture --with-pylons=test.ini --with-coverage --cover-package=ckanext.react_usmetadata --cover-inclusive --cover-erase --cover-tests
ckanext-react_usmetadata should be availabe on PyPI as https://pypi.python.org/pypi/ckanext-react_usmetadata. If that link doesn't work, then you can register the project on PyPI for the first time by following these steps:
Create a source distribution of the project:
python setup.py sdist
Register the project:
python setup.py register
Upload the source distribution to PyPI:
python setup.py sdist upload
Tag the first release of the project on GitHub with the version number from the
setup.pyfile. For example if the version number insetup.pyis 0.0.1 then do:git tag 0.0.1 git push --tags
ckanext-react_usmetadata is availabe on PyPI as https://pypi.python.org/pypi/ckanext-react_usmetadata. To publish a new version to PyPI follow these steps:
Update the version number in the
setup.pyfile. See PEP 440 for how to choose version numbers.Create a source distribution of the new version:
python setup.py sdist
Upload the source distribution to PyPI:
python setup.py sdist upload
Tag the new release of the project on GitHub with the version number from the
setup.pyfile. For example if the version number insetup.pyis 0.0.2 then do:git tag 0.0.2 git push --tags