Skip to content

Commit 45d7e5a

Browse files
committed
Linting
1 parent 0f15c7c commit 45d7e5a

File tree

7 files changed

+137
-54
lines changed

7 files changed

+137
-54
lines changed

src/app/model/activity-store.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { IgnoreList } from './ignore-list';
33
import { MarkdownText } from './markdown-text';
44

55
export class ActivityFileMeta {
6-
static DSOMM_PUBLISHER: string = 'https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel-data/'
6+
static DSOMM_PUBLISHER: string =
7+
'https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel-data/';
78

89
version: string | null = null;
910
released: Date | null = null;
@@ -30,7 +31,7 @@ export class ActivityFileMeta {
3031
}
3132
return null;
3233
}
33-
};
34+
}
3435

3536
export interface ActivityFile {
3637
meta: ActivityFileMeta | null;

src/app/pages/settings/settings.component.html

Lines changed: 112 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
<div class="date-format-container">
66
<label for="dateFormatDropdown" class="nowrap">Date Format</label>
77
<mat-form-field appearance="fill" class="date-format-field">
8-
<mat-select id="dateFormatDropdown" name="dateFormat" [(ngModel)]="selectedDateFormat"
8+
<mat-select
9+
id="dateFormatDropdown"
10+
name="dateFormat"
11+
[(ngModel)]="selectedDateFormat"
912
(ngModelChange)="onDateFormatChange()">
1013
<mat-option *ngFor="let format of dateFormats" [value]="format.value">
1114
{{ format.label }}
@@ -18,8 +21,15 @@
1821
<mat-card-content>
1922
<div class="max-level-row">
2023
<label class="nowrap">Max level</label>
21-
<mat-slider id="maxLevelSlider" min="1" [max]="dataStoreMaxLevel || 5" step="1" [value]="selectedMaxLevel"
22-
[tickInterval]="1" class="max-slider" (input)="onMaxLevelChange($event.value)">
24+
<mat-slider
25+
id="maxLevelSlider"
26+
min="1"
27+
[max]="dataStoreMaxLevel || 5"
28+
step="1"
29+
[value]="selectedMaxLevel"
30+
[tickInterval]="1"
31+
class="max-slider"
32+
(input)="onMaxLevelChange($event.value)">
2333
</mat-slider>
2434
<span class="caption">{{ selectedMaxLevelCaption }}</span>
2535
</div>
@@ -31,7 +41,10 @@
3141
<div class="selectable-list-header">
3242
<h2>Progress Definitions</h2>
3343
<div *ngIf="editingProgressDefinitions" class="edit-hint">Click Accept when finished</div>
34-
<button mat-icon-button *ngIf="!editingProgressDefinitions" (click)="toggleProgressDefinitionsEdit()"
44+
<button
45+
mat-icon-button
46+
*ngIf="!editingProgressDefinitions"
47+
(click)="toggleProgressDefinitionsEdit()"
3548
title="Edit Progress Definitions">
3649
<mat-icon>edit</mat-icon>
3750
</button>
@@ -49,7 +62,8 @@ <h2>Progress Definitions</h2>
4962
</div>
5063

5164
<div class="progress-definitions-grid" [formGroup]="progressDefinitionsForm">
52-
<ng-container *ngIf="
65+
<ng-container
66+
*ngIf="
5367
editingProgressDefinitions;
5468
then editProgress;
5569
else displayProgress
@@ -80,23 +94,42 @@ <h2>Progress Definitions</h2>
8094

8195
<mat-form-field appearance="outline" class="grid-cell progress-score edit">
8296
<mat-label>Score</mat-label>
83-
<input matInput type="number" min="0" max="100" class="progress-score" formControlName="score"
97+
<input
98+
matInput
99+
type="number"
100+
min="0"
101+
max="100"
102+
class="progress-score"
103+
formControlName="score"
84104
[disabled]="getDefinitionGroup(i).get('mandatory')?.value" />
85105
<span matSuffix>%</span>
86106
</mat-form-field>
87107

88108
<mat-form-field appearance="outline" class="grid-cell progress-definition edit">
89109
<mat-label>Definition</mat-label>
90-
<textarea matInput required minlength="1" formControlName="definition" cdkTextareaAutosize
91-
cdkAutosizeMinRows="1" cdkAutosizeMaxRows="5"></textarea>
110+
<textarea
111+
matInput
112+
required
113+
minlength="1"
114+
formControlName="definition"
115+
cdkTextareaAutosize
116+
cdkAutosizeMinRows="1"
117+
cdkAutosizeMaxRows="5"></textarea>
92118
</mat-form-field>
93119

94120
<div class="grid-cell action-buttons edit">
95-
<mat-icon title="You cannot remove this definition"
121+
<mat-icon
122+
title="You cannot remove this definition"
96123
*ngIf="getDefinitionGroup(i).get('mandatory')?.value"
97-
class="material-icons-outlined mandatory-icon">lock</mat-icon>
98-
<button title="Delete" *ngIf="!getDefinitionGroup(i).get('mandatory')?.value" mat-icon-button
99-
(click)="removeProgressDefinition(i)" title="Delete definition">
124+
class="material-icons-outlined mandatory-icon"
125+
>lock</mat-icon
126+
>
127+
<button
128+
title="Delete"
129+
*ngIf="!getDefinitionGroup(i).get('mandatory')?.value"
130+
mat-icon-button
131+
(click)="removeProgressDefinition(i)"
132+
title="Delete definition">
100133
<mat-icon class="material-icons-outlined">delete</mat-icon>
101134
</button>
102135
</div>
@@ -126,15 +159,23 @@ <h2>Progress Definitions</h2>
126159
<mat-card class="settings-about-section">
127160
<h2>About the DSOMM Model</h2>
128161
<div class="card-content">
129-
<p>The <a target="_blank"
130-
href="https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel">DSOMM application</a>
131-
and the <a target="_blank" href="https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel-data">DSOMM
132-
model</a>
162+
<p>
163+
The
164+
<a target="_blank" href="https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel"
165+
>DSOMM application</a
166+
>
167+
and the
168+
<a
169+
target="_blank"
170+
href="https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel-data"
171+
>DSOMM model</a
172+
>
133173
are released independently.
134174
</p>
135175
<p>
136176
The model contains the definitions, activities, and structure used by this application.
137-
While the application is the tool for assessing and tracking DevSecOps maturity, i.e. using the model.<br/>
177+
While the application is the tool for assessing and tracking DevSecOps maturity, i.e. using
178+
the model.<br />
138179
</p>
139180
<ng-container *ngIf="meta?.activityMeta?.getDsommVersion()">
140181
<p>The current version of the DSOMM model in use is:</p>
@@ -143,45 +184,84 @@ <h2>About the DSOMM Model</h2>
143184
<!-- Model version row -->
144185
<div class="grid-col-1 grid-row-1">Model version</div>
145186
<div class="grid-col-1 grid-row-2">Release date</div>
146-
<div class="grid-col-2 grid-row-1">{{ meta.activityMeta?.getDsommVersion() || ''}}</div>
147-
<div class="grid-col-2 grid-row-2">{{ dateFormat(meta.activityMeta?.getDsommReleaseDate()) }}</div>
187+
<div class="grid-col-2 grid-row-1">
188+
{{ meta.activityMeta?.getDsommVersion() || '' }}
189+
</div>
190+
<div class="grid-col-2 grid-row-2">
191+
{{ dateFormat(meta.activityMeta?.getDsommReleaseDate()) }}
192+
</div>
148193

149-
<div class="grid-col-3 grid-row-1" *ngIf="remoteReleaseCheck?.isNewerAvailable === false">Up to date</div>
194+
<div
195+
class="grid-col-3 grid-row-1"
196+
*ngIf="remoteReleaseCheck?.isNewerAvailable === false">
197+
Up to date
198+
</div>
150199
<ng-container *ngIf="remoteReleaseCheck?.isNewerAvailable === true">
151-
<div class="grid-col-3 grid-row-1">{{ remoteReleaseCheck?.latestRelease?.tagName }}</div>
152-
<div class="grid-col-3 grid-row-2">{{ dateFormat(remoteReleaseCheck?.latestRelease?.publishedAt) }}</div>
200+
<div class="grid-col-3 grid-row-1">
201+
{{ remoteReleaseCheck?.latestRelease?.tagName }}
202+
</div>
203+
<div class="grid-col-3 grid-row-2">
204+
{{ dateFormat(remoteReleaseCheck?.latestRelease?.publishedAt) }}
205+
</div>
153206

154207
<div class="grid-col-4 grid-row-1">
155-
<a [href]="remoteReleaseCheck?.latestRelease?.downloadUrl" target="_blank" class="action-link">Download</a>
208+
<a
209+
[href]="remoteReleaseCheck?.latestRelease?.downloadUrl"
210+
target="_blank"
211+
class="action-link"
212+
>Download</a
213+
>
156214
</div>
157215
<div class="grid-col-4 grid-row-2">
158-
<a [href]="remoteReleaseCheck?.latestRelease?.changelogUrl" target="_blank" class="action-link">Changelog</a>
216+
<a
217+
[href]="remoteReleaseCheck?.latestRelease?.changelogUrl"
218+
target="_blank"
219+
class="action-link"
220+
>Changelog</a
221+
>
159222
</div>
160223
</ng-container>
161224
</div>
162225
<div class="button-container vflex">
163-
<div *ngIf="remoteReleaseCheck?.latestCheckError" class="error"><p>Error checking updates:</p><p> {{ remoteReleaseCheck?.latestCheckError }}</p></div>
226+
<div *ngIf="remoteReleaseCheck?.latestCheckError" class="error">
227+
<p>Error checking updates:</p>
228+
<p>{{ remoteReleaseCheck?.latestCheckError }}</p>
229+
</div>
164230
<div class="hflex">
165-
<button mat-raised-button class="normal-button" (click)="checkForLatestRelease()" [disabled]="remoteReleaseCheck?.isChecking">
231+
<button
232+
mat-raised-button
233+
class="normal-button"
234+
(click)="checkForLatestRelease()"
235+
[disabled]="remoteReleaseCheck?.isChecking">
166236
Check for newer DSOMM
167237
</button>
168-
<mat-progress-spinner *ngIf="remoteReleaseCheck?.isChecking" mode="indeterminate" diameter="20"></mat-progress-spinner>
238+
<mat-progress-spinner
239+
*ngIf="remoteReleaseCheck?.isChecking"
240+
mode="indeterminate"
241+
diameter="20"></mat-progress-spinner>
169242
</div>
170243
</div>
171244
</div>
172245
<div class="version-info-customization" *ngIf="meta.activityFiles.length > 1">
173-
<div>This application uses the official DSOMM Model above, with some local customizations. The following files are used to describe the model in use:</div>
246+
<div>
247+
This application uses the official DSOMM Model above, with some local customizations.
248+
The following files are used to describe the model in use:
249+
</div>
174250
<ul>
175-
<li *ngFor="let file of meta?.activityFiles"><a href="{{ file }}" target="_blank">{{ file.replace('assets/YAML/', '') }}</a></li>
251+
<li *ngFor="let file of meta?.activityFiles">
252+
<a href="{{ file }}" target="_blank">{{ file.replace('assets/YAML/', '') }}</a>
253+
</li>
176254
</ul>
177255
</div>
178256
</ng-container>
179257
<ng-container *ngIf="!meta?.activityMeta?.getDsommVersion()">
180-
<div>This application runs on a customized version of the DSOMM model: </div>
258+
<div>This application runs on a customized version of the DSOMM model:</div>
181259
<ul>
182-
<li *ngFor="let file of meta?.activityFiles"><a href="{{ file }}" target="_blank">{{ file.replace('assets/YAML/', '') }}</a></li>
260+
<li *ngFor="let file of meta?.activityFiles">
261+
<a href="{{ file }}" target="_blank">{{ file.replace('assets/YAML/', '') }}</a>
262+
</li>
183263
</ul>
184264
</ng-container>
185265
</div>
186266
</mat-card>
187-
</div>
267+
</div>

src/app/pages/settings/settings.component.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { dateStr, deepCopy } from 'src/app/util/util';
1313
import { MetaStore } from 'src/app/model/meta-store';
1414
import { ProgressStore } from 'src/app/model/progress-store';
1515

16-
1716
interface RemoteReleaseInfo {
1817
tagName: string;
1918
publishedAt?: Date;
@@ -62,7 +61,6 @@ export class SettingsComponent implements OnInit {
6261
];
6362
selectedDateFormat: string = this.BROWSER_LOCALE;
6463

65-
6664
constructor(
6765
private loader: LoaderService,
6866
private settings: SettingsService,
@@ -104,14 +102,16 @@ export class SettingsComponent implements OnInit {
104102
}
105103

106104
if (!this.remoteReleaseCheck.latestRelease) {
107-
this.remoteReleaseCheck.latestCheckError = 'Error: No release information received from Github';
108-
} else {
105+
this.remoteReleaseCheck.latestCheckError =
106+
'Error: No release information received from Github';
107+
} else {
109108
const remote = this.remoteReleaseCheck.latestRelease;
110109

111110
const remoteTag = (remote && remote.tagName?.replace(/^v/, '')) || '';
112111
const localTag = this.meta?.activityMeta?.getDsommVersion()?.replace(/^v/, '') || '';
113112

114-
const remoteDate = remote && remote.publishedAt && new Date(remote.publishedAt.toDateString());
113+
const remoteDate =
114+
remote && remote.publishedAt && new Date(remote.publishedAt.toDateString());
115115
const localDate = this.meta?.activityMeta?.getDsommReleaseDate();
116116

117117
// Prefer version tag comparison, fallback to published date comparison
@@ -120,16 +120,16 @@ export class SettingsComponent implements OnInit {
120120
newer = remoteTag !== localTag || remoteDate > localDate;
121121
} else {
122122
let tmp: string[] = [];
123-
if(!remoteTag) tmp.push('remoteTag');
124-
if(!localTag) tmp.push('localTag');
125-
if(!remoteDate) tmp.push('remoteDate');
126-
if(!localDate) tmp.push('localDate');
127-
this.remoteReleaseCheck.latestCheckError =
128-
`Could not determine ${tmp.join(', ')} for comparison`;
123+
if (!remoteTag) tmp.push('remoteTag');
124+
if (!localTag) tmp.push('localTag');
125+
if (!remoteDate) tmp.push('remoteDate');
126+
if (!localDate) tmp.push('localDate');
127+
this.remoteReleaseCheck.latestCheckError = `Could not determine ${tmp.join(
128+
', '
129+
)} for comparison`;
129130
console.warn('ERROR: ' + this.remoteReleaseCheck.latestCheckError);
130131
}
131132
this.remoteReleaseCheck.isNewerAvailable = newer;
132-
133133
}
134134
}
135135

@@ -344,5 +344,4 @@ export class SettingsComponent implements OnInit {
344344
dateFormat(date: Date | null | undefined): string {
345345
return dateStr(date, this.settings?.getDateFormat());
346346
}
347-
348347
}

src/app/service/loader/data-loader.service.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ import { perfNow } from 'src/app/util/util';
33
import { YamlService } from '../yaml-loader/yaml-loader.service';
44
import { MetaStore } from 'src/app/model/meta-store';
55
import { TeamProgressFile, Uuid } from 'src/app/model/types';
6-
import { Activity, ActivityFile, ActivityFileMeta, ActivityStore, Data } from 'src/app/model/activity-store';
6+
import {
7+
Activity,
8+
ActivityFile,
9+
ActivityFileMeta,
10+
ActivityStore,
11+
Data,
12+
} from 'src/app/model/activity-store';
713
import { DataStore } from 'src/app/model/data-store';
814

915
export class DataValidationError extends Error {

src/app/service/settings/github-release.service.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/app/service/settings/github.service.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export class GithubService {
3737
return releaseInfo;
3838
}
3939

40-
4140
getDownloadUrl(tag: string): string {
4241
if (!tag) return '';
4342
// Ensure tag is encoded safely
@@ -48,4 +47,4 @@ export class GithubService {
4847
getChangelogUrl(): string {
4948
return this.CHANGELOG_URL;
5049
}
51-
}
50+
}

src/app/service/yaml-loader/yaml-loader.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Injectable } from '@angular/core';
33
import {
44
parse as parseSingle,
55
parseAllDocuments as parseMultiple,
6-
stringify as yamlStringify
6+
stringify as yamlStringify,
77
} from 'yaml';
88
// import YAML from 'yaml';
99
import { perfNow } from 'src/app/util/util';
@@ -30,7 +30,7 @@ export class YamlService {
3030
}
3131

3232
public stringifyMultiple(yamlObj: any[]): string {
33-
throw Error("NOT YET IMPLEMENTED")
33+
throw Error('NOT YET IMPLEMENTED');
3434
return yamlStringify(yamlObj);
3535
}
3636

0 commit comments

Comments
 (0)