Skip to content

Commit

Permalink
Merge pull request #41 from platformatic/bugfix/multiple-templates
Browse files Browse the repository at this point in the history
feat: using multiple templates
  • Loading branch information
tonysnowboardunderthebridge authored Nov 30, 2023
2 parents 30ab8b8 + 1b071b1 commit 1970015
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/renderer/src/components/steps/PrepareFolder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const PrepareFolder = React.forwardRef(({ onNext }, ref) => {
onClick={() => onClickCopyLogs()}
color={WHITE}
backgroundColor={RICH_BLACK}
classes={`${commonStyles.buttonPadding} cy-action-next`}
classes={`${commonStyles.buttonPadding} cy-action-donwload-logs`}
/>
{folderPreparedError
? <Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ function ConfigureEnvVarsTemplateAndPlugins ({
const [currentComponent, setCurrentComponent] = useState(<></>)

useEffect(() => {
if (configuredServices !== null) {
if (configuredServices !== null && !serviceSelected) {
setServiceSelected(configuredServices[0])
}
}, [configuredServices])
}, [configuredServices, !serviceSelected])

function handleChangeTemplateEnvVars (event) {
return handleChangeTemplateForm(event, serviceSelected.template, serviceSelected.name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const ConfigureServices = React.forwardRef(({ onNext }, ref) => {

useEffect(() => {
if (services.length > 0) {
const tmpServices = []
let tmpTemplateForms = {}
let tmpTemplateValidations = {}
let tmpTemplateValidForm = {}
Expand Down Expand Up @@ -60,8 +61,9 @@ const ConfigureServices = React.forwardRef(({ onNext }, ref) => {
tmpObj.validForm = tmpTemplateValidForm
tmpObj.updatedAt = new Date().toISOString()
tmpObj.plugins = []
tmpServices.push(tmpObj)
})
setConfiguredServices([...configuredServices, tmpObj])
setConfiguredServices(tmpServices)
}
}, [services])

Expand Down

0 comments on commit 1970015

Please sign in to comment.