Skip to content

Commit b7516cd

Browse files
committed
fix: resolve SonarQube issues - contrast, unused import, accessibility and CSS cleanup
1 parent 752a9b3 commit b7516cd

3 files changed

Lines changed: 36 additions & 37 deletions

File tree

src/components/BMDashboard/Issues/IssuesList.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,9 @@ export default function IssuesList() {
268268
{error && <div className="alert alert-danger">{error}</div>}
269269
{loading && (
270270
<div className="text-center py-3">
271-
<div className="spinner-border text-primary" role="status">
271+
<output className="spinner-border text-primary">
272272
<span className="visually-hidden">Loading...</span>
273-
</div>
273+
</output>
274274
</div>
275275
)}
276276
<Table bordered hover responsive className={styles.issueTable}>

src/components/BMDashboard/Issues/IssuesList.module.css

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/* Main table layout */
22
.issueTable {
3-
--issueTable-th-font-size: 12px;
4-
--issueTable-th-padding: 12px 16px;
5-
--issueTable-td-font-size: 10px;
6-
--issueTable-td-padding: 10px 12px;
3+
--issue-table-th-font-size: 12px;
4+
--issue-table-th-padding: 12px 16px;
5+
--issue-table-td-font-size: 10px;
6+
--issue-table-td-padding: 10px 12px;
7+
78
border-collapse: separate;
89
border-spacing: 0 10px; /* vertical spacing between rows */
910
width: 100%;
@@ -16,31 +17,30 @@
1617
/* Header cells */
1718
.issueTable thead th {
1819
font-weight: 600;
19-
font-size: var(--issueTable-th-font-size);
20+
font-size: var(--issue-table-th-font-size);
2021
color: #6c757d;
2122
text-align: left;
22-
padding: var(--issueTable-th-padding);
23+
padding: var(--issue-table-th-padding);
2324
border-bottom: 1px solid #dee2e6;
2425
background-color: white;
2526
}
2627

2728
/* Body cells */
2829
.issueTable tbody td {
29-
font-size: var(--issueTable-td-font-size);
30+
font-size: var(--issue-table-td-font-size);
3031
color: #212529;
31-
padding: var(--issueTable-td-padding);
32-
background-color: #ffffff;
32+
padding: var(--issue-table-td-padding);
33+
background-color: #fff;
3334
vertical-align: middle;
3435
white-space: normal; /* Allows text wrapping */
35-
word-wrap: break-word; /* Breaks long words */
36-
overflow-wrap: break-word;
36+
overflow-wrap: break-word; /* Breaks long words */
3737
max-width: 200px;
3838
}
3939

4040
/* Row styling */
4141
.issueTable tbody tr {
4242
border-radius: 8px;
43-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
43+
box-shadow: 0 2px 4px rgb(0 0 0 / 5%);
4444
}
4545

4646
.renameActive {
@@ -57,7 +57,7 @@
5757
.renameInput:focus {
5858
outline: none;
5959
border: 1px solid #007bff;
60-
box-shadow: 0 0 3px rgba(0, 123, 255, 0.5);
60+
box-shadow: 0 0 3px rgb(0 123 255 / 50%);
6161
}
6262

6363
/* Button for tags (Virtual / In-person) */
@@ -74,7 +74,7 @@
7474
gap: 4px;
7575
background-color: #fff;
7676
border-radius: 8px;
77-
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
77+
box-shadow: 0 4px 12px rgb(0 0 0 / 10%);
7878
text-align: center !important;
7979
left: 0 !important;
8080
min-width: 4rem!important;
@@ -111,7 +111,7 @@
111111
padding-bottom: 12px;
112112
}
113113

114-
/* Light mode for multi select*/
114+
/* Light mode for multi select */
115115
:global(.custom-select__control) {
116116
background-color: #fff;
117117
color: #000;
@@ -132,7 +132,7 @@
132132
}
133133

134134
:global(.custom-select__multi-value__remove:hover) {
135-
background-color: #ced4da;
135+
background-color: #868e96;
136136
color: #fff;
137137
}
138138

@@ -161,7 +161,7 @@
161161

162162
:global(.dark-theme) .issueTable thead th {
163163
background-color: #1c2541;
164-
color: #cccccc;
164+
color: #ccc;
165165
border: 1px solid #eceaea;
166166
}
167167

@@ -172,7 +172,7 @@
172172
}
173173

174174
:global(.dark-theme) .issueTable tbody tr {
175-
box-shadow: 0 2px 4px rgba(255, 255, 255, 0.05);
175+
box-shadow: 0 2px 4px rgb(255 255 255 / 5%);
176176
}
177177

178178
:global(.dark-theme) .issueTable :global(.btn-outline-primary) {
@@ -183,7 +183,7 @@
183183

184184
:global(.dark-theme) .dropdownMenuCustom {
185185
background-color: #1c2541;
186-
box-shadow: 0px 4px 12px rgba(255, 255, 255, 0.1);
186+
box-shadow: 0 4px 12px rgb(255 255 255 / 10%);
187187
min-width: 4rem;
188188
}
189189

@@ -277,7 +277,7 @@
277277

278278
/* Selected day styling in dark theme */
279279
.darkThemeCalendar :global(.react-datepicker__day--selected) {
280-
background-color: #4a90e2 !important;
280+
background-color: #1a5fa8 !important;
281281
color: #fff !important;
282282
border-radius: 50%;
283283
}
@@ -289,7 +289,7 @@
289289
border-radius: 50%;
290290
}
291291

292-
/* Dark mode for multi select*/
292+
/* Dark mode for multi select */
293293
:global(.dark-theme) :global(.custom-select__control), :global(.dark-theme) :global(.custom-select__menu) {
294294
background-color: #1c2541!important;
295295
border-color: #666!important;
@@ -325,7 +325,7 @@
325325
}
326326

327327
:global(.dark-theme) :global(.custom-select__multi-value__remove:hover) {
328-
background-color: #ff6b6b!important;
328+
background-color: #c0392b!important;
329329
color: #fff!important;
330330
}
331331

@@ -343,7 +343,7 @@
343343
}
344344

