Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion locale/en.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions locale/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -5410,6 +5410,10 @@ msgstr "Registry sync"
#~ msgid "Released <0/>"
#~ msgstr "Released <0/>"

#: src/components/lazy-screen.tsx
msgid "Reload"
msgstr "Reload"

#: src/components/repository-form.tsx
#: src/containers/ansible-repository/list.tsx
#: src/containers/ansible-repository/tab-details.tsx
Expand Down Expand Up @@ -7354,6 +7358,10 @@ msgstr "This page is under construction and some features may be broken. You can
msgid "This project is an attempt to up-cycle the Ansible Galaxy UI codebase. The first version contains mostly saved code with minor fixes. In the future more types of content will be added. We welcome kindly any contributions."
msgstr "This project is an attempt to up-cycle the Ansible Galaxy UI codebase. The first version contains mostly saved code with minor fixes. In the future more types of content will be added. We welcome kindly any contributions."

#: src/components/lazy-screen.tsx
msgid "This screen could not be loaded"
msgstr "This screen could not be loaded"

#: src/components/coming-soon.tsx
msgid "This screen is not available in this UI yet."
msgstr "This screen is not available in this UI yet."
Expand Down
2 changes: 1 addition & 1 deletion locale/es.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions locale/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -5409,6 +5409,10 @@ msgstr ""
#~ msgid "Released <0/>"
#~ msgstr "Lanzado <0/>"

#: src/components/lazy-screen.tsx
msgid "Reload"
msgstr ""

#: src/components/repository-form.tsx
#: src/containers/ansible-repository/list.tsx
#: src/containers/ansible-repository/tab-details.tsx
Expand Down Expand Up @@ -7353,6 +7357,10 @@ msgstr ""
msgid "This project is an attempt to up-cycle the Ansible Galaxy UI codebase. The first version contains mostly saved code with minor fixes. In the future more types of content will be added. We welcome kindly any contributions."
msgstr ""

#: src/components/lazy-screen.tsx
msgid "This screen could not be loaded"
msgstr ""

#: src/components/coming-soon.tsx
msgid "This screen is not available in this UI yet."
msgstr ""
Expand Down
2 changes: 1 addition & 1 deletion locale/fr.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions locale/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -5409,6 +5409,10 @@ msgstr ""
#~ msgid "Released <0/>"
#~ msgstr "Sortie <0/>"

#: src/components/lazy-screen.tsx
msgid "Reload"
msgstr ""

#: src/components/repository-form.tsx
#: src/containers/ansible-repository/list.tsx
#: src/containers/ansible-repository/tab-details.tsx
Expand Down Expand Up @@ -7353,6 +7357,10 @@ msgstr ""
msgid "This project is an attempt to up-cycle the Ansible Galaxy UI codebase. The first version contains mostly saved code with minor fixes. In the future more types of content will be added. We welcome kindly any contributions."
msgstr ""

#: src/components/lazy-screen.tsx
msgid "This screen could not be loaded"
msgstr ""

#: src/components/coming-soon.tsx
msgid "This screen is not available in this UI yet."
msgstr ""
Expand Down
2 changes: 1 addition & 1 deletion locale/ja.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions locale/ja.po
Original file line number Diff line number Diff line change
Expand Up @@ -5409,6 +5409,10 @@ msgstr ""
#~ msgid "Released <0/>"
#~ msgstr "<0/> のリリース済み"

#: src/components/lazy-screen.tsx
msgid "Reload"
msgstr ""

#: src/components/repository-form.tsx
#: src/containers/ansible-repository/list.tsx
#: src/containers/ansible-repository/tab-details.tsx
Expand Down Expand Up @@ -7353,6 +7357,10 @@ msgstr ""
msgid "This project is an attempt to up-cycle the Ansible Galaxy UI codebase. The first version contains mostly saved code with minor fixes. In the future more types of content will be added. We welcome kindly any contributions."
msgstr ""

#: src/components/lazy-screen.tsx
msgid "This screen could not be loaded"
msgstr ""

#: src/components/coming-soon.tsx
msgid "This screen is not available in this UI yet."
msgstr ""
Expand Down
2 changes: 1 addition & 1 deletion locale/ko.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions locale/ko.po
Original file line number Diff line number Diff line change
Expand Up @@ -5409,6 +5409,10 @@ msgstr ""
#~ msgid "Released <0/>"
#~ msgstr "<0/>이/가 릴리스됨"

#: src/components/lazy-screen.tsx
msgid "Reload"
msgstr ""

#: src/components/repository-form.tsx
#: src/containers/ansible-repository/list.tsx
#: src/containers/ansible-repository/tab-details.tsx
Expand Down Expand Up @@ -7353,6 +7357,10 @@ msgstr ""
msgid "This project is an attempt to up-cycle the Ansible Galaxy UI codebase. The first version contains mostly saved code with minor fixes. In the future more types of content will be added. We welcome kindly any contributions."
msgstr ""

