Skip to content

Commit

Permalink
Merge pull request #61 from molit-institute/fix-summary-buttons
Browse files Browse the repository at this point in the history
fix summary buttons
  • Loading branch information
rossjan committed Nov 24, 2021
2 parents 1c2c69f + e37e7a2 commit f9a4fe9
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@molit/questionnaire-renderer",
"version": "1.0.4",
"version": "1.0.5",
"private": false,
"description": "Stencil Component for questionnaire-renderer",
"main": "dist/index.cjs.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ export class QuestionnaireRenderer {
*/
async filterItemList() {
let newList = [];
if (this.currentQuestionnaireResponse && this.questionnaire) {
if (this.currentQuestionnaireResponse && this.currentQuestionnaire) {
newList = await questionnaireController.handleEnableWhen(this.currentQuestionnaireResponse, this.currentQuestionnaire.item);
}
this.filteredItemList = newList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ export class QuestionnaireSummary {
</div>
)}
</div>
<div class="qr-summary-buttonContainer">
<div class="qr-summary-buttonContainer" v-if="editable">
<button type="button" class="btn button btn-outline-primary btn-lg qr-button-outline-primary" onClick={() => this.returnToQuestionnaire()}>
{this.strings.back}
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
margin-top: -4px;
color: #6a6a6a;
}
.qr-question-hidden {
visibility: hidden;
}
.center-vertical {
flex: 1;
display: flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,13 @@ export class StepperQuestionnaire {
} else if (this.count === this.filteredItemList.length - 1 && !this.disabled && !this.editMode) {
if (!this.enableSummary) {
this.finish.emit('finish');
}else{
} else {
this.summary.emit('summary');
}
} else if (this.startCount !== null && this.editMode) {
if (!this.enableSummary) {
this.finish.emit('finish');
}else{
} else {
this.summary.emit('summary');
}
}
Expand Down Expand Up @@ -278,6 +278,12 @@ export class StepperQuestionnaire {
}
}
}
/**
*
*/
isGroupQuestion() {
return this.filteredItemList[this.count].type === "group";
}

/* Lifecycle Methods */
componentDidUpdate() {
Expand Down Expand Up @@ -327,11 +333,18 @@ export class StepperQuestionnaire {
<div class="qr-stepperQuestionnaire-progress-container">
{/* PROGRESS */}
<div class="progress qr-stepperQuestionnaire-progress">
<div class="progress-bar qr-stepperQuestionnaire-progress-progressBar" role="progressbar" aria-valuenow={this.questionCount} aria-valuemin="1" aria-valuemax={this.numberOfQuestions()} style={{ width: (this.questionCount / this.numberOfQuestions()) * 100 + '%' }}></div>
<div
class="progress-bar qr-stepperQuestionnaire-progress-progressBar"
role="progressbar"
aria-valuenow={this.questionCount}
aria-valuemin="1"
aria-valuemax={this.numberOfQuestions()}
style={{ width: (this.questionCount / this.numberOfQuestions()) * 100 + '%' }}
></div>
</div>
{/* Progress Counter */}
{this.strings ? (
<div class="progress-counter qr-stepperQuestionnaire-title">
<div class={this.isGroupQuestion() ? 'qr-question-hidden progress-counter qr-stepperQuestionnaire-title' : 'progress-counter qr-stepperQuestionnaire-title'}>
<span style={{ color: this.primary }}>
{this.strings.question} {this.questionCount} &nbsp;
</span>
Expand Down

0 comments on commit f9a4fe9

Please sign in to comment.