Skip to content

Commit 8c375b6

Browse files
liatb-rhsjd78
andauthored
✨ Workflow - retrieve configuration for applications (#2507)
Resolves: #2288 Resolves: https://issues.redhat.com/browse/MTA-5248 🔧 Add Retrieve Configuration Wizard for Applications Summary This PR introduces a new Retrieve Configuration Wizard that enables users to retrieve runtime configurations from source platforms for selected applications. The wizard provides a streamlined two-step process for selecting applications and reviewing configuration retrieval tasks. 🚀 Features Added New Retrieve Configuration Wizard Two-step wizard flow: Application selection → Review & Submit Bulk application selection for configuration retrieval Source platform integration: Automatically connects to application source platforms Task management using configuration discovery taskgroups UI/UX Enhancements Added new "Retrieve configurations" action to applications table bulk actions Added individual application menu item for configuration retrieval Comprehensive form validation with Yup schema Responsive table layout with checkbox selection Clear progress indicators and status messages Internationalization Full translation support for the new wizard Added translation keys for: Actions Dialogs Wizard steps Contextual help text and descriptions 🔧 Technical Implementation New Components Created RetrieveConfigWizard – Main wizard container with form management SetApplications – Application selection step with table interface Review – Configuration review step before submission TaskGroupContext – Context provider for taskgroup state management Integration Points Extended ApplicationsTable component with wizard integration Used existing taskgroup infrastructure for task management Follows wizard patterns established by the analysis wizard Integrated with existing error handling and notification systems Validation & Error Handling Ensures at least one application is selected via form validation Graceful error handling for: Taskgroup operations Applications without source platforms User-friendly error messages and notifications 📁 Files Added/Modified New Files retrieve-config-wizard/retrieve-config-wizard.tsx retrieve-config-wizard/set-applications.tsx retrieve-config-wizard/review.tsx retrieve-config-wizard/schema.ts retrieve-config-wizard/components/TaskGroupContext.tsx retrieve-config-wizard/index.ts Modified Files applications-table.tsx translation.json 🎯 Usage Navigate to the Applications table Select one or more applications (via bulk or individual action) Click "Retrieve configurations" from the actions menu Walk through the wizard: select → review → submit ✅ Testing Considerations Wizard launches correctly from both bulk and individual actions Application selection and deselection works as expected Taskgroup is created and submitted properly Error handling works for: Taskgroup failures Applications lacking source platforms <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added the ability to retrieve runtime configurations for one or multiple applications via a new modal wizard. * Enhanced action menus with a "Retrieve Configurations" option and improved dropdown organization. * Introduced a review step to preview selected applications before retrieving configurations. * Added detailed results display for configuration retrieval tasks showing successes and failures. * **User Interface** * Added new tooltips, dialog messages, and error notifications related to configuration retrieval. * Improved feedback and guidance during the configuration retrieval workflow. * Included localization support for all new UI elements in the configuration retrieval process. * **Bug Fixes** * Resolved duplicate localization entries and improved error messaging for configuration retrieval failures. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Liat Berkovich <[email protected]> Signed-off-by: Scott J Dickerson <[email protected]> Co-authored-by: Scott J Dickerson <[email protected]>
1 parent deaaf51 commit 8c375b6

File tree

11 files changed

+1209
-496
lines changed

11 files changed

+1209
-496
lines changed

client/public/locales/en/translation.json

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@
5151
"override": "Override",
5252
"reset": "Reset",
5353
"review": "Review",
54+
"retrieve": "Retrieve",
55+
"retrieveConfigurations": "Retrieve configurations",
5456
"save": "Save",
5557
"saveAndReview": "Save and review",
58+
"selectAll": "Select all",
5659
"saveAsDraft": "Save as draft",
5760
"selectAll_one": "Select all ({{count}} item)",
5861
"selectAll_other": "Select all ({{count}} items)",
@@ -69,7 +72,6 @@
6972
"view": "View",
7073
"viewErrorReport": "View error report",
7174
"viewArchetypes": "View archetypes",
72-
"retrieveConfigurations": "Retrieve configurations",
7375
"changeSourcePlatform": "Change source platform",
7476
"generateAssets": "Generate assets"
7577
},
@@ -119,6 +121,7 @@
119121
},
120122
"dialog": {
121123
"message": {
124+
"retrieveConfigurations": "Retrieve runtime configurations from source platforms for the selected applications.",
122125
"applicationsBulkDelete": "The selected application(s) will be deleted.",
123126
"TasksBulkCancel": "The selected task(s) will be canceled.",
124127
"delete": "This action cannot be undone.",
@@ -163,6 +166,7 @@
163166
"newStakeholderGroup": "New stakeholder group",
164167
"newTag": "New Tag",
165168
"newTagCategory": "New tag category",
169+
"retrieveConfigurations": "Retrieve configurations",
166170
"update": "Update {{what}}",
167171
"updateArchetype": "Update archetype",
168172
"updateApplication": "Update application",
@@ -207,6 +211,8 @@
207211
"copyAssessmentQuestion": "Copy assessment?",
208212
"couldNotFetchBody": "Resource doesn't exists or you don't have access to it",
209213
"couldNotFetchTitle": "Not available",
214+
"configDiscoveryTaskgroupCreationFailed": "Configuration discovery taskgroup creation failed",
215+
"configDiscoveryTaskgroupSubmitFailed": "Configuration discovery taskgroup submit failed",
210216
"duplicateTag": "A tag with this name already exists. Use a different name.",
211217
"duplicateWave": "The migration wave could not be created due to a conflict with an existing wave. Make sure the name and start/end dates are unique and try again.",
212218
"importErrorCheckDocumentation": "For status Error imports, check the documentation to ensure your file is structured correctly.",
@@ -440,6 +446,7 @@
440446
"name": "Name",
441447
"new": "New",
442448
"none": "None",
449+
"noDescription": "No description available",
443450
"northboundDependencies": "Northbound dependencies",
444451
"notAvailable": "Not available",
445452
"notConnected": "Not connected",
@@ -660,6 +667,30 @@
660667
"advancedAnalysisDetails": "Enable enhanced analysis details to get more information about the analysis."
661668
}
662669
},
670+
"retrieveConfigWizard": {
671+
"selectedCount": "{{count}} of {{total}} applications selected",
672+
"noApplicationsWithSourcePlatforms": "No applications with source platforms selected.",
673+
"noTasksSubmitted": "No tasks were submitted.",
674+
"toast": {
675+
"submittedOk": "Application manifest fetches submitted",
676+
"submittedFailed": "Application manifest fetches failed"
677+
},
678+
"results": {
679+
"title": "Configuration Retrieval Results",
680+
"summary": "Summary of configuration retrieval task submissions.",
681+
"noResults": "No results available.",
682+
"failedSubmissions_one": "Failed Submission",
683+
"failedSubmissions_other": "Failed Submissions ({{count}})",
684+
"successSubmissions_one": "Success Submission",
685+
"successSubmissions_other": "Success Submissions ({{count}})"
686+
},
687+
"review": {
688+
"description_one": "This application is ready to retrieve configurations from its source platform. The application's platform coordinates will be used to connect to the platform and build the application's discovery manifest.",
689+
"description_other": "These applications are ready to retrieve configurations from their source platforms. The applications' platform coordinates will be used to connect to the platform and build the applications' discovery manifests.",
690+
"selectedApplications_one": "Selected application",
691+
"selectedApplications_other": "Selected applications ({{count}})"
692+
}
693+
},
663694
"credentials": {
664695
"delete": {
665696
"application_one": "1 application",

client/src/app/api/models.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ export type TaskState =
328328
| "Postponed"
329329
| "SucceededWithErrors"; // synthetic state for ease-of-use in UI;
330330

331-
export interface Task {
331+
export interface Task<DataType = TaskData> {
332332
id: number;
333333
createUser?: string;
334334
updateUser?: string;
@@ -343,8 +343,9 @@ export interface Task {
343343
priority?: number;
344344
policy?: TaskPolicy;
345345
ttl?: TTL;
346-
data?: TaskData;
346+
data?: DataType;
347347
application: Ref;
348+
platform?: Ref;
348349
bucket?: Ref;
349350
pod?: string;
350351
retries?: number;
@@ -356,6 +357,18 @@ export interface Task {
356357
attached?: TaskAttachment[];
357358
}
358359

360+
export type EmptyTaskData = Record<string, never>;
361+
362+
export interface ApplicationTask<DataType>
363+
extends Omit<Task<DataType>, "application" | "platform"> {
364+
application: Ref;
365+
}
366+
367+
export interface PlatformTask<DataType>
368+
extends Omit<Task<DataType>, "application" | "platform"> {
369+
platform: Ref;
370+
}
371+
359372
/** A smaller version of `Task` fetched from the report/dashboard endpoint. */
360373
export interface TaskDashboard {
361374
id: number;

client/src/app/api/rest.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,9 +381,9 @@ export const getApplicationSummaryCSV = (id: string) => {
381381
// ---------------------------------------
382382
// Tasks
383383
//
384-
export function getTaskById(id: number): Promise<Task> {
384+
export function getTaskById(id: number) {
385385
return axios
386-
.get(`${TASKS}/${id}`, {
386+
.get<Task>(`${TASKS}/${id}`, {
387387
headers: { ...HEADERS.json },
388388
responseType: "json",
389389
})
@@ -461,8 +461,17 @@ export const getTaskQueue = (addon?: string): Promise<TaskQueue> =>
461461
.get<TaskQueue>(`${TASKS}/report/queue`, { params: { addon } })
462462
.then(({ data }) => data);
463463

464-
export const updateTask = (task: Partial<Task> & { id: number }) =>
465-
axios.patch<Task>(`${TASKS}/${task.id}`, task);
464+
export const createTask = <TaskData, TaskType extends Task<TaskData>>(
465+
task: New<TaskType>
466+
) => axios.post<TaskType>(TASKS, task).then((response) => response.data);
467+
468+
export const updateTask = <TaskData, TaskType extends Task<TaskData>>(
469+
task: Partial<TaskType> & { id: number }
470+
) => axios.patch<TaskType>(`${TASKS}/${task.id}`, task);
471+
472+
export const submitTask = <TaskData, TaskType extends Task<TaskData>>(
473+
task: TaskType
474+
) => axios.put<void>(`${TASKS}/${task.id}/submit`, { id: task.id });
466475

467476
// ---------------------------------------
468477
// Task Groups
@@ -472,7 +481,7 @@ export const createTaskgroup = (obj: New<Taskgroup>) =>
472481

473482
export const submitTaskgroup = (obj: Taskgroup) =>
474483
axios
475-
.put<Taskgroup>(`${TASKGROUPS}/${obj.id}/submit`, obj)
484+
.put<void>(`${TASKGROUPS}/${obj.id}/submit`, obj)
476485
.then((response) => response.data);
477486

478487
export const deleteTaskgroup = (id: number): AxiosPromise =>

0 commit comments

Comments
 (0)