Skip to content

Commit

Permalink
HMS-2590 fix: align wizard page 2 and 3
Browse files Browse the repository at this point in the history
Align the appearance for the pages 2 and 3, and add the VerifyRegistry
component to the page 2.

Signed-off-by: Alejandro Visiedo <[email protected]>
  • Loading branch information
avisiedo committed Oct 1, 2023
1 parent 7bc38bc commit abd8204
Show file tree
Hide file tree
Showing 5 changed files with 340 additions and 188 deletions.
212 changes: 106 additions & 106 deletions src/Api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -970,56 +970,6 @@ export const ActionsApiAxiosParamCreator = function (configuration?: Configurati
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = serializeDataIfNeeded(updateDomainAgentRequest, localVarRequestOptions, configuration);

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Update the rhel-idm domain information.
* @summary Update domain information by user.
* @param {string} uuid The uuid that identify the domain.
* @param {UpdateDomainUserRequest} updateDomainUserRequest Information for an IPA domain so it is updated from the ipa-hcc agent.
* @param {string} [xRhInsightsRequestId] Request id for distributed tracing.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateDomainUser: async (
uuid: string,
updateDomainUserRequest: UpdateDomainUserRequest,
xRhInsightsRequestId?: string,
options: AxiosRequestConfig = {}
): Promise<RequestArgs> => {
// verify required parameter 'uuid' is not null or undefined
assertParamExists('updateDomainUser', 'uuid', uuid);
// verify required parameter 'updateDomainUserRequest' is not null or undefined
assertParamExists('updateDomainUser', 'updateDomainUserRequest', updateDomainUserRequest);
const localVarPath = `/domains/{uuid}`.replace(`{${'uuid'}}`, encodeURIComponent(String(uuid)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}

const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options };
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;

// authentication x-rh-identity required
await setApiKeyToObject(localVarHeaderParameter, 'X-Rh-Identity', configuration);

if (xRhInsightsRequestId != null) {
localVarHeaderParameter['X-Rh-Insights-Request-Id'] = String(xRhInsightsRequestId);
}

localVarHeaderParameter['Content-Type'] = 'application/json';

setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = serializeDataIfNeeded(updateDomainUserRequest, localVarRequestOptions, configuration);

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
Expand Down Expand Up @@ -1081,24 +1031,6 @@ export const ActionsApiFp = function (configuration?: Configuration) {
);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Update the rhel-idm domain information.
* @summary Update domain information by user.
* @param {string} uuid The uuid that identify the domain.
* @param {UpdateDomainUserRequest} updateDomainUserRequest Information for an IPA domain so it is updated from the ipa-hcc agent.
* @param {string} [xRhInsightsRequestId] Request id for distributed tracing.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updateDomainUser(
uuid: string,
updateDomainUserRequest: UpdateDomainUserRequest,
xRhInsightsRequestId?: string,
options?: AxiosRequestConfig
): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DomainResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateDomainUser(uuid, updateDomainUserRequest, xRhInsightsRequestId, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
};
};

Expand Down Expand Up @@ -1149,23 +1081,6 @@ export const ActionsApiFactory = function (configuration?: Configuration, basePa
.updateDomainAgent(uuid, xRhIdmVersion, updateDomainAgentRequest, xRhInsightsRequestId, options)
.then((request) => request(axios, basePath));
},
/**
* Update the rhel-idm domain information.
* @summary Update domain information by user.
* @param {string} uuid The uuid that identify the domain.
* @param {UpdateDomainUserRequest} updateDomainUserRequest Information for an IPA domain so it is updated from the ipa-hcc agent.
* @param {string} [xRhInsightsRequestId] Request id for distributed tracing.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateDomainUser(
uuid: string,
updateDomainUserRequest: UpdateDomainUserRequest,
xRhInsightsRequestId?: string,
options?: any
): AxiosPromise<DomainResponse> {
return localVarFp.updateDomainUser(uuid, updateDomainUserRequest, xRhInsightsRequestId, options).then((request) => request(axios, basePath));
},
};
};

Expand Down Expand Up @@ -1215,27 +1130,6 @@ export class ActionsApi extends BaseAPI {
.updateDomainAgent(uuid, xRhIdmVersion, updateDomainAgentRequest, xRhInsightsRequestId, options)
.then((request) => request(this.axios, this.basePath));
}

/**
* Update the rhel-idm domain information.
* @summary Update domain information by user.
* @param {string} uuid The uuid that identify the domain.
* @param {UpdateDomainUserRequest} updateDomainUserRequest Information for an IPA domain so it is updated from the ipa-hcc agent.
* @param {string} [xRhInsightsRequestId] Request id for distributed tracing.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ActionsApi
*/
public updateDomainUser(
uuid: string,
updateDomainUserRequest: UpdateDomainUserRequest,
xRhInsightsRequestId?: string,
options?: AxiosRequestConfig
) {
return ActionsApiFp(this.configuration)
.updateDomainUser(uuid, updateDomainUserRequest, xRhInsightsRequestId, options)
.then((request) => request(this.axios, this.basePath));
}
}

