1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00
Go to file
2019-04-05 10:04:20 -04:00
__mocks__ test fixup 2019-01-03 17:53:37 -05:00
__tests__ fix tests eslintrc 2019-04-03 13:29:25 -04:00
build/locales recompile strings to fix Foo being displayed instead of My View 2019-02-20 09:41:38 -05:00
dist use a few more pf-core components 2018-09-26 21:39:04 -04:00
images Add help dropdown and about modal 2018-11-19 22:53:05 -05:00
src Set static value to const variable 2019-04-05 09:58:19 -04:00
.eslintignore update eslint config and add eslint ignore 2019-01-24 11:36:18 -05:00
.eslintrc add jest and enzyme testing dependencies and update infrastructure configuration to make testing work 2018-10-24 16:50:08 -04:00
.gitignore Moves locales out of src and into build dir. Changes npm commands from extract/compile to extract-strings/compile-strings 2018-12-12 11:28:29 -05:00
.linguirc Moves locales out of src and into build dir. Changes npm commands from extract/compile to extract-strings/compile-strings 2018-12-12 11:28:29 -05:00
babel.config.js Add support for i18n using lingui 2018-12-10 10:17:00 -05:00
CONTRIBUTING.md Update contributing doc to include: 2019-03-21 12:51:23 -04:00
jest.config.js Add support for i18n using lingui 2018-12-10 10:17:00 -05:00
jest.setup.js remove setTimeout hack for testing api.login Login.jsx handlers 2018-10-31 12:04:59 -04:00
package-lock.json Merge pull request #144 from keithjgrant/120-add-org-form-cleanup 2019-04-03 09:15:03 -04:00
package.json Merge pull request #144 from keithjgrant/120-add-org-form-cleanup 2019-04-03 09:15:03 -04:00
README.md Update readme to fix display of unit test commands 2018-12-20 09:52:03 -05:00
webpack.config.js Update @patternfly/patternfly-next references to @patternfly/patternfly 2019-02-19 16:00:11 -05:00

AWX-PF

Requirements

  • node 8.x LTS, npm 5.x LTS, make, git

Usage

  • git clone git@github.com:ansible/awx-pf.git
  • cd awx-pf
  • npm install
  • npm start
  • visit https://127.0.0.1:3001/

note: These instructions assume you have the awx development api server up and running at localhost:8043.

Unit Tests

To run the unit tests on files that you've changed:

  • npm test

To run a single test (in this case the login page test):

  • npm test -- __tests__/pages/Login.jsx

note: Once the test watcher is up and running you can hit a to run all the tests

Internationalization

Internationalization leans on the lingui project. Official documentation here. We use this libary to mark our strings for translation. For common React use cases see this link. If you want to see this in action you'll need to take the following steps:

  1. npm run add-locale to add the language that you want to translate to (we should only have to do this once and the commit to repo afaik). Example: npm run add-locale en es fr # Add English, Spanish and French locale
  2. npm run extract-strings to create .po files for each language specified. The .po files will be placed in src/locales but this is configurable.
  3. Open up the .po file for the language you want to test and add some translations. In production we would pass this .po file off to the translation team.
  4. Once you've edited your .po file (or we've gotten a .po file back from the translation team) run npm run compile-strings. This command takes the .po files and turns them into a minified JSON object and can be seen in the messages.js file in each locale directory. These files get loaded at the App root level (see: App.jsx).
  5. Change the language in your browser and reload the page. You should see your specified translations in place of English strings.