Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions src/Pages/App/CreateAppModal/UpdateTemplateConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,19 @@ const UpdateTemplateConfig = ({
}

const handleCIConfigParentStateUpdate: CIConfigProps['setParentState'] = (updatedParentStateOrHandler) => {
const {
ciConfig: { dockerRegistry, dockerRepository },
} = updatedParentStateOrHandler
if (updatedParentStateOrHandler?.ciConfig) {
const {
ciConfig: { dockerRegistry, dockerRepository },
} = updatedParentStateOrHandler

handleFormStateChange({
action: CreateAppFormStateActionType.updateBuildConfiguration,
value: {
dockerRegistry,
dockerRepository,
},
})
handleFormStateChange({
action: CreateAppFormStateActionType.updateBuildConfiguration,
value: {
dockerRegistry,
dockerRepository,
},
})
}
}

const handleGitMaterialsChange: MaterialListProps['handleGitMaterialsChange'] = (updatedGitMaterial, isError) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const GitInfoMaterial = ({
)
// Not added source not configured check here since ideally this should not be even called at that moment and we are not adding a new material

if (!newSelectedMaterialItem.result.length) {
if (!newSelectedMaterialItem.result?.length) {
throw new Error('Unable to fetch material details')
}

Expand Down Expand Up @@ -209,17 +209,17 @@ const GitInfoMaterial = ({
updatedMaterialKeys.history = [
{
commitURL: selectedMaterial.gitURL
? createGitCommitUrl(selectedMaterial.gitURL, commitHistoryResult.Commit)
? createGitCommitUrl(selectedMaterial.gitURL, commitHistoryResult?.Commit)
: '',
commit: commitHistoryResult.Commit || '',
author: commitHistoryResult.Author || '',
date: commitHistoryResult.Date ? handleUTCTime(commitHistoryResult.Date, false) : '',
message: commitHistoryResult.Message || '',
changes: commitHistoryResult.Changes || [],
commit: commitHistoryResult?.Commit || '',
author: commitHistoryResult?.Author || '',
date: commitHistoryResult?.Date ? handleUTCTime(commitHistoryResult.Date, false) : '',
message: commitHistoryResult?.Message || '',
changes: commitHistoryResult?.Changes || [],
showChanges: true,
webhookData: commitHistoryResult.WebhookData,
isSelected: !commitHistoryResult.Excluded,
excluded: commitHistoryResult.Excluded,
webhookData: commitHistoryResult?.WebhookData,
isSelected: !commitHistoryResult?.Excluded,
excluded: commitHistoryResult?.Excluded,
},
]

Expand Down
Loading