/**
Expand Down Expand Up @@ -1510,6 +1404,56 @@ export const ResourcesApiAxiosParamCreator = function (configuration?: Configura
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = serializeDataIfNeeded(registerDomainRequest, localVarRequestOptions, configuration);

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Update the rhel-idm domain information.
* @summary Update domain information by user.
* @param {string} uuid The uuid that identify the domain.
* @param {UpdateDomainUserRequest} updateDomainUserRequest Information for an IPA domain so it is updated from the ipa-hcc agent.
* @param {string} [xRhInsightsRequestId] Request id for distributed tracing.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateDomainUser: async (
uuid: string,
updateDomainUserRequest: UpdateDomainUserRequest,
xRhInsightsRequestId?: string,
options: AxiosRequestConfig = {}
): Promise<RequestArgs> => {
// verify required parameter 'uuid' is not null or undefined
assertParamExists('updateDomainUser', 'uuid', uuid);
// verify required parameter 'updateDomainUserRequest' is not null or undefined
assertParamExists('updateDomainUser', 'updateDomainUserRequest', updateDomainUserRequest);
const localVarPath = `/domains/{uuid}`.replace(`{${'uuid'}}`, encodeURIComponent(String(uuid)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}

const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options };
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;

// authentication x-rh-identity required
await setApiKeyToObject(localVarHeaderParameter, 'X-Rh-Identity', configuration);

if (xRhInsightsRequestId != null) {
localVarHeaderParameter['X-Rh-Insights-Request-Id'] = String(xRhInsightsRequestId);
}

localVarHeaderParameter['Content-Type'] = 'application/json';

setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = serializeDataIfNeeded(updateDomainUserRequest, localVarRequestOptions, configuration);

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
Expand Down Expand Up @@ -1631,6 +1575,24 @@ export const ResourcesApiFp = function (configuration?: Configuration) {
);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Update the rhel-idm domain information.
* @summary Update domain information by user.
* @param {string} uuid The uuid that identify the domain.
* @param {UpdateDomainUserRequest} updateDomainUserRequest Information for an IPA domain so it is updated from the ipa-hcc agent.
* @param {string} [xRhInsightsRequestId] Request id for distributed tracing.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updateDomainUser(
uuid: string,
updateDomainUserRequest: UpdateDomainUserRequest,
xRhInsightsRequestId?: string,
options?: AxiosRequestConfig
): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DomainResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateDomainUser(uuid, updateDomainUserRequest, xRhInsightsRequestId, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
};
};

Expand Down Expand Up @@ -1717,6 +1679,23 @@ export const ResourcesApiFactory = function (configuration?: Configuration, base
.registerDomain(xRhIdmRegistrationToken, xRhIdmVersion, registerDomainRequest, xRhInsightsRequestId, options)
.then((request) => request(axios, basePath));
},
/**
* Update the rhel-idm domain information.
* @summary Update domain information by user.
* @param {string} uuid The uuid that identify the domain.
* @param {UpdateDomainUserRequest} updateDomainUserRequest Information for an IPA domain so it is updated from the ipa-hcc agent.
* @param {string} [xRhInsightsRequestId] Request id for distributed tracing.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateDomainUser(
uuid: string,
updateDomainUserRequest: UpdateDomainUserRequest,
xRhInsightsRequestId?: string,
options?: any
): AxiosPromise<DomainResponse> {
return localVarFp.updateDomainUser(uuid, updateDomainUserRequest, xRhInsightsRequestId, options).then((request) => request(axios, basePath));
},
};
};

Expand Down Expand Up @@ -1824,4 +1803,25 @@ export class ResourcesApi extends BaseAPI {
.registerDomain(xRhIdmRegistrationToken, xRhIdmVersion, registerDomainRequest, xRhInsightsRequestId, options)
.then((request) => request(this.axios, this.basePath));
}

/**
* Update the rhel-idm domain information.
* @summary Update domain information by user.
* @param {string} uuid The uuid that identify the domain.
* @param {UpdateDomainUserRequest} updateDomainUserRequest Information for an IPA domain so it is updated from the ipa-hcc agent.
* @param {string} [xRhInsightsRequestId] Request id for distributed tracing.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ResourcesApi
*/
public updateDomainUser(
uuid: string,
updateDomainUserRequest: UpdateDomainUserRequest,
xRhInsightsRequestId?: string,
options?: AxiosRequestConfig
) {
return ResourcesApiFp(this.configuration)
.updateDomainUser(uuid, updateDomainUserRequest, xRhInsightsRequestId, options)
.then((request) => request(this.axios, this.basePath));
}
}
9 changes: 8 additions & 1 deletion src/Routes/DefaultPage/DefaultPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import './DefaultPage.scss';
import Section from '@redhat-cloud-services/frontend-components/Section';
import { Domain, ResourcesApiFactory } from '../../Api/api';
import { DomainList } from '../../Components/DomainList/DomainList';
import { AppContext } from '../../AppContext';
import { AppContext, IAppContext } from '../../AppContext';

// const SampleComponent = lazy(() => import('../../Components/SampleComponent/sample-component'));

Expand All @@ -54,8 +54,12 @@ const EmptyContent = () => {
// FIXME Update this link in the future
const linkLearnMoreAbout = 'https://access.redhat.com/articles/1586893';
const navigate = useNavigate();
const appContext = useContext<IAppContext>(AppContext);

const handleOpenWizard = () => {
appContext.wizard.setDomain({ domain_id: '', title: '', description: '' } as Domain);
appContext.wizard.setToken('');
appContext.wizard.setRegisteredStatus('initial');
navigate('/domains/wizard', { replace: true });
};

Expand Down Expand Up @@ -149,6 +153,9 @@ const ListContent = () => {
}, [page, perPage, offset]);

const handleOpenWizard = () => {
appContext.wizard.setDomain({ domain_id: '', title: '', description: '' } as Domain);
appContext.wizard.setRegisteredStatus('initial');
appContext.wizard.setToken('');
navigate('/domains/wizard', { replace: true });
};

Expand Down
Loading

0 comments on commit abd8204

Please sign in to comment.