+
+ );
+};
+
+/**
+ * Represents the propoerties for PageReviewIpaServersBody.
+ */
+interface PageReviewIpaServersProps {
+ /** The list of ipa servers associated to the rhel-idm. */
+ servers?: DomainIpaServer[];
+}
+
+/**
+ * Represents the body which shows the IPA server list.
+ * @param props Contains the list of servers at `servers`.
+ * @returns the body for the list of servers to use in the
+ * `TableComposable` component.
+ * @see {@link PageReviewIpaServersProps} about the properties.
+ * @see {@link PageReviewIpa} about the parent component.
+ */
+const PageReviewIpaServersBody = (props: PageReviewIpaServersProps) => {
+ return (
+
+ {props.servers?.map((server) => {
+ return (
+
+
{server.fqdn}
+
{server.subscription_manager_id}
+
+ );
+ })}
+
+ );
+};
- const onHostJoinEnabledChange = () => {
- setIsHostJoinEnabled(!isHostJoinEnabled);
- };
+/**
+ * Represent the table which list the IPA servers.
+ * @param props has the `servers` property which contains the
+ * list of servers that belongs to this rhel-idm domain.
+ * @returns the composable table with the header and body.
+ * @see {@link PageReviewIpaServersProps} about the properties.
+ * @see {@link PageReviewIpa} about the parent component.
+ */
+const PageReviewIpaServers = (props: PageReviewIpaServersProps) => {
+ return (
+ <>
+
+
+
+
+ >
+ );
+};
+/**
+ * This component represent the overview information to be
+ * presented for an rhel-idm domain service.
+ * @param props the `domain` property expect a 'rhel-idm' type.
+ * @returns the overview details for a rhel-idm domain service.
+ * @see {@link PageReviewProps} about the properties.
+ * @see {@link PageReview} about the parent component.
+ */
+const PageReviewIpa = (props: PageReviewProps) => {
return (
-
+ <>
= (props) => {
}}
>
- Identity and access management solution
- {domain.domain_type === 'rhel-idm' &&
RHEL IdM (IPA)
}
+ Service type
+ RHEL IdM (IPA)
- Name
- {domain.title}
+ Kerberos realm
+ {props.domain['rhel-idm']?.realm_name}
- Description
- {domain.description}
+ Red Hat IdM/IPA servers
+
+
+
- DNS Domain/Servers
-
- {/* TODO Navigator panel */}
- 1-3 of 3 v < >
-
+ Service name
+ {props.domain.title}
+
+
+ Service description
+ {props.domain.description}
-
- Allow host domain join
-
-
+ Domain join on launch
+
+ {props.domain.auto_enrollment_enabled ? 'Enable upon finishing registration' : 'Not enable upon finishing registration'}
-
+ >
+ );
+};
+
+/**
+ * Represent the properties for the PageReview component.
+ */
+interface PageReviewProps {
+ /** The ephemeral domain information, including the detailed
+ * information that the user have control about. */
+ domain: Domain;
+}
+
+/**
+ * It represents the Page review wizard, and it provide different view
+ * depending on the domain_type value.
+ * @param props provide the `domain` value to be rendered.
+ * @returns the render view for the domain overview.
+ * @see {@link PageReviewProps} to know about the properties.
+ * @see {@link WizardPage} about the parent component.
+ * @public
+ */
+const PageReview = (props: PageReviewProps) => {
+ return (
+ <>
+
+ Review
+
+ {props.domain.domain_type === 'rhel-idm' && }
+ >
);
};
diff --git a/src/Routes/WizardPage/WizardPage.tsx b/src/Routes/WizardPage/WizardPage.tsx
index 781f3f8..2eb48f7 100644
--- a/src/Routes/WizardPage/WizardPage.tsx
+++ b/src/Routes/WizardPage/WizardPage.tsx
@@ -23,22 +23,6 @@ const PageServiceRegistration = React.lazy(() => import('./Components/PageServic
const PageServiceDetails = React.lazy(() => import('./Components/PageServiceDetails/PageServiceDetails'));
const PageReview = React.lazy(() => import('./Components/PageReview/PageReview'));
-const initialDomain: Domain = {
- domain_id: '14f3a7a4-32c5-11ee-b40f-482ae3863d30',
- domain_name: 'mydomain.example',
- auto_enrollment_enabled: true,
- title: 'My Domain',
- description: 'My Domain Description',
- domain_type: 'rhel-idm',
- 'rhel-idm': {
- realm_name: '',
- realm_domains: [],
- ca_certs: [],
- servers: [],
- locations: [],
- },
-};
-
/**
* Wizard page to register a new domain into the service.
* @see {@link PagePreparation} about the preparation page.
@@ -110,6 +94,23 @@ const WizardPage = () => {
// appContext.wizard.setUUID('');
// }
}
+ if (id === 4) {
+ try {
+ if (domain.domain_id) {
+ const response = await resources_api.updateDomainUser(domain.domain_id, {
+ title: domain.title,
+ description: domain.description,
+ auto_enrollment_enabled: domain.auto_enrollment_enabled,
+ });
+ if (response.status >= 400) {
+ // TODO show-up notification with error message
+ }
+ }
+ } catch (error) {
+ // TODO show-up notification with error message
+ console.log('error noNextPage: ' + error);
+ }
+ }
};
const initCanJumpPage1 = true;
@@ -194,8 +195,8 @@ const WizardPage = () => {
{
id: 4,
name: 'Review',
- // FIXME Pass here the 'registering.domain' field from the context
- component: ,
+ component: ,
+ nextButtonText: 'Finish',
canJumpTo: canJumpPage4,
},
];