Merge ui and ui_next in one dir

Merge ui and ui_next in one dir

See: https://github.com/ansible/awx/issues/10676

Update django .po files

Update django .po files

Run `awx-manage makemessages`.
This commit is contained in:
nixocio
2021-07-22 12:34:07 -04:00
parent d89719c740
commit f85b2b6352
1531 changed files with 11344 additions and 13060 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -197,4 +197,4 @@ class MigrationRanCheckMiddleware(MiddlewareMixin):
executor = MigrationExecutor(connection)
plan = executor.migration_plan(executor.loader.graph.leaf_nodes())
if bool(plan) and getattr(resolve(request.path), 'url_name', '') != 'migrations_notran':
return redirect(reverse("ui_next:migrations_notran"))
return redirect(reverse("ui:migrations_notran"))

View File

@@ -111,7 +111,7 @@ def test_python_and_js_licenses():
api_licenses = index_licenses('%s/../docs/licenses' % base_dir)
ui_licenses = index_licenses('%s/../docs/licenses/ui' % base_dir)
api_requirements = read_api_requirements('%s/../requirements' % base_dir)
ui_requirements = read_ui_requirements('%s/ui_next' % base_dir)
ui_requirements = read_ui_requirements('%s/ui' % base_dir)
errors = []
errors += remediate_licenses_and_requirements(ui_licenses, ui_requirements)

View File

@@ -100,7 +100,7 @@ USE_L10N = True
USE_TZ = True
STATICFILES_DIRS = (os.path.join(BASE_DIR, 'ui_next', 'build', 'static'), os.path.join(BASE_DIR, 'static'))
STATICFILES_DIRS = (os.path.join(BASE_DIR, 'ui', 'build', 'static'), os.path.join(BASE_DIR, 'static'))
# Absolute filesystem path to the directory where static file are collected via
# the collectstatic command.
@@ -288,7 +288,7 @@ TEMPLATES = [
],
'builtins': ['awx.main.templatetags.swagger'],
},
'DIRS': [os.path.join(BASE_DIR, 'templates'), os.path.join(BASE_DIR, 'ui_next', 'build'), os.path.join(BASE_DIR, 'ui_next', 'public')],
'DIRS': [os.path.join(BASE_DIR, 'templates'), os.path.join(BASE_DIR, 'ui', 'build'), os.path.join(BASE_DIR, 'ui', 'public')],
}
]
@@ -316,7 +316,6 @@ INSTALLED_APPS = [
'awx.main',
'awx.api',
'awx.ui',
'awx.ui_next',
'awx.sso',
'solo',
]

View File

@@ -25,7 +25,7 @@ class BaseRedirectView(RedirectView):
def get_redirect_url(self, *args, **kwargs):
last_path = self.request.COOKIES.get('lastPath', '')
last_path = urllib.parse.quote(urllib.parse.unquote(last_path).strip('"'))
url = reverse('ui_next:index')
url = reverse('ui:index')
if last_path:
return '%s#%s' % (url, last_path)
else:

View File

