Skip to content

Commit 02298f1

Browse files
authored
Merge branch 'new-main-page-UX' into select-valid-id-form-clickable-elements
2 parents 7da9e7f + d577b50 commit 02298f1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+3679
-680
lines changed

.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
###> symfony/framework-bundle ###
1717
APP_ENV=prod
1818
APP_SECRET=eb2f09f8a21b0b7c57b9fc36eee250eb
19+
20+
# Add your sentry DSN if you want error tracking
21+
SENTRY_DSN=""
22+
1923
#TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
2024
#TRUSTED_HOSTS='^(localhost|example\.com)$'
2125
###< symfony/framework-bundle ###

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
php-versions: ['8.4']
2222
node-version: [20.19.0]
2323
steps:
24-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v4
2525

2626
- name: Log in to the Container registry
2727
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
@@ -35,27 +35,27 @@ jobs:
3535
uses: ASzc/change-string-case-action@v2
3636
with:
3737
string: ${{ github.repository }}
38-
38+
3939
- name: Display repository name
4040
run: echo ${{ steps.case.outputs.lowercase }}
4141

4242
- name: Find-and-replace strings
4343
id: slash
4444
uses: mad9000/actions-find-and-replace-string@2
4545
with:
46-
source: ${{ github.ref_name }}
47-
find: '/'
48-
replace: '-'
46+
source: ${{ github.ref_name }}
47+
find: '/'
48+
replace: '-'
4949

5050
- name: Display issue name
51-
run: echo ${{ steps.slash.outputs.value }}
51+
run: echo ${{ steps.slash.outputs.value }}
5252

5353
- name: Build Image
5454
run: |
5555
cp .env.example .env
5656
docker compose -f docker-compose.nginx.yml build
5757
docker compose -f docker-compose.nginx.yml run composer composer install --no-dev --no-interaction --no-progress --optimize-autoloader
58-
docker compose -f docker-compose.nginx.yml run yarn bash -c 'cd /app && yarn install && yarn build'
58+
docker compose -f docker-compose.nginx.yml run yarn bash -c 'cd /app && yarn install && yarn build'
5959
docker build . -t udoit:latest -f build/nginx/Dockerfile.build
6060
docker tag udoit:latest ${{ env.REGISTRY }}/${{ steps.case.outputs.lowercase }}:${{ steps.slash.outputs.value }}
6161

INSTALL.md

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ cp .env.example .env
3838
This command copies the `.env.example` into `.env`, creating the `.env` file in the process if it does not exist.
3939