345345
/* Filter controls layout for small screens */
346-
@media (max-width: 768px) {
346+
@media (width <= 768px) {
347347
:global(.custom-select__control) {
348348
font-size: 10px;
349349
}
@@ -360,7 +360,7 @@
360360
}
361361

362362
/* Column adjustments for filter Row */
363-
@media (max-width: 768px) {
363+
@media (width <= 768px) {
364364
:global(.row) > :global(.col-md-4),
365365
:global(.row) > :global(.col-md-2) {
366366
flex: 0 0 100%;
@@ -370,12 +370,12 @@
370370
}
371371

372372
/* Adjust table font and padding for narrow screens */
373-
@media (max-width: 576px) {
373+
@media (width <= 576px) {
374374
.issueTable {
375-
--issueTable-th-font-size: 8px;
376-
--issueTable-th-padding: 8px 10px;
377-
--issueTable-td-font-size: 8px;
378-
--issueTable-td-padding: 8px 10px;
375+
--issue-table-th-font-size: 8px;
376+
--issue-table-th-padding: 8px 10px;
377+
--issue-table-td-font-size: 8px;
378+
--issue-table-td-padding: 8px 10px;
379379
}
380380

381381
.dropdownToggleCustom {
@@ -415,13 +415,13 @@
415415
}
416416

417417
:global(.dark-theme) .paginationContainer :global(.btn-primary) {
418-
background-color: #007bff !important;
418+
background-color: #0056b3 !important;
419419
color: #fff !important;
420-
border-color: #007bff !important;
420+
border-color: #0056b3 !important;
421421
}
422422

423423
/* Make dropdown menu fill screen width on very small devices */
424-
@media (max-width: 480px) {
424+
@media (width <= 480px) {
425425
.dropdownMenuCustom {
426426
width: 100vw;
427427
left: 0 !important;
@@ -436,7 +436,7 @@
436436
left: 0;
437437
width: 100vw;
438438
height: 100vh;
439-
background-color: rgba(0, 0, 0, 0.5);
439+
background-color: rgb(0 0 0 / 50%);
440440
display: flex;
441441
align-items: center;
442442
justify-content: center;
@@ -449,7 +449,7 @@
449449
padding: 1.5rem;
450450
max-width: 400px;
451451
width: 90%;
452-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
452+
box-shadow: 0 4px 6px rgb(0 0 0 / 10%);
453453
}
454454

455455
.modalDialogCustom:global(.dark-theme) {

src/components/BMDashboard/WeeklyProjectSummary/WeeklyProjectSummary.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import LossTrackingLineChart from './Financials/LossTrackingLineCharts/LossTrack
2929
import MostFrequentKeywords from './MostFrequentKeywords/MostFrequentKeywords';
3030
import LessonsLearntChart from '../LessonsLearnt/LessonsLearntChart';
3131
import DistributionLaborHours from './DistributionLaborHours/DistributionLaborHours';
32-
import MaterialStockOutRiskIndicator from './MaterialStockOutRiskIndicator/MaterialStockOutRiskIndicator';
3332
import SupplierPerformanceGraph from './SupplierPerformanceGraph.jsx';
3433

3534
const projectStatusButtons = [

0 commit comments

Comments
 (0)