Skip to content

Commit

Permalink
Rename configuration property to match its extended usage
Browse files Browse the repository at this point in the history
  • Loading branch information
bkimminich committed Nov 21, 2021
1 parent d5baf5c commit 275ffe6
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion config.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ challenges:
type: boolean
showMitigations:
type: boolean
showCodeSnippets:
codingChallengesEnabled:
type: string
restrictToTutorialsFirst:
type: boolean
Expand Down
2 changes: 1 addition & 1 deletion config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ challenges:
showSolvedNotifications: true
showHints: true
showMitigations: true
showCodeSnippets: solved # Options: never solved always # TODO Rename into "codingChallengesEnabled" with same options before v13.0.0 release
codingChallengesEnabled: solved # Options: never solved always
restrictToTutorialsFirst: false
overwriteUrlForProductTamperingChallenge: 'https://owasp.slack.com'
xssBonusPayload: '<iframe width="100%" height="166" scrolling="no" frameborder="no" allow="autoplay" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/771984076&color=%23ff5500&auto_play=true&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true"></iframe>'
Expand Down
2 changes: 1 addition & 1 deletion config/mozilla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ application:
encryption: ~
challenges:
showHints: false
showCodeSnippets: never
codingChallengesEnabled: never
xssBonusPayload: '<iframe width="560" height="315" src="https://www.youtube.com/embed/0u9g0LhRkGk" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'
showFeedbackButtons: false
hackingInstructor:
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/Services/configuration.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ interface Config {
showSolvedNotifications: boolean
showHints: boolean
showMitigations: boolean
showCodeSnippets: string
codingChallengesEnabled: string
restrictToTutorialsFirst: boolean
safetyOverride: boolean
overwriteUrlForProductTamperingChallenge: string
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/app/score-board/score-board.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</mat-card-title>
<mat-progress-bar mode="determinate" [color]="'accent'" [value]="percentChallengesSolved"></mat-progress-bar>
</mat-card>
<mat-card *ngIf="showCodeSnippets !== 'never'">
<mat-card *ngIf="codingChallengesEnabled !== 'never'">
<mat-card-title>{{"TITLE_CODING_SCORE" | translate}}
<small class="confirmation">{{percentCodingChallengesSolved}}%</small>
</mat-card-title>
Expand Down Expand Up @@ -185,10 +185,10 @@
</mat-icon>
</button>
</a>
<div [matTooltip]="('SOLVE_HACKING_CHALLENGE' | translate)" [matTooltipDisabled]="!challenge.hasSnippet || showCodeSnippets === 'solved' && challenge.solved || showCodeSnippets === 'always'" matTooltipPosition="above">
<div [matTooltip]="('SOLVE_HACKING_CHALLENGE' | translate)" [matTooltipDisabled]="!challenge.hasSnippet || codingChallengesEnabled === 'solved' && challenge.solved || codingChallengesEnabled === 'always'" matTooltipPosition="above">
<button
*ngIf="challenge.hasSnippet && showCodeSnippets !== 'never'"
[disabled]="showCodeSnippets === 'solved' && !challenge.solved"
*ngIf="challenge.hasSnippet && codingChallengesEnabled !== 'never'"
[disabled]="codingChallengesEnabled === 'solved' && !challenge.solved"
mat-mini-fab
(click)="showCodeSnippet(challenge.key,challenge.name,challenge.codingChallengeStatus)"
[matTooltip]="('LAUNCH_CODING_CHALLENGE' | translate)"
Expand All @@ -208,7 +208,7 @@
</button>
</div>
<button
*ngIf="challenge.key === 'scoreBoardChallenge' && showHackingInstructor && challenge.solved && showCodeSnippets !== 'never' && challenge.codingChallengeStatus < 1"
*ngIf="challenge.key === 'scoreBoardChallenge' && showHackingInstructor && challenge.solved && codingChallengesEnabled !== 'never' && challenge.codingChallengeStatus < 1"
mat-mini-fab color="warn"
(click)="startHackingInstructor('Coding Challenges')"
[matTooltip]="('INFO_HACKING_INSTRUCTOR' | translate)"
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app/score-board/score-board.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class ScoreBoardComponent implements OnInit {
public allowRepeatNotifications: boolean = false
public showChallengeHints: boolean = true
public showVulnerabilityMitigations: boolean = true
public showCodeSnippets: string = 'solved'
public codingChallengesEnabled: string = 'solved'
public showHackingInstructor: boolean = true
public challenges: Challenge[] = []
public percentChallengesSolved: string = '0'
Expand All @@ -78,7 +78,7 @@ export class ScoreBoardComponent implements OnInit {
this.allowRepeatNotifications = config.challenges.showSolvedNotifications && config.ctf?.showFlagsInNotifications
this.showChallengeHints = config.challenges.showHints
this.showVulnerabilityMitigations = config.challenges.showMitigations
this.showCodeSnippets = config.challenges.showCodeSnippets
this.codingChallengesEnabled = config.challenges.codingChallengesEnabled
this.showHackingInstructor = config.hackingInstructor?.isEnabled
this.showContributionInfoBox = config.application.showGitHubLinks
this.showFeedbackButtons = config.challenges.showFeedbackButtons
Expand Down

0 comments on commit 275ffe6

Please sign in to comment.