diff --git a/scripts/mk/crc-frontend.mk b/scripts/mk/crc-frontend.mk index 762dfa8..5ea8a50 100644 --- a/scripts/mk/crc-frontend.mk +++ b/scripts/mk/crc-frontend.mk @@ -39,11 +39,17 @@ run:$(NODE_BIN)/fec ## Execute frontend .PHONY: generate-api generate-api: $(NODE_BIN)/openapi-generator-cli $(NODE_BIN)/prettier $(PUBLIC_OPENAPI) ## Generate the API client from openapi specification - @rm -rf $(APIDIR) + @rm -rf "$(APIDIR)/idmsvc" + + # Generate idmsvc API client TS_POST_PROCESS_FILE="node_modules/.bin/prettier --write" \ npm run openapi-generator-cli -- generate --enable-post-process-file \ - -i "$(PUBLIC_OPENAPI)" -g typescript-axios -o $(APIDIR) - @rm -f $(APIDIR)/.gitignore $(APIDIR)/.npmignore $(APIDIR)/git_push.sh + -i "$(PUBLIC_OPENAPI)" -g typescript-axios -o $(APIDIR)/idmsvc + @rm -rf \ + "$(APIDIR)/idmsvc/.gitignore" \ + "$(APIDIR)/idmsvc/.npmignore" \ + "$(APIDIR)/idmsvc/git_push.sh" \ + "$(APIDIR)/idmsvc/.gitignore" .PHONY: update-api update-api: diff --git a/src/Api/.openapi-generator-ignore b/src/Api/idmsvc/.openapi-generator-ignore similarity index 100% rename from src/Api/.openapi-generator-ignore rename to src/Api/idmsvc/.openapi-generator-ignore diff --git a/src/Api/.openapi-generator/FILES b/src/Api/idmsvc/.openapi-generator/FILES similarity index 100% rename from src/Api/.openapi-generator/FILES rename to src/Api/idmsvc/.openapi-generator/FILES diff --git a/src/Api/.openapi-generator/VERSION b/src/Api/idmsvc/.openapi-generator/VERSION similarity index 100% rename from src/Api/.openapi-generator/VERSION rename to src/Api/idmsvc/.openapi-generator/VERSION diff --git a/src/Api/api.ts b/src/Api/idmsvc/api.ts similarity index 100% rename from src/Api/api.ts rename to src/Api/idmsvc/api.ts diff --git a/src/Api/base.ts b/src/Api/idmsvc/base.ts similarity index 100% rename from src/Api/base.ts rename to src/Api/idmsvc/base.ts diff --git a/src/Api/common.ts b/src/Api/idmsvc/common.ts similarity index 100% rename from src/Api/common.ts rename to src/Api/idmsvc/common.ts diff --git a/src/Api/configuration.ts b/src/Api/idmsvc/configuration.ts similarity index 100% rename from src/Api/configuration.ts rename to src/Api/idmsvc/configuration.ts diff --git a/src/Api/index.ts b/src/Api/idmsvc/index.ts similarity index 100% rename from src/Api/index.ts rename to src/Api/idmsvc/index.ts diff --git a/src/AppContext.tsx b/src/AppContext.tsx index cc7fcfc..b55b3eb 100644 --- a/src/AppContext.tsx +++ b/src/AppContext.tsx @@ -1,5 +1,5 @@ import { ReactNode, createContext, useState } from 'react'; -import { Domain } from './Api'; +import { Domain } from './Api/idmsvc'; import { VerifyState } from './Routes/WizardPage/Components/VerifyRegistry/VerifyRegistry'; import React from 'react'; diff --git a/src/Components/AutoJoinChangeConfirmDialog/AutoJoinChangeConfirmDialog.test.tsx b/src/Components/AutoJoinChangeConfirmDialog/AutoJoinChangeConfirmDialog.test.tsx index 82d03c2..d5dc71e 100644 --- a/src/Components/AutoJoinChangeConfirmDialog/AutoJoinChangeConfirmDialog.test.tsx +++ b/src/Components/AutoJoinChangeConfirmDialog/AutoJoinChangeConfirmDialog.test.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { render, screen } from '@testing-library/react'; import AutoJoinChangeConfirmDialog from './AutoJoinChangeConfirmDialog'; import '@testing-library/jest-dom'; -import { Domain, DomainType } from '../../Api'; +import { Domain, DomainType } from '../../Api/idmsvc'; const domain: Domain = { title: 'domain', diff --git a/src/Components/AutoJoinChangeConfirmDialog/AutoJoinChangeConfirmDialog.tsx b/src/Components/AutoJoinChangeConfirmDialog/AutoJoinChangeConfirmDialog.tsx index 6aa89ae..0dfb791 100644 --- a/src/Components/AutoJoinChangeConfirmDialog/AutoJoinChangeConfirmDialog.tsx +++ b/src/Components/AutoJoinChangeConfirmDialog/AutoJoinChangeConfirmDialog.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Button, Modal } from '@patternfly/react-core'; import './AutoJoinChangeConfirmDialog.scss'; -import { Domain } from '../../Api/api'; +import { Domain } from '../../Api/idmsvc'; interface AutoJoinChangeConfirmDialogProps { /** The domain to be changed */ diff --git a/src/Components/ConfirmDeleteDomain/ConfirmDeleteDomain.test.tsx b/src/Components/ConfirmDeleteDomain/ConfirmDeleteDomain.test.tsx index e3b7371..0570691 100644 --- a/src/Components/ConfirmDeleteDomain/ConfirmDeleteDomain.test.tsx +++ b/src/Components/ConfirmDeleteDomain/ConfirmDeleteDomain.test.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { render, screen } from '@testing-library/react'; import ConfirmDeleteDomain from './ConfirmDeleteDomain'; import '@testing-library/jest-dom'; -import { Domain } from '../../Api'; +import { Domain } from '../../Api/idmsvc'; const domain: Domain = { domain_name: 'mydomain.test', diff --git a/src/Components/ConfirmDeleteDomain/ConfirmDeleteDomain.tsx b/src/Components/ConfirmDeleteDomain/ConfirmDeleteDomain.tsx index c792177..2395707 100644 --- a/src/Components/ConfirmDeleteDomain/ConfirmDeleteDomain.tsx +++ b/src/Components/ConfirmDeleteDomain/ConfirmDeleteDomain.tsx @@ -1,7 +1,7 @@ import { Button, Modal } from '@patternfly/react-core'; import './ConfirmDeleteDomain.scss'; import React from 'react'; -import { Domain } from '../../Api/api'; +import { Domain } from '../../Api/idmsvc'; interface ConfirmDeleteDomainProps { domain?: Domain; diff --git a/src/Components/DomainList/DomainList.tsx b/src/Components/DomainList/DomainList.tsx index a049f01..eb7142a 100644 --- a/src/Components/DomainList/DomainList.tsx +++ b/src/Components/DomainList/DomainList.tsx @@ -3,7 +3,7 @@ import './DomainList.scss'; import { Fragment, useContext, useState } from 'react'; import React from 'react'; -import { Domain, DomainType, ResourcesApiFactory } from '../../Api/api'; +import { Domain, DomainType, ResourcesApiFactory } from '../../Api/idmsvc'; import { useNavigate } from 'react-router-dom'; import { AppContext, AppContextType } from '../../AppContext'; import { Button } from '@patternfly/react-core'; diff --git a/src/Routes/DefaultPage/DefaultPage.tsx b/src/Routes/DefaultPage/DefaultPage.tsx index c028405..ce04690 100644 --- a/src/Routes/DefaultPage/DefaultPage.tsx +++ b/src/Routes/DefaultPage/DefaultPage.tsx @@ -27,7 +27,7 @@ import { PageHeader, PageHeaderTitle } from '@redhat-cloud-services/frontend-com import './DefaultPage.scss'; import Section from '@redhat-cloud-services/frontend-components/Section'; -import { Domain, ResourcesApiFactory } from '../../Api/api'; +import { Domain, ResourcesApiFactory } from '../../Api/idmsvc'; import { DomainList } from '../../Components/DomainList/DomainList'; import { AppContext } from '../../AppContext'; diff --git a/src/Routes/DetailPage/Components/DetailGeneral/DetailGeneral.tsx b/src/Routes/DetailPage/Components/DetailGeneral/DetailGeneral.tsx index f03f178..54bc719 100644 --- a/src/Routes/DetailPage/Components/DetailGeneral/DetailGeneral.tsx +++ b/src/Routes/DetailPage/Components/DetailGeneral/DetailGeneral.tsx @@ -15,7 +15,7 @@ import { } from '@patternfly/react-core'; import React from 'react'; import { useState } from 'react'; -import { Domain, ResourcesApiFactory } from '../../../../Api'; +import { Domain, ResourcesApiFactory } from '../../../../Api/idmsvc'; import useNotification from '../../../../Hooks/useNotification'; import OutlinedQuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/outlined-question-circle-icon'; import PencilAltIcon from '@patternfly/react-icons/dist/esm/icons/pencil-alt-icon'; diff --git a/src/Routes/DetailPage/Components/DetailServers/DetailServers.tsx b/src/Routes/DetailPage/Components/DetailServers/DetailServers.tsx index 9ea6cd1..579a7b0 100644 --- a/src/Routes/DetailPage/Components/DetailServers/DetailServers.tsx +++ b/src/Routes/DetailPage/Components/DetailServers/DetailServers.tsx @@ -1,6 +1,6 @@ import { Flex, FlexItem, Stack, StackItem, TextInputGroupUtilities } from '@patternfly/react-core'; import React from 'react'; -import { Domain, DomainIpaServer } from '../../../../Api'; +import { Domain, DomainIpaServer } from '../../../../Api/idmsvc'; import { Table, Tbody, Td, Th, ThProps, Thead, Tr } from '@patternfly/react-table'; interface DetailServersProps { diff --git a/src/Routes/DetailPage/DetailPage.tsx b/src/Routes/DetailPage/DetailPage.tsx index c32715d..a18ae70 100644 --- a/src/Routes/DetailPage/DetailPage.tsx +++ b/src/Routes/DetailPage/DetailPage.tsx @@ -6,7 +6,7 @@ import { Dropdown, DropdownItem, KebabToggle } from '@patternfly/react-core/depr import { PageHeader, PageHeaderTitle } from '@redhat-cloud-services/frontend-components/PageHeader'; import './DetailPage.scss'; -import { Domain, ResourcesApiFactory } from '../../Api/api'; +import { Domain, ResourcesApiFactory } from '../../Api/idmsvc'; import { AppContext } from '../../AppContext'; import { DetailGeneral } from './Components/DetailGeneral/DetailGeneral'; import { DetailServers } from './Components/DetailServers/DetailServers'; diff --git a/src/Routes/DetailPage/detailNotifications.tsx b/src/Routes/DetailPage/detailNotifications.tsx index 028037c..ea9a6b6 100644 --- a/src/Routes/DetailPage/detailNotifications.tsx +++ b/src/Routes/DetailPage/detailNotifications.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { Domain } from '../../Api/api'; +import { Domain } from '../../Api/idmsvc'; import { NotificationPayload } from '../../Hooks/useNotification'; export const buildDescriptionEditSuccessNotification = (): NotificationPayload => { diff --git a/src/Routes/WizardPage/Components/PagePreparation/PagePreparation.tsx b/src/Routes/WizardPage/Components/PagePreparation/PagePreparation.tsx index e086290..dc11760 100644 --- a/src/Routes/WizardPage/Components/PagePreparation/PagePreparation.tsx +++ b/src/Routes/WizardPage/Components/PagePreparation/PagePreparation.tsx @@ -3,7 +3,7 @@ import ExternalLinkAltIcon from '@patternfly/react-icons/dist/esm/icons/external import { Alert, Button, ClipboardCopy, Form, FormGroup, TextContent, Title } from '@patternfly/react-core'; import './PagePreparation.scss'; -import { ResourcesApiFactory } from '../../../../Api'; +import { ResourcesApiFactory } from '../../../../Api/idmsvc'; import { AppContext } from '../../../../AppContext'; /** Represent the properties for PagePreparation component. */ diff --git a/src/Routes/WizardPage/Components/PageReview/PageReview.tsx b/src/Routes/WizardPage/Components/PageReview/PageReview.tsx index 0bcca66..b832f45 100644 --- a/src/Routes/WizardPage/Components/PageReview/PageReview.tsx +++ b/src/Routes/WizardPage/Components/PageReview/PageReview.tsx @@ -24,7 +24,7 @@ import { } from '@patternfly/react-core'; import './PageReview.scss'; -import { Domain, DomainIpaServer } from '../../../../Api/api'; +import { Domain, DomainIpaServer } from '../../../../Api/idmsvc'; import { Table /* data-codemods */, Tbody, Td, Th, Thead, Tr } from '@patternfly/react-table'; /** diff --git a/src/Routes/WizardPage/Components/PageServiceRegistration/PageServiceRegistration.tsx b/src/Routes/WizardPage/Components/PageServiceRegistration/PageServiceRegistration.tsx index 3a23590..04c59e3 100644 --- a/src/Routes/WizardPage/Components/PageServiceRegistration/PageServiceRegistration.tsx +++ b/src/Routes/WizardPage/Components/PageServiceRegistration/PageServiceRegistration.tsx @@ -3,7 +3,7 @@ import { Alert, Button, ClipboardCopy, Flex, FlexItem, Form, TextContent, Title import './PageServiceRegistration.scss'; import VerifyRegistry, { VerifyState } from '../VerifyRegistry/VerifyRegistry'; -import { Domain } from '../../../../Api'; +import { Domain } from '../../../../Api/idmsvc'; /** * Represents the properties accepted by the @{link PageServiceRegistration} component. diff --git a/src/Routes/WizardPage/Components/VerifyRegistry/VerifyRegistry.tsx b/src/Routes/WizardPage/Components/VerifyRegistry/VerifyRegistry.tsx index 31c075e..27309fd 100644 --- a/src/Routes/WizardPage/Components/VerifyRegistry/VerifyRegistry.tsx +++ b/src/Routes/WizardPage/Components/VerifyRegistry/VerifyRegistry.tsx @@ -8,7 +8,7 @@ import { PendingIcon } from '@patternfly/react-icons/dist/esm/icons/pending-icon import { ExternalLinkAltIcon } from '@patternfly/react-icons/dist/esm/icons/external-link-alt-icon'; import './VerifyRegistry.scss'; -import { Domain, ResourcesApiFactory } from '../../../../Api'; +import { Domain, ResourcesApiFactory } from '../../../../Api/idmsvc'; /* Common definitions */ diff --git a/src/Routes/WizardPage/WizardPage.tsx b/src/Routes/WizardPage/WizardPage.tsx index 9b41a39..4625343 100644 --- a/src/Routes/WizardPage/WizardPage.tsx +++ b/src/Routes/WizardPage/WizardPage.tsx @@ -14,7 +14,7 @@ import { PageHeader, PageHeaderTitle } from '@redhat-cloud-services/frontend-com import './WizardPage.scss'; import { Link, useNavigate } from 'react-router-dom'; -import { Domain, ResourcesApiFactory } from '../../Api/api'; +import { Domain, ResourcesApiFactory } from '../../Api/idmsvc'; import { AppContext } from '../../AppContext'; import { VerifyState } from './Components/VerifyRegistry/VerifyRegistry'; import useNotification from '../../Hooks/useNotification';