Skip to content
Merged

Dev #2745

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
Expand Up @@ -22,7 +22,7 @@
<h4>@L["AIPrompts"]</h4>
</div>
<div class="filter-search-action-bar_search-wrapper">
<input type="search" id="search-prompts" placeholder="Search" class="tbl-search">
<input type="search" id="search-prompts" placeholder="Search" aria-label="Search" class="tbl-search">
</div>
<div id="dynamicButtonContainerId" class="dynamic-buttons-div button-gap-1"></div>
</div>
Expand All @@ -48,7 +48,7 @@
<div class="card-header version-editor-header py-2">
<div class="d-flex align-items-center gap-2 flex-wrap">
<strong id="versionEditorTitle" class="text-truncate me-1" style="max-width:160px;"></strong>
<label class="mb-0 small text-muted">Version:</label>
<label for="versionSelect" class="mb-0 small text-muted">Version:</label>
<select id="versionSelect" class="form-select form-select-sm version-select"></select>
<button id="newVersionBtn" class="btn btn-sm btn-outline-primary">
<i class="fa fa-plus"></i> New Version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="container-fluid px-0">
<div class="action-bar p-2 filter-search-action-bar">
<div class="filter-search-action-bar_search-wrapper">
<input type="search" id="search-prompts" placeholder="@L["Common:Search"]" class="tbl-search">
<input type="search" id="search-prompts" placeholder="@L["Common:Search"]" aria-label="@L["Common:Search"]" class="tbl-search">
</div>
</div>
<div class="p-3 pt-0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<h4><b>Scoresheets</b></h4>
<div class="d-flex justify-content-end m-3">
<form id="form" name="form" action="/uploader" enctype="multipart/form-data" method="post">
<input id="scoresheet_import_upload" name="scoresheet_import_upload" type="file" size="1" onchange="importScoresheetFile('scoresheet_import_upload');" style="display: none" />
<input id="scoresheet_import_upload" name="scoresheet_import_upload" type="file" size="1" onchange="importScoresheetFile('scoresheet_import_upload');" aria-label="Import Scoresheet" style="display: none" />
<abp-button text="Import Scoresheet"
id="scoresheet_import_upload_btn"
icon-type="Other"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
min="0" max="100" step="1"
value="@Model.FieldWidth"
style="width: 70px;"
aria-label="Field width percentage"
oninput="onNumberInput(this.value)" />
</div>
<div class="d-flex align-items-center gap-2 mt-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
<th></th>
</thead>
<tr id="new-checkbox-row">
<td><input type="text" class="form-control" id="new-row-key" pattern="[a-zA-Z0-9 ]+" minlength="1" maxlength="60" placeholder="Key" /></td>
<td><input type="text" class="form-control" id="new-row-label" maxlength="100" placeholder="Label" /></td>
<td><input type="text" class="form-control" id="new-row-key" pattern="[a-zA-Z0-9 ]+" minlength="1" maxlength="60" placeholder="Key" aria-label="Key" /></td>
<td><input type="text" class="form-control" id="new-row-label" maxlength="100" placeholder="Label" aria-label="Label" /></td>
<td class="new-row-actions">
<abp-button id="save-checkbox-option-btn" icon-type="Other" icon="fl fl-checkmark"
abp-tooltip="Confirm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
<th></th>
<th></th></thead>
<tr id="new-column-row">
<td><input type="text" class="form-control" id="new-row-key" placeholder="Name" /></td>
<td><input type="text" class="form-control" id="new-row-key" placeholder="Name" aria-label="Name" /></td>
<td>
<select class="form-control form-select" id="new-row-type" asp-items="@Model.SupportedFieldTypes"></select>
<select class="form-control form-select" id="new-row-type" asp-items="@Model.SupportedFieldTypes" aria-label="Type"></select>
</td>
<td class="new-row-actions">
<abp-button id="save-column-option-btn" icon-type="Other" icon="fl fl-checkmark"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<abp-column id="scoresheet-left-col" class="p-0 d-flex flex-column">
<div class="scoresheet-left-header">
<form id="scoresheet-import-form" name="scoresheet-import-form" action="/uploader" enctype="multipart/form-data" method="post" class="d-none">
<input id="scoresheet_import_upload" name="scoresheet_import_upload" type="file" size="1" onchange="importScoresheetFile('scoresheet_import_upload');" />
<input id="scoresheet_import_upload" name="scoresheet_import_upload" type="file" size="1" onchange="importScoresheetFile('scoresheet_import_upload');" aria-label="Import Scoresheet" />
</form>
<div class="d-flex justify-content-between align-items-center mb-3">
<h4 class="mb-0"><b>Scoresheets</b></h4>
Expand All @@ -34,7 +34,7 @@
</div>
</div>
<div class="scoresheet-filters d-flex gap-2 mb-2 align-items-center px-1">
<input type="text" id="scoresheet-name-filter" class="form-control form-control-sm" placeholder="Filter by title or name..." />
<input type="text" id="scoresheet-name-filter" class="form-control form-control-sm" placeholder="Filter by title or name..." aria-label="Filter by title or name" />
<fieldset class="btn-group btn-group-sm flex-shrink-0" id="scoresheet-published-toggle">
<legend class="visually-hidden">Scoresheet filter</legend>
<button type="button" class="btn btn-outline-secondary active" data-filter="all">All</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
<th></th>
</thead>
<tr id="new-selectlist-row">
<td><input type="text" class="form-control" id="new-row-key" minlength="1" maxlength="100" placeholder="Key" /></td>
<td><input type="text" class="form-control" id="new-row-label" minlength="1" maxlength="250" placeholder="Value" /></td>
<td><input type="text" class="form-control" id="new-row-key" minlength="1" maxlength="100" placeholder="Key" aria-label="Key" /></td>
<td><input type="text" class="form-control" id="new-row-label" minlength="1" maxlength="250" placeholder="Value" aria-label="Value" /></td>
<td class="new-row-actions">
<abp-button id="save-selectlist-option-btn" icon-type="Other" icon="fl fl-checkmark"
abp-tooltip="Confirm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<abp-column id="worksheet-left-col" class="p-0 d-flex flex-column">
<div class="worksheet-left-header">
<form id="form" name="form" action="/uploader" enctype="multipart/form-data" method="post" class="d-none">
<input id="worksheet_import_upload" name="worksheet_import_upload" type="file" size="1" onchange="importWorksheetFile('worksheet_import_upload');" />
<input id="worksheet_import_upload" name="worksheet_import_upload" type="file" size="1" onchange="importWorksheetFile('worksheet_import_upload');" aria-label="Import Worksheet" />
</form>
<div class="d-flex justify-content-between align-items-center mb-3">
<h4 class="mb-0"><b>Worksheets</b></h4>
Expand All @@ -33,7 +33,7 @@
</div>
</div>
<div class="worksheet-filters d-flex gap-2 mb-2 align-items-center px-1">
<input type="text" id="worksheet-name-filter" class="form-control form-control-sm" placeholder="Filter by title or name..." />
<input type="text" id="worksheet-name-filter" class="form-control form-control-sm" placeholder="Filter by title or name..." aria-label="Filter by title or name" />
<fieldset class="btn-group btn-group-sm flex-shrink-0" id="worksheet-published-toggle">
<legend class="visually-hidden">Published filter</legend>
<button type="button" class="btn btn-outline-secondary active" data-filter="all">All</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</div>

