Skip to content

Commit

Permalink
🐞 The candidates would not be displayed if write ins active (#357) (#362
Browse files Browse the repository at this point in the history
)

Parent issue: sequentech/meta#148

---------

Co-authored-by: Eduardo Robles Elvira <edu@sequentech.io>
  • Loading branch information
Findeton and edulix committed Jul 19, 2023
1 parent 8faa7f1 commit 8dd4fa3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h3 class="category-heading">
</span>
</div>
</div>
<div class="category-body">
<div class="category-body" ng-class="{'empty-category': isEmptyCategory}">
<div
class="question-answers text-left"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,18 @@
box-shadow: none;
}
}
[avb-simultaneous-questions-category-v2].empty-category {
background-color: unset;
box-shadow: unset;

.category-heading-container {
display: none;
}

.category-body .questions-answers {
gap: unset;
}
}
[avb-simultaneous-questions-category-v2] {
background-color: @av-primary;
padding: 0 14px 20px 16px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ <h2 class="question-title" aria-level="2" ng-bind-html="question.title">
'flex-col-12': (question.extra_options.answer_group_columns_size === 12),
'flex-col-6': (question.extra_options.answer_group_columns_size === 6),
'flex-col-4': (question.extra_options.answer_group_columns_size === 4),
'flex-col-3': (question.extra_options.answer_group_columns_size === 3)
'flex-col-3': (question.extra_options.answer_group_columns_size === 3),
'empty-category': !category.title
}"
>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,19 @@ angular.module('avBooth')
return (
!ErrorCheckerGeneratorService.hasUrl(answer.urls, 'invalidVoteFlag', 'true') &&
!ErrorCheckerGeneratorService.hasUrl(answer.urls, 'isCategoryList', 'true') &&
!!answer.category &&
(
!ErrorCheckerGeneratorService.hasUrl(answer.urls, 'isWriteIn', 'true') ||
(question.extra_options && question.extra_options.allow_writeins)
)
);
}
);

var hasNonEmptyCategory = _.pluck(filteredAnswers, "category").some(
function (category) {
return !!category;
}
);
var categories = _.groupBy(filteredAnswers, "category");
categories = _.map(
_.pairs(categories),
Expand All @@ -220,8 +225,9 @@ angular.module('avBooth')
};
}
);

question.categories = categories;
question.hasCategories = (categories.length >= 1);
question.hasCategories = hasNonEmptyCategory;

// filter write-ins
question.writeIns = _.filter(
Expand Down

0 comments on commit 8dd4fa3

Please sign in to comment.