Skip to content
Snippets Groups Projects
Commit 6ef25ba0 authored by Klaus-Dieter Quibeldey-Cirkel's avatar Klaus-Dieter Quibeldey-Cirkel
Browse files

Merge branch 'tag-cloud' into 'staging'

Merge 'tag-cloud' into 'staging'

See merge request arsnova/topic-cloud!63
parents a85eec37 103082f3
No related merge requests found
revision of the tool-tips and the translation
\ No newline at end of file
......@@ -100,6 +100,9 @@ export class CloudConfigurationComponent implements OnInit {
this.cloudParameters = this.parent.currentCloudParameters;
this.defaultCloudParameters = this.parent.currentCloudParameters;
this.parent.dataManager.getMetaData().subscribe((value)=>{
if (!value) {
return;
}
this.countPerWeight = value.countPerWeight;
this.parseArrayToJsonWeightClasses();
});
......
......@@ -133,6 +133,7 @@ export class CommentListComponent implements OnInit, OnDestroy {
initNavigation() {
this._subscriptionEventServiceTagConfig = this.eventService.on<string>('setTagConfig').subscribe(tag => {
this.setTimePeriod(Period.all);
this.clickedOnKeyword(tag);
});
this._subscriptionEventServiceRoomData = this.eventService.on<string>('pushCurrentRoomData').subscribe(_ => {
......@@ -395,7 +396,9 @@ export class CommentListComponent implements OnInit, OnDestroy {
return c.userNumber === compare;
case this.keyword:
this.selectedKeyword = compare;
return c.keywordsFromQuestioner ? c.keywordsFromQuestioner.includes(compare) : false;
const isInQuestioner = c.keywordsFromQuestioner ? c.keywordsFromQuestioner.includes(compare) : false;
const isInSpacy = c.keywordsFromSpacy ? c.keywordsFromSpacy.includes(compare) : false;
return isInQuestioner || isInSpacy;
case this.answer:
return c.answer;
case this.unanswered:
......
......@@ -237,10 +237,16 @@ export class TagCloudComponent implements OnInit, OnDestroy, AfterContentInit, A
});
}
});
this.dataManager.getData().subscribe(_ => {
this.dataManager.getData().subscribe(data => {
if (!data) {
return;
}
this.rebuildData();
});
this.dataManager.getMetaData().subscribe(data => {
if (!data) {
return;
}
this.eventService.broadcast('tagCloudHeaderDataOverview', data);
});
this.authenticationService.watchUser.subscribe(newUser => {
......
import { Injectable } from '@angular/core';
import { TopicCloudAdminData } from '../../components/shared/_dialogs/topic-cloud-administration/TopicCloudAdminData';
import { Observable, Subject, Subscription } from 'rxjs';
import { BehaviorSubject, Observable, Subject, Subscription } from 'rxjs';
import { TopicCloudAdminService } from './topic-cloud-admin.service';
import { CommentFilter } from '../../utils/filter-options';
import { TranslateService } from '@ngx-translate/core';
......@@ -65,8 +65,8 @@ export enum TagCloudCalcWeightType {
export class TagCloudDataService {
private _isDemoActive: boolean;
private _isAlphabeticallySorted: boolean;
private _dataBus: Subject<TagCloudData>;
private _metaDataBus: Subject<TagCloudMetaData>;
private _dataBus: BehaviorSubject<TagCloudData>;
private _metaDataBus: BehaviorSubject<TagCloudMetaData>;
private _cachedData: TagCloudData;
private _commentSubscription = null;
private _roomId = null;
......@@ -85,7 +85,7 @@ export class TagCloudDataService {
private _roomDataService: RoomDataService) {
this._isDemoActive = false;
this._isAlphabeticallySorted = false;
this._dataBus = new Subject<TagCloudData>();
this._dataBus = new BehaviorSubject<TagCloudData>(null);
this._currentMetaData = {
tagCount: 0,
commentCount: 0,
......@@ -94,7 +94,7 @@ export class TagCloudDataService {
maxWeight: 0,
countPerWeight: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
};
this._metaDataBus = new Subject<TagCloudMetaData>();
this._metaDataBus = new BehaviorSubject<TagCloudMetaData>(null);
this._cachedData = null;
// Subscribe to own 'service' for caching
this._dataBus.asObservable().subscribe(data => {
......
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