Skip to content

Commit 32c3b2c

Browse files
committed
Merge branch 'dev' into issue/1057-add-gradient-contrast
2 parents f6cf646 + 510f93a commit 32c3b2c

30 files changed

Lines changed: 850 additions & 628 deletions

assets/css/udoit4-theme.css

Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
--link-color-light: color-mix(in srgb, var(--link-color) 5%, var(--white) 100%); /* #E9F3FF; */
4646
--link-color-dark: color-mix(in srgb, var(--link-color) 100%, var(--black) 10%);
4747

48-
--text-secondary-color: #2F3741; /* #4A5565; */
48+
--text-secondary-color: #434D5B; /* #4A5565; #2F3741; */
4949
--text-disabled-color: #8B95A7; /* #D1D5DC; */
5050

5151
/* PILLS have three colors: border color, light background color, and text color */
@@ -70,9 +70,10 @@
7070
--help-color-text: #BB4D00;
7171

7272
--background-color: var(--gray-lightest);
73+
--container-color: #F2F4F7;
7374
--border-color: #C5C9D3; /* #E5E7EB; */
7475
--progress-bar-background-color: var(--gray-light);
75-
--progress-bar-color: var(--success-color);
76+
--progress-bar-color: var(--selection-color);
7677
--shadow-color: #00000044;
7778
--backdrop-color: rgba(0, 0, 0, 0.25);
7879

@@ -90,6 +91,7 @@
9091
}
9192

9293
#app-container {
94+
overflow: hidden;
9395
border: 1px solid var(--border-color);
9496
box-shadow: 3px 3px 3px var(--gray-light);
9597
background-color: var(--background-color);
@@ -192,6 +194,11 @@
192194
font-weight: 600;
193195
line-height: normal;
194196
color: var(--text-color);
197+
198+
&:focus {
199+
outline: 2px solid var(--focus-color);
200+
outline-offset: 3px;
201+
}
195202
}
196203

197204
.pageTitle {
@@ -231,6 +238,17 @@
231238
}
232239
}
233240

241+
a {
242+
color: var(--link-color);
243+
font-weight: 300;
244+
245+
&:focus {
246+
outline: 2px solid var(--focus-color);
247+
outline-offset: 3px;
248+
border-radius: 2px;
249+
}
250+
}
251+
234252
button {
235253
font-family: var(--heading-font-family);
236254
padding: .5rem 1rem;
@@ -267,7 +285,6 @@
267285
}
268286
}
269287

270-
271288
.btn-primary {
272289
background-color: var(--primary-color);
273290
border-color: var(--primary-color);
@@ -336,12 +353,13 @@
336353
background-color: transparent;
337354
color: var(--link-color);
338355
padding: .15rem 0.5rem;
339-
border-radius: 8px;
356+
border-radius: var(--element-radius);
340357
cursor: pointer;
358+
box-shadow: none;
341359
}
342360

343361
.btn-header {
344-
border-radius: 8px !important;
362+
border-radius: var(--element-radius) !important;
345363
justify-content: center;
346364
width: 100%;
347365
font-size: 0.9em;
@@ -559,17 +577,25 @@
559577
h2 {
560578
line-height: normal;
561579
align-self: center;
580+
margin: 0;
562581
}
563582

564583
.close-icon {
565584
cursor: pointer;
566-
padding: .25rem;
585+
padding: .2rem;
567586
margin-inline-end: -.5rem;
587+
border: 1px solid transparent;
588+
fill: var(--text-disabled-color);
589+
box-shadow: none;
590+
border-radius: 50%;
568591

569592
&:hover,
570593
&:focus {
594+
fill: var(--text-color);
571595
background-color: var(--gray-lighter);
572-
border-radius: 50%;
596+
}
597+
598+
&:focus {
573599
outline-offset: -2px;
574600
outline: 2px solid var(--focus-color);
575601
}
@@ -657,6 +683,22 @@
657683
}
658684
}
659685

686+
.ufixit-widget code,
687+
.ufixit-widget-dialog code,
688+
.ufixit-learn-container code,
689+
.info-popover-content code {
690+
padding: 0.15rem 0.4rem;
691+
background-color: var(--gray-dark);
692+
color: var(--white);
693+
border-radius: 4px;
694+
font-size: 0.9em;
695+
696+
strong {
697+
font-weight: 400;
698+
text-decoration: underline;
699+
}
700+
}
701+
660702
}
661703

662704
@layer udoit-layout {
@@ -1150,8 +1192,8 @@
11501192
}
11511193

