From 74b1075fc333911033e7fb2a9af4521144013b02 Mon Sep 17 00:00:00 2001 From: Blackchai Date: Thu, 22 Oct 2020 08:06:43 -0600 Subject: [PATCH] [all] Clean up some no longer needed TODOs (#1068) --- .../instructure/annotations/PdfSubmissionView.kt | 1 - .../com/instructure/canvasapi2/models/Account.kt | 2 +- .../canvasapi2/models/AccountNotification.kt | 10 +++++----- .../instructure/canvasapi2/models/AccountRole.kt | 2 +- .../instructure/canvasapi2/models/Assignee.kt | 2 +- .../canvasapi2/models/AuthenticatedSession.kt | 2 +- .../instructure/canvasapi2/models/CanvasError.kt | 4 ++-- .../instructure/canvasapi2/models/CanvasTheme.kt | 16 ++++++++-------- .../instructure/canvasapi2/models/ColumnDatum.kt | 4 ++-- .../com/instructure/canvasapi2/models/Course.kt | 2 +- .../canvasapi2/models/CreateFolder.kt | 2 +- .../canvasapi2/models/CustomColumn.kt | 8 ++++---- .../models/GradeableStudentSubmission.kt | 2 +- .../instructure/canvasapi2/models/Placements.kt | 2 +- .../canvasapi2/models/QuizOverride.kt | 2 +- .../instructure/canvasapi2/models/StreamItem.kt | 12 ++++++------ .../com/instructure/canvasapi2/models/Tab.kt | 6 +++--- .../com/instructure/canvasapi2/models/ToDo.kt | 2 +- .../instructure/canvasapi2/models/UsageRights.kt | 8 ++++---- .../com/instructure/canvasapi2/models/User.kt | 2 +- 20 files changed, 45 insertions(+), 46 deletions(-) diff --git a/libs/annotations/src/main/java/com/instructure/annotations/PdfSubmissionView.kt b/libs/annotations/src/main/java/com/instructure/annotations/PdfSubmissionView.kt index 65b06aeb08..8aa7bb5f6d 100644 --- a/libs/annotations/src/main/java/com/instructure/annotations/PdfSubmissionView.kt +++ b/libs/annotations/src/main/java/com/instructure/annotations/PdfSubmissionView.kt @@ -306,7 +306,6 @@ abstract class PdfSubmissionView(context: Context) : FrameLayout(context), Annot load(apiValues.pdfUrl) { setupPSPDFKit(it) } } else { - //TODO: better handle case where redirect url is empty, is a canvadoc failure case toast(R.string.errorOccurred) } } else { diff --git a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/Account.kt b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/Account.kt index 2af82be671..33f6e303de 100644 --- a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/Account.kt +++ b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/Account.kt @@ -21,7 +21,7 @@ import kotlinx.android.parcel.Parcelize @Parcelize data class Account( override val id: Long = 0, - var name: String = "", // TODO: null? + var name: String = "", @SerializedName("effective_locale") val effectiveLocale: String? = null ) : CanvasModel() diff --git a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/AccountNotification.kt b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/AccountNotification.kt index 3998e5a0ae..a880dc79e4 100644 --- a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/AccountNotification.kt +++ b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/AccountNotification.kt @@ -24,13 +24,13 @@ import kotlinx.android.parcel.Parcelize @Parcelize data class AccountNotification( override val id: Long = 0, - val subject: String = "", // TODO: null? - val message: String = "", // TODO: null? + val subject: String = "", + val message: String = "", @SerializedName("start_at") - val startAt: String = "", // TODO: null? + val startAt: String = "", @SerializedName("end_at") - val endAt: String = "", // TODO: null? - val icon: String = "" // TODO: null? + val endAt: String = "", + val icon: String = "" ) : CanvasModel() { override val comparisonString get() = subject override val comparisonDate get() = startDate diff --git a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/AccountRole.kt b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/AccountRole.kt index d834b55494..d63a996fba 100644 --- a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/AccountRole.kt +++ b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/AccountRole.kt @@ -21,7 +21,7 @@ import kotlinx.android.parcel.Parcelize @Parcelize data class AccountRole( override val id: Long = 0, - val role: String = "", // TODO: null? + val role: String = "", val label: String? = null, @SerializedName("base_role_type") val baseRoleType: String? = null, diff --git a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/Assignee.kt b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/Assignee.kt index 727f54c11e..a5c9969a2c 100644 --- a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/Assignee.kt +++ b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/Assignee.kt @@ -27,7 +27,7 @@ sealed class Assignee : Parcelable { @Parcelize data class StudentAssignee( - val student: User, // TODO: handle id and name when not given a student? + val student: User, override val id: Long = student.id, override val name: String = student.name, override val pronouns: String? = student.pronouns diff --git a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/AuthenticatedSession.kt b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/AuthenticatedSession.kt index 96181a8a18..5fe21d1ede 100644 --- a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/AuthenticatedSession.kt +++ b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/AuthenticatedSession.kt @@ -19,5 +19,5 @@ import com.google.gson.annotations.SerializedName data class AuthenticatedSession( @SerializedName("session_url") - val sessionUrl: String // TODO: null? + val sessionUrl: String ) diff --git a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/CanvasError.kt b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/CanvasError.kt index d43fe92de5..8a22f7af6a 100644 --- a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/CanvasError.kt +++ b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/CanvasError.kt @@ -17,8 +17,8 @@ package com.instructure.canvasapi2.models data class CanvasError( - val attribute: String, // TODO: null? - val message: String // TODO: null? + val attribute: String, + val message: String ) data class CanvasAuthError(val message: String) diff --git a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/CanvasTheme.kt b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/CanvasTheme.kt index 50659bfe8c..8b680e5b50 100644 --- a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/CanvasTheme.kt +++ b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/CanvasTheme.kt @@ -23,19 +23,19 @@ import kotlinx.android.parcel.Parcelize @Parcelize class CanvasTheme( @SerializedName("ic-brand-primary") - var brand: String, // TODO: null? + var brand: String, @SerializedName("ic-brand-font-color-dark") - var fontColorDark: String, // TODO: null? + var fontColorDark: String, @SerializedName("ic-brand-button--primary-bgd") - var button: String, // TODO: null? + var button: String, @SerializedName("ic-brand-button--primary-text") - var buttonText: String, // TODO: null? + var buttonText: String, @SerializedName("ic-brand-global-nav-bgd") - var primary: String, // TODO: null? + var primary: String, @SerializedName("ic-brand-global-nav-menu-item__text-color") - var primaryText: String, // TODO: null? + var primaryText: String, @SerializedName("ic-brand-global-nav-menu-item__text-color--active") - var accent: String, // TODO: null? + var accent: String, @SerializedName("ic-brand-header-image") - var logoUrl: String // TODO: null? + var logoUrl: String ) : CanvasComparable() \ No newline at end of file diff --git a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/ColumnDatum.kt b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/ColumnDatum.kt index 7381564097..a4ff421f4c 100644 --- a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/ColumnDatum.kt +++ b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/ColumnDatum.kt @@ -22,9 +22,9 @@ import kotlinx.android.parcel.Parcelize @Parcelize data class ColumnDatum( - val content: String, // TODO: null? + val content: String, @SerializedName("user_id") - val userId: Long // TODO: default + val userId: Long ) : CanvasModel() { override fun compareTo(other: ColumnDatum): Int = 0 } diff --git a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/Course.kt b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/Course.kt index a79245b3c9..073ff9b76a 100644 --- a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/Course.kt +++ b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/Course.kt @@ -27,7 +27,7 @@ import java.util.* @Parcelize data class Course( override val id: Long = 0, - override var name: String = "", // TODO: null? + override var name: String = "", @SerializedName("original_name") var originalName: String? = null, @SerializedName("course_code") diff --git a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/CreateFolder.kt b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/CreateFolder.kt index dbeac99085..159e04fc24 100644 --- a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/CreateFolder.kt +++ b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/CreateFolder.kt @@ -18,7 +18,7 @@ package com.instructure.canvasapi2.models import com.google.gson.annotations.SerializedName data class CreateFolder( - var name: String = "", // TODO: null? + var name: String = "", var locked: Boolean = true ) diff --git a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/CustomColumn.kt b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/CustomColumn.kt index bf7c212752..206b43d101 100644 --- a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/CustomColumn.kt +++ b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/CustomColumn.kt @@ -23,11 +23,11 @@ import kotlinx.android.parcel.Parcelize @Parcelize data class CustomColumn( override val id: Long = 0, - val title: String, // Header text // TODO: null? - val position: Int, //Column order // TODO: default - val hidden: Boolean, // Won't be displayed if hidden is true // TODO: default + val title: String, // Header text + val position: Int, //Column order + val hidden: Boolean, // Won't be displayed if hidden is true @SerializedName("teacher_notes") - val teacherNotes: Boolean // Is it the teacher's note column? // TODO: default + val teacherNotes: Boolean // Is it the teacher's note column? ) : CanvasModel() { override val comparisonString get() = title } diff --git a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/GradeableStudentSubmission.kt b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/GradeableStudentSubmission.kt index 95204b1b4c..7dbd84c18f 100644 --- a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/GradeableStudentSubmission.kt +++ b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/GradeableStudentSubmission.kt @@ -21,7 +21,7 @@ import kotlinx.android.parcel.Parcelize @Parcelize data class GradeableStudentSubmission( - val assignee: Assignee, // TODO: Assignee() + val assignee: Assignee, var submission: Submission? = null, var isCached: Boolean = false ) : CanvasModel() { diff --git a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/Placements.kt b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/Placements.kt index 90038e3621..4e6532ae4c 100644 --- a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/Placements.kt +++ b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/Placements.kt @@ -23,7 +23,7 @@ import kotlinx.android.parcel.Parcelize @Parcelize data class Placements( @SerializedName("global_navigation") - var globalNavigation: Placement, // TODO: null? + var globalNavigation: Placement, @SerializedName("course_navigation") var courseNavigation: Placement? = null ) : Parcelable \ No newline at end of file diff --git a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/QuizOverride.kt b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/QuizOverride.kt index 39671cdb6c..11ceccafd0 100644 --- a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/QuizOverride.kt +++ b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/QuizOverride.kt @@ -26,7 +26,7 @@ data class QuizOverride( override var id: Long = 0, @SerializedName("assignment_id") var assignmentId: Long = 0, - var title: String = "", // TODO: null? + var title: String = "", @SerializedName("due_at") var dueAt: Date? = null, @SerializedName("all_day") diff --git a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/StreamItem.kt b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/StreamItem.kt index 26e79aebb5..6bcd5280ed 100644 --- a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/StreamItem.kt +++ b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/StreamItem.kt @@ -30,12 +30,12 @@ import java.util.ArrayList data class StreamItem( override val id: Long = -1, @SerializedName("updated_at") - val updatedAt: String = "", // TODO: null? + val updatedAt: String = "", @SerializedName("submitted_at") val submittedAt: String? = null, var title: String? = null, private var message: String? = null, - val type: String = "", // TODO: null? + val type: String = "", private val context_type: String? = null, // Helper method to show that the stream item has been read without having to reload all the data. // this method does not get the data from the server, so make sure item is actually read. @@ -43,7 +43,7 @@ data class StreamItem( var isReadState: Boolean = false, val url: String? = null, @SerializedName("html_url") - val htmlUrl: String = "", // TODO: null? + val htmlUrl: String = "", private var course_id: Long = -1, private var group_id: Long = -1, var assignment_id: Long = -1, @@ -52,7 +52,7 @@ data class StreamItem( @SerializedName("message_id") val messageId: Long = -1, @SerializedName("notification_category") - val notificationCategory: String = "", // TODO: null? + val notificationCategory: String = "", // Conversation @SerializedName("conversation_id") @@ -82,10 +82,10 @@ data class StreamItem( @SerializedName("submission_type") val submissiTonType: String? = null, @SerializedName("workflow_state") - val workflowState: String = "", // TODO: null? + val workflowState: String = "", val late: Boolean = false, @SerializedName("preview_url") - val previewUrl: String = "", // TODO: null? + val previewUrl: String = "", @SerializedName("submission_comments") val submissionComments: List = ArrayList(), var canvasContext: CanvasContext? = null, diff --git a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/Tab.kt b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/Tab.kt index 5245a65901..37e820f296 100644 --- a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/Tab.kt +++ b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/Tab.kt @@ -24,19 +24,19 @@ import kotlinx.android.parcel.Parcelize @Parcelize data class Tab( @SerializedName("id") - val tabId: String = "", // TODO: null? + val tabId: String = "", val label: String? = null, val type: String = TYPE_INTERNAL, @SerializedName("html_url") val htmlUrl: String? = null, // Internal url @SerializedName("full_url") val externalUrl: String? = null, // External url - val visibility: String = "none", // possible values are: public, members, admins, and none // TODO: enum? + val visibility: String = "none", // possible values are: public, members, admins, and none @SerializedName("hidden") val isHidden: Boolean = false, // only included when true val position: Int = 0, @SerializedName("url") - val ltiUrl: String = "" // TODO: null? + val ltiUrl: String = "" ) : CanvasModel() { override val id get() = position.toLong() diff --git a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/ToDo.kt b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/ToDo.kt index 16c5b2b97c..9b532fdca6 100644 --- a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/ToDo.kt +++ b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/ToDo.kt @@ -26,7 +26,7 @@ import java.util.* @Parcelize data class ToDo( @SerializedName("start_date") - val startAt: String? = "", // TODO: null? + val startAt: String? = "", val type: Type? = null, @SerializedName("needs_grading_count") val needsGradingCount: Int = 0, diff --git a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/UsageRights.kt b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/UsageRights.kt index b3fe8e3681..1b1e00a34f 100644 --- a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/UsageRights.kt +++ b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/UsageRights.kt @@ -22,13 +22,13 @@ import kotlinx.android.parcel.Parcelize @Parcelize data class UsageRights( @SerializedName("legal_copyright") - val legalCopyright: String? = "", // TODO: null? + val legalCopyright: String? = "", @SerializedName("use_justification") val useJustification: FileUsageRightsJustification = FileUsageRightsJustification.OWN_COPYRIGHT, - val license: String? = "", // TODO: null? + val license: String? = "", @SerializedName("license_name") - val licenseName: String? = "", // TODO: null? - val message: String? = "", // TODO: null? + val licenseName: String? = "", + val message: String? = "", @SerializedName("file_ids") val fileIds: ArrayList = ArrayList() ) : Parcelable diff --git a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/User.kt b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/User.kt index 60679c69a8..8bcbef3998 100644 --- a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/User.kt +++ b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/User.kt @@ -24,7 +24,7 @@ import java.util.ArrayList @Parcelize data class User( override val id: Long = 0, - override val name: String = "", // TODO: null? + override val name: String = "", @SerializedName("short_name") val shortName: String? = null, @SerializedName("login_id")