Skip to content
Snippets Groups Projects
Commit be76e465 authored by Ruben Bimberg's avatar Ruben Bimberg :computer:
Browse files

Fix UserRole bug

This commit fixes the UserRole error.
After a user enters a room,
another check is performed to ensure his role.

[Ticket: #118]
parent cbf41d6d
Branches
Tags
No related merge requests found
......@@ -5,7 +5,7 @@ import { TranslateService } from '@ngx-translate/core';
import { RoomCreatorPageComponent } from '../../../creator/room-creator-page/room-creator-page.component';
import { LanguageService } from '../../../../services/util/language.service';
import { EventService } from '../../../../services/util/event.service';
import { Router } from '@angular/router';
import { ActivatedRoute, Router } from '@angular/router';
import { CommentFilter } from '../../../../utils/filter-options';
import { RoomService } from '../../../../services/http/room.service';
import { Comment } from '../../../../models/comment';
......@@ -23,7 +23,7 @@ class CommentsCount {
styleUrls: ['./topic-cloud-filter.component.scss']
})
export class TopicCloudFilterComponent implements OnInit {
@Input() shortId: string;
@Input() target: string;
continueFilter = 'continueWithCurr';
comments: Comment[];
......@@ -115,7 +115,7 @@ export class TopicCloudFilterComponent implements OnInit {
}
CommentFilter.currentFilter = filter;
this.dialogRef.close(this.router.navigateByUrl('/participant/room/' + this.shortId + '/comments/tagcloud'));
this.dialogRef.close(this.router.navigateByUrl(this.target));
};
}
}
......@@ -224,6 +224,7 @@ export class CommentListComponent implements OnInit, OnDestroy {
this.userRole = this.route.snapshot.data.roles[0];
this.route.params.subscribe(params => {
this.shortId = params['shortId'];
this.authenticationService.checkAccess(this.shortId);
this.authenticationService.guestLogin(UserRole.PARTICIPANT).subscribe(r => {
this.roomService.getRoomByShortId(this.shortId).subscribe(room => {
this.room = room;
......
......@@ -305,7 +305,7 @@ export class HeaderComponent implements OnInit {
const confirmDialogRef = this.confirmDialog.open(TopicCloudFilterComponent, {
autoFocus: false
});
confirmDialogRef.componentInstance.shortId = this.shortId;
confirmDialogRef.componentInstance.target = this.router.url + '/tagcloud';
}
public navigateTopicCloudConfig() {
......
......@@ -74,7 +74,7 @@ export class RoomJoinComponent implements OnInit {
joinRoom(id: string): void {
if (!this.sessionCodeFormControl.hasError('required') && !this.sessionCodeFormControl.hasError('minlength')) {
if (!this.user) {
this.authenticationService.guestLogin(UserRole.CREATOR).subscribe(() => {
this.authenticationService.guestLogin(UserRole.PARTICIPANT).subscribe(() => {
this.getRoom(id);
});
} else {
......
......@@ -252,6 +252,7 @@ export class TagCloudComponent implements OnInit, OnDestroy, AfterContentInit, A
this.userRole = this.route.snapshot.data.roles[0];
this.route.params.subscribe(params => {
this.shortId = params['shortId'];
this.authenticationService.checkAccess(this.shortId);
this.authenticationService.guestLogin(UserRole.PARTICIPANT).subscribe(r => {
this.roomService.getRoomByShortId(this.shortId).subscribe(room => {
this.room = room;
......
......@@ -343,6 +343,59 @@
"session-name": "Name der Sitzung",
"preview": "Vorschau"
},
"tag-cloud-popup": {
"few-seconds": "wenige Sekunden",
"few-minutes": "wenige Minuten",
"some-minutes": "{{minutes}} Minuten",
"one-hour": "1 Stunde",
"some-hours": "{{hours}} Stunden",
"one-day": "1 Tag",
"some-days": "{{days}} Tage",
"one-week": "1 Woche",
"some-weeks": "{{weeks}} Wochen",
"some-months": "{{months}} Monate",
"tag-correction-placeholder": "Korrektur"
},
"topic-cloud-dialog": {
"cancel": "Abbrechen",
"save": "Speichern",
"edit": "Bearbeiten",
"delete": "Löschen",
"question-count-singular": "Frage",
"question-count-plural": "Fragen",
"edit-keyword-tip": "Neues Thema",
"no-keywords-note": "Es gibt keine Themen",
"consider-votes": "Votes berücksichtigen",
"profanity": "Schimpfwörter zensieren",
"hide-blacklist-words": "Blacklist Stichworte verbergen",
"sort-alpha": "Alphabetisch",
"sort-count": "Fragenanzahl",
"sort-vote": "Votes",
"keyword-search": "Stichwort suchen",
"edit-profanity-list": "Zensurliste bearbeiten",
"edit-blacklist-list": "Blackliste bearbeiten",
"add-word": "Wort hinzufügen",
"enter-word": "Wort eingeben",
"settings": "Einstellungen",
"keyword": "Stichwort",
"full-text": "Voller Text",
"both": "Beide",
"select-choice": "Wählen Sie aus",
"show-blacklist": "Zeige Blackliste",
"hide-blacklist": "Verberge Blackliste",
"show-profanity-list": "Zeige Schimpfwortliste",
"hide-profanity-list": "Verberge Schimpfwortliste",
"keyword-delete": "Stichwort gelöscht",
"keyword-edit": "Stichwort umbenannt",
"keywords-merge": "Stichwörter zusammengefügt",
"changes-gone-wrong": "Etwas ist schiefgelaufen",
"english": "Englisch",
"german": "Deutsch",
"select-all": "Alle auswählen",
"keyword-counter": "Anzahl der Themen",
"sort": "Sortieren",
"words-will-be-overwritten": "unanständige Wörter werden mit '***' überschrieben"
},
"tag-cloud-config":{
"general":"Allgemein",
"overflow":"Überlauf",
......
......@@ -344,6 +344,59 @@
"session-name": "Session name",
"preview": "Preview"
},
"tag-cloud-popup": {
"few-seconds": "few seconds",
"few-minutes": "few minutes",
"some-minutes": "{{minutes}} minutes",
"one-hour": "1 hour",
"some-hours": "{{hours}} hours",
"one-day": "1 day",
"some-days": "{{days}} days",
"one-week": "1 week",
"some-weeks": "{{weeks}} weeks",
"some-months": "{{months}} months",
"tag-correction-placeholder": "Correction"
},
"topic-cloud-dialog":{
"edit": "Edit",
"delete": "Delete",
"cancel": "Cancel",
"save": "Save",
"question-count-singular": "Question",
"question-count-plural": "Questions",
"edit-keyword-tip": "New topic",
"no-keywords-note": "There are no topics!",
"consider-votes": "Consider Votes",
"profanity": "Censor profanity",
"hide-blacklist-words": "Hide blacklist keywords",
"sort-alpha": "Alphabetically",
"sort-count": "Questions count",
"sort-vote": "Votes",
"keyword-search": "Search keyword",
"edit-profanity-list": "Edit profanity list",
"edit-blacklist-list": "Edit blacklist list",
"add-word": "Add Word",
"enter-word": "Enter word",
"settings": "Settings",
"keyword": "Keyword",
"full-text": "Full-text",
"both": "Both",
"select-choice": "Select one",
"show-blacklist": "Show blacklist",
"hide-blacklist": "Hide blacklist",
"show-profanity-list": "Show profanity list",
"hide-profanity-list": "Hide profanity list",
"keyword-delete": "keyword deleted",
"keyword-edit": "keyword renamed",
"keywords-merge": "keywords merged",
"changes-gone-wrong": "somthing has gone wrong",
"english": "English",
"german": "German",
"select-all": "Select all",
"keyword-counter": "Topic count",
"sort": "Sort",
"words-will-be-overwritten": "profane words will be overwritten with '***'"
},
"tag-cloud-config":{
"general":"General",
"overflow":"Overflow",
......@@ -395,7 +448,7 @@
"highestWeight-tooltip": "show x tags with the highest weight",
"rotate-weight": "Rotate some entries of this weight class randomly by x degrees",
"font":"Font",
"reset-btn": "Reset",
"reset-btn": "Reset",
"font-style-bold" : "Bold",
"font-style-italic": "Italic",
"font-family":"Font Family"
......
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