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

Merge branch...

Merge branch '671-implement-explanation-modals-for-the-my-bonus-stars-and-bonus-archive-dialogs' into 'staging'

Resolve "Implement explanation modals for the "My Bonus Stars" and "Bonus Archive" dialogs"

Closes #671

See merge request arsnova/frag.jetzt!654
parents 2772d62e 271292b9
Branches
Tags
No related merge requests found
Showing
with 128 additions and 28 deletions
......@@ -60,7 +60,21 @@
</div>
</div>
<app-dialog-action-buttons
buttonsLabelSection="content"
[cancelButtonClickAction]="buildDeclineActionCallback()">
</app-dialog-action-buttons>
<ars-row ars-flex-box class="action-button-container">
<ars-col>
<button
mat-flat-button
class="help-button"
(click)="openHelp()">
<mat-icon>help</mat-icon>
{{ 'explanation.label' | translate}}
</button>
</ars-col>
<ars-col>
<app-dialog-action-buttons
buttonsLabelSection="content"
[spacing]="false"
[cancelButtonClickAction]="buildDeclineActionCallback()">
</app-dialog-action-buttons>
</ars-col>
</ars-row>
......@@ -22,7 +22,6 @@ p {
}
.mat-stroked-button {
margin-left: 30px;
width: 130px;
height: 40px;
margin: auto;
......@@ -50,4 +49,26 @@ p {
.validator .mat-stroked-button {
float: right;
margin-left: -40%;
}
\ No newline at end of file
}
.action-button-container {
@media screen and (max-width: 500px) {
overflow: auto;
display: flex;
justify-content: space-between;
flex-direction: column !important;
flex-wrap: wrap;
align-items: flex-end;
}
}
.help-button {
background-color: var(--secondary);
color: var(--on-secondary);
margin-top: 1rem;
.mat-icon {
font-size: 18px;
margin-top: 3px;
}
}
......@@ -12,6 +12,7 @@ import { Subject, Subscription } from 'rxjs';
import { debounceTime } from 'rxjs/operators';
import { isNumeric } from 'rxjs/internal-compatibility';
import { EventService } from '../../../../services/util/event.service';
import { ExplanationDialogComponent } from '../../../shared/_dialogs/explanation-dialog/explanation-dialog.component';
@Component({
selector: 'app-bonus-token',
......@@ -39,7 +40,8 @@ export class BonusTokenComponent implements OnInit, OnDestroy {
ngOnInit() {
this.bonusTokenService.getTokensByRoomId(this.room.id).subscribe(list => {
this.bonusTokens = list.sort((a, b) => (a.token > b.token) ? 1 : -1);
list.sort((a, b) => (a.token > b.token) ? 1 : -1);
this.bonusTokens = list;
});
this.lang = localStorage.getItem('currentLang');
this.subscription = this.modelChanged
......@@ -105,9 +107,9 @@ export class BonusTokenComponent implements OnInit, OnDestroy {
}
navToCommentByValue() {
if(this.valid) {
this.bonusTokens.map(b => {
if(b.token === this.value) {
if (this.valid) {
this.bonusTokens.forEach(b => {
if (b.token === this.value) {
this.navToComment(b.commentId);
}
});
......@@ -133,7 +135,7 @@ export class BonusTokenComponent implements OnInit, OnDestroy {
inputToken() {
const index = this.validateTokenInput(this.value);
if(index) {
if (index) {
this.translationService.get('token-validator.valid').subscribe(msg => {
this.notificationService.show(msg);
});
......@@ -146,8 +148,15 @@ export class BonusTokenComponent implements OnInit, OnDestroy {
}
}
openHelp() {
const ref = this.dialog.open(ExplanationDialogComponent, {
autoFocus: false
});
ref.componentInstance.translateKey = 'explanation.bonus-archive';
}
validateTokenInput(input: any) {
if(input.length === 8 && isNumeric(input)) {
if (input.length === 8 && isNumeric(input)) {
return this.bonusTokens.map((c, index) => {
if (c.token === input) {
return index;
......
......@@ -41,7 +41,21 @@
</div>
</div>
<app-dialog-action-buttons
buttonsLabelSection="introduction"
[cancelButtonClickAction]="buildDeclineActionCallback()">
</app-dialog-action-buttons>
<ars-row ars-flex-box class="action-button-container">
<ars-col>
<button
mat-flat-button
class="help-button"
(click)="openHelp()">
<mat-icon>help</mat-icon>
{{ 'explanation.label' | translate}}
</button>
</ars-col>
<ars-col>
<app-dialog-action-buttons
buttonsLabelSection="introduction"
[spacing]="false"
[cancelButtonClickAction]="buildDeclineActionCallback()">
</app-dialog-action-buttons>
</ars-col>
</ars-row>
......@@ -25,3 +25,25 @@ form {
::ng-deep .mat-form-field .mat-form-field-infix {
max-width: 400px;
}
.action-button-container {
@media screen and (max-width: 500px) {
overflow: auto;
display: flex;
justify-content: space-between;
flex-direction: column !important;
flex-wrap: wrap;
align-items: flex-end;
}
}
.help-button {
background-color: var(--secondary);
color: var(--on-secondary);
margin-top: 1rem;
.mat-icon {
font-size: 18px;
margin-top: 3px;
}
}
......@@ -3,11 +3,12 @@ import { BonusTokenService } from '../../../../services/http/bonus-token.service
import { RoomService } from '../../../../services/http/room.service';
import { BonusToken } from '../../../../models/bonus-token';
import { BonusTokenRoomMixin } from '../../../../models/bonus-token-room-mixin';
import { MatDialogRef } from '@angular/material/dialog';
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
import { MatOptionSelectionChange } from '@angular/material/core';
import { Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
import { NotificationService } from '../../../../services/util/notification.service';
import { ExplanationDialogComponent } from '../../../shared/_dialogs/explanation-dialog/explanation-dialog.component';
export class MinRoom {
name: string;
......@@ -37,18 +38,18 @@ export class UserBonusTokenComponent implements OnInit {
private dialogRef: MatDialogRef<UserBonusTokenComponent>,
protected router: Router,
private translationService: TranslateService,
private dialog: MatDialog,
private notificationService: NotificationService
) {
}
ngOnInit() {
this.bonusTokenService.getTokensByUserId(this.userId).subscribe( list => {
this.bonusTokens = list.sort((a, b) => {
return (a.token > b.token) ? 1 : -1;
});
this.bonusTokenService.getTokensByUserId(this.userId).subscribe(list => {
list.sort((a, b) => (a.token > b.token) ? 1 : -1);
this.bonusTokens = list;
for (const bt of this.bonusTokens) {
this.roomService.getRoom(bt.roomId).subscribe(room => {
const btm = <BonusTokenRoomMixin> bt;
const btm = bt as BonusTokenRoomMixin;
btm.roomShortId = room.shortId;
btm.roomName = room.name;
this.bonusTokensMixin.push(btm);
......@@ -76,6 +77,13 @@ export class UserBonusTokenComponent implements OnInit {
return tokens;
}
openHelp() {
const ref = this.dialog.open(ExplanationDialogComponent, {
autoFocus: false
});
ref.componentInstance.translateKey = 'explanation.user-bonus';
}
setCurrentRoom(event: MatOptionSelectionChange, room: MinRoom) {
if (event.source.selected) {
this.currentRoom = room;
......
......@@ -254,7 +254,9 @@
"close": "Schließen",
"deepl": "## Text optimieren \n\nUm deine Frage optimal lesbar und verständlich zu präsentieren, lassen wir sie mit dem KI-Übersetzungsprogramm [DeepL](https://www.deepl.com/translator) ins Englische und zurück ins Deutsche übersetzen. \n\nDie Rückübersetzung ist in fast allen Fällen besser als das Original in Bezug auf Rechtschreibung, Grammatik, Interpunktion und Sprachstil.",
"spacy": "## Stichwörter \n\nMittels NLP (Natural Language Processing) wird deine Frage grammatikalisch analysiert. Die erkannten Substantive werden in ihre Grundform gebracht, d. h. lemmatisiert, und dir als Stichwörter vorgeschlagen. Für die Textanalyse verwenden wir die freie NLP-Software [spaCy](https://spacy.io/). \n\nDie Stichwörter können verwendet werden, um die Liste der Fragen zu filtern oder um eine Wortwolke zu erstellen.",
"topic-cloud": "## Themen als Wortwolke \n\nUnsere **Themenwolke** visualisiert die Bedeutung der Stichwörter. \n\n In die Berechnung der Schriftgröße gehen ein:\n\n* die Differenz zwischen Up- und Down-Votes, wenn sie positiv ist,\n* die Anzahl der Fragen mit diesem Stichwort,\n* die Anzahl der Fragensteller mit diesem Stichwort,\n* die Rolle des Fragenstellers: Raumersteller, Moderator oder Teilnehmer,\n* ob der Fragensteller eine Fragenkategorie ausgewählt hat,\n* ob das Stichwort generiert oder vom Fragensteller vergeben wurde,\n* ob die Frage vom Raumersteller oder einem Moderator beantwortet wurde.\n\nDie Themenwolke dient als **Navigator** zu allen Fragen zu einem Stichwort: Wenn du auf ein Wort in der Wolke klickst, gelangst du zu den Fragen mit diesem Stichwort."
"topic-cloud": "## Themen als Wortwolke \n\nUnsere **Themenwolke** visualisiert die Bedeutung der Stichwörter. \n\n In die Berechnung der Schriftgröße gehen ein:\n\n* die Differenz zwischen Up- und Down-Votes, wenn sie positiv ist,\n* die Anzahl der Fragen mit diesem Stichwort,\n* die Anzahl der Fragensteller mit diesem Stichwort,\n* die Rolle des Fragenstellers: Raumersteller, Moderator oder Teilnehmer,\n* ob der Fragensteller eine Fragenkategorie ausgewählt hat,\n* ob das Stichwort generiert oder vom Fragensteller vergeben wurde,\n* ob die Frage vom Raumersteller oder einem Moderator beantwortet wurde.\n\nDie Themenwolke dient als **Navigator** zu allen Fragen zu einem Stichwort: Wenn du auf ein Wort in der Wolke klickst, gelangst du zu den Fragen mit diesem Stichwort.",
"user-bonus": "Lorem ipsum",
"bonus-archive": "Lorem ipsum"
},
"home-page": {
"create-session": "Neue Sitzung",
......
......@@ -255,7 +255,9 @@
"close": "Close",
"deepl": "## Text optimization\n\nTo make your question as readable and understandable as possible, we have it translated into German and back into English using the translation program [DeepL](https://www.deepl.com/translator).\n\nThe back translation is in almost all cases better than the original in terms of spelling, grammar, punctuation and language style.",
"spacy": "## Text analysis\n\nUsing NLP (Natural Language Processing) your question will be analyzed grammatically. The recognized nouns are put into their basic form, i.e. lemmatized, and suggested to you as keywords. For the text analysis we use the free NLP software [spaCy](https://spacy.io/). \n\nThe keywords can be used to filter the list of questions or to create a word cloud.",
"topic-cloud": "## Topics as tags in a word cloud\n\nOur **topic cloud** visualizes the significance of the keywords. \n\n The calculation of the font size includes:\n\n* the difference between up- and down-votes, if it is positive\n* the number of questions with this keyword\n* the number of questioners with this keyword.\n* the role of the questioner: room creator, moderator or participant \n* whether the questioner has selected a question category \n* whether the keyword was generated or assigned by the question poser\n* whether the question was answered by the room creator or a moderator \n\n The topic cloud serves as a **navigator** to all questions related to a selected keyword: If you click on a word in the cloud, you will get to the questions related to this keyword."
"topic-cloud": "## Topics as tags in a word cloud\n\nOur **topic cloud** visualizes the significance of the keywords. \n\n The calculation of the font size includes:\n\n* the difference between up- and down-votes, if it is positive\n* the number of questions with this keyword\n* the number of questioners with this keyword.\n* the role of the questioner: room creator, moderator or participant \n* whether the questioner has selected a question category \n* whether the keyword was generated or assigned by the question poser\n* whether the question was answered by the room creator or a moderator \n\n The topic cloud serves as a **navigator** to all questions related to a selected keyword: If you click on a word in the cloud, you will get to the questions related to this keyword.",
"user-bonus": "Lorem ipsum",
"bonus-archive": "Lorem ipsum"
},
"home-page": {
"create-session": "New session",
......
......@@ -64,7 +64,9 @@
"close": "Schließen",
"deepl": "## Text optimieren \n\nUm deine Frage optimal lesbar und verständlich zu präsentieren, lassen wir sie mit dem KI-Übersetzungsprogramm [DeepL](https://www.deepl.com/translator) ins Englische und zurück ins Deutsche übersetzen. \n\nDie Rückübersetzung ist in fast allen Fällen besser als das Original in Bezug auf Rechtschreibung, Grammatik, Interpunktion und Sprachstil.",
"spacy": "## Stichwörter \n\nMittels NLP (Natural Language Processing) wird deine Frage grammatikalisch analysiert. Die erkannten Substantive werden in ihre Grundform gebracht, d. h. lemmatisiert, und dir als Stichwörter vorgeschlagen. Für die Textanalyse verwenden wir die freie NLP-Software [spaCy](https://spacy.io/). \n\nDie Stichwörter können verwendet werden, um die Liste der Fragen zu filtern oder um eine Wortwolke zu erstellen.",
"topic-cloud": "## Themen als Wortwolke \n\nUnsere **Themenwolke** visualisiert die Bedeutung der Stichwörter. \n\n In die Berechnung der Schriftgröße gehen ein:\n\n* die Differenz zwischen Up- und Down-Votes, wenn sie positiv ist,\n* die Anzahl der Fragen mit diesem Stichwort,\n* die Anzahl der Fragensteller mit diesem Stichwort,\n* die Rolle des Fragenstellers: Raumersteller, Moderator oder Teilnehmer,\n* ob der Fragensteller eine Fragenkategorie ausgewählt hat,\n* ob das Stichwort generiert oder vom Fragensteller vergeben wurde,\n* ob die Frage vom Raumersteller oder einem Moderator beantwortet wurde.\n\nDie Themenwolke dient als **Navigator** zu allen Fragen zu einem Stichwort: Wenn du auf ein Wort in der Wolke klickst, gelangst du zu den Fragen mit diesem Stichwort."
"topic-cloud": "## Themen als Wortwolke \n\nUnsere **Themenwolke** visualisiert die Bedeutung der Stichwörter. \n\n In die Berechnung der Schriftgröße gehen ein:\n\n* die Differenz zwischen Up- und Down-Votes, wenn sie positiv ist,\n* die Anzahl der Fragen mit diesem Stichwort,\n* die Anzahl der Fragensteller mit diesem Stichwort,\n* die Rolle des Fragenstellers: Raumersteller, Moderator oder Teilnehmer,\n* ob der Fragensteller eine Fragenkategorie ausgewählt hat,\n* ob das Stichwort generiert oder vom Fragensteller vergeben wurde,\n* ob die Frage vom Raumersteller oder einem Moderator beantwortet wurde.\n\nDie Themenwolke dient als **Navigator** zu allen Fragen zu einem Stichwort: Wenn du auf ein Wort in der Wolke klickst, gelangst du zu den Fragen mit diesem Stichwort.",
"user-bonus": "Lorem ipsum",
"bonus-archive": "Lorem ipsum"
},
"header": {
"abort": "Abbrechen",
......
......@@ -51,7 +51,9 @@
"close": "Close",
"deepl": "## Text optimization\n\nTo make your question as readable and understandable as possible, we have it translated into English and back into German using the translation program [DeepL] (https://www.deepl.com/translator). \n\nThe back translation is in almost all cases better than the original in terms of spelling, grammar, punctuation and language style.",
"spacy": "## Text analysis\n\nUsing NLP (Natural Language Processing) your question will be analyzed grammatically. The recognized nouns are put into their basic form, i.e. lemmatized, and suggested to you as keywords. For the text analysis we use the free NLP software [spaCy] (https://spacy.io/). \n\nThe keywords can be used to filter the list of questions or to create a word cloud.",
"topic-cloud": "## Topics as tags in a word cloud\n\nOur **topic cloud** visualizes the significance of the keywords. \n\n The calculation of the font size includes:\n\n* the difference between up- and down-votes, if it is positive\n* the number of questions with this keyword\n* the number of questioners with this keyword.\n* the role of the questioner: room creator, moderator or participant \n* whether the questioner has selected a question category\n* whether the keyword was generated or assigned by the question poser\n* whether the question was answered by the room creator or a moderator \n\n The topic cloud serves as a **navigator** to all questions related to a selected keyword: If you click on a word in the cloud, you will get to the questions related to this keyword."
"topic-cloud": "## Topics as tags in a word cloud\n\nOur **topic cloud** visualizes the significance of the keywords. \n\n The calculation of the font size includes:\n\n* the difference between up- and down-votes, if it is positive\n* the number of questions with this keyword\n* the number of questioners with this keyword.\n* the role of the questioner: room creator, moderator or participant \n* whether the questioner has selected a question category\n* whether the keyword was generated or assigned by the question poser\n* whether the question was answered by the room creator or a moderator \n\n The topic cloud serves as a **navigator** to all questions related to a selected keyword: If you click on a word in the cloud, you will get to the questions related to this keyword.",
"user-bonus": "Lorem ipsum",
"bonus-archive": "Lorem ipsum"
},
"header": {
"abort": "Cancel",
......
......@@ -182,7 +182,9 @@
"close": "Schließen",
"deepl": "## Text optimieren \n\nUm deine Frage optimal lesbar und verständlich zu präsentieren, lassen wir sie mit dem KI-Übersetzungsprogramm [DeepL](https://www.deepl.com/translator) ins Englische und zurück ins Deutsche übersetzen. \n\nDie Rückübersetzung ist in fast allen Fällen besser als das Original in Bezug auf Rechtschreibung, Grammatik, Interpunktion und Sprachstil.",
"spacy": "## Stichwörter \n\nMittels NLP (Natural Language Processing) wird deine Frage grammatikalisch analysiert. Die erkannten Substantive werden in ihre Grundform gebracht, d. h. lemmatisiert, und dir als Stichwörter vorgeschlagen. Für die Textanalyse verwenden wir die freie NLP-Software [spaCy](https://spacy.io/). \n\nDie Stichwörter können verwendet werden, um die Liste der Fragen zu filtern oder um eine Wortwolke zu erstellen.",
"topic-cloud": "## Themen als Wortwolke \n\nUnsere **Themenwolke** visualisiert die Bedeutung der Stichwörter. \n\n In die Berechnung der Schriftgröße gehen ein:\n\n* die Differenz zwischen Up- und Down-Votes, wenn sie positiv ist,\n* die Anzahl der Fragen mit diesem Stichwort,\n* die Anzahl der Fragensteller mit diesem Stichwort,\n* die Rolle des Fragenstellers: Raumersteller, Moderator oder Teilnehmer,\n* ob der Fragensteller eine Fragenkategorie ausgewählt hat,\n* ob das Stichwort generiert oder vom Fragensteller vergeben wurde,\n* ob die Frage vom Raumersteller oder einem Moderator beantwortet wurde.\n\nDie Themenwolke dient als **Navigator** zu allen Fragen zu einem Stichwort: Wenn du auf ein Wort in der Wolke klickst, gelangst du zu den Fragen mit diesem Stichwort."
"topic-cloud": "## Themen als Wortwolke \n\nUnsere **Themenwolke** visualisiert die Bedeutung der Stichwörter. \n\n In die Berechnung der Schriftgröße gehen ein:\n\n* die Differenz zwischen Up- und Down-Votes, wenn sie positiv ist,\n* die Anzahl der Fragen mit diesem Stichwort,\n* die Anzahl der Fragensteller mit diesem Stichwort,\n* die Rolle des Fragenstellers: Raumersteller, Moderator oder Teilnehmer,\n* ob der Fragensteller eine Fragenkategorie ausgewählt hat,\n* ob das Stichwort generiert oder vom Fragensteller vergeben wurde,\n* ob die Frage vom Raumersteller oder einem Moderator beantwortet wurde.\n\nDie Themenwolke dient als **Navigator** zu allen Fragen zu einem Stichwort: Wenn du auf ein Wort in der Wolke klickst, gelangst du zu den Fragen mit diesem Stichwort.",
"user-bonus": "Lorem ipsum",
"bonus-archive": "Lorem ipsum"
},
"home-page": {
"exactly-8": "Ein Raum-Code hat genau 8 Ziffern.",
......
......@@ -191,7 +191,9 @@
"close": "Close",
"deepl": "## Text optimization\n\nTo make your question as readable and understandable as possible, we have it translated into German and back into English using the translation program [DeepL](https://www.deepl.com/translator).\n\nThe back translation is in almost all cases better than the original in terms of spelling, grammar, punctuation and language style.",
"spacy": "## Text analysis\n\nUsing NLP (Natural Language Processing) your question will be analyzed grammatically. The recognized nouns are put into their basic form, i.e. lemmatized, and suggested to you as keywords. For the text analysis we use the free NLP software [spaCy](https://spacy.io/). \n\nThe keywords can be used to filter the list of questions or to create a word cloud.",
"topic-cloud": "## Topics as tags in a word cloud\n\nOur **topic cloud** visualizes the significance of the keywords. \n\n The calculation of the font size includes:\n\n* the difference between up- and down-votes, if it is positive\n* the number of questions with this keyword\n* the number of questioners with this keyword.\n* the role of the questioner: room creator, moderator or participant \n* whether the questioner has selected a question category\n* whether the keyword was generated or assigned by the question poser\n* whether the question was answered by the room creator or a moderator \n\n The topic cloud serves as a **navigator** to all questions related to a selected keyword: If you click on a word in the cloud, you will get to the questions related to this keyword."
"topic-cloud": "## Topics as tags in a word cloud\n\nOur **topic cloud** visualizes the significance of the keywords. \n\n The calculation of the font size includes:\n\n* the difference between up- and down-votes, if it is positive\n* the number of questions with this keyword\n* the number of questioners with this keyword.\n* the role of the questioner: room creator, moderator or participant \n* whether the questioner has selected a question category\n* whether the keyword was generated or assigned by the question poser\n* whether the question was answered by the room creator or a moderator \n\n The topic cloud serves as a **navigator** to all questions related to a selected keyword: If you click on a word in the cloud, you will get to the questions related to this keyword.",
"user-bonus": "Lorem ipsum",
"bonus-archive": "Lorem ipsum"
},
"home-page": {
"exactly-8": "A key is a combination of 8 digits.",
......
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