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

Merge branch '658-do-not-offer-question-analysis-if-there-are-no-questions' into 'staging'

Resolve "Do not offer question analysis if there are no questions"

Closes #658, #660, and #661

See merge request arsnova/frag.jetzt!641
parents 2efa4860 314df4a2
Branches
Tags
No related merge requests found
...@@ -86,7 +86,7 @@ export class TopicCloudFilterComponent implements OnInit, OnDestroy { ...@@ -86,7 +86,7 @@ export class TopicCloudFilterComponent implements OnInit, OnDestroy {
this._room = data.room; this._room = data.room;
this.roomDataService.getRoomData(data.room.id).subscribe(roomData => { this.roomDataService.getRoomData(data.room.id).subscribe(roomData => {
this.comments = roomData; this.comments = roomData;
this.commentsLoadedCallback(); this.commentsLoadedCallback(true);
}); });
this._subscriptionCommentUpdates = this.roomDataService.receiveUpdates([{ finished: true }]) this._subscriptionCommentUpdates = this.roomDataService.receiveUpdates([{ finished: true }])
.subscribe(_ => this.commentsLoadedCallback()); .subscribe(_ => this.commentsLoadedCallback());
...@@ -100,16 +100,30 @@ export class TopicCloudFilterComponent implements OnInit, OnDestroy { ...@@ -100,16 +100,30 @@ export class TopicCloudFilterComponent implements OnInit, OnDestroy {
} }
} }
commentsLoadedCallback() { commentsLoadedCallback(isNew = false) {
this.allComments = this.getCommentCounts(this.comments); this.allComments = this.getCommentCounts(this.comments);
this.filteredComments = this.getCommentCounts(this.comments.filter(comment => this.tmpFilter.checkComment(comment))); this.filteredComments = this.getCommentCounts(this.comments.filter(comment => this.tmpFilter.checkComment(comment)));
this.hasNoKeywords = this.isUpdatable(); if (isNew) {
this.hasNoKeywords = this.isUpdatable();
}
this.disableCurrentFiltersOptions = ((this.allComments.comments === this.filteredComments.comments) && this.disableCurrentFiltersOptions = ((this.allComments.comments === this.filteredComments.comments) &&
(this.allComments.users === this.filteredComments.users) && (this.allComments.users === this.filteredComments.users) &&
(this.allComments.keywords === this.filteredComments.keywords)); (this.allComments.keywords === this.filteredComments.keywords));
if (this.disableCurrentFiltersOptions) { if (this.disableCurrentFiltersOptions) {
this.continueFilter = 'continueWithAll'; this.continueFilter = 'continueWithAll';
} }
if (this.filteredComments.comments === 0 && this.allComments.comments === 0) {
if (this.user && this.user.role > UserRole.PARTICIPANT) {
setTimeout(() => {
this.continueFilter = 'continueWithAllFromNow';
});
} else {
setTimeout(() => {
this.continueFilter = 'continueWithAllFromNow';
this.confirmButtonActionCallback()();
});
}
}
} }
isMobile(): boolean { isMobile(): boolean {
...@@ -188,6 +202,9 @@ export class TopicCloudFilterComponent implements OnInit, OnDestroy { ...@@ -188,6 +202,9 @@ export class TopicCloudFilterComponent implements OnInit, OnDestroy {
count++; count++;
} }
}); });
if (newCount + count < 1) {
return false;
}
if (this.user && this.user.role === UserRole.PARTICIPANT) { if (this.user && this.user.role === UserRole.PARTICIPANT) {
return newCount < 1; return newCount < 1;
} }
......
...@@ -60,31 +60,31 @@ ...@@ -60,31 +60,31 @@
[xp]="16" [xp]="16"
[extra]="true"> [extra]="true">
<button mat-icon-button <button mat-icon-button
disableRipple="true"
*ngIf="isAdminConfigEnabled" *ngIf="isAdminConfigEnabled"
class="pseudo-button" class="pseudo-button"
matRipple
matTooltip="{{'header.overview-admin-config-enabled' | translate}}"> matTooltip="{{'header.overview-admin-config-enabled' | translate}}">
<mat-icon class="oldtypo-h2 comment_tag-icon" <mat-icon class="oldtypo-h2 comment_tag-icon"
style="color: red !important;">warning style="color: red !important;">warning
</mat-icon> </mat-icon>
</button> </button>
<button mat-icon-button <button mat-icon-button
disableRipple="true"
class="pseudo-button" class="pseudo-button"
matRipple
matTooltip="{{'header.overview-question-tooltip' | translate}}"> matTooltip="{{'header.overview-question-tooltip' | translate}}">
<mat-icon class="oldtypo-h2 comment_tag-icon">comment</mat-icon> <mat-icon class="oldtypo-h2 comment_tag-icon">comment</mat-icon>
<span style="margin-left: 0.25em;">{{commentsCountQuestions}}</span> <span style="margin-left: 0.25em;">{{commentsCountQuestions}}</span>
</button> </button>
<button mat-icon-button <button mat-icon-button
disableRipple="true"
class="pseudo-button" class="pseudo-button"
matRipple
matTooltip="{{'header.overview-questioners-tooltip' | translate}}"> matTooltip="{{'header.overview-questioners-tooltip' | translate}}">
<mat-icon class="oldtypo-h2 comment_tag-icon">person</mat-icon> <mat-icon class="oldtypo-h2 comment_tag-icon">person</mat-icon>
<span style="margin-left: 0.25em;">{{commentsCountUsers}}</span> <span style="margin-left: 0.25em;">{{commentsCountUsers}}</span>
</button> </button>
<button mat-icon-button <button mat-icon-button
disableRipple="true"
class="pseudo-button" class="pseudo-button"
matRipple
matTooltip="{{'header.overview-keywords-tooltip' | translate}}"> matTooltip="{{'header.overview-keywords-tooltip' | translate}}">
<mat-icon svgIcon="hashtag" <mat-icon svgIcon="hashtag"
class="oldtypo-h2 comment_tag-icon"></mat-icon> class="oldtypo-h2 comment_tag-icon"></mat-icon>
......
...@@ -45,9 +45,11 @@ mat-toolbar-row { ...@@ -45,9 +45,11 @@ mat-toolbar-row {
.topic-cloud-btns { .topic-cloud-btns {
> ars-col button { > ars-col button {
margin-right: 0.75em; margin-right: 0.75em;
cursor: default;
&:hover, &:focus { &:hover, &:focus {
border: none; border: none;
cursor: default;
} }
} }
......
...@@ -31,6 +31,7 @@ import { CloudParameters, CloudTextStyle } from '../../../utils/cloud-parameters ...@@ -31,6 +31,7 @@ import { CloudParameters, CloudTextStyle } from '../../../utils/cloud-parameters
import { SmartDebounce } from '../../../utils/smart-debounce'; import { SmartDebounce } from '../../../utils/smart-debounce';
import { Theme } from '../../../../theme/Theme'; import { Theme } from '../../../../theme/Theme';
import { MatDrawer } from '@angular/material/sidenav'; import { MatDrawer } from '@angular/material/sidenav';
import { DeviceInfoService } from '../../../services/util/device-info.service';
class CustomPosition implements Position { class CustomPosition implements Position {
left: number; left: number;
...@@ -127,7 +128,8 @@ export class TagCloudComponent implements OnInit, OnDestroy, AfterContentInit { ...@@ -127,7 +128,8 @@ export class TagCloudComponent implements OnInit, OnDestroy, AfterContentInit {
private topicCloudAdmin: TopicCloudAdminService, private topicCloudAdmin: TopicCloudAdminService,
private router: Router, private router: Router,
public dataManager: TagCloudDataService, public dataManager: TagCloudDataService,
private wsRoomService: WsRoomService) { private wsRoomService: WsRoomService,
private deviceInfo: DeviceInfoService) {
this.roomId = localStorage.getItem('roomId'); this.roomId = localStorage.getItem('roomId');
this.langService.langEmitter.subscribe(lang => { this.langService.langEmitter.subscribe(lang => {
this.translateService.use(lang); this.translateService.use(lang);
...@@ -384,6 +386,12 @@ export class TagCloudComponent implements OnInit, OnDestroy, AfterContentInit { ...@@ -384,6 +386,12 @@ export class TagCloudComponent implements OnInit, OnDestroy, AfterContentInit {
admin.endDate = data.admin.endDate; admin.endDate = data.admin.endDate;
data.admin = undefined; data.admin = undefined;
this.topicCloudAdmin.setAdminData(admin, false, this.userRole); this.topicCloudAdmin.setAdminData(admin, false, this.userRole);
if (this.deviceInfo.isCurrentlyMobile) {
const defaultParams = new CloudParameters();
defaultParams.resetToDefault(this.themeService.getThemeByKey(this.themeService.themeName).isDark);
data.fontSizeMin = defaultParams.fontSizeMin;
data.fontSizeMax = defaultParams.fontSizeMax;
}
this.setCloudParameters(data as CloudParameters); this.setCloudParameters(data as CloudParameters);
} else { } else {
this.resetColorsToTheme(); this.resetColorsToTheme();
......
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