Remove unused document stuff

master
trivernis 5 years ago
parent 752adaf511
commit 9ddc7de6ef

@ -6,8 +6,6 @@ import {SocketIoConfig, SocketIoModule} from 'ngx-socket-io';
import {HttpModule} from '@angular/http'; import {HttpModule} from '@angular/http';
import {AppComponent} from './app.component'; import {AppComponent} from './app.component';
import {DocumentListComponent} from './components/document-list/document-list.component';
import {DocumentComponent} from './components/document/document.component';
import {RegisterComponent} from './components/register/register.component'; import {RegisterComponent} from './components/register/register.component';
import {LoginComponent} from './components/login/login.component'; import {LoginComponent} from './components/login/login.component';
import {ChatComponent} from './components/chat/chat.component'; import {ChatComponent} from './components/chat/chat.component';
@ -81,8 +79,6 @@ const appRoutes: Routes = [
@NgModule({ @NgModule({
declarations: [ declarations: [
AppComponent, AppComponent,
DocumentListComponent,
DocumentComponent,
RegisterComponent, RegisterComponent,
LoginComponent, LoginComponent,
ChatComponent, ChatComponent,

@ -1,5 +0,0 @@
<div class='sidenav'>
<span (click)='newDoc()'>New Document</span>
<span [class.selected]='docId === currentDoc' (click)='loadDoc(docId)'
*ngFor='let docId of documents | async'>{{ docId }}</span>
</div>

@ -1,28 +0,0 @@
.sidenav {
position: fixed;
height: 100%;
width: 220px;
top: 0;
left: 0;
background-color: #111111;
overflow-x: hidden;
padding-top: 20px;
span {
padding: 6px 8px 6px 16px;
text-decoration: none;
font-size: 25px;
font-family: 'Roboto', Tahoma, Geneva, Verdana, sans-serif;
color: #818181;
display: block;
}
.selected {
color: #e1e1e1;
}
:hover {
color: #f1f1f1;
cursor: pointer;
}
}

@ -1,25 +0,0 @@
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {DocumentListComponent} from './document-list.component';
describe('DocumentListComponent', () => {
let component: DocumentListComponent;
let fixture: ComponentFixture<DocumentListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [DocumentListComponent]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(DocumentListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -1,36 +0,0 @@
import {Component, OnDestroy, OnInit} from '@angular/core';
import {Observable, Subscription} from 'rxjs';
import {DocumentService} from 'src/app/services/document.service';
@Component({
selector: 'app-document-list',
templateUrl: './document-list.component.html',
styleUrls: ['./document-list.component.scss']
})
export class DocumentListComponent implements OnInit, OnDestroy {
documents: Observable<string[]>;
currentDoc: string;
private _docSub: Subscription;
constructor(private documentService: DocumentService) {
}
ngOnInit() {
this.documents = this.documentService.documents;
this._docSub = this.documentService.currentDocument.subscribe(doc => this.currentDoc = doc.id);
}
ngOnDestroy() {
this._docSub.unsubscribe();
}
loadDoc(id: string) {
this.documentService.getDocument(id);
}
newDoc() {
this.documentService.newDocument();
}
}

@ -1 +0,0 @@
<textarea [(ngModel)]='document.doc' (keyup)='editDoc()' placeholder='Start typing...'></textarea>

@ -1,12 +0,0 @@
textarea {
position: fixed;
width: calc(100% - 235px);
height: 100%;
right: 0;
top: 0;
font-size: 18pt;
padding-top: 20px;
resize: none;
border: none;
padding: 20px 0px 20px 15px;
}

@ -1,25 +0,0 @@
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {DocumentComponent} from './document.component';
describe('DocumentComponent', () => {
let component: DocumentComponent;
let fixture: ComponentFixture<DocumentComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [DocumentComponent]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(DocumentComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -1,32 +0,0 @@
import {Component, OnDestroy, OnInit} from '@angular/core';
import {DocumentService} from 'src/app/services/document.service';
import {Subscription} from 'rxjs';
import {Document} from 'src/app/models/document';
import {startWith} from 'rxjs/operators';
@Component({
selector: 'app-document',
templateUrl: './document.component.html',
styleUrls: ['./document.component.scss']
})
export class DocumentComponent implements OnInit, OnDestroy {
document: Document;
private _docSub: Subscription;
constructor(private documentService: DocumentService) {
}
ngOnInit() {
this._docSub = this.documentService.currentDocument.pipe(
startWith({id: '', doc: 'Select an existing document or create a new one to get started'})
).subscribe(document => this.document = document);
}
ngOnDestroy() {
this._docSub.unsubscribe();
}
editDoc() {
this.documentService.editDocument(this.document);
}
}
Loading…
Cancel
Save