diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 66ab49e75c7279e6eeca8ddd988298a751d6c945..eb0554009d96fec4acbd906420d53c5b5b5b289d 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -96,6 +96,8 @@ import { GenericDataDialogComponent } from './components/dialogs/generic-data-di import { FooterComponent } from './components/fragments/footer/footer.component'; import { FooterLoginDialogComponent } from './components/dialogs/footer-login-dialog/footer-login-dialog.component'; import { FooterImprintComponent } from './components/pages/footer-imprint/footer-imprint.component'; +import { CollectionSelectComponent } from './components/dialogs/collection-select/collection-select.component'; +import { AddCollectionComponent } from './components/dialogs/add-collection/add-collection.component'; export function dialogClose(dialogResult: any) { } @@ -144,7 +146,8 @@ export function dialogClose(dialogResult: any) { GenericDataDialogComponent, FooterComponent, FooterLoginDialogComponent, - FooterImprintComponent + FooterImprintComponent, + CollectionSelectComponent ], entryComponents: [ RegisterComponent, @@ -161,7 +164,8 @@ export function dialogClose(dialogResult: any) { ContentDeleteComponent, MarkdownHelpDialogComponent, GenericDataDialogComponent, - FooterLoginDialogComponent + FooterLoginDialogComponent, + CollectionSelectComponent ], imports: [ AppRoutingModule, diff --git a/src/app/components/dialogs/collection-select-component/collection-select-component.component.html b/src/app/components/dialogs/collection-select-component/collection-select-component.component.html new file mode 100644 index 0000000000000000000000000000000000000000..8eb205d142af9c1deef206b3b1e66692ae232488 --- /dev/null +++ b/src/app/components/dialogs/collection-select-component/collection-select-component.component.html @@ -0,0 +1,3 @@ +<p> + collection-select-component works! +</p> diff --git a/src/app/components/dialogs/collection-select-component/collection-select-component.component.scss b/src/app/components/dialogs/collection-select-component/collection-select-component.component.scss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/app/components/dialogs/collection-select-component/collection-select-component.component.spec.ts b/src/app/components/dialogs/collection-select-component/collection-select-component.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..763f10321f275597f304653d9815bd4885025673 --- /dev/null +++ b/src/app/components/dialogs/collection-select-component/collection-select-component.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CollectionSelectComponentComponent } from './collection-select-component.component'; + +describe('CollectionSelectComponentComponent', () => { + let component: CollectionSelectComponentComponent; + let fixture: ComponentFixture<CollectionSelectComponentComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CollectionSelectComponentComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CollectionSelectComponentComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/dialogs/collection-select-component/collection-select-component.component.ts b/src/app/components/dialogs/collection-select-component/collection-select-component.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..570dc1caab270f0f206c2b952abbdc7b1622d488 --- /dev/null +++ b/src/app/components/dialogs/collection-select-component/collection-select-component.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-collection-select-component', + templateUrl: './collection-select-component.component.html', + styleUrls: ['./collection-select-component.component.scss'] +}) +export class CollectionSelectComponentComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/components/dialogs/collection-select/collection-select.component.html b/src/app/components/dialogs/collection-select/collection-select.component.html new file mode 100644 index 0000000000000000000000000000000000000000..c33ded255d91c4e5e23764aa3c6ac775fc4a90f2 --- /dev/null +++ b/src/app/components/dialogs/collection-select/collection-select.component.html @@ -0,0 +1,19 @@ +<form> + <div fxLayout="column" fxLayoutAlign="center" fxLayoutGap="10px"> + <div fxLayout="row" fxLayoutAlign="center"> + <p> + Please select a collection or create a new one! + </p> + <button mat-raised-button color="primary" type="submit"> + <mat-icon>note_add</mat-icon> + </button> + </div> + <div> + <mat-selection-list #collection> + <mat-list-option checkboxPosition="before" *ngFor="let collection of collections"> + {{collection}} + </mat-list-option> + </mat-selection-list> + </div> + </div> +</form> diff --git a/src/app/components/dialogs/collection-select/collection-select.component.scss b/src/app/components/dialogs/collection-select/collection-select.component.scss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/app/components/dialogs/collection-select/collection-select.component.spec.ts b/src/app/components/dialogs/collection-select/collection-select.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..cc4ea9286fde12ea1ae9da215dcffcb5ee4fb584 --- /dev/null +++ b/src/app/components/dialogs/collection-select/collection-select.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CollectionSelectComponent } from './collection-select.component'; + +describe('CollectionSelectComponent', () => { + let component: CollectionSelectComponent; + let fixture: ComponentFixture<CollectionSelectComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CollectionSelectComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CollectionSelectComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/dialogs/collection-select/collection-select.component.ts b/src/app/components/dialogs/collection-select/collection-select.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..a6c2826ff521dd1cd2322c3d9ae593be1298c28c --- /dev/null +++ b/src/app/components/dialogs/collection-select/collection-select.component.ts @@ -0,0 +1,39 @@ +import { Component, Inject, OnInit } from '@angular/core'; +import { RoomService } from '../../../services/http/room.service'; +import { Room } from '../../../models/room'; +import { Router } from '@angular/router'; +import { NotificationService } from '../../../services/util/notification.service'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material'; + +@Component({ + selector: 'app-collection-select', + templateUrl: './collection-select.component.html', + styleUrls: ['./collection-select.component.scss'] +}) +export class CollectionSelectComponent implements OnInit { + + name: string; + emptyInputs = false; + room: Room; + roomId: string; + collections: string[] = ['ARSnova', 'Angular', 'HTML', 'TypeScript' ]; + + constructor(private roomService: RoomService, + private router: Router, + private notification: NotificationService, + public dialogRef: MatDialogRef<CollectionSelectComponent>, + @Inject(MAT_DIALOG_DATA) public data: any) { + } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + } + + resetEmptyInputs(): void { + this.emptyInputs = false; + } + +} diff --git a/src/app/components/fragments/content-text-creator/content-text-creator.component.html b/src/app/components/fragments/content-text-creator/content-text-creator.component.html index 78e4f1c3799a64856407f38531a0d21d27c304d9..aff13e677e9d495a12077241b042a417c805e420 100644 --- a/src/app/components/fragments/content-text-creator/content-text-creator.component.html +++ b/src/app/components/fragments/content-text-creator/content-text-creator.component.html @@ -8,8 +8,8 @@ matTextareaAutosize matAutosizeMinRows="3" matAutosizeMaxRows="8"></textarea> </mat-form-field> <markdown [data]="content.body"></markdown> - <div *ngIf="!editDialogMode"> - <button mat-raised-button type="submit" color="primary">Submit</button> + <div fxLayout="row" fxLayoutAlign="center" fxLayoutGap="5px" *ngIf="!editDialogMode"> + <button mat-raised-button type="submit" color="primary" (click)="openCollectionSelectDialog()">Submit</button> </div> <div *ngIf="editDialogMode"> <button mat-raised-button (click)="editDialogClose($event,'edit')" color="primary">Update</button> diff --git a/src/app/components/fragments/content-text-creator/content-text-creator.component.ts b/src/app/components/fragments/content-text-creator/content-text-creator.component.ts index d8a1f1cc359b3ea88edf6d0c92150a8047227dca..96149725886a1afd5048687b6b5af91048832e33 100644 --- a/src/app/components/fragments/content-text-creator/content-text-creator.component.ts +++ b/src/app/components/fragments/content-text-creator/content-text-creator.component.ts @@ -6,6 +6,8 @@ import { NotificationService } from '../../../services/util/notification.service import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material'; import { ContentListComponent } from '../content-list/content-list.component'; import { ContentDeleteComponent } from '../../dialogs/content-delete/content-delete.component'; +import { RoomCreateComponent } from '../../dialogs/room-create/room-create.component'; +import { CollectionSelectComponent } from '../../dialogs/collection-select/collection-select.component'; @Component({ selector: 'app-content-text-creator', @@ -47,6 +49,12 @@ export class ContentTextCreatorComponent implements OnInit { this.notificationService.show('Content submitted. Ready for creation of new content.'); } + openCollectionSelectDialog(): void { + this.dialog.open(CollectionSelectComponent, { + width: '350px' + }); + } + submitContent(subject: string, body: string) { this.contentService.addContent(new ContentText( '1', diff --git a/src/app/components/fragments/room-join/room-join.component.html b/src/app/components/fragments/room-join/room-join.component.html index a90377652e1f69cd4ebe2da722f8d9ed9d8252ec..34f130104165f3f52cae0f1a6aeeee79226b8d05 100644 --- a/src/app/components/fragments/room-join/room-join.component.html +++ b/src/app/components/fragments/room-join/room-join.component.html @@ -8,7 +8,7 @@ <mat-error *ngIf="roomFormControl.hasError('minlength')">A room-id has exactly 8 digits.</mat-error> </mat-form-field> <button mat-fab color="primary" type="submit"> - <mat-icon>send</mat-icon> + <mat-icon>input</mat-icon> </button> </div> </form> diff --git a/src/app/components/fragments/room-list/room-list.component.html b/src/app/components/fragments/room-list/room-list.component.html index 2513764e9b0fdc1734b5ee7dd2161989ddaec001..d0729809dc820b5ed790ace94eebb0c538ce5980 100644 --- a/src/app/components/fragments/room-list/room-list.component.html +++ b/src/app/components/fragments/room-list/room-list.component.html @@ -5,7 +5,7 @@ <mat-expansion-panel *ngFor="let room of rooms"> <mat-expansion-panel-header> <button mat-button color="primary" routerLink="/{{ baseUrl }}/room/{{ room.shortId }}"> - <mat-icon>send</mat-icon> + <mat-icon>input</mat-icon> </button> <mat-panel-title> {{ room.shortId }}