Skip to content

Commit 7507bd6

Browse files
committed
chore: parsing value added
1 parent 93ca40a commit 7507bd6

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/components/ciConfig/CIConfig.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ export default function CIConfig({
7171
const sourceConfigMaterial = sourceConfig.material?.map((material: MaterialOptionType) => {
7272
return {
7373
...material,
74-
label: material?.name,
75-
value: material?.id,
76-
startIcon: getGitProviderIcon(material.url),
74+
label: material?.name || '',
75+
value: material?.id || '',
76+
startIcon: getGitProviderIcon(material.url) || '',
7777
}
7878
})
7979
_sourceConfig.material = sourceConfigMaterial

src/components/ciConfig/CIConfigForm.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,20 @@ export default function CIConfigForm({
7575
: sourceConfig.material[0]
7676

7777
const getParsedCurrentMaterial = (material?): SelectedGitMaterialType => {
78-
const _currentMaterial: SelectedGitMaterialType = {
79-
...(material ? material : currentMaterial),
80-
value: currentMaterial.checkoutPath,
81-
label: currentMaterial.name,
82-
startIcon: getGitProviderIcon(currentMaterial.url),
78+
const _currentMaterial = {
79+
...material,
80+
name: material?.name || currentMaterial.name,
81+
url: material?.url || currentMaterial.url,
82+
value: material?.checkoutPath || currentMaterial.checkoutPath,
83+
label: material?.name || currentMaterial.name,
84+
startIcon: getGitProviderIcon(material?.url || currentMaterial.url),
8385
}
8486
return _currentMaterial
8587
}
8688

8789
const getParsedSourceConfig = (): SourceConfigType => {
8890
const _sourceConfig = { ...sourceConfig }
89-
_sourceConfig.material = _sourceConfig.material.map((_material) => {
90-
return getParsedCurrentMaterial(_material)
91-
})
91+
_sourceConfig.material = _sourceConfig.material.map(getParsedCurrentMaterial)
9292
return _sourceConfig
9393
}
9494

0 commit comments

Comments
 (0)