Skip to content

Commit

Permalink
fix: Allow user to add impact in object in dx config file
Browse files Browse the repository at this point in the history
  • Loading branch information
adelkahomolova committed Sep 19, 2019
1 parent 70f4c9c commit 22e1577
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/scanner/Scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,14 @@ export class Scanner {

const reportString = this.reporter.report(
relevantPractices.map((p) => {
const impact = p.componentContext.configProvider.getOverridenPractice(p.practice.getMetadata().id);
const config = p.componentContext.configProvider.getOverridenPractice(p.practice.getMetadata().id);

let impact;
if (typeof config === 'string') {
impact = config;
} else if (config && 'impact' in config) {
impact = config.impact;
}

return {
practice: {
Expand Down
1 change: 0 additions & 1 deletion src/scanner/ScannerUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export class ScannerUtils {
*/
static isFulfilled(practice: IPracticeWithMetadata, evaluatedPractices: PracticeWithContext[]): boolean {
const practiceMetadata = practice.getMetadata();
// console.log(practiceMetadata.name, 'name');
if (!practiceMetadata.dependsOn) return true;

for (const evaluation of _.keys(practiceMetadata.dependsOn)) {
Expand Down

0 comments on commit 22e1577

Please sign in to comment.