Skip to content

Commit b187864

Browse files
committed
fix double use of formControlName and ngModel, improve wording and other nitpicks (all CodeRabbit finds)
1 parent f41fb78 commit b187864

File tree

5 files changed

+35
-49
lines changed

5 files changed

+35
-49
lines changed

src/main/webapp/app/core/course/manage/update/course-update.component.html

Lines changed: 26 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ <h4 class="form-group" jhiTranslate="artemisApp.course.form.sections.general"></
7070
</div>
7171
<div class="form-group">
7272
<label class="form-control-label" jhiTranslate="artemisApp.course.description" for="field_description"></label>
73-
<textarea id="field_description" class="form-control" rows="2" formControlName="description" [(ngModel)]="course.description"></textarea>
73+
<textarea id="field_description" class="form-control" rows="2" formControlName="description"></textarea>
7474
</div>
7575
@if (isAdmin) {
7676
<div class="form-group">
@@ -89,7 +89,13 @@ <h5>
8989
</div>
9090
}
9191
</div>
92-
<button id="addOrganizationButton" type="button" class="btn btn-outline-primary" (click)="openOrganizationsModal()">Add</button>
92+
<button
93+
id="addOrganizationButton"
94+
type="button"
95+
class="btn btn-outline-primary"
96+
(click)="openOrganizationsModal()"
97+
jhiTranslate="entity.action.add"
98+
></button>
9399
</div>
94100
}
95101
<div class="row g-2">
@@ -98,7 +104,6 @@ <h5>
98104
id="field_startDate"
99105
labelName="{{ 'artemisApp.course.startDate' | artemisTranslate }}"
100106
formControlName="startDate"
101-
[(ngModel)]="course.startDate"
102107
[error]="!isValidDate"
103108
/>
104109
@if (!isValidDate) {
@@ -110,7 +115,6 @@ <h5>
110115
id="field_endDate"
111116
labelName="{{ 'artemisApp.course.endDate' | artemisTranslate }}"
112117
formControlName="endDate"
113-
[(ngModel)]="course.endDate"
114118
[error]="!isValidDate"
115119
/>
116120
@if (!isValidDate) {
@@ -165,12 +169,12 @@ <h5>
165169
<hr />
166170
<h4 class="form-group" jhiTranslate="artemisApp.course.form.sections.exercises"></h4>
167171
<div class="row">
168-
<div class="form-group col-md">
172+
<div class="form-group col-xl mb-2 mb-xl-3">
169173
<label class="form-control-label" for="field_maxPoints" jhiTranslate="artemisApp.course.maxPoints.title"></label>
170174
<fa-icon [icon]="faQuestionCircle" class="text-secondary" ngbTooltip="{{ 'artemisApp.course.maxPoints.info' | artemisTranslate }}" />
171175
<input type="number" class="form-control" name="maxPoints" id="field_maxPoints" min="1" formControlName="maxPoints" />
172176
</div>
173-
<div class="form-group col-md">
177+
<div class="form-group col-xl">
174178
<label class="form-control-label" for="field_accuracyOfScores" jhiTranslate="artemisApp.course.accuracyOfScores.title"></label>
175179
<fa-icon [icon]="faQuestionCircle" class="text-secondary" ngbTooltip="{{ 'artemisApp.course.accuracyOfScores.info' | artemisTranslate }}" />
176180
<input required type="number" class="form-control" name="accuracyOfScores" id="field_accuracyOfScores" min="0" max="5" formControlName="accuracyOfScores" />
@@ -196,9 +200,7 @@ <h4 class="form-group" jhiTranslate="artemisApp.course.form.sections.exercises">
196200
id="field_customizeGroupNamesEnabled"
197201
formControlName="customizeGroupNames"
198202
/>
199-
<label class="form-control-label" jhiTranslate="artemisApp.course.customizeGroupNames.title" for="field_customizeGroupNamesEnabled"
200-
>Customize Group Names</label
201-
>
203+
<label class="form-control-label" jhiTranslate="artemisApp.course.customizeGroupNames.title" for="field_customizeGroupNamesEnabled"></label>
202204
<fa-icon [icon]="faExclamationTriangle" class="text-secondary" ngbTooltip="{{ 'artemisApp.course.customizeGroupNames.description' | artemisTranslate }}" />
203205
</div>
204206
@if (customizeGroupNames) {
@@ -208,9 +210,7 @@ <h4 class="form-group" jhiTranslate="artemisApp.course.form.sections.exercises">
208210
<input type="text" class="form-control" name="studentGroupName" id="field_studentGroupName" formControlName="studentGroupName" />
209211
</div>
210212
<div class="nested-form-group">
211-
<label class="form-control-label" jhiTranslate="artemisApp.course.teachingAssistantGroupName" for="field_teachingAssistantGroupName"
212-
>Teaching Assistant Group Name</label
213-
>
213+
<label class="form-control-label" jhiTranslate="artemisApp.course.teachingAssistantGroupName" for="field_teachingAssistantGroupName"></label>
214214
<input
215215
type="text"
216216
class="form-control"
@@ -263,7 +263,7 @@ <h4 class="form-group" jhiTranslate="artemisApp.course.form.sections.exercises">
263263
<input required type="number" class="form-control" name="maxComplaintTimeDays" id="field_maxComplaintTimeDays" formControlName="maxComplaintTimeDays" />
264264
</div>
265265
<div class="row nested-form-group last">
266-
<div class="col-md">
266+
<div class="col-xl mb-2 mb-xl-3">
267267
<label class="form-control-label" jhiTranslate="artemisApp.course.maxComplaintTextLimit.title" for="field_maxComplaintTextLimit"></label>
268268
<fa-icon
269269
[icon]="faQuestionCircle"
@@ -279,7 +279,7 @@ <h4 class="form-group" jhiTranslate="artemisApp.course.form.sections.exercises">
279279
formControlName="maxComplaintTextLimit"
280280
/>
281281
</div>
282-
<div class="col-md">
282+
<div class="col-xl">
283283
<label
284284
class="form-control-label"
285285
jhiTranslate="artemisApp.course.maxComplaintResponseTextLimit.title"
@@ -312,14 +312,12 @@ <h4 class="form-group" jhiTranslate="artemisApp.course.form.sections.exercises">
312312
(change)="changeRequestMoreFeedbackEnabled()"
313313
formControlName="requestMoreFeedbackEnabled"
314314
/>
315-
<label class="form-control-label" jhiTranslate="artemisApp.course.requestMoreFeedbackEnabled.title" for="field_maxRequestMoreFeedbackSettingEnabled"
316-
>Enable More Feedback Requests</label
317-
>
315+
<label class="form-control-label" jhiTranslate="artemisApp.course.requestMoreFeedbackEnabled.title" for="field_maxRequestMoreFeedbackSettingEnabled"></label>
318316
<fa-icon [icon]="faQuestionCircle" class="text-secondary" ngbTooltip="{{ 'artemisApp.course.requestMoreFeedbackEnabled.description' | artemisTranslate }}" />
319317
</div>
320318
@if (requestMoreFeedbackEnabled) {
321319
<div class="nested-form-group last">
322-
<label class="form-control-label" jhiTranslate="artemisApp.course.maxRequestMoreFeedbackTimeDays.title" for="field_maxComplaintTimeDays"></label>
320+
<label class="form-control-label" jhiTranslate="artemisApp.course.maxRequestMoreFeedbackTimeDays.title" for="field_maxRequestMoreFeedbackTimeDays"></label>
323321
<fa-icon
324322
[icon]="faQuestionCircle"
325323
class="text-secondary"
@@ -359,20 +357,13 @@ <h4 class="form-group" jhiTranslate="artemisApp.course.form.sections.additionalF
359357
<jhi-feature-overlay [enabled]="atlasEnabled">
360358
<div class="form-group" [jhiFeatureToggleHide]="FeatureToggle.LearningPaths">
361359
<div class="form-check">
362-
<input
363-
type="checkbox"
364-
class="form-check-input"
365-
name="learningPathsEnabled"
366-
id="field_learningPathsEnabled"
367-
formControlName="learningPathsEnabled"
368-
[(ngModel)]="course.learningPathsEnabled"
369-
/>
360+
<input type="checkbox" class="form-check-input" name="learningPathsEnabled" id="field_learningPathsEnabled" formControlName="learningPathsEnabled" />
370361
<label class="form-control-label" jhiTranslate="artemisApp.course.learningPaths.label" for="field_learningPathsEnabled"></label>
371362
<fa-icon [icon]="faQuestionCircle" class="text-secondary" ngbTooltip="{{ 'artemisApp.course.learningPaths.tooltip' | artemisTranslate }}" />
372363
</div>
373364
</div>
374365
</jhi-feature-overlay>
375-
@if (this.isAdmin) {
366+
@if (isAdmin) {
376367
<div class="form-group" [jhiFeatureToggleHide]="FeatureToggle.StudentCourseAnalyticsDashboard">
377368
<div class="form-check">
378369
<input
@@ -381,22 +372,21 @@ <h4 class="form-group" jhiTranslate="artemisApp.course.form.sections.additionalF
381372
name="studentCourseAnalyticsDashboardEnabled"
382373
id="field_studentCourseAnalyticsDashboardEnabled"
383374
formControlName="studentCourseAnalyticsDashboardEnabled"
384-
[(ngModel)]="course.studentCourseAnalyticsDashboardEnabled"
385375
/>
386376
<label class="form-control-label" jhiTranslate="artemisApp.course.dashboard.label" for="field_studentCourseAnalyticsDashboardEnabled"></label>
387377
<fa-icon [icon]="faQuestionCircle" class="text-secondary" ngbTooltip="{{ 'artemisApp.course.dashboard.tooltip' | artemisTranslate }}" />
388378
</div>
389379
</div>
390380
}
391-
@if (this.isAdmin && this.isAthenaEnabled) {
381+
@if (isAdmin && isAthenaEnabled) {
392382
<div class="form-group form-check">
393383
<input
394384
type="checkbox"
395385
class="form-check-input"
396386
name="restrictedAthenaModulesEnabled"
397387
id="field_restrictedAthenaModulesEnabled"
398388
[checked]="course.restrictedAthenaModulesAccess"
399-
(change)="this.changeRestrictedAthenaModulesEnabled()"
389+
(change)="changeRestrictedAthenaModulesEnabled()"
400390
/>
401391
<label class="form-control-label" jhiTranslate="artemisApp.course.restrictedAthenaModulesAccess.label" for="field_restrictedAthenaModulesEnabled"></label>
402392
<fa-icon [icon]="faQuestionCircle" class="text-secondary" ngbTooltip="{{ 'artemisApp.course.restrictedAthenaModulesAccess.tooltip' | artemisTranslate }}" />
@@ -445,7 +435,7 @@ <h4 class="form-group" jhiTranslate="artemisApp.course.form.sections.additionalF
445435
<!-- Section: Enrollment -->
446436
<hr />
447437
<h4 jhiTranslate="artemisApp.course.form.sections.enrollment"></h4>
448-
@if (ltiEnabled && !this.course.enrollmentEnabled) {
438+
@if (ltiEnabled && !course.enrollmentEnabled) {
449439
<div class="form-check">
450440
<input
451441
type="checkbox"
@@ -454,22 +444,22 @@ <h4 jhiTranslate="artemisApp.course.form.sections.enrollment"></h4>
454444
id="field_onlineCourse"
455445
formControlName="onlineCourse"
456446
[checked]="course.onlineCourse"
457-
(change)="this.changeOnlineCourse()"
447+
(change)="changeOnlineCourse()"
458448
/>
459449
<label class="form-control-label" jhiTranslate="artemisApp.course.onlineCourse.title" for="field_onlineCourse"></label>
460450
<fa-icon [icon]="faQuestionCircle" class="text-secondary" ngbTooltip="{{ 'artemisApp.course.onlineCourse.description' | artemisTranslate }}" />
461451
</div>
462452
}
463453
<!-- enrollment -->
464-
@if (!this.course.onlineCourse) {
454+
@if (!course.onlineCourse) {
465455
<div class="nested-form-group-head form-check">
466456
<input
467457
type="checkbox"
468458
class="form-check-input"
469459
name="enrollmentEnabled"
470460
id="field_enrollmentEnabled"
471461
[checked]="course.enrollmentEnabled"
472-
(change)="this.changeEnrollmentEnabled()"
462+
(change)="changeEnrollmentEnabled()"
473463
/>
474464
<label class="form-control-label" jhiTranslate="artemisApp.course.enrollmentEnabled.title" for="field_enrollmentEnabled"></label>
475465
<fa-icon [icon]="faQuestionCircle" class="text-secondary" ngbTooltip="{{ 'artemisApp.course.enrollmentEnabled.description' | artemisTranslate }}" />
@@ -483,7 +473,6 @@ <h4 jhiTranslate="artemisApp.course.form.sections.enrollment"></h4>
483473
id="field_enrollmentStartDate"
484474
labelName="{{ 'artemisApp.course.enrollmentStartDate' | artemisTranslate }}"
485475
formControlName="enrollmentStartDate"
486-
[(ngModel)]="course.enrollmentStartDate"
487476
[error]="!isValidEnrollmentPeriod"
488477
/>
489478
@if (!isValidEnrollmentPeriod) {
@@ -495,7 +484,6 @@ <h4 jhiTranslate="artemisApp.course.form.sections.enrollment"></h4>
495484
id="field_enrollmentEndDate"
496485
labelName="{{ 'artemisApp.course.enrollmentEndDate' | artemisTranslate }}"
497486
formControlName="enrollmentEndDate"
498-
[(ngModel)]="course.enrollmentEndDate"
499487
[error]="!isValidEnrollmentPeriod"
500488
/>
501489
@if (!isValidEnrollmentPeriod) {
@@ -504,9 +492,7 @@ <h4 jhiTranslate="artemisApp.course.form.sections.enrollment"></h4>
504492
</div>
505493
</div>
506494
<div class="nested-form-group last" id="field_enrollmentConfirmationMessage">
507-
<label class="form-control-label" jhiTranslate="artemisApp.course.enrollmentConfirmationMessage" for="field_enrollmentConfirmationMessage"
508-
>Enrollment Confirmation Message</label
509-
>
495+
<label class="form-control-label" jhiTranslate="artemisApp.course.enrollmentConfirmationMessage" for="field_enrollmentConfirmationMessage"></label>
510496
<jhi-markdown-editor-monaco
511497
class="markdown-editor"
512498
[(markdown)]="course.enrollmentConfirmationMessage"
@@ -522,7 +508,7 @@ <h4 jhiTranslate="artemisApp.course.form.sections.enrollment"></h4>
522508
name="unenrollmentEnabled"
523509
id="field_unenrollmentEnabled"
524510
[checked]="course.unenrollmentEnabled"
525-
(change)="this.changeUnenrollmentEnabled()"
511+
(change)="changeUnenrollmentEnabled()"
526512
/>
527513
<label class="form-control-label" jhiTranslate="artemisApp.course.unenrollmentEnabled.title" for="field_unenrollmentEnabled"></label>
528514
<fa-icon
@@ -537,7 +523,6 @@ <h4 jhiTranslate="artemisApp.course.form.sections.enrollment"></h4>
537523
id="field_unenrollmentEndDate"
538524
labelName="{{ 'artemisApp.course.unenrollmentEndDate' | artemisTranslate }}"
539525
formControlName="unenrollmentEndDate"
540-
[(ngModel)]="course.unenrollmentEndDate"
541526
[error]="!isValidUnenrollmentEndDate"
542527
/>
543528
@if (!isValidUnenrollmentEndDate) {

src/main/webapp/app/core/course/manage/update/course-update.component.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,12 @@ hr {
5151
}
5252

5353
.nested-form-group {
54-
margin-left: 21.6px;
54+
margin-left: 1.35rem;
5555
margin-bottom: 0.5rem;
5656
}
57+
5758
.row.nested-form-group {
58-
margin-left: calc(21.6px - var(--bs-gutter-x) / 2);
59+
margin-left: calc(1.35rem - var(--bs-gutter-x) / 2);
5960
}
6061

6162
.nested-form-group.last {

src/main/webapp/i18n/de/course.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"courseIcon": "Kursicon",
5050
"shortName": "Kurzname",
5151
"maxComplaints": {
52-
"title": "Max. Anzahl an Beschwerden pro Student",
52+
"title": "Max. Anzahl an Beschwerden pro Studierende:n",
5353
"description": "Erlaubte Anzahl an Beschwerden von Studierenden setzen. Wenn eine Beschwerde abgelehnt wird, verliert der Studierende sie. Wenn eine Beschwerde akzeptiert wird, behält der Studierende sie. Diese Begrenzung gilt für individuelle Übungen."
5454
},
5555
"maxTeamComplaints": {
@@ -62,7 +62,7 @@
6262
},
6363
"maxComplaintTextLimit": {
6464
"title": "Max. Zeichenzahl pro Beschwerde",
65-
"description": "Diese Nummer gibt an, wie viele Zeichen ein Student maximal pro Beschwerde verwenden darf."
65+
"description": "Diese Nummer gibt an, wie viele Zeichen maximal pro Beschwerde verwendet werden dürfen."
6666
},
6767
"maxComplaintResponseTextLimit": {
6868
"title": "Max. Zeichenzahl pro Beschwerdeantwort",
@@ -151,7 +151,7 @@
151151
"enrollmentConfirmationMessage": "Nachricht zur Bestätigung der Einschreibung",
152152
"unenrollmentEnabled": {
153153
"title": "Austragen aus dem Kurs für Studierende aktiviert",
154-
"description": "Aktiviere diese Checkbox, damit sich Studierende selbstständig vom Kurs austragen können. Du kannst das späteste Datum hierfür einstellen, andernfalls ist es den Studenten bis zum Ende des Kurses möglich sich auszutragen."
154+
"description": "Aktiviere diese Checkbox, damit sich Studierende selbstständig vom Kurs austragen können. Du kannst das späteste Datum hierfür einstellen, andernfalls ist es den Studierenden bis zum Ende des Kurses möglich sich auszutragen."
155155
},
156156
"unenrollmentEndDate": "Spätestes Datum zur Austragung",
157157
"exercises": "Aufgaben",

0 commit comments

Comments
 (0)