Skip to content

Commit

Permalink
Merge pull request #35 from platformatic/feature/updating-configure-a…
Browse files Browse the repository at this point in the history
…pplication-and-generating

feat: updating configure application
  • Loading branch information
tonysnowboardunderthebridge authored Nov 29, 2023
2 parents a08d920 + 4740bd0 commit 3809471
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
11 changes: 11 additions & 0 deletions src/renderer/src/components/steps/ConfigureApplication.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ const ConfigureApplication = React.forwardRef(({ onNext }, ref) => {
const [validForm, setValidForm] = useState(false)

function onClickGenerateApp () {
addFormData({
configureApplication: {
entrypoint: form.entryPoint,
port: form.port,
logLevel: form.logLevel,
typescript: form.language === TYPESCRIPT,
createGitHubRepository: form.createGitHubRepository,
installGitHubActions: form.installGitHubActions
}
})
onNext()
}

Expand Down Expand Up @@ -212,6 +222,7 @@ const ConfigureApplication = React.forwardRef(({ onNext }, ref) => {
</div>
<div className={`${styles.buttonContainer} ${commonStyles.fullWidth}`}>
<Button
type='button'
disabled={!validForm}
label='Generate App'
onClick={() => onClickGenerateApp()}
Expand Down
18 changes: 16 additions & 2 deletions src/renderer/src/components/steps/GeneratingApplication.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict'
import React from 'react'
import React, { useEffect } from 'react'
import PropTypes from 'prop-types'
import { BorderedBox, Button, Icons } from '@platformatic/ui-components'
import commonStyles from '~/styles/CommonStyles.module.css'
Expand Down Expand Up @@ -130,7 +130,21 @@ function StepCreation ({ step, index, concludedStep, /* startTime = 0, endTime =

const GeneratingApplication = React.forwardRef(({ onClickComplete }, ref) => {
const globalState = useStackablesStore()
const { formData } = globalState
const { formData, services } = globalState

useEffect(() => {
async function generateApplication () {
try {
console.log('let\'scall createApp')
const obj = { projectName: formData.createApplication.application, services, ...formData.configureApplication }
console.log(`prjectDir: ${formData.createApplication.path}`)
console.log(obj)
} catch (error) {
console.log(`Error on prepareFolder ${error}`)
}
}
generateApplication()
}, [])

return (
<div className={`${commonStyles.largeFlexBlock} ${commonStyles.halfWidth}`} ref={ref}>
Expand Down

0 comments on commit 3809471

Please sign in to comment.