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

Update GraphQL Queries with Pagination #3064

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

suhaibabsi-inst
Copy link
Contributor

@suhaibabsi-inst suhaibabsi-inst commented Jan 14, 2025

refs: MBL-18026
affects: Student, Teacher
release note: Update GraphQL Queries with Pagination.

What's Changed

All GraphQL queries used to fetch a list of items were modified to include paging, and those are:

1- Teacher's Comments Library for Assignment Submission.

Request type: APICommentLibraryRequest
Used in Teacher app.

2- Assignment Picker List of Submit Assignment Extension.

Request type: AssignmentPickerListRequest
Used in "SubmitAssignment" extension of Student app.

3- Settings page course sections list of Assignment Submissions List.

GetAssignmentPostPolicyInfoRequest type was splitted into two separate requests:
A. GetPostPolicyCourseSectionsRequest: was modified to include paging.
B. GetPostPolicyAssignmentSubmissionsRequest : paging was not included, because it was used to calculate counts rather than presenting information of submissions.

Used in Teacher app.

Paging Logic

New main types were introduced to encapsulate paging logic for both UIKit and SwiftUI contexts:
PagingButton - SwiftUI View to be added to the very bottom of the list.

In UIKit context, to handle paging in UITableView, you need to consider the following ones.
Paging<C> - A presenter object used to handle paging logic in UITableView instances, you need to create one per a table view.
PageLoadingCell - A cell that can be dequeued in UITableView with loading & call-to-action variations, to be shown based on the logic encapsulated in the Paging instance associated with.

Test Plan

1 - Teacher's Comments Library:

  • Make sure to enable comments suggestions for SpeedGrader. See this page.
  • Open Teacher app, then navigate to a student submission made to any assignment.
  • Open comments sheet, the tap on text input field.
  • Comments library would show up to choose from. That list should be loading comments in pages.

2 - Assignment Picker List of Submit Assignment Extension.

  • Go to Files or Photos app, then user "Share" option on any photo or valid file for assignment submission.
  • Choose Student app, then select the course you are interested in using "Select course" field of the shown form.
  • Then tap on "Select Assignment" field to show list of assignment to pick from.
  • That list should be loading assignments in pages.

3- Settings page course sections list of Assignment Submissions List.

  • In Teacher app, go to any assignment submissions list page.
  • Tap on the top right button with the "eye" icon.
  • Turn on, "Specific Sections" toggle on.
  • Course sections must be loaded below in pages, this for both of the screen tabs (Post Marks / Hide Marks)

Note:

"List loading in pages" means that you get to notice loading indicator when you scroll to the very bottom of it, if loading failed "Load More" button is shown to allow user to try fetching again.

Video Recordings

1- Comments Library

case1_comments_library.mp4

2- Assignment Picker List

case2_post_policy.mp4

3- Post Policy Settings Page

case3_assignment_picker.mp4

Checklist

  • Follow-up e2e test ticket created
  • A11y checked
  • Tested on phone
  • Tested on tablet
  • Tested in dark mode
  • Tested in light mode
  • Approve from product

@inst-danger
Copy link
Contributor

inst-danger commented Jan 14, 2025

Warnings
⚠️ One or more files are below the minimum test coverage 50%

Release Note:

Update GraphQL Queries with Pagination

Affected Apps: Student, Teacher

MBL-18026

Coverage New % Master % Delta
Canvas iOS 90.89% 91.28% -0.39%
Core/Core/Common/CommonUI/Presenter/Paging.swift 0% -- --
Core/Core/Features/Submissions/APICommentLibraryRequest.swift 21.43% 100% -78.57%
Core/Core/Common/CommonModels/Store/FetchedCollection.swift 48.72% 48.72% 0%
Core/Core/Common/Extensions/Foundation/CGSizeExtensions.swift 0% 0% 0%
Core/Core/Features/Courses/SmartSearch/Model/CourseSmartSearchViewAttributes.swift 30.77% 30.77% 0%
Core/Core/Common/Extensions/SwiftUI/UIColor+Color.swift 0% 0% 0%
Core/Core/Features/Search/Model/SearchSupportButtonModel.swift 0% 0% 0%
Core/Core/Common/CommonModels/AppEnvironment/AppEnvironmentOverride.swift 32.76% 32.76% 0%
Core/Core/Features/SubmitAssignmentExtension/Model/API/AssignmentPickerListRequest.swift 21.43% 100% -78.57%

Generated by 🚫 dangerJS against 6a484d1

refs: MBL-18026
affects: Student, Teacher
release note: Update GraphQL Queries with Pagination
@inst-danger
Copy link
Contributor

inst-danger commented Jan 15, 2025

Teacher Build QR Code:

@inst-danger
Copy link
Contributor

inst-danger commented Jan 15, 2025

Student Build QR Code:

@suhaibabsi-inst suhaibabsi-inst marked this pull request as ready for review January 21, 2025 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants