Skip to content

Commit 429831f

Browse files
committed
Finished file filters, added file type icons, first pass on file reference preview window.
1 parent e4d04bc commit 429831f

21 files changed

+204
-47
lines changed

assets/css/udoit4-theme.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,11 @@ h1, h2, h3, h4, h5, h6 {
629629
fill: var(--gray);
630630
}
631631

632+
.gray-stroke {
633+
stroke: var(--gray);
634+
fill: none;
635+
}
636+
632637
.white {
633638
color: var(--white);
634639
fill: var(--white);

assets/js/Components/App.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ export default function App(initialData) {
133133
const processNewReport = (rawReport) => {
134134
const tempReport = analyzeReport(rawReport, settings.ISSUE_STATE)
135135
setReport(tempReport)
136-
console.log(tempReport)
137136

138137
let api = new Api(settings)
139138
api.setReportData(tempReport.id, {'scanCounts': tempReport.scanCounts, 'scanRules': tempReport.scanRules})

assets/js/Components/FixIssuesPage.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,11 @@ export default function FixIssuesPage({
382382
}
383383

384384
// Do not include this issue if it doesn't match the module filter
385-
if (tempFilters[FILTER.TYPE.MODULE] !== FILTER.ALL && !issue.sectionIds.includes(tempFilters[FILTER.TYPE.MODULE].toString())) {
386-
continue
385+
if (tempFilters[FILTER.TYPE.MODULE] !== FILTER.ALL) {
386+
let sectionId = tempFilters[FILTER.TYPE.MODULE].replace('section-', '')
387+
if (!issue.sectionIds.includes(sectionId)) {
388+
continue
389+
}
387390
}
388391

389392
// Do not include this issue if it doesn't match the published filter

assets/js/Components/Icons/ContentTypeIcon.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ import ContentDiscussionForumIcon from './ContentDiscussionForumIcon';
77
import ContentFileIcon from './ContentFileIcon';
88
import ContentQuizIcon from './ContentQuizIcon';
99
import ContentSyllabusIcon from './ContentSyllabusIcon';
10+
import ListIcon from './ListIcon';
1011

1112
export default function ContentTypeIcon(props) {
1213
if(!props.type) {
1314
return null
1415
}
1516

16-
switch(props.type) {
17+
switch(props.type.toUpperCase()) {
1718
case('PAGE'):
1819
return <ContentPageIcon {...props} />
1920
case('ASSIGNMENT'):
@@ -31,6 +32,9 @@ export default function ContentTypeIcon(props) {
3132
return <ContentQuizIcon {...props} />
3233
case('SYLLABUS'):
3334
return <ContentSyllabusIcon {...props} />
35+
case('SECTION'):
36+
case('MODULE'):
37+
return <ListIcon {...props} />
3438
default:
3539
return null
3640
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from 'react';
2+
3+
/* SVG from: https://lucide.dev/icons/file-volume */
4+
export default function FileTypeAudioIcon(props) {
5+
return (
6+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" strokeLinecap="round" strokeLinejoin="round" {...props}><path d="M11 11a5 5 0 0 1 0 6"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M4 6.765V4a2 2 0 0 1 2-2h9l5 5v13a2 2 0 0 1-2 2H6a2 2 0 0 1-.93-.23"/><path d="M7 10.51a.5.5 0 0 0-.826-.38l-1.893 1.628A1 1 0 0 1 3.63 12H2.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h1.129a1 1 0 0 1 .652.242l1.893 1.63a.5.5 0 0 0 .826-.38z"/></svg>
7+
)
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from 'react';
2+
3+
/* SVG from: https://lucide.dev/icons/file-spreadsheet */
4+
export default function FileTypeExcelIcon(props) {
5+
return (
6+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" strokeLinecap="round" strokeLinejoin="round" {...props}><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M8 13h2"/><path d="M14 13h2"/><path d="M8 17h2"/><path d="M14 17h2"/></svg>
7+
)
8+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import React from 'react';
2+
import FileTypePDFIcon from './FileTypePDFIcon'
3+
import FileTypeWordIcon from './FileTypeWordIcon'
4+
import FileTypePowerPointIcon from './FileTypePowerPointIcon'
5+
import FileTypeExcelIcon from './FileTypeExcelIcon'
6+
import FileTypeAudioIcon from './FileTypeAudioIcon'
7+
import FileTypeVideoIcon from './FileTypeVideoIcon'
8+
9+
export default function FileTypeIcon(props) {
10+
if(!props.type) {
11+
return null
12+
}
13+
14+
switch(props.type.toUpperCase()) {
15+
case('PDF'):
16+
return <FileTypePDFIcon {...props} />
17+
case('WORD'):
18+
return <FileTypeWordIcon {...props} />
19+
case('POWERPOINT'):
20+
return <FileTypePowerPointIcon {...props} />
21+
case('EXCEL'):
22+
return <FileTypeExcelIcon {...props} />
23+
case('VIDEO'):
24+
return <FileTypeVideoIcon {...props} />
25+
case('AUDIO'):
26+
return <FileTypeAudioIcon {...props} />
27+
default:
28+
return null
29+
}
30+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from 'react';
2+
3+
/* SVG from: https://lucide.dev/icons/book-text */
4+
export default function FileTypePDFIcon(props) {
5+
return (
6+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" strokeLinecap="round" strokeLinejoin="round" {...props}><path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20"/><path d="M8 11h8"/><path d="M8 7h6"/></svg>
7+
)
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from 'react';
2+
3+
/* SVG from: https://lucide.dev/icons/file-chart-pie */
4+
export default function FileTypePowerPointIcon(props) {
5+
return (
6+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" strokeLinecap="round" strokeLinejoin="round" {...props}><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M16 22h2a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3.5"/><path d="M4.017 11.512a6 6 0 1 0 8.466 8.475"/><path d="M9 16a1 1 0 0 1-1-1v-4c0-.552.45-1.008.995-.917a6 6 0 0 1 4.922 4.922c.091.544-.365.995-.917.995z"/></svg>
7+
)
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from 'react';
2+
3+
/* SVG from: https://lucide.dev/icons/file-volume */
4+
export default function FileTypeVideoIcon(props) {
5+
return (
6+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" strokeLinecap="round" strokeLinejoin="round" {...props}><path d="M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><rect width="8" height="6" x="2" y="12" rx="1"/><path d="m10 13.843 3.033-1.755a.645.645 0 0 1 .967.56v4.704a.645.645 0 0 1-.967.56L10 16.157"/></svg>
7+
)
8+
}

0 commit comments

Comments
 (0)