4040
2. Open `.env` with a text editor (i.e. Notepad, VS Code, etc.) and make the necessary changes to the following variables:
41-
- `APP_ENV`: If you are setting up a development environment, change this to `dev` and follow the steps in [Installing Composer Dependencies](#installing-composer-dependencies) without the `--no-dev` flag to obtain all of the development packages. Otherwise, leave it as `prod`.
41+
- `APP_ENV`: If you are setting up a development environment, change this to `dev`. Otherwise, leave it as `prod`.
4242
- `DATABASE_URL`: If you are hosting UDOIT on Docker or your local machine, leave it as it is. Otherwise, change it to your database URL.
4343
- `BASE_URL`: If you are hosting UDOIT on Docker or your local machine, leave it as it is. Otherwise, change it to the URL of your instance of UDOIT.
4444
- `WEBPACK_PUBLIC_PATH`: Uf you are hosting UDOIT on Docker or your local machine, leave it as it is. Otherwise, change it to match the `BASE_URL`in such a way that `/build` is located at the root of the `BASE_URL` (Example: If your `BASE_URL` is set to `http://127.0.0.1:8000`, your `WEBPACK_PUBLIC_PATH` should be `/build`).
@@ -51,20 +51,31 @@ This command copies the `.env.example` into `.env`, creating the `.env` file in
5151
### Option 1: Docker
5252
We provide a fast and simple way of setting up a local UDOIT instance through Docker.
5353

54-
1. Install [Docker Desktop](https://docs.docker.com/get-docker/). This will install Docker and Docker Compose on your system.
55-
> Alternatively, you may install Docker and [Docker Compose](https://docs.docker.com/compose/install/) individually.
54+
#### 1. Install [Docker Desktop](https://docs.docker.com/get-docker/). This will install Docker and Docker Compose on your system.
55+
> Alternatively, you may install Docker and [Docker Compose](https://docs.docker.com/compose/install/) individually.
5656
57-
2. Build the Containers
57+
#### 2. (Optional) Install the Necessary PHP Dependencies for Dev Environment
58+
59+
UDOIT uses Composer to install PHP dependencies. If your `APP_ENV` is set to `prod`, UDOIT will handle this for you. However, if it is set to `dev`, you may need some additional dependencies.
60+
61+
You can set them up by running the following command:
62+
```
63+
docker compose -f docker-compose.nginx.yml run composer composer install
64+
```
65+
66+
#### 3. Build the Containers
5867

5968
```
6069
make start
6170
```
6271

63-
3. Once the containers are initialized, run the following command:
72+
*Note: This may take a while to fully initiate. This is normal.*
73+
#### 4. Set Up Database
74+
75+
The following command applies migrations necessary to set up the database to store all UDOIT data. Please make sure the containers have fully spun up before running this command.
6476
```
6577
make migrate
6678
```
67-
This applies migrations necessary to set up the database to store all UDOIT data.
6879

6980
Running this will give the following warning:
7081

@@ -76,12 +87,14 @@ Type `yes` and proceed. The warning is expected and is a non issue.
7687
7788
UDOIT should be installed and running as Docker containers.
7889

79-
4. To stop the UDOIT containers, run the following command:
90+
#### To stop the UDOIT containers, run the following command:
8091
```
8192
make down
8293
```
8394

84-
> Please be sure to review the `makefile` for more information on what these commands do.
95+
Please be sure to review the `makefile` for more information on what this command and others do.
96+
97+
If UDOIT is running without errors, you can move on to [installing it for your LMS](#connecting-udoit-to-an-lms)! If you're encountering errors, please check out the [wiki](https://github.com/ucfopen/UDOIT/wiki).
8598

8699
### Option 2: Manual Installation
87100
If you prefer not to use Docker, the process is more complicated:
@@ -140,3 +153,6 @@ For example, if you are setting this up on your local computer via Docker, it ma
140153
To configure it fully within your LMS, follow the installation instructions below that apply to you.
141154
- To install it on Canvas, follow [INSTALL_CANVAS.md](INSTALL_CANVAS.md)
142155
- or for D2l Brightspace, follow [INSTALL_D2L.md](INSTALL_D2L.md)
156+
157+
## Encountering Errors
158+
Please resort to the [wiki page](https://github.com/ucfopen/UDOIT/wiki) for some commonly found errors when setting up UDOIT.

INSTALL_CANVAS.md

Lines changed: 56 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,29 @@ Once UDOIT has been installed on a public web server the following steps must be
55
* Update the Institutions table
66
* Install the application
77

8+
## Docker Compose Base URL
9+
If you are setting up UDOIT for local development through `docker compose`, <YOUR_UDOIT_BASE_URL> in both the API developer key and the LTI developer key above should be set to `http://127.0.0.1:8000/udoit3`.
10+
11+
812
## Create an API Developer Key
913
UDOIT requires an API developer key since all course data is gathered through the Canvas API.
1014

1115
### Steps to Create an API Key
1216
1. Navigate to `Developer Keys` in the root account menu.
1317
2. Choose to add a `Developer Key` => `API Key`
1418
3. Provide values for the following fields:
15-
* Key Name: i.e. UDOIT 3 API
16-
* Owner Email
17-
* Redirect URIs: <YOUR_UDOIT_BASE_URL>/authorize/check
18-
* Icon URL: <YOUR_UDOIT_BASE_URL>/build/static/udoit_logo.svg
19-
* Client Credentials
20-
* Canvas
21-
* Enforce Scopes
22-
* See the section below for a list of scopes to enable.
23-
* Check `Allow Include Parameters`
24-
* Redirect URL (Legacy) : *SKIP*
25-
* Vendor Code : *SKIP*
26-
* Notes : *Optional*
27-
* These are only seen by other LMS admins
28-
* Test Cluster Only : *SKIP*
19+
* Key Name: i.e. UDOIT 3 API
20+
* Owner Email
21+
* Redirect URIs: <YOUR_UDOIT_BASE_URL>/authorize/check
22+
* Redirect URL (Legacy) : *SKIP*
23+
* Vendor Code : *SKIP*
24+
* Icon URL: <YOUR_UDOIT_BASE_URL>/build/static/udoit_logo.svg
25+
* Notes : *Optional*
26+
* These are only seen by other LMS admins
27+
* Client Credentials Audience: Canvas
28+
* Enforce Scopes
29+
* Check `Allow Include Parameters`
30+
* See the section below for a list of scopes to enable.
2931
4. Save
3032
5. Click `ON` to enable the newly created key
3133

@@ -42,10 +44,19 @@ We strongly recommend you enforce scopes with your API key. The following scopes
4244
* url:GET|/api/v1/courses/:course_id/assignments
4345
* url:GET|/api/v1/courses/:course_id/assignments/:id
4446
* url:PUT|/api/v1/courses/:course_id/assignments/:id
47+
* context_module_items_api
48+
* url:GET|/api/v1/courses/:course_id/modules/:module_id/items
49+
* url:GET|/api/v1/courses/:course_id/modules/:module_id/items/:id
50+
* url:PUT|/api/v1/courses/:course_id/modules/:module_id/items/:id
51+
* context_modules_api
52+
* url:GET|/api/v1/courses/:course_id/modules
53+
* url:GET|/api/v1/courses/:course_id/modules/:id
54+
* url:PUT|/api/v1/courses/:course_id/modules/:id
4555
* courses
4656
* url:PUT|/api/v1/courses/:id
4757
* url:GET|/api/v1/courses/:id
4858
* url:POST|/api/v1/courses/:course_id/files
59+
* url:GET|/api/v1/courses/:course_id/users
4960
* discussion_topics
5061
* url:GET|/api/v1/courses/:course_id/discussion_topics
5162
* url:PUT|/api/v1/courses/:course_id/discussion_topics/:topic_id
@@ -54,14 +65,6 @@ We strongly recommend you enforce scopes with your API key. The following scopes
5465
* files
5566
* url:GET|/api/v1/courses/:course_id/files
5667
* url:GET|/api/v1/courses/:course_id/files/:id
57-
* context_module_items_api
58-
* url:GET|/api/v1/courses/:course_id/modules/:module_id/items
59-
* url:GET|/api/v1/courses/:course_id/modules/:module_id/items/:id
60-
* url:PUT|/api/v1/courses/:course_id/modules/:module_id/items/:id
61-
* context_modules_api
62-
* url:GET|/api/v1/courses/:course_id/modules
63-
* url:GET|/api/v1/courses/:course_id/modules/:id
64-
* url:PUT|/api/v1/courses/:course_id/modules/:id
6568
* quizzes/quiz_questions
6669
* url:GET|/api/v1/courses/:course_id/quizzes/:quiz_id/questions
6770
* url:GET|/api/v1/courses/:course_id/quizzes/:quiz_id/questions/:id
@@ -78,8 +81,11 @@ We strongly recommend you enforce scopes with your API key. The following scopes
7881
* url:GET|/api/v1/courses/:course_id/pages
7982
* url:GET|/api/v1/courses/:course_id/pages/:url_or_id
8083
* url:PUT|/api/v1/courses/:course_id/pages/:url_or_id
84+
85+
* enrollments_api
86+
* url:GET|/api/v1/courses/:course_id/enrollments
87+
*
8188

82-
---
8389
## Create an LTI Developer Key
8490
UDOIT uses LTI 1.3 to integrate with the LMS.
8591

@@ -89,30 +95,26 @@ Follow the steps below, replacing `<YOUR_UDOIT_BASE_URL>` with the `BASE_URL` va
8995
1. Navigate to `Developer Keys` in the root account menu.
9096
2. Choose to add a `Developer Key` => `LTI Key`
9197
3. Provide values for the following fields:
92-
* Key Name: i.e. UDOIT 3 LTI
93-
* Owner Email
94-
* Redirect URIs: <YOUR_UDOIT_BASE_URL>/lti/authorize/check
95-
* Configure method: Enter URL
96-
* JSON URL: <YOUR_UDOIT_BASE_URL>/lti/config
97-
* If your instance of Canvas is self-hosted, modify the URL under **JWK Method** to point to your Canvas instance.
98-
* Set Additional Settings
99-
* Domain: Your UDOIT domain
100-
* Tool ID: Enter a name
101-
* Custom Fields
102-
```
103-
lms_id=canvas
104-
lms_user_id=$Canvas.user.id
105-
lms_course_id=$Canvas.course.id
106-
lms_api_domain=$Canvas.api.domain
107-
```
98+
* Key Name: i.e. UDOIT 3 LTI
99+
* Owner Email
100+
* Redirect URIs: <YOUR_UDOIT_BASE_URL>/lti/authorize/check
101+
* Configure methods
102+
* Manual entry
103+
* Paste JSON URL: <YOUR_UDOIT_BASE_URL>/lti/config
104+
* If your instance of Canvas is self-hosted, modify the URL under **JWK Method** to point to your Canvas instance.
105+
* Set Additional Settings
106+
* Domain: Your UDOIT domain
107+
* Tool ID: Enter a name
108+
* Custom Fields
109+
```
110+
lms_id=canvas
111+
lms_user_id=$Canvas.user.id
112+
lms_course_id=$Canvas.course.id
113+
lms_api_domain=$Canvas.api.domain
114+
```
108115
4. Click Save.
109-
5. Click `ON` to enable the newly created key.
110-
111-
---
112-
## Docker Compose Base URL
113-
If you are setting up UDOIT for local development through `docker compose`, <YOUR_UDOIT_BASE_URL> in both the API developer key and the LTI developer key above should be set to `http://127.0.0.1:8000/udoit3`.
116+
5. Click `ON` to enable the newly created key.
114117
115-
---
116118
## Update the Institutions Table
117119
UDOIT is built to support more than one LMS instance. For this purpose, we have an `institution` table that must be populated with the LMS information.
118120
@@ -126,17 +128,21 @@ UDOIT is built to support more than one LMS instance. For this purpose, we have
126128
- `CREATED` = Date in this format: `2021-06-08`
127129
- `STATUS` = `1` if you are using MySQL or MariaDB (or Docker), `true` if you are using PostgreSQL
128130
- `VANITY_URL` = Your LMS vanity URL (i.e. `canvas.myschool.edu`)
129-
- `METADATA` = Optional. Institution-specific settings, such as language or excluded tests. Text representation of a JSON object. (i.e. `{"lang":"es"}`)
131+
- `METADATA` = Optional. Institution-specific settings, such as language or excluded tests. Text representation of a JSON object. (i.e. `{"lang":"en"}`)
130132
- `API_CLIENT_ID` = The ID of the developer API key you created earlier
131133
- `API_CLIENT_SECRET` = The secret for the API key you created earlier
132134
133-
4. Run the following command:
135+
With all the values now set up, you're ready to run the command that will automate the creation of your `institutions` table! Run the following command if you have a MySQL database setup:
136+
```
137+
make ins-mysql
138+
```
139+
Or this one if you have a PostgreSQL setup:
134140
```
135-
make ins-mysql # For MySQL or MariaDB
136-
make ins-psql # For PostgreSQL
141+
make ins-psql
137142
```
143+
Your database should now show a new row in the `institution` table, containing all the values you input above.
144+
138145
139-
---
140146
## .ENV Setup
141147
For cloud-hosted canvas instances, the default value for the `JWK_BASE_URL` environmental variable will work out of the box. If you are not cloud-hosted, you may need to change the value of this variable in `.env.local` to match your canvas instance.
142148
@@ -154,5 +160,3 @@ UDOIT now needs to be added to an account in Canvas. Follow these steps to add t
154160
9. Click Submit.
155161
156162
You're done! "UDOIT" should now appear in the navigation menu of the course (or every course in the account) in which you installed it. If you installed it on an account, "UDOIT Admin" will also appear in the account navigation menu.
157-
158-

assets/js/Components/Admin/AdminApp.js

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,29 @@ export default function AdminApp(initialData) {
9292
}, [filters])
9393

9494
const handleCourseUpdate = (courseData) => {
95-
let tempCourses = Object.assign({}, courses)
96-
tempCourses[courseData.id] = courseData
95+
let tempCourses = {...courses}
96+
97+
// If there's an oldId, this is a newly scanned course that needs the old entry removed
98+
if (courseData.oldId && courseData.oldId !== courseData.id) {
99+
// Remove the old unscanned course entry
100+
if (tempCourses[courseData.oldId]) {
101+
delete tempCourses[courseData.oldId]
102+
}
103+
104+
// Add the new scanned course entry
105+
const updatedCourse = {...courseData}
106+
delete updatedCourse.oldId // Remove the signal flag
107+
tempCourses[courseData.id] = updatedCourse
108+
}
109+
// If updating an existing course, just update its data
110+
else if (tempCourses[courseData.id]) {
111+
tempCourses[courseData.id] = {...tempCourses[courseData.id], ...courseData}
112+
}
113+
// If it's a new course, add it
114+
else {
115+
tempCourses[courseData.id] = courseData
116+
}
117+
97118
setCourses(tempCourses)
98119
}
99120

@@ -132,7 +153,7 @@ export default function AdminApp(initialData) {
132153
}
133154

134155
{ !loadingCourses && (
135-
<div className="non-scrollable">
156+
<div className="mt-3">
136157

137158
{('courses' === navigation) &&
138159
<CoursesPage

assets/js/Components/Admin/AdminFilters.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ export default function AdminFilters({
6969
<select
7070
id="inputAccount"
7171
disabled={loadingContent}
72+
value={filters.accountId.toString()}
7273
onChange={(e) => handleAccountSelect(e.target.value)}
7374
>
7475
{accountOptions.map((acct, i) => {
7576
return (
7677
<option
7778
key={`acct-${i}`}
7879
value={acct.id}
79-
selected={filters.accountId.toString() === acct.id.toString()}
80-
>
80+
>
8181
{acct.name}
8282
</option>
8383
)
@@ -93,15 +93,15 @@ export default function AdminFilters({
9393
<select
9494
id="inputTerm"
9595
disabled={loadingContent}
96+
value={filters.accountId.toString()}
9697
onChange={(e) => handleTermSelect(e.target.value)}
9798
>
9899
{termOptions.map((term, i) => {
99100
return (
100101
<option
101102
key={`term-${i}`}
102103
value={term.id}
103-
selected={filters.termId.toString() === term.id.toString()}
104-
>
104+
>
105105
{term.name}
106106
</option>
107107
)

0 commit comments

Comments
 (0)