-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Edusign - new components #19460
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
Merged
Merged
Edusign - new components #19460
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
74d9b82
new components
michelle0927 787a701
pnpm-lock.yaml
michelle0927 1163b2c
updates
michelle0927 6199813
Update components/edusign/actions/create-course/create-course.mjs
michelle0927 f2f8f05
Update components/edusign/actions/create-course/create-course.mjs
michelle0927 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
components/edusign/actions/add-student-to-course/add-student-to-course.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| import edusign from "../../edusign.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "edusign-add-student-to-course", | ||
| name: "Add Student to Course", | ||
| description: "Add a student to a course. [See the documentation](https://developers.edusign.com/reference/putv1courseattendancecourseid)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: false, | ||
| }, | ||
| props: { | ||
| edusign, | ||
| courseId: { | ||
| propDefinition: [ | ||
| edusign, | ||
| "courseId", | ||
| ], | ||
| }, | ||
| studentId: { | ||
| propDefinition: [ | ||
| edusign, | ||
| "studentId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.edusign.addStudentToCourse({ | ||
| $, | ||
| courseId: this.courseId, | ||
| data: { | ||
| studentId: this.studentId, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully added student ${this.studentId} to course ${this.courseId}`); | ||
| return response; | ||
| }, | ||
| }; |
92 changes: 92 additions & 0 deletions
92
components/edusign/actions/create-course/create-course.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| import edusign from "../../edusign.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "edusign-create-course", | ||
| name: "Create Course", | ||
| description: "Create a new course. [See the documentation](https://developers.edusign.com/reference/postv1course)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: false, | ||
| }, | ||
| props: { | ||
| edusign, | ||
| name: { | ||
| type: "string", | ||
| label: "Name", | ||
| description: "The name of the course", | ||
| }, | ||
| start: { | ||
| type: "string", | ||
| label: "Start", | ||
| description: "Start date of the course (ISO 8601 datetime, e.g. `2023-02-15T09:00:00Z`)", | ||
| }, | ||
| end: { | ||
| type: "string", | ||
| label: "End", | ||
| description: "End date of the course (ISO 8601 datetime, e.g. `2025-11-29T15:00:00Z`)", | ||
| }, | ||
| professorId: { | ||
| propDefinition: [ | ||
| edusign, | ||
| "professorId", | ||
| ], | ||
| }, | ||
| needStudentSignature: { | ||
| type: "boolean", | ||
| label: "Need Student Signature", | ||
| description: "Whether the course needs a student signature", | ||
| }, | ||
| description: { | ||
| type: "string", | ||
| label: "Description", | ||
| description: "The description of the course", | ||
| optional: true, | ||
| }, | ||
| groupIds: { | ||
| propDefinition: [ | ||
| edusign, | ||
| "groupId", | ||
| ], | ||
| type: "string[]", | ||
| label: "Group IDs", | ||
| description: "The IDs of the groups to add to the course", | ||
| optional: true, | ||
| }, | ||
| maxStudents: { | ||
| type: "integer", | ||
| label: "Max Students", | ||
| description: "The maximum number of students to add to the course", | ||
| optional: true, | ||
| }, | ||
| classroomId: { | ||
| propDefinition: [ | ||
| edusign, | ||
| "classroomId", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.edusign.createCourse({ | ||
| $, | ||
| data: { | ||
| course: { | ||
| NAME: this.name, | ||
| START: this.start, | ||
| END: this.end, | ||
| PROFESSOR: this.professorId, | ||
| NEED_STUDENT_SIGNATURE: this.needStudentSignature, | ||
| DESCRIPTION: this.description, | ||
| SCHOOL_GROUP: this.groupIds, | ||
| MAX_STUDENTS: this.maxStudents, | ||
| CLASSROOM: this.classroomId, | ||
| }, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully created course with ID: ${response.result.ID}`); | ||
| return response; | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| import edusign from "../../edusign.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "edusign-create-group", | ||
| name: "Create Group", | ||
| description: "Create a new group. [See the documentation](https://developers.edusign.com/reference/postv1group)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: false, | ||
| }, | ||
| props: { | ||
| edusign, | ||
| name: { | ||
| type: "string", | ||
| label: "Name", | ||
| description: "The name of the group", | ||
| }, | ||
| description: { | ||
| type: "string", | ||
| label: "Description", | ||
| description: "The description of the group", | ||
| }, | ||
| studentIds: { | ||
| propDefinition: [ | ||
| edusign, | ||
| "studentId", | ||
| ], | ||
| type: "string[]", | ||
| label: "Student IDs", | ||
| description: "The IDs of the students to add to the group", | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.edusign.createGroup({ | ||
| $, | ||
| data: { | ||
| group: { | ||
| NAME: this.name, | ||
| DESCRIPTION: this.description, | ||
| STUDENTS: this.studentIds, | ||
| }, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully created group with ID: ${response.result.ID}`); | ||
| return response; | ||
| }, | ||
| }; |
85 changes: 85 additions & 0 deletions
85
components/edusign/actions/create-student/create-student.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| import edusign from "../../edusign.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "edusign-create-student", | ||
| name: "Create Student", | ||
| description: "Create a new student. [See the documentation](https://developers.edusign.com/reference/postv1student)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: false, | ||
| }, | ||
| props: { | ||
| edusign, | ||
| firstName: { | ||
| type: "string", | ||
| label: "First Name", | ||
| description: "The first name of the student", | ||
| }, | ||
| lastName: { | ||
| type: "string", | ||
| label: "Last Name", | ||
| description: "The last name of the student", | ||
| }, | ||
| email: { | ||
| type: "string", | ||
| label: "Email", | ||
| description: "The email of the student", | ||
| }, | ||
| phone: { | ||
| type: "string", | ||
| label: "Phone", | ||
| description: "The phone number of the student", | ||
| optional: true, | ||
| }, | ||
| photo: { | ||
| type: "string", | ||
| label: "Photo", | ||
| description: "The URL of the student's photo", | ||
| optional: true, | ||
| }, | ||
| fileNumber: { | ||
| type: "string", | ||
| label: "File Number", | ||
| description: "The file number of the student", | ||
| optional: true, | ||
| }, | ||
| tags: { | ||
| type: "string[]", | ||
| label: "Tags", | ||
| description: "The tags of the student", | ||
| optional: true, | ||
| }, | ||
| groupIds: { | ||
| propDefinition: [ | ||
| edusign, | ||
| "groupId", | ||
| ], | ||
| type: "string[]", | ||
| label: "Groups", | ||
| description: "The groups of the student", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.edusign.createStudent({ | ||
| $, | ||
| data: { | ||
| student: { | ||
| FIRSTNAME: this.firstName, | ||
| LASTNAME: this.lastName, | ||
| EMAIL: this.email, | ||
| PHONE: this.phone, | ||
| PHOTO: this.photo, | ||
| FILE_NUMBER: this.fileNumber, | ||
| TAGS: this.tags, | ||
| GROUPS: this.groupIds, | ||
| }, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully created student with ID: ${response.result.ID}`); | ||
| return response; | ||
| }, | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.