Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating equal access branch with lambda functions #961

Merged
merged 73 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
0bf0382
add TableNotEmpty rule info
AlanFCMV Dec 3, 2021
0e4b4a2
Merge remote-tracking branch 'upstream/dev/v3-2-0' into issue/492-emp…
rob-3 Jan 31, 2022
a0f71c0
Merge branch 'dev/v3-3-0' into issue/492-empty-tables
SimonRothUCF Apr 14, 2022
aa412c0
Merge branch 'dev/v3-3-0' into issue/492-empty-tables
bagofarms Aug 5, 2022
d0a7eff
Merge branch 'dev/v3-3-1' into issue/492-empty-tables
dmols Dec 14, 2022
e836f84
Remove ContentPage.getDerviedStateFromProps
ssciolla Feb 14, 2023
7dcc764
Add changes from other PR
ssciolla Feb 17, 2023
bfca5b2
Add full rescan option
taheralfayad Mar 24, 2023
b259bff
Merge with main
taheralfayad Mar 24, 2023
a146a9b
Allow UDOIT to accept modern filetypes
taheralfayad Mar 31, 2023
a0a0bc8
Make syntax consistent
ssciolla Apr 10, 2023
8891ead
Merge branch 'main' into issue/492-empty-tables
dmols Jun 29, 2023
d2da477
Merge branch 'main' into issue/899-filetype
dmols Jun 29, 2023
9107666
Merge branch 'main' into issue-644-remove-get-derived
dmols Jun 29, 2023
641c9b3
Add apiDelete function
taheralfayad Aug 4, 2023
5d9873b
Bump get-func-name from 2.0.0 to 2.0.2
dependabot[bot] Sep 27, 2023
c2f400f
Bump @babel/traverse from 7.14.2 to 7.23.2
dependabot[bot] Oct 17, 2023
6aa485b
Bump axios from 0.21.2 to 1.6.0
dependabot[bot] Nov 10, 2023
979792e
merge main
taheralfayad Apr 3, 2024
2062d74
merge main
taheralfayad Apr 4, 2024
88df689
Added spanish translation for full course rescan
dmols Apr 17, 2024
47d3bd5
Added spanish translation for filetype error
dmols Apr 18, 2024
c963624
Minor spelling fix to spanish translation addition
dmols Apr 18, 2024
b0388da
Reworded spanish translation for menu option
dmols Apr 18, 2024
e04f201
Allow UDOIT to accept modern filetypes (#900)
taheralfayad Apr 18, 2024
28bf1f0
Merge pull request #898 from ucfopen/issue/871-full-rescan
dmols Apr 18, 2024
52022f4
Hotfix - fix wrongly named variable in setAcceptType
taheralfayad Apr 23, 2024
a17b058
change misnamed variable in setAcceptType
taheralfayad Apr 24, 2024
a6f101c
update nginx conf and php.ini to increase maximum file size
taheralfayad Apr 24, 2024
567cba8
merge dev
taheralfayad Apr 25, 2024
98fb0da
Merge pull request #943 from ucfopen/issue/899-filetype
dmols Apr 25, 2024
788731b
Add file size too large error for file uploads
taheralfayad Apr 26, 2024
ebf1dd4
merge dev
taheralfayad Apr 26, 2024
6c0b0b9
Added spanish translation for 10mb+ file size error
dmols Apr 26, 2024
8e124b6
Removed unnecessary console logs and reworded some others
dmols Apr 29, 2024
397705b
Deleted console log of new data since it printed even when new data i…
dmols Apr 29, 2024
b2846aa
change file_size error wording
taheralfayad Apr 30, 2024
cf4b251
Updated dependencies in composer.lock
dmols Apr 30, 2024
fe1742e
Merge pull request #947 from ucfopen/Updating-composer-dependencies
dmols Apr 30, 2024
b4d973b
Merge pull request #946 from ucfopen/issue/945-cleanup-console-printouts
dmols Apr 30, 2024
2b05846
Hotfix: added error description change that was meant to go to dev, n…
dmols Apr 30, 2024
4a453e5
Hotfix: Replaced description for style usage modal
dmols Apr 30, 2024
c4ceac6
Merge branch 'dev' of github.com:ucfopen/UDOIT into dev
dmols May 1, 2024
c096ab5
Merge pull request #944 from ucfopen/issue/942-large-files
dmols May 1, 2024
89e2dfa
Merge branch 'dev' into dependabot/npm_and_yarn/get-func-name-2.0.2
dmols May 1, 2024
50f85bc
update apiFilePost parameters in postContentItem
taheralfayad May 2, 2024
87397e5
update apiFilePost parameters in postContentItem
taheralfayad May 2, 2024
b5f695a
Merge branch 'dev' of github.com:ucfopen/UDOIT into dependabot/npm_an…
dmols May 14, 2024
f655ab7
Merge pull request #922 from ucfopen/dependabot/npm_and_yarn/get-func…
dmols May 14, 2024
dc5dc48
Merge remote-tracking branch 'origin/dependabot-branch-merging' into …
dmols May 14, 2024
38cd810
Merge branch 'dev' into dependabot/npm_and_yarn/babel/traverse-7.23.2
dmols May 21, 2024
57e195e
Merge pull request #951 from ucfopen/dependabot/npm_and_yarn/axios-1.6.0
dmols May 24, 2024
80a6c7f
Merge pull request #924 from ucfopen/dependabot/npm_and_yarn/babel/tr…
dmols May 24, 2024
2c6962f
Bump ws from 6.2.2 to 6.2.3
dependabot[bot] Jun 18, 2024
0839145
Merge pull request #888 from ssciolla/issue-644-remove-get-derived
dmols Jul 24, 2024
e62f3a2
Merge pull request #892 from ssciolla/issue-887-keep-recent-in-modal
dmols Jul 25, 2024
19c9368
Merge branch 'dev' of github.com:ucfopen/UDOIT into issue/492-empty-t…
taheralfayad Jul 29, 2024
908c934
Merge pull request #725 from ucfopen/issue/492-empty-tables
dmols Jul 30, 2024
e15af27
Merge pull request #953 from ucfopen/dependabot/npm_and_yarn/ws-6.2.3
dmols Jul 30, 2024
cb0f908
Merge remote-tracking branch 'origin/dev' into equal-access (what cou…
panbed Aug 21, 2024
c22a25e
lambda
evannaderi Aug 26, 2024
278bcf1
lambda
evannaderi Aug 26, 2024
5616efb
5Merge branch 'equal-access' into lambda
evannaderi Aug 26, 2024
c03d871
maybe lambda works
evannaderi Aug 26, 2024
65362ef
mostly just testing to see if i can push to this fork
panbed Aug 26, 2024
2377813
Merge branch 'lambda' of https://github.com/evannaderi/UDOIT into lambda
panbed Aug 26, 2024
08caf35
VERY early testing of EC2 equal access scanner in UDOIT
panbed Aug 26, 2024
5361d6d
currently trying to separate the 'extensions' to udoit with a scanner…
panbed Aug 26, 2024
d95d35a
more testing the lambda in UDOIT and trying to refactor services to b…
panbed Aug 27, 2024
8ec15c3
moving to equal access rules instead
panbed Sep 17, 2024
d701a70
async functionality working, some cleanup
panbed Sep 25, 2024
7516927
fix marking as resolved and phpally-ignore
panbed Sep 25, 2024
24e796a
more cleanup, begin adding back phpally integration
panbed Sep 30, 2024
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
14 changes: 14 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@ ADMIN_LTI_NAME="UDOIT 3 Admin"
USE_DEVELOPMENT_AUTH="no"
VERSION_NUMBER="3.3.1"

# Define which accessibility checker to use
# Available options: "phpally", "equalaccess_local", "equalaccess_lambda"
ACCESSIBILITY_CHECKER="phpally"

# NOTE: When using a lambda function with equal access,
# you need to define the following in a separate .env.local:
# AWS_ACCESS_KEY_ID=<access_key_id>
# AWS_SECRET_ACCESS_KEY=<secret_access_key>
# AWS_REGION=<region (e.g. us-east-1)>
# AWS_SERVICE=<service (e.g. execute-api)>
# AWS_HOST=abcdefghi.execute-api.us-east-1.amazonaws.com
# AWS_ENDPOINT=https://abcdefghi.execute-api.us-east-1.amazonaws.com/endpoint/generate-accessibility-report


###> symfony/messenger ###
MESSENGER_TRANSPORT_DSN=doctrine://default
Expand All @@ -68,6 +81,7 @@ PHPALLY_SUGGESTION_RULES="
RedirectedLink,
EmbedTagDetected,
IframeNotHandled,
TableNotEmpty
"
# Rules that are easiest to tackle when using UDOIT. Comma-separated list of rule IDs.
EASY_FIX_RULES="
Expand Down
3 changes: 1 addition & 2 deletions assets/js/Components/Admin/UsersPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ class UsersPage extends React.Component {
.then((responseStr) => responseStr.json())
.then((response) => {
let users = this.state.users
console.log('response', response);
if (response && response.id) {
const ind = users.findIndex((el) => { el.id === response.id })
users[ind] = response
Expand All @@ -183,4 +182,4 @@ class UsersPage extends React.Component {
}
}

export default UsersPage;
export default UsersPage;
32 changes: 27 additions & 5 deletions assets/js/Components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class App extends React.Component {
this.handleIssueSave = this.handleIssueSave.bind(this)
this.handleFileSave = this.handleFileSave.bind(this)
this.handleCourseRescan = this.handleCourseRescan.bind(this)
this.handleFullCourseRescan = this.handleFullCourseRescan.bind(this)
this.handleNewReport = this.handleNewReport.bind(this)
this.resizeFrame = this.resizeFrame.bind(this)
}
Expand All @@ -53,6 +54,7 @@ class App extends React.Component {
navigation={this.state.navigation}
handleNavigation={this.handleNavigation}
handleCourseRescan={this.handleCourseRescan}
handleFullCourseRescan={this.handleFullCourseRescan}
handleModal={this.handleModal} />

{(('welcome' !== this.state.navigation) && ('summary' !== this.state.navigation)) &&
Expand Down Expand Up @@ -148,6 +150,11 @@ class App extends React.Component {
return api.scanCourse(this.settings.course.id)
}

fullRescan() {
let api = new Api(this.settings)
return api.fullRescan(this.settings.course.id)
}

disableReview = () => {
return this.state.syncComplete && !this.state.disableReview
}
Expand All @@ -162,6 +169,16 @@ class App extends React.Component {
this.forceUpdate()
}

handleFullCourseRescan() {
if (this.state.hasNewReport) {
this.setState({ hasNewReport: false, syncComplete: false })
this.fullRescan()
.then((response) => response.json())
.then(this.handleNewReport)
}
this.forceUpdate()
}

handleNewReport(data) {
let report = this.state.report
let hasNewReport = this.state.hasNewReport
Expand All @@ -184,7 +201,6 @@ class App extends React.Component {
});
}
if (data.data && data.data.id) {
console.log('new data', data.data)
report = data.data
hasNewReport = true
}
Expand Down Expand Up @@ -217,14 +233,20 @@ class App extends React.Component {
}

handleIssueSave(newIssue, newReport) {
let { report } = this.state
report = {...report, ...newReport}
const oldReport = this.state.report;

const report = { ...oldReport, ...newReport };

if (report && Array.isArray(report.issues)) {
report.issues = report.issues.map(issue => (issue.id == newIssue.id) ? newIssue : issue)
// Combine backend issues with frontend issue state
report.issues = report.issues.map((issue) => {
if (issue.id === newIssue.id) return newIssue;
const oldIssue = oldReport.issues.find((oldReportIssue) => oldReportIssue.id === issue.id);
return oldIssue !== undefined ? { ...oldIssue, ...issue } : issue;
});
}

this.setState({ report })
this.setState({ report });
}

handleFileSave(newFile, newReport) {
Expand Down
6 changes: 5 additions & 1 deletion assets/js/Components/Constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ export const issueRuleIds = [
"RedirectedLink",
"TableDataShouldHaveTableHeader",
"TableHeaderShouldHaveScope",
"TableNotEmpty",
"VideoCaptionsMatchCourseLanguage",
"VideoEmbedCheck",
"VideoProvidesCaptions",
"VideosEmbeddedOrLinkedNeedCaptions",
"VideosHaveAutoGeneratedCaptions"
"VideosHaveAutoGeneratedCaptions",

"img_alt_misuse",
"text_contrast_sufficient",
]
21 changes: 9 additions & 12 deletions assets/js/Components/ContentPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,6 @@ class ContentPage extends React.Component {
}
}

static getDerivedStateFromProps(props, state) {
const stateActiveIssue = state.activeIssue
const propsActiveIssue = stateActiveIssue && props.report.issues[stateActiveIssue.id]
if(propsActiveIssue && propsActiveIssue.status !== stateActiveIssue.status) {
return {
activeIssue: propsActiveIssue
}
}
return null
}

handleSearchTerm = (e, val) => {
this.setState({searchTerm: val, filteredIssues: [], tableSettings: Object.assign({}, this.state.tableSettings, {pageNum: 0})});
}
Expand All @@ -102,9 +91,17 @@ class ContentPage extends React.Component {
}

handleCloseButton = () => {
const newReport = { ...this.props.report };
newReport.issues = newReport.issues.map((issue) => {
issue.recentlyResolved = false;
issue.recentlyUpdated = false;
return issue;
});

this.setState({
report: newReport,
modalOpen: false
})
});
}

handleTrayToggle = (e, val) => {
Expand Down
53 changes: 51 additions & 2 deletions assets/js/Components/FilesModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class FilesModal extends React.Component {
this.handleDropAccept = this.handleDropAccept.bind(this)
this.handleDropReject = this.handleDropReject.bind(this)
this.handleFilePost = this.handleFilePost.bind(this)
this.setAcceptType = this.setAcceptType.bind(this)
}

componentDidUpdate(prevProps, prevState) {
Expand All @@ -59,6 +60,46 @@ class FilesModal extends React.Component {
return -1;
}

setAcceptType(file) {
let accept = []

switch(file.fileType) {
case "doc":
accept = ["doc", "docx"]
break

case "ppt":
accept = ["ppt", "pptx"]
break

case "xls":
accept = ["xls", "xlsx"]
break

default:
accept = file.fileType
break
}

let extension = file.fileName.slice(-4)

switch(extension) {
case "xlsx":
accept = "xlsx"
break

case "pptx":
accept = "pptx"
break

case "docx":
accept = "docx"
break
}

return accept
}

// Handler for the previous and next buttons on the modal
// Will wrap around if the index goes out of bounds
handleFileChange(newIndex) {
Expand All @@ -80,7 +121,8 @@ class FilesModal extends React.Component {
}

render() {
const { activeFile } = this.props
let { activeFile } = this.props
activeFile.acceptType = this.setAcceptType(activeFile)
let activeIndex = this.findActiveIndex()

return (
Expand Down Expand Up @@ -121,7 +163,7 @@ class FilesModal extends React.Component {
<Text display="block" weight="bold">{this.props.t('label.replace')}</Text>
<Text as="p">{this.props.t('label.replace.desc')}</Text>
<FileDrop
accept={activeFile.fileType}
accept={activeFile.acceptType}
onDropAccepted={this.handleDropAccept}
onDropRejected={this.handleDropReject}
renderLabel={
Expand Down Expand Up @@ -207,6 +249,13 @@ class FilesModal extends React.Component {
return
}

if(file.size > 1024 * 1024 * 10) {
this.addMessage({severity: 'error', message: this.props.t('msg.file.replace.file_size'), timeout: 5000})
this.setState({ replaceFileObj: null })
this.forceUpdate()
return
}

this.setState({ replaceFileObj: file })
}

Expand Down
2 changes: 1 addition & 1 deletion assets/js/Components/FilesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,4 +328,4 @@ class FilesPage extends React.Component {
}
}

export default FilesPage;
export default FilesPage;
6 changes: 2 additions & 4 deletions assets/js/Components/Forms/HeadingEmptyForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,15 @@ export default class HeadingEmptyForm extends React.Component {
if(!this.state.deleteHeader) {
this.checkTextNotEmpty()
}


if (this.formErrors.length > 0) {
this.setState({ textInputErrors: this.formErrors })
}
}

else {
this.setState({ textInputErrors: []})
let issue = this.props.activeIssue
issue.newHtml = this.processHtml()
console.log(issue.newHtml)
this.props.handleIssueSave(issue)
}
}
Expand Down
1 change: 0 additions & 1 deletion assets/js/Components/Forms/TableHeaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export default class TableHeaders extends React.Component {
}

handleSubmit() {
console.log('activeIssue', this.props.activeIssue)
let issue = this.props.activeIssue
issue.newHtml = this.fixHeaders()
this.props.handleIssueSave(issue)
Expand Down
1 change: 1 addition & 0 deletions assets/js/Components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class Header extends React.Component {
{/* <Menu.Item onClick={() => this.handleMoreNav('settings')}>{this.props.t('menu.settings')}</Menu.Item> */}
<Menu.Separator />
<Menu.Item onClick={this.props.handleCourseRescan}>{this.props.t('menu.scan_course')}</Menu.Item>
<Menu.Item onClick={this.props.handleFullCourseRescan}>{this.props.t('menu.full_rescan')}</Menu.Item>
<Menu.Separator />
<Menu.Item href={pdfUrl}>{this.props.t('menu.download_pdf')}</Menu.Item>
</Menu>
Expand Down
16 changes: 16 additions & 0 deletions assets/js/Services/Api.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default class Api {
adminCourses: '/api/admin/courses/account/{account}/term/{term}',
scanContent: '/api/sync/content/{contentItem}',
scanCourse: '/api/sync/{course}',
fullRescan: '/api/sync/rescan/{course}',
scanIssue: '/api/issues/{issue}/scan',
adminReport: '/api/admin/courses/{course}/reports/latest',
adminReportHistory: '/api/admin/reports/account/{account}/term/{term}',
Expand Down Expand Up @@ -233,6 +234,21 @@ export default class Api {
})
}

fullRescan(courseId)
{
const authToken = this.getAuthToken()
let url = `${this.apiUrl}${this.endpoints.fullRescan}`
url = url.replace('{course}', courseId)

return fetch(url, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'X-AUTH-TOKEN': authToken,
},
})
}

scanContent(contentId)
{
const authToken = this.getAuthToken()
Expand Down
2 changes: 0 additions & 2 deletions assets/js/Services/Html.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ export function setInnerText(element, newText) {
const children = element.childNodes
let textNodeFound = false

console.log(children)

children.forEach(node => {
if(node.nodeType === Node.TEXT_NODE) {
if(textNodeFound != true) {
Expand Down
3 changes: 3 additions & 0 deletions assets/js/Services/Ufixit.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ const UfixitForms = {
VideoCaptionsMatchCourseLanguage: Video,
VideosEmbeddedOrLinkedNeedCaptions: Video,
VideosHaveAutoGeneratedCaptions: Video,

img_alt_misuse: AltText,
text_contrast_sufficient: ContrastForm,
}

export function returnIssueForm(activeIssue) {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/getInitialData.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function getInitialData() {
data = JSON.parse(settingsElement.textContent)

if (Object.keys(data).length > 0) {
console.log('data', data)
console.log('Data was found and loaded!')
} else {
console.error('No data loaded!')
}
Expand Down
3 changes: 2 additions & 1 deletion build/nginx/deploy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ server {

rewrite ^/udoit3/(.*)$ /$1 break;
try_files $uri @symfonyFront;
client_max_body_size 10M;
}

set $symfonyRoot /var/www/html/public;
Expand All @@ -29,4 +30,4 @@ server {
}
error_log /var/log/nginx/project_error.log;
access_log /var/log/nginx/project_access.log;
}
}
3 changes: 2 additions & 1 deletion build/nginx/local.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ server {

rewrite ^/udoit3/(.*)$ /$1 break;
try_files $uri @symfonyFront;
client_max_body_size 10M;
}

set $symfonyRoot /var/www/html/public;
Expand All @@ -29,4 +30,4 @@ server {
}
error_log /var/log/nginx/project_error.log;
access_log /var/log/nginx/project_access.log;
}
}
2 changes: 2 additions & 0 deletions build/nginx/php-custom.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
max_execution_time = 180
memory_limit = 800M
upload_max_filesize = 10M
post_max_size = 10M
Loading
Loading