Resolves #604. The available and chosen package search inputs now have a reset button which resets the search and list elements to their default states. This fixes a cosmetic issue related to the focus-visible width being smaller than the search input width. This is accomplished by passing an onClear prop to the search input. The functions used to add all and selected packages were split from two functions into four functions. The functions appear similiar but this is only superficial; the logic is actually quite different and there is very little code reuse. Four separate functions will be easier to understand and maintain. This commit includes several other modifications: 1. The chosen package search is now a typeahead filter. This brings it in line with PatternFly dual list selector examples. 2. The available package search button has changed to be in line with the PatternFly <SearchInput /> component examples. 3. Package sorting behavior is now consistent. Previously, packages would be sorted if 'add all' was used but not if 'add selected' was used. Now the default behavior is to always sort the package list. |
||
|---|---|---|
| .github | ||
| .travis | ||
| config | ||
| devel | ||
| distribution | ||
| src | ||
| .eslintrc.yml | ||
| .gitignore | ||
| .stylelintrc.json | ||
| .travis.yml | ||
| babel.config.js | ||
| codecov.yml | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
image-builder-frontend
Frontend Development
To develop the frontend you can use a proxy to run image-builder-frontend locally against the chrome and backend at console.redhat.com.
Working against the production environment is preferred, as any work can be released without worrying if a feature from stage has been released yet.
Nodejs and npm version
Make sure you have npm@7 and node 15+ installed. If you need multiple versions of nodejs check out nvm.
Webpack proxy
-
run
npm ci -
run
npm run start:proxy:beta. This command uses a prod-beta env by default. Configure your environment by theenvattribute indev.webpack.config.js. -
open browser at
https://prod.foo.redhat.com:1337/beta/insights/image-builder
Webpack proxy (staging) -- Runs with image-builder's stage deployment
-
run
npm ci -
run
npm run stage. This command uses a stage-beta env by default. Configure your environment by theenvattribute indev.webpack.config.js. -
open browser at
https://stage.foo.redhat.com:1337/beta/insights/image-builder
Insights proxy (deprecated)
-
Clone the insights proxy: https://github.com/RedHatInsights/insights-proxy
-
Setting up the proxy
Choose a runner (podman or docker), and point the SPANDX_CONFIG variable to
profile/local-frontend.jsincluded in image-builder-frontend.sudo insights-proxy/scripts/patch-etc-hosts.sh export RUNNER="podman" export SPANDX_CONFIG=$PATH_TO/image-builder-frontend/profiles/local-frontend.js sudo -E insights-proxy/scripts/run.sh -
Starting up image-builder-frontend
In the image-builder-frontend checkout directory
npm install npm start
The UI should be running on https://prod.foo.redhat.com:1337/beta/insights/image-builder/landing. Note that this requires you to have access to either production or stage (plus VPN and proxy config) of insights.
Backend Development
To develop both the frontend and the backend you can again use the proxy to run both the frontend and backend locally against the chrome at cloud.redhat.com. For instructions see devel/README.md.
Style Guidelines
This project uses eslint's recommended styling guidelines. These rules can be found here: https://eslint.org/docs/rules/
Test Guidelines
Testing is done using React Testing Library. All UI contributions must also include a new test or update an existing test in order to maintain code coverage.
Tests can be run with
npm run test
These tests will also be run in our Travis CI when a PR is opened.