<div class="filter-search-action-bar_search-wrapper">
<input type="search" id="search-roles" placeholder="Search" class="tbl-search">
<input type="search" id="search-roles" placeholder="Search" aria-label="Search" class="tbl-search">
</div>

<div class="btn-group" id="app_custom_buttons"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<h4 id="PermissionRoleMatrixTitle">Permission-Role Matrix - @CurrentTenant.Name</h4>
</div>
<div class="filter-search-action-bar_search-wrapper">
<input type="search" id="search" placeholder="Search" class="tbl-search">
<input type="search" id="search" placeholder="Search" aria-label="Search" class="tbl-search">
</div>

<div class="btn-group" id="app_custom_buttons">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<abp-tabs name="create-user-modal-tabs">
<abp-tab title="@L["UserInformations"].Value">
<div class="mt-3" >
<input asp-for="UserInfo.Id" />
<input asp-for="UserInfo.ConcurrencyStamp" />
<input type="hidden" asp-for="UserInfo.Id" />
<input type="hidden" asp-for="UserInfo.ConcurrencyStamp" />
<abp-input disabled readonly="true" asp-for="UserInfo.UserName" />
<abp-input disabled readonly="true" asp-for="UserInfo.Name" />
<abp-input disabled readonly="true" asp-for="UserInfo.Surname" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</div>

