Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
siewer committed Aug 5, 2024
1 parent 17f440d commit 9fe5f93
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/app/pages/show-asset/asset-cicd/asset-cicd.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,28 @@ export class AssetCicdComponent implements OnInit {
}

showConfig() {
// Check if sca_name is null and update it if necessary
if (this.config.code.sca_name === null) {
this.config.code.sca_name = '# Fill with proper sca_name, create ling between Repo and SCA Project. SCA_NAME can be filled only on root elements or on all childs apps';
this.config.code.sca_name = '# Fill with proper sca_name';
}
for (const app of this.config.code.apps) {
if (app.sca_name === null ) {
app.sca_name = '# Fill it';

// Check if apps array is empty or contains elements
if (this.config.code.apps.length === 0) {
// Remove the apps attribute if the array is empty
delete this.config.code.apps;
} else {
// Iterate over apps array and update sca_name if necessary
for (const app of this.config.code.apps) {
if (app.sca_name === null) {
app.sca_name = '# Fill it';
}
}
}

// Convert the updated config object to YAML
this.yamlString = this.yamlService.convertObjectToYaml(this.config);

// Open the dialog to show the config
this.dialogService.open(this.showConfigTemplate);
}
}

0 comments on commit 9fe5f93

Please sign in to comment.