Skip to content
Merged

Dev #2601

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
0cedb5f
[AB#31718] Normalize form control layout for form configuration tabs
plavoie-BC Jun 17, 2026
d145f3a
Merge remote-tracking branch 'origin/dev' into bugfix/AB#31718-form-c…
plavoie-BC Jun 17, 2026
238c440
[AB#31718] Add Standardized Form Config Action Bar
plavoie-BC Jun 22, 2026
b593ff0
Merge remote-tracking branch 'origin/dev' into bugfix/AB#31718-form-c…
plavoie-BC Jun 22, 2026
be63e85
AB#33493: Sanitize HTML of Scoresheets
aurelio-aot Jun 22, 2026
adc8852
[AB#31718] Form Configuration Action Bar Quality Fixes
plavoie-BC Jun 22, 2026
276106a
[AB#33086] Add Fiscal Year End calculation and localization
plavoie-BC Jun 22, 2026
26db08d
[AB#33086] Add Fiscal Year End calculation for applicant page
plavoie-BC Jun 23, 2026
6c4d1aa
Merge branch 'dev' into feature/AB#33086-calculate-FYE
plavoie-BC Jun 23, 2026
0c34c9a
[AB#33086] Fiscal Year End - SonarQube Fixes
plavoie-BC Jun 23, 2026
bad27bb
[AB#33086] Fiscal Year End Date - Fix Mapping Bug
plavoie-BC Jun 23, 2026
80c6a63
Merge branch 'dev' into bugfix/AB#31718-form-config-action-bar
plavoie-BC Jun 23, 2026
eedd1e7
[AB#32199] Add Permission-User Matrix page and logic
plavoie-BC Jun 23, 2026
0bc762a
[AB#32199] Enhance Permission-User Matrix with role display
plavoie-BC Jun 23, 2026
6f1dca7
[AB#32199] Implement table layout adjustment on resize
plavoie-BC Jun 23, 2026
07f1384
[AB#32199] Refactor Permission-User Matrix for export options
plavoie-BC Jun 23, 2026
c8ad28d
[AB#32199] Add authorization attributes to Permission matrices
plavoie-BC Jun 23, 2026
f5ade4e
[AB#32199] Optimize user role retrieval and display logic
plavoie-BC Jun 23, 2026
9aaaaeb
[AB#32199] Update authorization attributes for role and user matrices
plavoie-BC Jun 23, 2026
e4f3cb6
[AB#32199] Add authorization checks for buttons and code fixes
plavoie-BC Jun 23, 2026
5aefee2
[AB#31718] Update button attributes for cancel action
plavoie-BC Jun 23, 2026
9825935
[AB#31718] Update report configuration tab container
plavoie-BC Jun 23, 2026
94af011
[AB#31718] Update button styles for compact action bar
plavoie-BC Jun 23, 2026
f48574e
AB#33493: Fix Sonarqube Issues
aurelio-aot Jun 23, 2026
e92b33c
AB#33087: Add Category Column in Payment List Page
aurelio-aot Jun 24, 2026
ee9f321
feature/AB#33609-FixSqlLightVulnerability
JamesPasta Jun 24, 2026
be08899
Merge pull request #2582 from bcgov/bugfix/AB#31718-form-config-actio…
JamesPasta Jun 24, 2026
37be46e
Merge pull request #2598 from bcgov/feature/AB#33609-FixSqlLightVulne…
JamesPasta Jun 24, 2026
8b9fb82
Merge pull request #2596 from bcgov/feature/AB#33087-Payment-List-Cat…
JamesPasta Jun 24, 2026
a2a61a3
Merge pull request #2590 from bcgov/feature/AB#32199-permission-user-…
JamesPasta Jun 24, 2026
17cbf5c
Merge pull request #2588 from bcgov/feature/AB#33086-calculate-FYE
JamesPasta Jun 24, 2026
a663c85
Merge pull request #2584 from bcgov/bugfix/AB#33493-Scoresheet-HTML-S…
JamesPasta Jun 24, 2026
1387ae6
AB#33573 - [UI] "Notifications" page layout issue
hasanpour Jun 25, 2026
d955a96
Merge pull request #2600 from bcgov/bugfix/AB#33573-Notifications-pag…
hasanpour Jun 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@using Microsoft.AspNetCore.Mvc.Localization
@using Unity.Flex.Localization;
@using Unity.Flex.Web.Views.Shared.Components.Scoresheet;
@using Volo.Abp.Authorization.Permissions;
@inject IHtmlLocalizer<FlexResource> L
@inject IPermissionChecker PermissionChecker
Expand Down Expand Up @@ -99,7 +98,8 @@
data-maxlength="@question.GetMaxLength()"
data-yesvalue="@question.GetYesValue()"
data-novalue="@question.GetNoValue()"
data-questiondesc="@question.Description"
data-questionlabel="@question.Label"
data-questiondesc="@question.Description"
data-definition="@question.Definition"
data-rows="@question.GetRowsValue()"
data-required="@question.GetIsRequiredValue()">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,63 @@
const _SANITIZE_ALLOWED_TAGS = new Set([
'a', 'b', 'blockquote', 'br', 'code', 'del', 'em',
'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i',
'li', 'ol', 'p', 'pre', 's', 'span', 'strong', 'u', 'ul'
]);
const _SANITIZE_ALLOWED_ATTRS = new Set(['href', 'rel', 'target', 'title']);
const _SANITIZE_ALLOWED_SCHEMES = new Set(['http:', 'https:', 'mailto:']);
const _SANITIZE_STRIP_WITH_CONTENT = new Set(['script', 'style', 'iframe', 'noscript', 'object', 'embed']);

function _isSafeHref(href) {
try {
const url = new URL(href, location.href);
return _SANITIZE_ALLOWED_SCHEMES.has(url.protocol);
} catch (e) {
console.warn('sanitizeHtml: invalid href removed:', e);
return false;
}
}

function _sanitizeElement(el) {
for (const attr of Array.from(el.attributes)) {
if (_SANITIZE_ALLOWED_ATTRS.has(attr.name)) {
if (attr.name === 'href' && !_isSafeHref(el.getAttribute('href'))) {
el.removeAttribute('href');
}
} else {
el.removeAttribute(attr.name);
}
}
}

function sanitizeHtml(html) {
if (!html) return '';
const template = document.createElement('template');
template.innerHTML = html;
// Process bottom-up so children are handled before their parent is unwrapped/removed
const elements = Array.from(template.content.querySelectorAll('*')).reverse();
for (const el of elements) {
const tag = el.tagName.toLowerCase();
if (_SANITIZE_STRIP_WITH_CONTENT.has(tag)) {
el.remove();
} else if (_SANITIZE_ALLOWED_TAGS.has(tag)) {
_sanitizeElement(el);
} else {
el.replaceWith(...Array.from(el.childNodes));
}
}
const wrapper = document.createElement('div');
wrapper.appendChild(template.content);
return wrapper.innerHTML;
}

function escapeHtml(text) {
return String(text)
.replaceAll('&', '&amp;')
.replaceAll('<', '&lt;')
.replaceAll('>', '&gt;')
.replaceAll('"', '&quot;');
}

$(function () {

function makeScoresheetsSortable() {
Expand Down Expand Up @@ -149,7 +209,7 @@ $(function () {
<form method="post" id="section-form-${hashCode(item.innerText)}" onSubmit="return false;">
<h2 class="accordion-header" id="panel-${hashCode(item.innerText)}">
<button class="accordion-button preview-btn unt-accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapse-${hashCode(item.innerText)}" aria-expanded="true" aria-controls="collapse-${hashCode(item.innerText)}">
${sectionNumber}. ${item.dataset.label}
${sectionNumber}. ${escapeHtml(item.dataset.label)}
</button>
</h2>
<div id="collapse-${hashCode(item.innerText)}" class="accordion-collapse collapse show" aria-labelledby="panel-${hashCode(item.innerText)}">
Expand All @@ -163,7 +223,7 @@ $(function () {
<div class="accordion-item">
<h2 class="accordion-header" id="nested-panel${hashCode(item.innerText)}">
<button class="accordion-button question-btn collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#nested-collapse${hashCode(item.innerText)}" aria-expanded="true" aria-controls="nested-collapse${hashCode(item.innerText)}">
${sectionNumber}.${questionNumber} ${item.innerText} ${item.dataset.required == 'True' ? '*' : ''}
${sectionNumber}.${questionNumber} ${sanitizeHtml(item.dataset.questionlabel)} ${item.dataset.required == 'True' ? '*' : ''}
</button>
</h2>
<div id="nested-collapse${hashCode(item.innerText)}" class="accordion-collapse collapse" aria-labelledby="nested-panel${hashCode(item.innerText)}">
Expand Down Expand Up @@ -219,7 +279,7 @@ $(function () {
function buildTextAreaFieldPreview(item) {
let req = item.dataset.required ? "required" : null;
return `
<p>${item.dataset.questiondesc}</p>
<p>${sanitizeHtml(item.dataset.questiondesc)}</p>
<div class="mb-3">
<label for="answer-text-${item.dataset.id}" class="form-label unt-form-label">Answer</label>
<textarea rows="${item.dataset.rows}" type="text" ${req} class="form-control answer-text-input" minlength="${item.dataset.minlength}" maxlength="${item.dataset.maxlength}"
Expand All @@ -238,7 +298,7 @@ $(function () {
}).join('');

return `
<p>${item.dataset.questiondesc}</p>
<p>${sanitizeHtml(item.dataset.questiondesc)}</p>
<div class="mb-3">
<label for="answer-selectlist-${item.dataset.id}" class="form-label unt-form-label">Answer</label>
<select id="answer-selectlist-${item.dataset.id}"
Expand All @@ -254,7 +314,7 @@ $(function () {
function buildNumberFieldPreview(item) {
let req = item.dataset.required ? "required" : null;
return `
<p>${item.dataset.questiondesc}</p>
<p>${sanitizeHtml(item.dataset.questiondesc)}</p>
<div class="mb-3">
<label for="answer-number-${item.dataset.id}" class="form-label unt-form-label">Answer</label>
<input type="number" ${req} class="form-control answer-number-input" min="${item.dataset.min}" max="${item.dataset.max}"
Expand All @@ -266,7 +326,7 @@ $(function () {

function buildYesNoFieldPreview(item) {
return `
<p>${item.dataset.questiondesc}</p>
<p>${sanitizeHtml(item.dataset.questiondesc)}</p>
<div class="mb-3">
<label for="answer-yesno-${item.dataset.id}" class="form-label unt-form-label">Answer</label>
<select id="answer-yesno-${item.dataset.id}"
Expand All @@ -287,7 +347,7 @@ $(function () {
let req = item.dataset.required ? "required" : null;

return `
<p>${item.dataset.questiondesc}</p>
<p>${sanitizeHtml(item.dataset.questiondesc)}</p>
<div class="mb-3">
<label for="answer-text-${item.dataset.id}" class="form-label unt-form-label">Answer</label>
<input type="text" ${req} class="form-control answer-text-input" minlength="${item.dataset.minlength}" maxlength="${item.dataset.maxlength}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
<PackageReference Include="Volo.Abp.EntityFrameworkCore.Sqlite" Version="10.3.0" />
<PackageReference Include="Volo.Abp.SettingManagement.Application" Version="10.3.0" />
<PackageReference Include="Volo.Abp.SettingManagement.Domain" Version="10.3.0" />
<!-- Explicit reference to fix vulnerable transitive dependency -->
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="3.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
using Microsoft.AspNetCore.Authorization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Unity.GrantManager.Repositories;
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Identity;
using Volo.Abp.Localization;

namespace Unity.GrantManager.Web.Pages.Identity.Roles;

[Authorize(IdentityPermissions.Roles.Default)]
public class PermissionRoleMatrixModel(IPermissionRoleMatrixRepository repository, IPermissionDefinitionManager permissionDefinitionManager) : AbpPageModel
{
public bool IsExpanded { get; private set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$(document).ready(function () {
const urlParams = new URLSearchParams(window.location.search);
const urlParams = new URLSearchParams(globalThis.location.search);
const isExpanded = urlParams.get('Render') === 'Expanded';
const exportTitle = `${abp.currentTenant.name}_${(new Date()).toISOString().slice(0, 10)}_Permission-Role Matrix`;

Expand All @@ -11,7 +11,7 @@
);
_permissionsModal.onClose(function () {
// Refresh the page to show updated permissions
window.location.reload();
globalThis.location.reload();
});

const roleColumnIndexes = [];
Expand All @@ -34,6 +34,16 @@
});
}

const adjustTableLayout = function () {
globalThis.requestAnimationFrame(function () {
localTable.columns.adjust();

if (localTable.fixedHeader) {
localTable.fixedHeader.adjust();
}
});
};

$.fn.dataTable.Buttons.defaults.dom.button.className = 'btn flex-none';
let localTable = $('#permissionTable').DataTable({
paging: false,
Expand All @@ -55,7 +65,7 @@
: '<i class="fl fl-fullscreen align-middle"></i> <span>View Expanded</span>',
className: 'btn-light rounded-1',
action: function (e, dt, button, config) {
window.location = isExpanded
globalThis.location = isExpanded
? '/Identity/Roles/PermissionRoleMatrix'
: '/Identity/Roles/PermissionRoleMatrix?Render=Expanded';
}
Expand Down Expand Up @@ -122,6 +132,11 @@
// Hide spinner and show table after initialization
$('.loading-spinner').hide();
$('#permissionTable').show();
adjustTableLayout();

$(globalThis).on('resize', function () {
adjustTableLayout();
});

// Add click handlers to role column headers using data-role-header attribute
$(document).on('click', 'th[data-role-header]', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ $(function () {
{
text: '<i class="fl fl-multi-select align-middle"></i><span>View Role Matrix</span>',
className: 'btn-light rounded-1',
available: () => abp.auth.isGranted('AbpIdentity.Roles'),
action: function (e, dt, button, config) {
window.location = '/Identity/Roles/PermissionRoleMatrix'
globalThis.location = '/Identity/Roles/PermissionRoleMatrix'
}
},
{
Expand Down
Loading
Loading