Move all message types to a standardised location

This commit is contained in:
Kristóf Tóth
2018-05-31 11:31:22 +02:00
parent 2bf68b1500
commit e510fb58f6
18 changed files with 30 additions and 30 deletions

View File

@ -16,7 +16,7 @@ import 'brace/mode/python';
import 'brace/mode/sql';
import 'brace/theme/cobalt';
import { SourceCode } from './source-code';
import { IDECommand } from '../message.types/ide.command';
import { WebSocketService } from '../services/websocket.service';
import { ProcessManagerService } from '../services/processmanager.service';
import { DeploymentNotificationService } from '../services/deployment-notification.service';
@ -89,7 +89,7 @@ export class IdeComponent implements OnInit {
}
subscribeWS() {
this.webSocketService.observeKey<SourceCode>(this.key_id).subscribe((event) => {
this.webSocketService.observeKey<IDECommand>(this.key_id).subscribe((event) => {
this.command_handlers[event.data.command](event.data);
this.changeDetectorRef.detectChanges();
});
@ -119,7 +119,7 @@ export class IdeComponent implements OnInit {
);
}
updateFileData(data: SourceCode) {
updateFileData(data: IDECommand) {
this.filename = data.filename;
this.directory = data.directory;
this.code = (data.content != null) ? data.content : this.code;
@ -127,15 +127,15 @@ export class IdeComponent implements OnInit {
this.files = data.files;
}
selectHandler(data: SourceCode) {
selectHandler(data: IDECommand) {
this.updateFileData(data);
}
reloadHandler(data: SourceCode) {
reloadHandler(data: IDECommand) {
this.requestCode();
}
readHandler(data: SourceCode) {
readHandler(data: IDECommand) {
if (this.codeState === CodeState.SAVED) {
this.updateFileData(data);
}
@ -145,7 +145,7 @@ export class IdeComponent implements OnInit {
this.setCodeState(CodeState.SAVED);
}
selectdirHandler(data: SourceCode) {
selectdirHandler(data: IDECommand) {
this.updateFileData(data);
}

View File

@ -1,10 +0,0 @@
// Copyright (C) 2018 Avatao.com Innovative Learning Kft.
// All Rights Reserved. See LICENSE file for details.
export interface SourceCode {
filename: string;
content?: string;
files: string[];
directory: string;
command: string;
}