Merge pull request #4560 from FinnStutzenstein/removeChatMessageClient
Remove the ChatMessage from the client
This commit is contained in:
commit
fc3098b08f
@ -282,8 +282,6 @@ _('Can manage the projector');
|
||||
_('Can see the front page');
|
||||
_('Can manage tags');
|
||||
_('Can manage configuration');
|
||||
_('Can use the chat');
|
||||
_('Can manage the chat');
|
||||
_('Can manage logos and fonts');
|
||||
_('Can see history');
|
||||
// mediafiles
|
||||
|
@ -1,17 +0,0 @@
|
||||
import { TestBed, inject } from '@angular/core/testing';
|
||||
|
||||
import { E2EImportsModule } from 'e2e-imports.module';
|
||||
import { ChatMessageRepositoryService } from './chatmessage-repository.service';
|
||||
|
||||
describe('ChatMessageRepositoryService', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [E2EImportsModule],
|
||||
providers: [ChatMessageRepositoryService]
|
||||
});
|
||||
});
|
||||
|
||||
it('should be created', inject([ChatMessageRepositoryService], (service: ChatMessageRepositoryService) => {
|
||||
expect(service).toBeTruthy();
|
||||
}));
|
||||
});
|
@ -1,34 +0,0 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DataStoreService } from '../../core-services/data-store.service';
|
||||
import { BaseRepository } from '../base-repository';
|
||||
import { CollectionStringMapperService } from '../../core-services/collectionStringMapper.service';
|
||||
import { ChatMessage } from 'app/shared/models/core/chat-message';
|
||||
import { ViewChatMessage } from 'app/site/common/models/view-chatmessage';
|
||||
import { ViewModelStoreService } from 'app/core/core-services/view-model-store.service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { DataSendService } from 'app/core/core-services/data-send.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ChatMessageRepositoryService extends BaseRepository<ViewChatMessage, ChatMessage> {
|
||||
public constructor(
|
||||
DS: DataStoreService,
|
||||
dataSend: DataSendService,
|
||||
mapperService: CollectionStringMapperService,
|
||||
viewModelStoreService: ViewModelStoreService,
|
||||
translate: TranslateService
|
||||
) {
|
||||
super(DS, dataSend, mapperService, viewModelStoreService, translate, ChatMessage);
|
||||
}
|
||||
|
||||
public getVerboseName = (plural: boolean = false) => {
|
||||
return this.translate.instant(plural ? 'Chatmessages' : 'Chatmessage');
|
||||
};
|
||||
|
||||
protected createViewModel(message: ChatMessage): ViewChatMessage {
|
||||
const viewChatMessage = new ViewChatMessage(message);
|
||||
viewChatMessage.getVerboseName = this.getVerboseName;
|
||||
return viewChatMessage;
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
import { BaseModel } from '../base/base-model';
|
||||
|
||||
/**
|
||||
* Representation of chat messages.
|
||||
* @ignore
|
||||
*/
|
||||
export class ChatMessage extends BaseModel<ChatMessage> {
|
||||
public static COLLECTIONSTRING = 'core/chat-message';
|
||||
public id: number;
|
||||
public message: string;
|
||||
public timestamp: string; // TODO: Type for timestamp
|
||||
public user_id: number;
|
||||
|
||||
public constructor(input?: any) {
|
||||
super(ChatMessage.COLLECTIONSTRING, input);
|
||||
}
|
||||
}
|
@ -1,18 +1,7 @@
|
||||
import { AppConfig } from '../../core/app-config';
|
||||
import { ChatMessage } from '../../shared/models/core/chat-message';
|
||||
import { ChatMessageRepositoryService } from 'app/core/repositories/common/chatmessage-repository.service';
|
||||
import { ViewChatMessage } from './models/view-chatmessage';
|
||||
|
||||
export const CommonAppConfig: AppConfig = {
|
||||
name: 'common',
|
||||
models: [
|
||||
{
|
||||
collectionString: 'core/chat-message',
|
||||
model: ChatMessage,
|
||||
viewModel: ViewChatMessage,
|
||||
repository: ChatMessageRepositoryService
|
||||
}
|
||||
],
|
||||
mainMenuEntries: [
|
||||
{
|
||||
route: '/',
|
||||
|
@ -1,40 +0,0 @@
|
||||
import { ChatMessage } from 'app/shared/models/core/chat-message';
|
||||
import { BaseViewModel } from 'app/site/base/base-view-model';
|
||||
|
||||
export class ViewChatMessage extends BaseViewModel {
|
||||
public static COLLECTIONSTRING = ChatMessage.COLLECTIONSTRING;
|
||||
|
||||
private _chatMessage: ChatMessage;
|
||||
|
||||
/**
|
||||
* This is set by the repository
|
||||
*/
|
||||
public getVerboseName;
|
||||
|
||||
public get chatmessage(): ChatMessage {
|
||||
return this._chatMessage;
|
||||
}
|
||||
|
||||
public get id(): number {
|
||||
return this.chatmessage.id;
|
||||
}
|
||||
|
||||
public get message(): string {
|
||||
return this.chatmessage.message;
|
||||
}
|
||||
|
||||
public constructor(message?: ChatMessage) {
|
||||
super(ChatMessage.COLLECTIONSTRING);
|
||||
this._chatMessage = message;
|
||||
}
|
||||
|
||||
public getTitle = () => {
|
||||
return 'Chatmessage';
|
||||
};
|
||||
|
||||
public getModel(): ChatMessage {
|
||||
return this.chatmessage;
|
||||
}
|
||||
|
||||
public updateDependencies(message: BaseViewModel): void {}
|
||||
}
|
Loading…
Reference in New Issue
Block a user