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

Fix wrong messages

parent f7262305
Branches
Tags
No related merge requests found
......@@ -193,30 +193,14 @@ export class TagCloudComponent implements OnInit, OnDestroy, AfterContentInit {
this.authenticationService.guestLogin(UserRole.PARTICIPANT).subscribe(r => {
this.roomService.getRoomByShortId(this.shortId).subscribe(room => {
this.room = room;
this.retrieveTagCloudSettings(room);
this.roomId = room.id;
this._subscriptionRoom = this.wsRoomService.getRoomStream(this.roomId).subscribe(msg => {
const message = JSON.parse(msg.body);
if (message.type === 'RoomPatched') {
this.room.questionsBlocked = message.payload.changes.questionsBlocked;
this.room.blacklistIsActive = message.payload.changes.blacklistIsActive;
const data = JSON.parse(message.payload.changes.tagCloudSettings);
if (data) {
const admin = TopicCloudAdminService.getDefaultAdminData;
admin.considerVotes = data.admin.considerVotes;
admin.keywordORfulltext = data.admin.keywordORfulltext;
admin.wantedLabels = data.admin.wantedLabels;
admin.minQuestioners = data.admin.minQuestioners;
admin.minQuestions = data.admin.minQuestions;
admin.minUpvotes = data.admin.minUpvotes;
admin.startDate = data.admin.startDate;
admin.endDate = data.admin.endDate;
data.admin = undefined;
this.topicCloudAdmin.setAdminData(admin, false, this.userRole);
this.setCloudParameters(data as CloudParameters);
} else {
this.resetColorsToTheme();
this.setCloudParameters(this.currentCloudParameters);
}
this.retrieveTagCloudSettings(message.payload.changes);
}
});
this.directSend = this.room.directSend;
......@@ -370,18 +354,39 @@ export class TagCloudComponent implements OnInit, OnDestroy, AfterContentInit {
TopicCloudAdminService.applySettingsToRoom(room);
this.room = room;
this.roomService.updateRoom(room).subscribe(_ => {
this.translateService.get('topic-cloud.changes-successful').subscribe(msg => {
this.translateService.get('tag-cloud.changes-successful').subscribe(msg => {
this.notificationService.show(msg);
});
},
error => {
this.translateService.get('topic-cloud.changes-gone-wrong').subscribe(msg => {
this.translateService.get('tag-cloud.changes-gone-wrong').subscribe(msg => {
this.notificationService.show(msg);
});
});
});
}
private retrieveTagCloudSettings(room: Room) {
const data = JSON.parse(room.tagCloudSettings);
if (data) {
const admin = TopicCloudAdminService.getDefaultAdminData;
admin.considerVotes = data.admin.considerVotes;
admin.keywordORfulltext = data.admin.keywordORfulltext;
admin.wantedLabels = data.admin.wantedLabels;
admin.minQuestioners = data.admin.minQuestioners;
admin.minQuestions = data.admin.minQuestions;
admin.minUpvotes = data.admin.minUpvotes;
admin.startDate = data.admin.startDate;
admin.endDate = data.admin.endDate;
data.admin = undefined;
this.topicCloudAdmin.setAdminData(admin, false, this.userRole);
this.setCloudParameters(data as CloudParameters);
} else {
this.resetColorsToTheme();
this.setCloudParameters(this.currentCloudParameters);
}
}
private updateAlphabeticalPosition(elements: TagComment[]): void {
const sizes = new Array(10);
const fontRange = (this._currentSettings.fontSizeMax - this._currentSettings.fontSizeMin) / 10;
......
......@@ -9,10 +9,10 @@
<div #tooltipContainer></div>
<div fxLayout="row" style="justify-content: space-between; padding: 0 5px">
<span aria-hidden="true" style="font-size: 75%">
{{ 'comment-page.Markdown-hint' | translate }}
{{currentText.length}} / {{maxTextCharacters}}
</span>
<span aria-hidden="true" style="font-size: 75%">
{{currentText.length}} / {{maxTextCharacters}}
{{'comment-page.format-count' | translate: {count: currentData.length, length: maxDataCharacters} }}
</span>
</div>
</ars-row>
......
......@@ -34,6 +34,7 @@ export class ViewCommentDataComponent implements OnInit, AfterViewInit {
@Input() user: User;
@Input() currentData = '';
@Input() maxTextCharacters = 500;
@Input() maxDataCharacters = 1500;
@Input() markEvents?: {
onCreate: (markContainer: HTMLDivElement, tooltipContainer: HTMLDivElement, editor: QuillEditorComponent) => void;
onChange: (delta: any) => void;
......
......@@ -49,6 +49,7 @@
[user]="user"
[isEditor]="true"
[maxTextCharacters]="maxTextCharacters"
[maxDataCharacters]="maxDataCharacters"
[markEvents]="getMarkEvents()"></app-view-comment-data>
<ars-row ars-flex-box *ngIf="enabled" class="spellcheck">
<ars-col>
......
......@@ -147,6 +147,7 @@
"exit-description": "Präsentation verlassen",
"export": "Exportieren",
"export-description": "Exportieren",
"format-count": "Formatierungszeichen {{count}}/{{length}}",
"live-announcer": "Du befindest dich jetzt auf der Fragen-Seite. Um Informationen zu Tastenkombinationen zu erhalten drücke jetzt die Enter-Taste oder rufe die Ansage zu einem späteren Zeitpunkt mit der Escape-Taste auf.",
"live-announcer-moderation": "Du befindest dich jetzt auf der Moderations-Seite. Um Informationen zu Tastenkombinationen zu erhalten drücke jetzt die Enter-Taste oder rufe die Ansage zu einem späteren Zeitpunkt mit der Escape-Taste auf.",
"mark-correct": "Frage bejahen",
......@@ -468,7 +469,9 @@
"period-since-first-comment":"Zeitraum seit der ersten Frage",
"upvote-topic": "Up-Votes für dieses Thema",
"downvote-topic": "Down-Votes für dieses Thema",
"blacklist-topic": "Thema auf die »Blacklist« setzen"
"blacklist-topic": "Thema auf die »Blacklist« setzen",
"changes-gone-wrong": "Etwas ist schiefgelaufen!",
"changes-successful": "Änderungen gespeichert."
},
"tag-cloud-config": {
"general": "Allgemein",
......
......@@ -148,6 +148,7 @@
"exit-description": "Exit Presentation Mode",
"export": "Export",
"export-description": "Export",
"format-count": "Formatting characters {{count}}/{{length}}",
"live-announcer": "You are now on the questions page. To get information about key combinations press the Enter key or call the announcement later with the Escape key.",
"live-announcer-moderation": "You are now on the moderation page. To get information about key combinations press the Enter key or call the announcement later with the Escape key.",
"mark-correct": "Mark as correct",
......@@ -377,7 +378,9 @@
"period-since-first-comment":"Period since first comment",
"upvote-topic": "Upvotes for this topic",
"downvote-topic": "Downvotes for this topic",
"blacklist-topic": "Add topic to blacklist"
"blacklist-topic": "Add topic to blacklist",
"changes-gone-wrong": "Something went wrong!",
"changes-successful": "Successfully updated."
},
"tag-cloud-popup": {
"few-seconds": "few seconds",
......
......@@ -131,6 +131,7 @@
"error-comment-text": "Dein Text ist zu lang. Bitte kürze ihn.",
"error-comment-data": "Zu viele Formatierungen oder verknüpfte Elemente. Bitte entferne einige.",
"error-title": "Bitte gib einen Titel ein.",
"format-count": "Formatierungszeichen {{count}}/{{length}}",
"has-answer": "Die Frage wurde kommentiert. Klick hier, um den Kommentar zu lesen.",
"exit-description": "Präsentationsmodus verlassen",
"live-announcer": "Du befindest dich jetzt auf der Fragen-Seite. Um Informationen zu Tastenkombinationen zu erhalten drücke jetzt die Enter-Taste oder rufe die Ansage zu einem späteren Zeitpunkt mit der Escape-Taste auf.",
......@@ -272,7 +273,9 @@
"period-since-first-comment":"Zeitraum seit der ersten Frage",
"upvote-topic": "Up-Votes für dieses Thema",
"downvote-topic": "Down-Votes für dieses Thema",
"blacklist-topic": "Thema auf die »Blacklist« setzen"
"blacklist-topic": "Thema auf die »Blacklist« setzen",
"changes-gone-wrong": "Etwas ist schiefgelaufen!",
"changes-successful": "Änderungen gespeichert."
},
"tag-cloud-popup": {
"few-seconds": "wenige Sekunden",
......
......@@ -141,6 +141,7 @@
"error-comment-data": "Too much formatting or linked elements. Please remove some.",
"error-title": "Please enter a title.",
"exit-description": "Exit Presentation Mode",
"format-count": "Formatting characters {{count}}/{{length}}",
"has-answer": "The question was answered. Click for full view.",
"live-announcer": "You are now on the questions page. To get information about key combinations press the Enter key or call the announcement later with the Escape key.",
"mark-not-correct": "Marked as correct",
......@@ -278,7 +279,9 @@
"period-since-first-comment":"Period since first comment",
"upvote-topic": "Upvotes for this topic",
"downvote-topic": "Downvotes for this topic",
"blacklist-topic": "Add topic to blacklist"
"blacklist-topic": "Add topic to blacklist",
"changes-gone-wrong": "Something went wrong!",
"changes-successful": "Successfully updated."
},
"tag-cloud-popup": {
"few-seconds": "few seconds",
......
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