Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into remove-issuer-state…
Browse files Browse the repository at this point in the history
…-injection
  • Loading branch information
kkmanos committed Apr 3, 2024
2 parents f30df7f + 7d8fbef commit 1f76ae1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions public/js/consent.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,14 @@ function checkCardSelection() {
selectCard.forEach(selectCard => {
selectCard.addEventListener('click', (e) => {
const button = e.target.closest('.toggle-card');
const thisId = e.target.id;
if (button) {
const isSelectedIcon = button.querySelector('.is-selected');
const isNotSelectedIcon = button.querySelector('.is-not-selected');
button.classList.toggle('selected');

// Toggle icon visibility
if(layout.classList.contains('multi')) {
toggleInput(thisId);
}
isSelectedIcon.style.display = isSelectedIcon.style.display === 'none' ? 'inline' : 'none';
isNotSelectedIcon.style.display = isNotSelectedIcon.style.display === 'none' ? 'inline' : 'none';

Expand Down Expand Up @@ -153,11 +155,11 @@ function selectInput(value) {
enableSubmitButtons();
}

function toggleInput(value) {
function toggleInput(id) {
const inputs = document.querySelectorAll('input');

inputs.forEach(input => {
if (input.value === value) {
if (input.id === id) {
input.disabled = !input.disabled;
}

Expand Down
6 changes: 3 additions & 3 deletions views/issuer/consent.pug
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ block layout-content
//- form.diplomas(name='selectDiplomas' method="post")
for credential, index in credentialViewList
.credential-card
input(type="hidden" name="selected_credential_id_list[]" value=credential.credential_id disabled)
input(type="hidden" name="selected_credential_id_list[]" id=`${credential.credential_id}_${index}` value=`${credential.credential_id}` disabled)
a.credential.toggle-card(id=`${credential.credential_id}_${index}` style=`background-image: url(${credential.credential_supported_object.display[0].logo.url});`)
if grant_type == "authorization_code"
i.is-selected.fa.fa-check-square-o(aria-hidden="true" style="display: none;")
Expand Down Expand Up @@ -66,7 +66,7 @@ block layout-content
.GetMultiBtnArea
p.Errors.Hidden#NoCredentialSelectedError Please select at least one Credential to be issued
if grant_type == "authorization_code"
button.Btn.Small.GetMultiBtn(type="submit" disabled) Get credentials
button.Btn.Small.GetMultiBtn(type="button" disabled) Get credentials
if grant_type == "authorization_code"
.DetailsArea
section.DetailsLayout
Expand All @@ -84,7 +84,7 @@ block layout-content
td
div 1 year
.BarBtnContainer
button#BarBtn.Btn.Large.GetMultiBtn(type="button" disabled) Get credentials
button#BarBtn.Btn.Large.GetMultiBtn(type="submit" disabled) Get credentials
input(id='wwwalletURL' type='hidden' value=wwwalletURL)

link(rel="stylesheet" href="/styles/consent.css")
Expand Down

0 comments on commit 1f76ae1

Please sign in to comment.