Skip to content

Commit

Permalink
dont display the header of a by status graph if no applications and a…
Browse files Browse the repository at this point in the history
…ssociate editors statistics if no asseds
  • Loading branch information
amdomanska committed Oct 16, 2024
1 parent a319adb commit c38fb8d
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions portality/static/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,16 @@ ${status}</a></li>`;
}

// Completed applications by associated editor
statisticsFrag += `<h4 class="label label--secondary">Applications <span class="label label--secondary status status--completed" style="padding: .5em; display: unset;">Completed</span> by associated editors</h4>`;
statisticsFrag += `<ul class="inlined-list">`;
for (let associateEditor of historicalNumbers.associate_editors) {
statisticsFrag += `<li><span class="label tag">${associateEditor.id}</span> <span class="tag tag--tertiary">${associateEditor.count}</span></span>`;
}
if (historicalNumbers.associate_editors.length) {
statisticsFrag += `<h4 class="label label--secondary">Applications <span class="progress-bar__bar--completed label label--secondary" style="padding: .5em; display: unset;">Completed</span> by associated editors</h4>`;
statisticsFrag += `<ul class="inlined-list">`;
for (let associateEditor of historicalNumbers.associate_editors) {
statisticsFrag += `<li><span class="label tag">${associateEditor.name}</span> <span class="tag tag--tertiary">${associateEditor.count}</span></span>`;
}

statisticsFrag += `</ul>
</section>`;
statisticsFrag += `</ul>`
}
statisticsFrag += `</section>`;
}

return statisticsFrag;
Expand Down Expand Up @@ -273,17 +275,16 @@ ${status}</a></li>`;
<ul class="inlined-list">
${editorListFrag}
</ul>
</section>
<section>
<h4 class="label label--secondary">Applications by status</h4>
<ul class="inlined-list progress-bar">
${appStatusProgressBar}
</ul>
</section>
${statisticsFragment}
</div>`;
</section>`
if (data["total"]["applications"]) {
frag += `<section>
<h4 class="label label--secondary">Applications by status</h4>
<ul class="inlined-list progress-bar">
${appStatusProgressBar}
</ul>
</section>`
}
frag += `${statisticsFragment}</div>`;

return frag;
}
Expand Down

0 comments on commit c38fb8d

Please sign in to comment.