Skip to content

Commit f3283f5

Browse files
committed
feat(): fix easy lint errors with autofix
1 parent dab8e90 commit f3283f5

File tree

51 files changed

+160
-160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+160
-160
lines changed

src/app/configuration/code-with-syntax-highlighting/code-with-syntax-highlighting.component.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import {
77
OnDestroy,
88
Output,
99
SimpleChanges,
10-
ViewChild,
10+
ViewChild, OnChanges,
1111
} from '@angular/core';
1212
import 'prismjs';
1313
import 'prismjs/components/prism-yaml';
1414
import 'prismjs/components/prism-bash';
1515
import 'prismjs/components/prism-regex';
1616

17-
declare var Prism: any;
17+
declare let Prism: any;
1818

1919
export enum supportedLanguages {
2020
//To allow for more Languages the prism Components have to be imported also. For a list of all Supported Languages see: https://prismjs.com/#supported-languages
@@ -29,9 +29,9 @@ export enum supportedLanguages {
2929
styleUrls: ['./code-with-syntax-highlighting.component.scss'],
3030
})
3131
export class CodeWithSyntaxHighlightingComponent
32-
implements AfterViewInit, OnDestroy
32+
implements AfterViewInit, OnDestroy, OnChanges
3333
{
34-
@Input('textValue') set textValue(value: string) {
34+
@Input() set textValue(value: string) {
3535
this._textValue = value;
3636
this.count++;
3737
if (!this.resizeable) {
@@ -94,7 +94,7 @@ export class CodeWithSyntaxHighlightingComponent
9494
}
9595

9696
setStyleValues() {
97-
if (!!this.initialized) {
97+
if (this.initialized) {
9898
this.codeEditor.nativeElement.style.outline = this.outline;
9999
this.codeEditor.nativeElement.style.height = this.height;
100100
this.codeEditor.nativeElement.style.width = this.width;
@@ -116,15 +116,15 @@ export class CodeWithSyntaxHighlightingComponent
116116
}
117117

118118
ngOnChanges(changes: SimpleChanges) {
119-
if (!!changes.textValue) {
119+
if (changes.textValue) {
120120
this._textValue = changes.textValue.currentValue;
121121
this.setHighlightedText(changes.textValue.currentValue);
122122
}
123123
}
124124

125125
onValueChange(event) {
126126
this.count++;
127-
let newText: string = event.target.value;
127+
const newText: string = event.target.value;
128128
this.textChanged.emit(newText);
129129
}
130130

@@ -136,7 +136,7 @@ export class CodeWithSyntaxHighlightingComponent
136136
}
137137

138138
resizeEvent(event) {
139-
let newHeight = event.height + 'px';
139+
const newHeight = event.height + 'px';
140140
this.codeEditor.nativeElement.style.height = newHeight;
141141
this.codeBlock.nativeElement.style.height = newHeight;
142142
this.textarea.nativeElement.style.height = newHeight;

src/app/configuration/environments/edit-environment/edit-environment.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ export class EditEnvironmentComponent implements OnInit, OnChanges {
250250

251251
public getValidVMTemplates() {
252252
let vmtList = this.VMTemplates;
253-
let selectedVMTs: string[] = [];
253+
const selectedVMTs: string[] = [];
254254
for (let i = 0; i < this.templateMappings.controls.templates.length; i++) {
255255
// i = index of template
256256
selectedVMTs.push(

src/app/configuration/roles/rule-form/rule-form.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class RuleFormComponent implements OnInit {
113113
(ag: ApiGroup) => ag == rbacApiGroup,
114114
) == undefined
115115
) {
116-
let groups = this.apiGroupControl.value;
116+
const groups = this.apiGroupControl.value;
117117
groups.push(rbacApiGroup);
118118
this.apiGroupControl.setValue(groups, {
119119
emitEvent: false,
@@ -125,7 +125,7 @@ export class RuleFormComponent implements OnInit {
125125
(ag: ApiGroup) => ag == hobbyfarmApiGroup,
126126
) == undefined
127127
) {
128-
let groups = this.apiGroupControl.value;
128+
const groups = this.apiGroupControl.value;
129129
groups.push(hobbyfarmApiGroup);
130130
this.apiGroupControl.setValue(groups, {
131131
emitEvent: false,

src/app/configuration/vmtemplates/edit-vmtemplate/edit-vmtemplate.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ export class EditVmtemplateComponent implements OnInit, OnChanges {
136136

137137
private buildVMServices(configMapData?: string) {
138138
if (configMapData) {
139-
let temp = JSON.parse(configMapData);
140-
let resultMap = new Map();
139+
const temp = JSON.parse(configMapData);
140+
const resultMap = new Map();
141141
temp.forEach((entry) => {
142142
entry.cloudConfigMap = new Map(Object.entries(entry['cloudConfigMap'])); // Convert Object to map
143143
entry['id'] = entry['id'] ?? uuid.v4(); //Catch old entries, that do not have an ID
@@ -150,7 +150,7 @@ export class EditVmtemplateComponent implements OnInit, OnChanges {
150150
public prepareConfigMap(vmTemplate: VMTemplate) {
151151
// differs from buildConfigMap() in that we are copying existing values
152152
// into the form
153-
let configKeys = Object.keys(vmTemplate.config_map).filter(
153+
const configKeys = Object.keys(vmTemplate.config_map).filter(
154154
(elem) => elem !== this.cloudConfigKey && elem != this.vmServiceKey,
155155
);
156156
this.cloudConfig.vmServices = this.buildVMServices(
@@ -212,13 +212,13 @@ export class EditVmtemplateComponent implements OnInit, OnChanges {
212212
}
213213
this.template.config_map[this.cloudConfigKey] =
214214
this.cloudConfig.cloudConfigYaml;
215-
let tempArray: VMTemplateServiceConfiguration[] = [];
215+
const tempArray: VMTemplateServiceConfiguration[] = [];
216216
this.cloudConfig.vmServices.forEach(
217217
(vmService: VMTemplateServiceConfiguration) => {
218218
tempArray.push(vmService);
219219
},
220220
);
221-
let jsonString = JSON.stringify(tempArray);
221+
const jsonString = JSON.stringify(tempArray);
222222
this.template.config_map[this.vmServiceKey] = jsonString;
223223
}
224224
public copyTemplate() {

src/app/configuration/vmtemplates/edit-vmtemplate/vmtemplate-service-form/vmtemplate-service-form.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, Input, OnInit, ViewChild } from '@angular/core';
1+
import { Component, Input, OnInit, ViewChild, DoCheck } from '@angular/core';
22
import { FormControl, FormGroup, NonNullableFormBuilder } from '@angular/forms';
33
import { DEFAULT_ALERT_WARNING_DURATION } from 'src/app/alert/alert';
44
import { AlertComponent } from 'src/app/alert/alert.component';
@@ -16,7 +16,7 @@ import * as uuid from 'uuid';
1616
templateUrl: './vmtemplate-service-form.component.html',
1717
styleUrls: ['./vmtemplate-service-form.component.scss'],
1818
})
19-
export class VMTemplateServiceFormComponent implements OnInit {
19+
export class VMTemplateServiceFormComponent implements OnInit, DoCheck {
2020
predefinedInterfaces: VMTemplateServiceConfiguration[];
2121

2222
@Input()
@@ -142,7 +142,7 @@ export class VMTemplateServiceFormComponent implements OnInit {
142142
}
143143

144144
newVMServiceClose() {
145-
let newVMService: VMTemplateServiceConfiguration =
145+
const newVMService: VMTemplateServiceConfiguration =
146146
new VMTemplateServiceConfiguration();
147147
newVMService.id = this.editVMService?.id ?? uuid.v4();
148148
newVMService.name = this.newVMServiceFormGroup.controls.name.value;

src/app/configuration/vmtemplates/vmtemplate-detail/vmtemplate-detail.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
</clr-accordion>
103103
}
104104
<!-- Cloud-Init -->
105-
@if (cloudConfigData == 'No Cloud Config defined') {
105+
@if (cloudConfigData === 'No Cloud Config defined') {
106106
<clr-stack-block>
107107
<clr-stack-label>Cloud-Init</clr-stack-label>
108108
<clr-stack-content>None</clr-stack-content>

src/app/content/content.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { ActivatedRoute, Router } from '@angular/router';
66
selector: 'app-content',
77
templateUrl: './content.component.html',
88
})
9-
export class ContentComponent implements OnInit {
9+
export class ContentComponent implements OnInit, OnChanges {
1010
constructor(
1111
public rbacService: RbacService,
1212
private route: Router,

src/app/course/course-wizard/course-wizard.component.html

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
></vmset>
8080
</clr-wizard-page>
8181

82-
@if (wizardCourse == 'edit') {
82+
@if (wizardCourse === 'edit') {
8383
<clr-wizard-page
8484
(clrWizardPageNext)="saveCourseWizard()"
8585
[clrWizardPageNextDisabled]="
@@ -157,7 +157,7 @@
157157
</clr-datagrid>
158158
}
159159
</clr-wizard-page>
160-
} @else if (wizardCourse == 'create') {
160+
} @else if (wizardCourse === 'create') {
161161
<clr-wizard-page (clrWizardPageNext)="saveCourseWizard()">
162162
<ng-template clrPageTitle>Scenarios</ng-template>
163163
@if (listScenarios) {
@@ -393,9 +393,9 @@ <h4>Course</h4>
393393
<tbody>
394394
<tr>
395395
<td>Name</td>
396-
@if (wizardCourse == 'create') {
396+
@if (wizardCourse === 'create') {
397397
<td>{{ course.name }}</td>
398-
} @else if (wizardCourse == 'edit') {
398+
} @else if (wizardCourse === 'edit') {
399399
@if (selectedCourse.name == editSelectedCourse.name) {
400400
<td>
401401
{{ selectedCourse.name }}
@@ -411,9 +411,9 @@ <h4>Course</h4>
411411
</tr>
412412
<tr>
413413
<td>Description</td>
414-
@if (wizardCourse == 'create') {
414+
@if (wizardCourse === 'create') {
415415
<td>{{ course.description }}</td>
416-
} @else if (wizardCourse == 'edit') {
416+
} @else if (wizardCourse === 'edit') {
417417
@if (
418418
selectedCourse.description == editSelectedCourse.description
419419
) {
@@ -433,9 +433,9 @@ <h4>Course</h4>
433433
</tr>
434434
<tr>
435435
<td>Keepalive Duration</td>
436-
@if (wizardCourse == 'create') {
436+
@if (wizardCourse === 'create') {
437437
<td>{{ course.keepalive_duration }}</td>
438-
} @else if (wizardCourse == 'edit') {
438+
} @else if (wizardCourse === 'edit') {
439439
@if (
440440
selectedCourse.keepalive_duration ==
441441
editSelectedCourse.keepalive_duration
@@ -458,9 +458,9 @@ <h4>Course</h4>
458458
</tr>
459459
<tr>
460460
<td>Pause Duration</td>
461-
@if (wizardCourse == 'create') {
461+
@if (wizardCourse === 'create') {
462462
<td>{{ course.pause_duration }}</td>
463-
} @else if (wizardCourse == 'edit') {
463+
} @else if (wizardCourse === 'edit') {
464464
@if (
465465
selectedCourse.pause_duration ==
466466
editSelectedCourse.pause_duration
@@ -483,9 +483,9 @@ <h4>Course</h4>
483483
</tr>
484484
<tr>
485485
<td>Learnpath</td>
486-
@if (wizardCourse == 'create') {
486+
@if (wizardCourse === 'create') {
487487
<td>{{ course.is_learnpath ? 'yes' : 'no' }}</td>
488-
} @else if (wizardCourse == 'edit') {
488+
} @else if (wizardCourse === 'edit') {
489489
@if (
490490
selectedCourse.is_learnpath == editSelectedCourse.is_learnpath
491491
) {
@@ -508,9 +508,9 @@ <h4>Course</h4>
508508

509509
<tr>
510510
<td>Shown in Catalog</td>
511-
@if (wizardCourse == 'create') {
511+
@if (wizardCourse === 'create') {
512512
<td>{{ course.in_catalog ? 'yes' : 'no' }}</td>
513-
} @else if (wizardCourse == 'edit') {
513+
} @else if (wizardCourse === 'edit') {
514514
@if (selectedCourse.in_catalog == editSelectedCourse.in_catalog) {
515515
<td>
516516
{{ selectedCourse.in_catalog ? 'yes' : 'no' }}
@@ -553,11 +553,11 @@ <h4>Course</h4>
553553
<tr>
554554
<td>Dynamic Scenario</td>
555555
<td>
556-
@if (wizardCourse == 'create') {
556+
@if (wizardCourse === 'create') {
557557
@for (categorie of selectedCourse.categories; track categorie) {
558558
<span class="label">{{ categorie }} </span>
559559
}
560-
} @else if (wizardCourse == 'edit') {
560+
} @else if (wizardCourse === 'edit') {
561561
@for (
562562
category of editSelectedCourse.categories;
563563
track category

src/app/course/course-wizard/course-wizard.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ export class CourseWizardComponent implements OnChanges, OnInit {
271271
this.dynamicAddedScenarios = [];
272272
if (this.canAddDynamicScenarios()) {
273273
this.courseService.listDynamicScenarios(this.editCategories).subscribe(
274-
(dynamicScenarios: String[]) => {
274+
(dynamicScenarios: string[]) => {
275275
this.scenarios.forEach((scenario) => {
276276
if (dynamicScenarios && dynamicScenarios.includes(scenario.id)) {
277277
this.dynamicAddedScenarios.push(scenario);
@@ -302,7 +302,7 @@ export class CourseWizardComponent implements OnChanges, OnInit {
302302
}
303303

304304
addCategory() {
305-
let categories = this.newCategoryForm.controls.category.value;
305+
const categories = this.newCategoryForm.controls.category.value;
306306
const categoryArray = categories?.split(',') ?? [];
307307
categoryArray.forEach((category) => {
308308
category = category.replace(/\s/g, ''); //remove all whitespaces

src/app/dashboards/dashboard-details/dashboard-details.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ export class DashboardDetailsComponent implements OnInit, OnDestroy {
8080
*/
8181
async setRbacCheck(resources: Resource[], verbs: Verb[]) {
8282
let rbacCheck = true;
83-
outerForLoop: for (let resource of resources) {
84-
for (let verb of verbs) {
83+
outerForLoop: for (const resource of resources) {
84+
for (const verb of verbs) {
8585
const allowed: boolean = await this.rbacService.Grants(resource, verb);
8686
if (!allowed) {
8787
rbacCheck = false;

0 commit comments

Comments
 (0)