Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
Revert "First frontend draft"
Browse files Browse the repository at this point in the history
This reverts commit 0156804.
  • Loading branch information
dboschm committed Apr 14, 2018
1 parent ef4e324 commit 20685cf
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 40 deletions.
2 changes: 0 additions & 2 deletions app/webFrontend/src/app/models/units/CodeKataUnit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ export class CodeKataUnit implements ICodeKataUnit {
weight: number;
updatedAt: string;
createdAt: string;
visibleFromDate: string;
visible: boolean;

definition: string;
code: string;
Expand Down
2 changes: 0 additions & 2 deletions app/webFrontend/src/app/models/units/FileUnit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ export class FileUnit implements IFileUnit {
weight: number;
updatedAt: string;
createdAt: string;
visibleFromDate: string;
visible: boolean;

files: IFile[] = [];
fileUnitType: string;
Expand Down
2 changes: 0 additions & 2 deletions app/webFrontend/src/app/models/units/FreeTextUnit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ export class FreeTextUnit implements IFreeTextUnit {
__t: string;
progressable: boolean;
weight: number;
visibleFromDate: string;
visible: boolean;

markdown: string;

Expand Down
2 changes: 0 additions & 2 deletions app/webFrontend/src/app/models/units/TaskUnit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ export class TaskUnit implements ITaskUnit {
__t: string;
progressable: boolean;
weight: number;
visibleFromDate: string;
visible: boolean;

tasks: ITask[] = [];
deadline: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ export class CodeKataUnitFormComponent implements OnInit {
name: this.generalInfo.form.value.name,
description: this.generalInfo.form.value.description,
deadline: this.generalInfo.form.value.deadline,
visible: this.generalInfo.form.value.visible,
visibleFromDate: this.generalInfo.form.value.visibleFromDate
};

if (this.model._id === undefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ export class FileUnitFormComponent implements OnInit {
this.model = {
...this.model,
name: this.generalInfo.form.value.name,
description: this.generalInfo.form.value.description,
visible: this.generalInfo.form.value.visible,
visibleFromDate: this.generalInfo.form.value.visibleFromDate
description: this.generalInfo.form.value.description
};

const reqObj = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ export class FreeTextUnitFormComponent implements OnInit {
...this.model,
name: this.generalInfo.form.value.name,
description: this.generalInfo.form.value.description,
visible: this.generalInfo.form.value.visible,
visibleFromDate: this.generalInfo.form.value.visibleFromDate,
markdown: this.freeTextEditor.markdown
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ export class TaskUnitEditComponent implements OnInit {
name: this.generalInfo.form.value.name,
description: this.generalInfo.form.value.description,
deadline: this.generalInfo.form.value.deadline,
visible: this.generalInfo.form.value.visible,
visibleFromDate: this.generalInfo.form.value.visibleFromDate
};

if (this.isTaskUnitValid()) {
Expand All @@ -80,7 +78,7 @@ export class TaskUnitEditComponent implements OnInit {
(task) => {
const message = `Task ${this.add ? 'created' : 'updated'}`;
this.snackBar.open(message, '', {duration: 3000});
this.onDone();
this.onDone()
return this.notificationService.createItem(
{
changedCourse: this.course,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,4 @@
<mat-datepicker-toggle matSuffix [for]="deadlineDatepicker"></mat-datepicker-toggle>
<mat-datepicker #deadlineDatepicker (selectedChanged)="updateDateTime($event)"></mat-datepicker>
</mat-form-field>

<div>
<mat-slide-toggle (change)="onChangeVisible($event)" [checked]="model.visible">
<span *ngIf="model.visible">Unit can be seen by students</span>
<span *ngIf="!model.visible">Unit cannot be seen by students</span>
</mat-slide-toggle>
</div>

<mat-form-field>
<input matInput formControlName="visibleFromDate" [matDatepicker]="visibleFromDateDatepicker" placeholder="Students can see this Unit from" [disabled]="model.visible">
<mat-datepicker-toggle matSuffix [for]="visibleFromDateDatepicker" [disabled]="model.visible"></mat-datepicker-toggle>
<mat-datepicker #visibleFromDateDatepicker></mat-datepicker>
</mat-form-field>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ export class UnitGeneralInfoFormComponent implements OnInit {
this.form = this.formBuilder.group({
name: [this.model ? this.model.name : '', Validators.required],
description: [this.model ? this.model.description : '', Validators.required],
deadline: [this.model ? this.model.deadline : ''],
visibleFromDate: [this.model ? this.model.visibleFromDate : ''],
visible: [this.model ? this.model.visible : false]
deadline: [this.model ? this.model.deadline : '']
});
}

Expand All @@ -32,8 +30,4 @@ export class UnitGeneralInfoFormComponent implements OnInit {
date.setHours(23);
date.setMinutes(59);
}

onChangeVisible(value) {
this.model.visible = value.checked;
}
}
2 changes: 0 additions & 2 deletions shared/models/units/IUnit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,5 @@ export interface IUnit {
weight: number;
updatedAt: string;
createdAt: string;
visibleFromDate: string;
visible: boolean;
__t: string;
}

0 comments on commit 20685cf

Please sign in to comment.