11521194
.disabled {
1153-
color: var(--text-disabled);
1154-
fill: var(--text-disabled);
1195+
color: var(--text-disabled-color);
1196+
fill: var(--text-disabled-color);
11551197
}
11561198

11571199
.icon-sm {

assets/js/Components/App.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,7 @@ export default function App(initialData) {
369369
className={`flex-column flex-grow-1 `
370370
+ `${settings?.user?.roles?.font_size || settings.DEFAULT_USER_SETTINGS.FONT_SIZE} `
371371
+ `${settings?.user?.roles?.font_family || settings.DEFAULT_USER_SETTINGS.FONT_FAMILY} `
372-
+ `${settings?.user?.roles?.dark_mode ? 'dark-mode' : ''} `
373-
+ `${('summary' === navigation && welcomeClosed) ? 'clear-background' : ''}`}>
372+
+ `${settings?.user?.roles?.dark_mode ? 'dark-mode' : ''}`}>
374373
{ !welcomeClosed ?
375374
( <WelcomePage
376375
t={t}

assets/js/Components/FixIssuesPage.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -822,16 +822,11 @@ export default function FixIssuesPage({
822822
setLiveUpdateToggle(!liveUpdateToggle)
823823
}
824824

825-
const isDialogOpen = () => {
826-
const dialog = document.getElementById(dialogId)
827-
return dialog && dialog.open
828-
}
829-
830825
const openDialog = () => {
831826
setWidgetState(WIDGET_STATE.FIXIT)
832827

833828
const dialog = document.getElementById(dialogId)
834-
if(dialog) {
829+
if(dialog && !dialog.open) {
835830
dialog.showModal()
836831

837832
const title = dialog.querySelector('#dialog-title')
@@ -891,7 +886,7 @@ export default function FixIssuesPage({
891886
closeDialog()
892887
}
893888
}}
894-
className="close-icon icon-lg text-color"
889+
className="close-icon icon-md"
895890
tabIndex="0"
896891
role="button"
897892
alt={t('fix.button.close')}

assets/js/Components/HomePage.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
box-sizing: border-box;
3333
border: 1px solid var(--border-color);
3434
border-radius: var(--element-radius);
35+
background-color: var(--white);
3536

3637
.summary-icon-container {
3738
padding: .5rem;

assets/js/Components/HomePage.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export default function HomePage({
164164
<button className="btn-small btn-icon-left" tabIndex="0" disabled>
165165
<ProgressIcon className="icon-sm spinner" />
166166
<div className="flex-column justify-content-center">
167-
{t('welcome.button.scanning')}
167+
{t('welcome.label.scanning')}
168168
</div>
169169
</button>
170170
) : (
@@ -193,7 +193,7 @@ export default function HomePage({
193193
<SeverityIcon type={panel.type} className='icon-lg' />
194194
</div>
195195
<div className="summary-text-container">
196-
<h2>{t('summary.label.' + panel.translationKey)}</h2>
196+
<h2 className="mt-0">{t('summary.label.' + panel.translationKey)}</h2>
197197
<div aria-label={Html.getTextContent('<p>' + t('summary.' + panel.translationKey + '.description', {count: panel.counter.total}) + '</p>')}>
198198
<div
199199
className="subtext"
@@ -228,7 +228,7 @@ export default function HomePage({
228228

229229
<div className="widget-container">
230230
<div className="callout-container feedback-container flex-column h-fit p-4 flex-grow-1">
231-
<h2 className="text-center">{t('summary.label.course_progress')}</h2>
231+
<h2 className="mt-0 text-center">{t('summary.label.course_progress')}</h2>
232232
<div className="flex-row align-self-center">
233233
<div className="flex-column progress-container">
234234
<div className="flex-row justify-content-center" aria-label={`${combinedCount.percent.toFixed(0)}%`}>

assets/js/Components/Reports/IssuesTable.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.issue-label {
22
display: inline-flex;
33
align-items: center;
4-
gap: 6px;
4+
gap: .75em;
55
}
66

77
.sr-only {

assets/js/Components/Reports/IssuesTable.js

Lines changed: 5 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import React, { useState, useEffect, useRef } from 'react'
22
import SortableTable from '../Widgets/SortableTable'
3-
import { formNameFromRule } from '../../Services/Ufixit'
4-
import InfoPopover from '../Widgets/InfoPopover'
53
import './IssuesTable.css'
64

75
export default function IssuesTable({
86
t,
97
issues,
10-
quickSearchTerm = null,
118
isAdmin,
129
selectedCourse
1310
}) {
@@ -30,20 +27,19 @@ export default function IssuesTable({
3027
ascending: false,
3128
pageNum: 0,
3229
})
33-
const [localIssues, setLocalIssues] = useState([])
3430
const [rows, setRows] = useState([])
3531

3632
const sortContent = () => {
37-
let tempRows = (issues) ? Object.values(localIssues) : []
33+
let tempRows = (issues) ? Object.values(issues) : []
3834
const { sortBy, ascending } = tableSettings
3935

4036
tempRows.sort((a, b) => {
4137
let aValue = a[sortBy]
4238
let bValue = b[sortBy]
4339

44-
if (sortBy === "label") {
45-
aValue = a.labelText || ""
46-
bValue = b.labelText || ""
40+
if (typeof(aValue) === "object" && typeof(bValue) === "object") {
41+
aValue = a[sortBy + "_display"] || ""
42+
bValue = b[sortBy + "_display"] || ""
4743
}
4844

4945
if (isNaN(aValue) || isNaN(bValue)) {
@@ -66,70 +62,7 @@ export default function IssuesTable({
6662

6763
useEffect(() => {
6864
setRows(sortContent())
69-
}, [tableSettings, localIssues])
70-
71-
useEffect(() => {
72-
if (issues) {
73-
let tempIssues = Object.values(issues)
74-
tempIssues.map((issue => {
75-
let label = ''
76-
let searchTerm = ''
77-
let formName = formNameFromRule(issue.id)
78-
if(formName === 'review_only') {
79-
label = t('report.label.unhandled') + issue.id
80-
searchTerm = issue.id
81-
}
82-
else {
83-
label = t(`form.${formName}.title`)
84-
searchTerm = t(`form.${formName}.title`)
85-
}
86-
issue.labelText = label
87-
issue.label = (
88-
<span className="issue-label">
89-
{label}
90-
<InfoPopover
91-
t={t}
92-
content={t(`form.${formName}.summary`)}
93-
/>
94-
</span>
95-
)
96-
issue.summary = t(`form.${formName}.summary`)
97-
if(quickSearchTerm !== null) {
98-
issue.onClick = () => quickSearchTerm(searchTerm)
99-
}
100-
return issue
101-
}))
102-
103-
let mergedIssues = []
104-
let labels = []
105-
tempIssues.forEach((issue) => {
106-
if (!labels.includes(issue.label)) {
107-
labels.push(issue.label)
108-
if(issue.type === 'error' || issue.type === 'issue') {
109-
issue.type = t('filter.label.severity.issue')
110-
}
111-
else if(issue.type === 'potential') {
112-
issue.type = t('filter.label.severity.potential')
113-
}
114-
else if(issue.type === 'suggestion') {
115-
issue.type = t('filter.label.severity.suggestion')
116-
}
117-
issue.handled = (issue.fixed + issue.resolved > 0 ? 1 : 0)
118-
mergedIssues.push(issue)
119-
}
120-
else {
121-
let index = mergedIssues.findIndex((i) => i.label === issue.label)
122-
mergedIssues[index].total += issue.total
123-
mergedIssues[index].active += issue.active
124-
mergedIssues[index].handled += (issue.fixed + issue.resolved > 0 ? 1 : 0)
125-
}
126-
})
127-
setLocalIssues(mergedIssues)
128-
}
129-
else {
130-
setLocalIssues([])
131-
}
132-
}, [issues])
65+
}, [tableSettings, issues])
13366

13467
return (
13568
<>

assets/js/Components/Reports/ReportsTable.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,16 @@ export default function ReportsTable({
5656
};
5757

5858
const getContent = () => {
59-
let list = getLatestReports(reports); // Preprocess reports to get the latest entry per course
59+
let list = []
60+
if(reports && reports.length > 0) {
61+
if(reports[0].courseName) {
62+
list = getLatestReports(reports) // Preprocess reports to get the latest entry per course
63+
}
64+
else {
65+
list = reports // If reports are already in the expected format, use them directly
66+
}
67+
}
68+
6069
if (!list) {
6170
return [];
6271
}

assets/js/Components/Reports/ResolutionsReport.css

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11
.resolutions-report-container {
22
display: flex;
3-
flex-direction: row;
4-
height: 100%;
3+
flex-direction: column;
4+
height: fit-content;
55
}
66

77
.resolutions-chart-area {
8-
flex: 3;
9-
padding: 20px;
10-
}
11-
12-
.resolutions-header {
13-
text-align: center;
14-
width: 100%;
15-
margin-top: 0;
16-
margin-bottom: 0.5em;
8+
padding-block-start: 1.5rem;
179
}
1810

1911
.resolutions-mode-toggle {

0 commit comments

Comments
 (0)