Skip to content

Commit 92f97af

Browse files
authored
refactor(console): remove api resource tutorial modal on creation (#7918)
* refactor(console): remove api resource tutorial modal on creation * fix: ui integration tests
1 parent fbad1dd commit 92f97af

File tree

8 files changed

+15
-222
lines changed

8 files changed

+15
-222
lines changed

packages/console/src/pages/ApiResources/components/GuideLibrary/index.module.scss

Lines changed: 0 additions & 39 deletions
This file was deleted.

packages/console/src/pages/ApiResources/components/GuideLibrary/index.tsx

Lines changed: 0 additions & 69 deletions
This file was deleted.

packages/console/src/pages/ApiResources/components/GuideLibraryModal/index.module.scss

Lines changed: 0 additions & 20 deletions
This file was deleted.

packages/console/src/pages/ApiResources/components/GuideLibraryModal/index.tsx

Lines changed: 0 additions & 63 deletions
This file was deleted.

packages/console/src/pages/ApiResources/index.tsx

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import useTheme from '@/hooks/use-theme';
2626
import pageLayout from '@/scss/page-layout.module.scss';
2727
import { buildUrl } from '@/utils/url';
2828

29-
import GuideLibraryModal from './components/GuideLibraryModal';
29+
import CreateForm from './components/CreateForm';
3030
import styles from './index.module.scss';
3131

3232
const pageSize = defaultPageSize;
@@ -128,15 +128,20 @@ function ApiResources() {
128128
}}
129129
onRetry={async () => mutate(undefined, true)}
130130
/>
131-
<GuideLibraryModal
132-
isOpen={isCreating}
133-
onClose={() => {
134-
navigate({
135-
pathname: apiResourcesPathname,
136-
search,
137-
});
138-
}}
139-
/>
131+
{isCreating && (
132+
<CreateForm
133+
onClose={(newApiResource) => {
134+
if (newApiResource) {
135+
navigate(`/api-resources/${newApiResource.id}`);
136+
return;
137+
}
138+
navigate({
139+
pathname: apiResourcesPathname,
140+
search,
141+
});
142+
}}
143+
/>
144+
)}
140145
</div>
141146
);
142147
}

packages/integration-tests/src/tests/console/rbac/machime-to-machime-rbac.test.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,6 @@ describe('M2M RBAC', () => {
6666
text: 'Create API resource',
6767
});
6868

69-
await expectModalWithTitle(page, 'Start with tutorials');
70-
71-
// Click bottom button to skip tutorials
72-
await expect(page).toClick('.ReactModalPortal nav[class$=actionBar] button span', {
73-
text: 'Continue without tutorial',
74-
});
75-
7669
await expectModalWithTitle(page, 'Create API resource');
7770

7871
await expect(page).toFillForm('.ReactModalPortal form', {

packages/integration-tests/src/tests/console/rbac/user-rbac.test.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,6 @@ describe('User RBAC', () => {
5555
text: 'Create API resource',
5656
});
5757

58-
await expectModalWithTitle(page, 'Start with tutorials');
59-
60-
// Click bottom button to skip tutorials
61-
await expect(page).toClick('.ReactModalPortal nav[class$=actionBar] button span', {
62-
text: 'Continue without tutorial',
63-
});
64-
6558
await expectModalWithTitle(page, 'Create API resource');
6659

6760
await expect(page).toFillForm('.ReactModalPortal form', {

packages/integration-tests/src/ui-helpers/expect-api-resources.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,7 @@ export default class ExpectApiResources extends ExpectConsole {
1515
async toCreateApiResource({ name, indicator }: { name: string; indicator: string }) {
1616
await this.gotoPage('/api-resources', 'API resources');
1717
await this.toClickButton('Create API resource');
18-
19-
await this.toExpectModal('Start with tutorials');
20-
21-
// Click bottom button to skip tutorials
22-
await this.toClickButton('Continue without tutorial', false);
23-
2418
await this.toExpectModal('Create API resource');
25-
2619
await this.toFillForm({
2720
name,
2821
indicator,

0 commit comments

Comments
 (0)