Skip to content

Commit 8e0cf7f

Browse files
author
David Hasani
committed
change build system form
1 parent 81e594b commit 8e0cf7f

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

packages/core/src/amazonqGumby/chat/controller/controller.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,8 @@ export class GumbyController {
334334

335335
await processTransformFormInput(pathToProject, fromJDKVersion, toJDKVersion)
336336

337+
this.messenger.sendProjectSelectionMessage(projectName, fromJDKVersion, toJDKVersion, message.tabID)
338+
337339
// at this point, buildSystems is either [Maven], [Gradle], or [Maven, Gradle]
338340
const buildSystems = await checkBuildSystem(pathToProject)
339341
let selectedBuildSystem = undefined
@@ -346,27 +348,14 @@ export class GumbyController {
346348
}
347349
getLogger().info(`Selected project uses build system: ${selectedBuildSystem}`)
348350
transformByQState.setBuildSystem(selectedBuildSystem)
349-
this.messenger.sendProjectSelectionMessage(
350-
projectName,
351-
fromJDKVersion,
352-
toJDKVersion,
353-
selectedBuildSystem,
354-
message.tabID
355-
)
356351
await this.validateBuildWithPromptOnError(message)
357352
}
358353

359354
private async handleBuildSystemForm(message: any) {
360355
const selectedBuildSystem: BuildSystem = message.formSelectedValues['GumbyTransformBuildSystemForm']
361356
getLogger().info(`Selected project uses Maven and Gradle; user selected build system: ${selectedBuildSystem}`)
362357
transformByQState.setBuildSystem(selectedBuildSystem)
363-
this.messenger.sendProjectSelectionMessage(
364-
transformByQState.getProjectName(),
365-
transformByQState.getSourceJDKVersion()!,
366-
transformByQState.getTargetJDKVersion(),
367-
selectedBuildSystem,
368-
message.tabID
369-
)
358+
this.messenger.sendBuildSystemSelectionMessage(selectedBuildSystem, message.tabID)
370359
// this message obj is from the build system form, not the project selection form,
371360
// which is fine since validateBuildWithPromptOnError just needs the tab ID here
372361
await this.validateBuildWithPromptOnError(message)

packages/core/src/amazonqGumby/chat/controller/messenger/messenger.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,6 @@ export class Messenger {
458458
projectName: string,
459459
fromJDKVersion: JDKVersion,
460460
toJDKVersion: JDKVersion,
461-
buildSystem: BuildSystem,
462461
tabID: any
463462
) {
464463
const message = `### Transformation details
@@ -468,7 +467,17 @@ export class Messenger {
468467
| **Project** | ${projectName} |
469468
| **Source JDK version** | ${fromJDKVersion} |
470469
| **Target JDK version** | ${toJDKVersion} |
471-
| **Build system** | ${buildSystem} |
470+
`
471+
472+
this.dispatcher.sendChatMessage(new ChatMessage({ message, messageType: 'prompt' }, tabID))
473+
}
474+
475+
public sendBuildSystemSelectionMessage(buildSystem: BuildSystem, tabID: any) {
476+
const message = `### Transformation details
477+
-------------
478+
| | |
479+
| :------------------- | -------: |
480+
| **Build system** | ${buildSystem} |
472481
`
473482

474483
this.dispatcher.sendChatMessage(new ChatMessage({ message, messageType: 'prompt' }, tabID))

0 commit comments

Comments
 (0)