@@ -262,10 +262,10 @@ About.defaultProps = {
There are currently a few custom hooks:
1. [useRequest](https://github.com/ansible/awx/blob/devel/awx/ui_next/src/util/useRequest.js#L21) encapsulates main actions related to requests.
2. [useDismissableError](https://github.com/ansible/awx/blob/devel/awx/ui_next/src/util/useRequest.js#L71) provides controls for "dismissing" an error message.
3. [useDeleteItems](https://github.com/ansible/awx/blob/devel/awx/ui_next/src/util/useRequest.js#L98) handles deletion of items from a paginated item list.
4. [useSelected](https://github.com/ansible/awx/blob/devel/awx/ui_next/src/util/useSelected.js#L14) provides a way to read and update a selected list.
1. [useRequest](https://github.com/ansible/awx/blob/devel/awx/ui/src/util/useRequest.js#L21) encapsulates main actions related to requests.
2. [useDismissableError](https://github.com/ansible/awx/blob/devel/awx/ui/src/util/useRequest.js#L71) provides controls for "dismissing" an error message.
3. [useDeleteItems](https://github.com/ansible/awx/blob/devel/awx/ui/src/util/useRequest.js#L98) handles deletion of items from a paginated item list.
4. [useSelected](https://github.com/ansible/awx/blob/devel/awx/ui/src/util/useSelected.js#L14) provides a way to read and update a selected list.
### Naming Functions

View File

@@ -4,7 +4,7 @@ ENV NPMRC_FILE=${NPMRC_FILE}
ARG TARGET='https://awx:8043'
ENV TARGET=${TARGET}
ENV CI=true
WORKDIR /ui_next
WORKDIR /ui
ADD public public
ADD package.json package.json
ADD package-lock.json package-lock.json

View File

@@ -8,11 +8,11 @@ The API development server will need to be running. See [CONTRIBUTING.md](../../
```shell
# install
npm --prefix=awx/ui_next install
npm --prefix=awx/ui 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
npm --prefix=awx/ui start
```
### Build for the Development Containers
@@ -34,28 +34,28 @@ you'll need use the `TARGET` environment variable when starting the ui developme
server:
```shell
TARGET='https://awx.local:8043' npm --prefix awx/ui_next start
TARGET='https://awx.local:8043' npm --prefix awx/ui start
```
## Testing
```shell
# run code formatting check
npm --prefix awx/ui_next run prettier-check
npm --prefix awx/ui run prettier-check
# run lint checks
npm --prefix awx/ui_next run lint
npm --prefix awx/ui run lint
# run all unit tests
npm --prefix awx/ui_next run test
npm --prefix awx/ui 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
npm --prefix awx/ui 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
npm --prefix awx/ui run test-watch
# start the tests and get the coverage report after the tests have completed
npm --prefix awx/ui_next run test -- --coverage
npm --prefix awx/ui run test -- --coverage
```
#### Note:
- Once the test watcher is up and running you can hit `a` to run all the tests.
@@ -72,25 +72,25 @@ container to ensure consistency.
docker exec -it tools_awx_1 bash
# start with a fresh install of the current dependencies
(tools_awx_1)$ make clean-ui && npm --prefix=awx/ui_next ci
(tools_awx_1)$ make clean-ui && npm --prefix=awx/ui ci
# add an exact development dependency
(tools_awx_1)$ npm --prefix awx/ui_next install --save-dev --save-exact dev-package@1.2.3
(tools_awx_1)$ npm --prefix awx/ui install --save-dev --save-exact dev-package@1.2.3
# add an exact production dependency
(tools_awx_1)$ npm --prefix awx/ui_next install --save --save-exact prod-package@1.23
(tools_awx_1)$ npm --prefix awx/ui install --save --save-exact prod-package@1.23
# remove a development dependency
(tools_awx_1)$ npm --prefix awx/ui_next uninstall --save-dev dev-package
(tools_awx_1)$ npm --prefix awx/ui uninstall --save-dev dev-package
# remove a production dependency
(tools_awx_1)$ npm --prefix awx/ui_next uninstall --save prod-package
(tools_awx_1)$ npm --prefix awx/ui uninstall --save prod-package
# exit the container
(tools_awx_1)$ exit
# 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
git add awx/ui/package.json awx/ui/package-lock.json
```
#### Note:
- Building the ui can use up a lot of resources. If you're running docker for mac or similar
@@ -98,8 +98,8 @@ virtualization, the default memory limit may not be enough and you should increa
## Building for Production
```shell
# built files are placed in awx/ui_next/build
npm --prefix awx/ui_next run build
# built files are placed in awx/ui/build
npm --prefix awx/ui run build
```
## CI Container
@@ -107,9 +107,9 @@ npm --prefix awx/ui_next run build
To run:
```shell
cd awx/awx/ui_next
cd awx/awx/ui
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
docker run --name tools_ui_1 --network tools_default --link 'tools_awx_1:awx' -e TARGET="https://awx:8043" -p '3001:3001' --rm -v $(pwd)/src:/ui/src awx-ui-next
```
**Note:** This is for CI, test systems, zuul, etc. For local development, see [usage](https://github.com/ansible/awx/blob/devel/awx/ui_next/README.md#Development)
**Note:** This is for CI, test systems, zuul, etc. For local development, see [usage](https://github.com/ansible/awx/blob/devel/awx/ui/README.md#Development)

View File

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

View File

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

View File

@@ -1,6 +1,5 @@
{
"name": "ui_next",
"version": "0.1.0",
"name": "ui",
"lockfileVersion": 2,
"requires": true,
"packages": {

View File

@@ -1,6 +1,5 @@
{
"name": "ui_next",
"version": "0.1.0",
"name": "ui",
"private": true,
"engines": {
"node": "14.x"

View File

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 270 KiB

After

Width:  |  Height:  |  Size: 270 KiB

View File

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View File

Before

Width:  |  Height:  |  Size: 191 KiB

After

Width:  |  Height:  |  Size: 191 KiB

View File

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 114 KiB

View File

Before

Width:  |  Height:  |  Size: 354 KiB

After

Width:  |  Height:  |  Size: 354 KiB

Some files were not shown because too many files have changed in this diff Show More