Skip to content
Snippets Groups Projects
Commit 373bbcde authored by Lukas Mauß's avatar Lukas Mauß Committed by Tom Käsler
Browse files

Fix collection selection

parent ec4f97db
No related merge requests found
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<markdown [data]="content.body"></markdown> <markdown [data]="content.body"></markdown>
<mat-form-field> <mat-form-field>
<input matInput #group type="text" matInput [formControl]="myControl" [matAutocomplete]="auto" <input matInput #group type="text" matInput [formControl]="myControl" [matAutocomplete]="auto"
placeholder="Collection" name="group"/> placeholder="Collection"/>
<mat-autocomplete #auto="matAutocomplete"> <mat-autocomplete #auto="matAutocomplete">
<mat-option *ngFor="let collection of filteredOptions | async" [value]="collection"> <mat-option *ngFor="let collection of filteredOptions | async" [value]="collection">
{{collection}} {{collection}}
......
...@@ -6,12 +6,11 @@ import { NotificationService } from '../../../services/util/notification.service ...@@ -6,12 +6,11 @@ import { NotificationService } from '../../../services/util/notification.service
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material';
import { ContentListComponent } from '../content-list/content-list.component'; import { ContentListComponent } from '../content-list/content-list.component';
import { ContentDeleteComponent } from '../../dialogs/content-delete/content-delete.component'; import { ContentDeleteComponent } from '../../dialogs/content-delete/content-delete.component';
import { CollectionSelectComponent } from '../../dialogs/collection-select/collection-select.component';
import { map, startWith } from 'rxjs/operators'; import { map, startWith } from 'rxjs/operators';
import { FormControl } from '@angular/forms'; import { FormControl } from '@angular/forms';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { RoomService } from '../../../services/http/room.service'; import { RoomService } from '../../../services/http/room.service';
import {Room} from "../../../models/room"; import { Room } from '../../../models/room';
@Component({ @Component({
selector: 'app-content-text-creator', selector: 'app-content-text-creator',
...@@ -32,7 +31,7 @@ export class ContentTextCreatorComponent implements OnInit { ...@@ -32,7 +31,7 @@ export class ContentTextCreatorComponent implements OnInit {
1, 1,
[], [],
); );
collections: string[]; // ['ARSnova', 'Angular', 'HTML', 'TypeScript' ]; collections: string[] = ['ARSnova', 'Angular', 'HTML', 'TypeScript' ];
myControl = new FormControl(); myControl = new FormControl();
filteredOptions: Observable<string[]>; filteredOptions: Observable<string[]>;
...@@ -69,12 +68,6 @@ export class ContentTextCreatorComponent implements OnInit { ...@@ -69,12 +68,6 @@ export class ContentTextCreatorComponent implements OnInit {
this.notificationService.show('Content submitted. Ready for creation of new content.'); this.notificationService.show('Content submitted. Ready for creation of new content.');
} }
openCollectionSelectDialog(): void {
this.dialog.open(CollectionSelectComponent, {
width: '350px'
});
}
submitContent(subject: string, body: string, group: string) { submitContent(subject: string, body: string, group: string) {
this.contentService.addContent(new ContentText( this.contentService.addContent(new ContentText(
'1', '1',
...@@ -89,7 +82,6 @@ export class ContentTextCreatorComponent implements OnInit { ...@@ -89,7 +82,6 @@ export class ContentTextCreatorComponent implements OnInit {
this.notificationService.show('No empty fields allowed. Please check subject and body.'); this.notificationService.show('No empty fields allowed. Please check subject and body.');
return; return;
} }
this.notificationService.show('Content submitted.');
this.resetAfterSubmit(); this.resetAfterSubmit();
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment