Skip to content

Commit

Permalink
Merge branch 'dev' into dependabot/npm_and_yarn/get-func-name-2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dmols committed May 1, 2024
2 parents 5d9873b + c096ab5 commit 89e2dfa
Show file tree
Hide file tree
Showing 31 changed files with 1,038 additions and 793 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ env:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.2']
node-version: [16.19.0]
steps:
- uses: actions/checkout@v2

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/udoit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.1']
php-versions: ['8.2']
node-version: [16.19.0]
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.1-fpm
FROM php:8.2-fpm
ARG ENVIRONMENT_TYPE

#Install dependencies and php extensions
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The system requirements depend on how you install UDOIT. If you use Docker, the

### Manual Installation Method
* Apache or Nginx webserver
* PHP 8.1+
* PHP 8.1, 8.2
* MySQL, MariaDB or PostgreSQL
* Git (If you are using The Git Method below) or if you plan on contributing to UDOIT
* Node v16 is supported; other versions may work
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ UDOIT enables faculty to identify accessibility issues in Canvas by Instructure.
UDOIT was originally developed by the University of Central Florida (UCF) in 2014. In 2020, UDOIT was in need of a code refresh and UCF partnered with Cidi Labs to rewrite UDOIT from the ground up.

## Prerequisites
- PHP 8.1+
- PHP 8.1, 8.2
- Symfony
- Composer
- Node v16 is supported; other versions may work
- Yarn
- MYSQL v5.7 / MariaDB
- MYSQL 5.7+ / MariaDB

## Skills Needed for Installation
To complete this installation you will need the following skills:
Expand Down Expand Up @@ -46,7 +46,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Primary Contact: Jacob Bates (jacob.bates@ucf.edu)
Primary Contact: Daniel Molares (dm@ucf.edu)

## Supported Languages
UDOIT currently offers support for both English (en) and Spanish (es). This can be configured either across the entire UDOIT instance or for a specific institution.
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;
18 changes: 17 additions & 1 deletion 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
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
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
2 changes: 1 addition & 1 deletion build/nginx/Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.1-fpm
FROM php:8.2-fpm

RUN apt-get update -y \
&& apt-get install -y nginx libpng-dev zlib1g-dev git unzip
Expand Down
4 changes: 2 additions & 2 deletions build/nginx/Dockerfile.php.pdo.mysql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM php:8.1-fpm
FROM php:8.2-fpm

# PHP extensions
RUN apt-get update && apt-get install -y libpng-dev zlib1g-dev git unzip
RUN docker-php-ext-install gd pdo pdo_mysql
RUN docker-php-ext-install gd pdo pdo_mysql
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;
}
}
4 changes: 3 additions & 1 deletion 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 = 500M
memory_limit = 800M
upload_max_filesize = 10M
post_max_size = 10M
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"version": "3.1.0",
"license": "GPL-3.0-only",
"require": {
"php": "^7.4.0 || ^8",
"php": "^7.4.0 || ^8.1 || ^8.2",
"ext-ctype": "*",
"ext-iconv": "*",
"ext-sodium": "*",
Expand Down
Loading

0 comments on commit 89e2dfa

Please sign in to comment.