mirror of
https://github.com/ansible/awx.git
synced 2026-02-20 20:50:06 -03:30
Subscription wizard SUMMARY Adds subscriptions routes Extends Config context to return an array with two items: config state and config setter Update components that use Config with the new return pattern Move mock config into setupTests.js Return only the routes the user is "authorized" (valid license key) to view Subscription Details view: /settings/subscription/details This is our standard details view Clicking Edit will send the user to subscription wizard view /settings/subscription/edit Route is not accessible when license type is OPEN Subscription Add wizard view: /settings/subscription_management Step 1 - Subscription: If a user does not have a Red Hat Ansible Automation Platform subscription, they can request a trial subscription via the link Toggle between uploading a subscription manifest .zip file or retrieving subscriptions using Red Hat credentials (username and password) Get Subscriptions button fetches subscriptions and displays them in a modal Step 2 - Tracking and analytics: Shows two checkboxes to enable User analytics and Automation analytics If the user has previously selected the RH subscription manifest flow, checking the Automation Analytics box will display required RH username and password fields If the user has previously selected the RH username/password flow, they will not see this additional username/password field if Automation Analytics is checked Step 3 - EULA: https://tower-mockups.testing.ansible.com/patternfly/settings/settings-license-step-03/ Submission should show a success message and navigate user to dashboard if this is the initial launch and to the subscription detail view if they are editing the subscription Failed submission should show a wizard form error ISSUE TYPE Feature COMPONENT NAME UI ADDITIONAL INFORMATION Reviewed-by: Michael Abashian <None> Reviewed-by: Kersom <None> Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
AWX-PF
Requirements
- node 14.x LTS, npm 6.x LTS, make, git
Development
The API development server will need to be running. See CONTRIBUTING.md.
# install
npm --prefix=awx/ui_next install
# Start the ui development server. While running, the ui will be reachable
# at https://127.0.0.1:3001 and updated automatically when code changes.
npm --prefix=awx/ui_next start
Build for the Development Containers
If you just want to build a ui for the container-based awx development environment, use these make targets:
# The ui will be reachable at https://localhost:8043 or
# http://localhost:8013
make ui-devel
# clean up
make clean-ui
Using an External Server
If you normally run awx on an external host/server (in this example, awx.local),
you'll need use the TARGET environment variable when starting the ui development
server:
TARGET='https://awx.local:8043' npm --prefix awx/ui_next start
Testing
# run code formatting check
npm --prefix awx/ui_next run prettier-check
# run lint checks
npm --prefix awx/ui_next run lint
# run all unit tests
npm --prefix awx/ui_next run test
# run a single test (in this case the login page test):
npm --prefix awx/ui_next test -- src/screens/Login/Login.test.jsx
# start the test watcher and run tests on files that you've changed
npm --prefix awx/ui_next run test-watch
# start the tests and get the coverage report after the tests have completed
npm --prefix awx/ui_next run test -- --coverage
Note:
- Once the test watcher is up and running you can hit
ato run all the tests. - All commands are run on your host machine and not in the api development containers.
Adding Dependencies
# add an exact development or build dependency
npm --prefix awx/ui_next install --save-dev --save-exact dev-package@1.2.3
# add an exact production dependency
npm --prefix awx/ui_next install --save --save-exact prod-package@1.23
# add the updated package.json and package-lock.json files to scm
git add awx/ui_next_next/package.json awx/ui_next_next/package-lock.json
Removing Dependencies
# remove a development or build dependency
npm --prefix awx/ui_next uninstall --save-dev dev-package
# remove a production dependency
npm --prefix awx/ui_next uninstall --save prod-package
Building for Production
# built files are placed in awx/ui_next/build
npm --prefix awx/ui_next run build
CI Container
To run:
cd awx/awx/ui_next
docker build -t awx-ui-next .
docker run --name tools_ui_next_1 --network tools_default --link 'tools_awx_1:awx' -e TARGET="https://awx:8043" -p '3001:3001' --rm -v $(pwd)/src:/ui_next/src awx-ui-next
Note: This is for CI, test systems, zuul, etc. For local development, see usage