#: src/components/lazy-screen.tsx
msgid "This screen could not be loaded"
msgstr ""

#: src/components/coming-soon.tsx
msgid "This screen is not available in this UI yet."
msgstr ""
Expand Down
2 changes: 1 addition & 1 deletion locale/nl.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions locale/nl.po
Original file line number Diff line number Diff line change
Expand Up @@ -5409,6 +5409,10 @@ msgstr ""
#~ msgid "Released <0/>"
#~ msgstr "Heeft <0/> vrijgegeven"

#: src/components/lazy-screen.tsx
msgid "Reload"
msgstr ""

#: src/components/repository-form.tsx
#: src/containers/ansible-repository/list.tsx
#: src/containers/ansible-repository/tab-details.tsx
Expand Down Expand Up @@ -7353,6 +7357,10 @@ msgstr ""
msgid "This project is an attempt to up-cycle the Ansible Galaxy UI codebase. The first version contains mostly saved code with minor fixes. In the future more types of content will be added. We welcome kindly any contributions."
msgstr ""

#: src/components/lazy-screen.tsx
msgid "This screen could not be loaded"
msgstr ""

#: src/components/coming-soon.tsx
msgid "This screen is not available in this UI yet."
msgstr ""
Expand Down
2 changes: 1 addition & 1 deletion locale/zh.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions locale/zh.po
Original file line number Diff line number Diff line change
Expand Up @@ -5409,6 +5409,10 @@ msgstr ""
#~ msgid "Released <0/>"
#~ msgstr "发布的 <0/>"

#: src/components/lazy-screen.tsx
msgid "Reload"
msgstr ""

#: src/components/repository-form.tsx
#: src/containers/ansible-repository/list.tsx
#: src/containers/ansible-repository/tab-details.tsx
Expand Down Expand Up @@ -7353,6 +7357,10 @@ msgstr ""
msgid "This project is an attempt to up-cycle the Ansible Galaxy UI codebase. The first version contains mostly saved code with minor fixes. In the future more types of content will be added. We welcome kindly any contributions."
msgstr ""

#: src/components/lazy-screen.tsx
msgid "This screen could not be loaded"
msgstr ""

#: src/components/coming-soon.tsx
msgid "This screen is not available in this UI yet."
msgstr ""
Expand Down
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
"license": "Apache-2.0",
"author": "Martin Hradil, Zita Pospisil Nemeckova",
"private": true,
"sideEffects": [
"*.css",
"*.scss",
"./src/entrypoint.tsx",
"./src/l10n.ts",
"./src/darkmode.ts"
],
"dependencies": {
"@babel/runtime": "^8.0.7",
"@lingui/core": "^6.9.1",
Expand Down
57 changes: 56 additions & 1 deletion src/app-routes.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { screen, waitFor } from '@testing-library/react';
import { HttpResponse, http } from 'msw';
import { useLocation, useRoutes } from 'react-router';
import { afterEach, describe, expect, it, vi } from 'vitest';
import { listOf } from 'src/test-utils/pulp';
import { AppContextProvider } from 'src/app-context';
import RootRoute from 'src/routes/root';
import { listOf, repository } from 'src/test-utils/pulp';
import { renderWithProviders } from 'src/test-utils/render';
import { server } from 'src/test-utils/server';
import { config } from 'src/ui-config';
Expand Down Expand Up @@ -606,3 +608,56 @@ describe('plugin routes while the installed plugins are unknown', () => {
).not.toBeInTheDocument();
});
});

describe('lazily loaded screens', () => {
it('keeps the layout in the entry: the root route is static', () => {
expect(dataRoutes[0]).toMatchObject({ id: 'root', Component: RootRoute });
expect(dataRoutes[0]).not.toHaveProperty('lazy');
});

it('shows the status screen on a deep link while signed out', async () => {
server.use(
http.get('*/pulp/api/v3/status/', () =>
HttpResponse.json({
versions: [{ component: 'core', version: '3.0.0' }],
content_settings: {
content_origin: 'https://content.example',
content_path_prefix: '/pulp/content/',
},
database_connection: { connected: true },
redis_connection: { connected: true },
domain_enabled: false,
online_workers: [],
online_api_apps: [],
online_content_apps: [],
}),
),
);

renderWithProviders(<Routed />, { route: '/status' });

expect(
await screen.findByRole('heading', { name: 'Status' }),
).toBeVisible();
});

it('shows a plugin section screen on a deep link once its code has loaded', async () => {
signIn();
server.use(
listOf('/pulp/api/v3/repositories/file/file/', [
repository({ name: 'zz-test-repo' }),
]).handler,
listOf('/pulp/api/v3/remotes/file/file/', []).handler,
listOf('/pulp/api/v3/distributions/file/file/', []).handler,
);

renderWithProviders(
<AppContextProvider>
<Routed />
</AppContextProvider>,
{ route: '/file/repositories' },
);

expect(await screen.findByText('zz-test-repo')).toBeVisible();
});
});
Loading
Loading