<div class="filter-search-action-bar_search-wrapper">
<input type="search" id="search-users" placeholder="Search" class="tbl-search">
<input type="search" id="search-users" placeholder="Search" aria-label="Search" class="tbl-search">
</div>

<div class="btn-group" id="app_custom_buttons"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,21 @@ private async Task<string> GetLevel1DecisionUserNameAsync(
return string.Empty;
}

var fullName = $"{user.Name} {user.Surname}".Trim();

if(!string.IsNullOrWhiteSpace(fullName))
{
return fullName.Length > 150 ? fullName[..150] : fullName;
}

if (!string.IsNullOrWhiteSpace(user.UserName))
{
return user.UserName;
}

var fullName = $"{user.Name} {user.Surname}".Trim();
return string.Empty;


return string.IsNullOrWhiteSpace(fullName)
? string.Empty
: fullName;
}
catch (Exception ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,8 @@ $(function () {
}
},
onStateLoaded: function (dtApi, data) {
if (!initialLoad) {
if (!initialLoad && data) {
// A saved state was restored
isRestoringState = false;
dtApi.ajax.reload(null, false);
}
Expand All @@ -539,9 +540,22 @@ $(function () {
contextMenuActionsSelector: '[data-selector="batch-payment-table-actions"]'
});

$('.grp-savedStates').text('Save View');
// Initialize savedStates button styling
$('.grp-savedStates').closest('.btn-group').addClass('cstm-save-view');

// Update button text based on whether any named saved views exist.
// Driven by the StateRestore extension's own 'stateRestore-change' event (the same
// event it uses internally to update its default label) rather than a localStorage
// key guess or a one-shot draw handler - those raced against the extension's own
// loading of previously-saved states from storage on page refresh.
function updateSavedStatesButtonText() {
const savedStatesExist = dataTable.stateRestore.states().length > 0;
$('.grp-savedStates').text(savedStatesExist ? 'Saved States' : 'Save View');
}

dataTable.on('stateRestore-change', updateSavedStatesButtonText);
updateSavedStatesButtonText();

dataTable.on('column-visibility.dt', function (e, settings, columnIdx) {
try {
const cols = dataTable.settings()[0].aoColumns;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
<!-- Action Bar -->
<div class="action-bar p-2 filter-search-action-bar">
<div class="filter-search-action-bar_search-wrapper">
<input type="search" id="search-report-config" placeholder="Search" class="tbl-search">
<input type="search" id="search-report-config" placeholder="Search" aria-label="Search" class="tbl-search">
</div>
<div class="d-flex align-items-center gap-2">
<div id="div-duplicate-keys-warning"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<h4>Endpoint Management</h4>
</div>
<div class="filter-search-action-bar_search-wrapper">
<input type="search" id="search-endpoints" placeholder="Search" class="tbl-search">
<input type="search" id="search-endpoints" placeholder="Search" aria-label="Search" class="tbl-search">
</div>

<div class="btn-group" id="app_custom_buttons"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<abp-modal>
<abp-modal-header title="@L["AssignManager"].Value"></abp-modal-header>
<abp-modal-body>
<input asp-for="Tenant.Id" />
<input asp-for="Tenant.ConcurrencyStamp" />
<input type="hidden" asp-for="Tenant.Id" />
<input type="hidden" asp-for="Tenant.ConcurrencyStamp" />
<abp-input asp-for="Tenant.Name" disabled label="@L["TenantName"].Value" readonly="true" />

@foreach (ObjectExtensionPropertyInfo propertyInfo in ObjectExtensionManager.Instance.GetProperties<AssignManagerModalModel.AssignManagerInfoModel>().Where(p => !p.Name.EndsWith("_Text")))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
<abp-modal>
<abp-modal-header title="@L["Edit"].Value"></abp-modal-header>
<abp-modal-body>
<input asp-for="Tenant.Id" />
<input asp-for="Tenant.ConcurrencyStamp" />
<input type="hidden" asp-for="Tenant.Id" />
<input type="hidden" asp-for="Tenant.ConcurrencyStamp" />
<abp-input asp-for="Tenant.Name" label="@L["TenantName"].Value" />
<abp-input asp-for="Tenant.Division" label="Division" />
<abp-input asp-for="Tenant.Branch" label="Branch" />
<abp-input asp-for="Tenant.Description" label="Description" />

<div class="form-group">
<label for="Tenant_ClientCode">CAS Client Code</label>
<select asp-for="Tenant.CasClientCode" class="form-control cas-client-select"
<label for="Tenant_CasClientCode">CAS Client Code</label>
<select asp-for="Tenant.CasClientCode" id="Tenant_CasClientCode" class="form-control cas-client-select"
data-ministry-target="#selected-ministry">
<option value="">Select a Client Code</option>
@foreach (var option in Model.CasClientOptions)
Expand Down
25 changes: 21 additions & 4 deletions applications/Unity.GrantManager/sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,36 @@ sonar.projectDescription=Grant management application for the Province of Britis
sonar.sources=src,modules
sonar.tests=test

# Quality gate settings (from Azure SonarQube)
# Quality gate settings
sonar.qualitygate.wait=true

# SonarQube Exclusions (from existing Azure configuration)
sonar.exclusions=src/Unity.GrantManager.EntityFrameworkCore/Migrations/**,modules/Unity.Payments/src/Unity.Payments.Web/Pages/BatchPayments/Index.js,src/Unity.GrantManager.EntityFrameworkCore/Scripts/**,**/bin/**,**/obj/**,**/wwwroot/lib/**,**/*.Designer.cs,**/node_modules/**
# SonarQube Exclusions (generic build artifacts and generated code only)
sonar.exclusions=src/Unity.GrantManager.EntityFrameworkCore/Migrations/**,src/Unity.GrantManager.EntityFrameworkCore/Scripts/**,**/bin/**,**/obj/**,**/wwwroot/lib/**,**/*.Designer.cs,**/node_modules/**

# Rule exclusion: javascript:S7721 "Functions should be moved to the highest possible scope"
# Disabled project-wide for JS. ABP renders pages by composing many independent widgets,
# and dynamically bundles each widget's scripts together onto whatever page happens to
# host them, at runtime. Widgets have no visibility into what else will be on the same
# page, so the established, intentional pattern across this codebase is to nest each
# widget's helper functions inside its own $(function(){...}) DOM-ready handler, using
# that nesting as the widget's isolation boundary against same-named helpers in other
# widgets (e.g. formatItems, responseCallback, updatePreview are common names reused
# across many widgets). S7721 pushes these helpers up to module/global scope, which
# breaks that isolation and creates real cross-widget name collisions that the rule
# has no way to detect, since it only ever sees one file at a time. This has already
# caused a production bug (two widgets bundled onto the same page silently overwrote
# each other's same-named global function). Keep the nesting.
sonar.issue.ignore.multicriteria=e1
sonar.issue.ignore.multicriteria.e1.ruleKey=javascript:S7721
sonar.issue.ignore.multicriteria.e1.resourceKey=**/*.js

# Test exclusions
sonar.test.exclusions=**/bin/**,**/obj/**

# Coverage analysis explicitly disabled (excludes all files from coverage)
sonar.coverage.exclusions=**/*

# Code duplication exclusions (from existing Azure configuration + all files)
# Code duplication exclusions
sonar.cpd.exclusions=**/*.aspx,**/*.aspx.designer.cs,**/*.cshtml,**/*.html,**/*.js,**/*

# SCM settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private async Task SeedOnboardingTenantAsync()
// "Unity.Onboarding" = SpecializationConsts.Onboarding; "T" = TenantFeatureValueProvider.ProviderName
await _featureManager.SetAsync(
"Unity.Onboarding",
"true",
"True",
"T",
newTenant.Id.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -650,9 +650,22 @@ $(function () {
});

// For savedStates
$('.grp-savedStates').text('Save View');
// Initialize button styling
$('.grp-savedStates').closest('.btn-group').addClass('cstm-save-view');

// Update button text based on whether any named saved views exist.
// Driven by the StateRestore extension's own 'stateRestore-change' event (the same
// event it uses internally to update its default label) rather than a localStorage
// key guess or a one-shot draw handler - those raced against the extension's own
// loading of previously-saved states from storage on page refresh.
function updateSavedStatesButtonText() {
const savedStatesExist = dataTable.stateRestore.states().length > 0;
$('.grp-savedStates').text(savedStatesExist ? 'Saved States' : 'Save View');
}

dataTable.on('stateRestore-change', updateSavedStatesButtonText);
updateSavedStatesButtonText();

// Subscribe to refresh events
PubSub.subscribe('refresh_applicant_list', (msg, data) => {
dataTable.ajax.reload(null, false);
Expand Down
Loading
Loading