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

Add a full rescan option to UDOIT #898

Merged
merged 5 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
4 changes: 2 additions & 2 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
17 changes: 17 additions & 0 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 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: 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
1 change: 1 addition & 0 deletions build/nginx/php-custom.ini
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
max_execution_time = 180
memory_limit = 800M
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
"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": "*",
"cidilabs/phpally": "~1.2.1",
"ucfopen/phpally": "~1.2.1",
"composer/package-versions-deprecated": "1.11.99.3",
"doctrine/annotations": "^1.0",
"doctrine/doctrine-bundle": "^2.4",
Expand Down Expand Up @@ -110,7 +110,7 @@
"repositories": [
{
"type": "vcs",
"url": "https://github.com/cidilabs/phpally"
"url": "https://github.com/ucfopen/phpally"
}
]
}
Loading
Loading