Skip to content

Commit

Permalink
[all] Clean up some no longer needed TODOs (#1068)
Browse files Browse the repository at this point in the history
  • Loading branch information
TrevorNeedham authored Oct 22, 2020
1 parent b1eab77 commit 74b1075
Show file tree
Hide file tree
Showing 20 changed files with 45 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Account>()
Original file line number Diff line number Diff line change
Expand Up @@ -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<AccountNotification>() {
override val comparisonString get() = subject
override val comparisonDate get() = startDate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ import com.google.gson.annotations.SerializedName

data class AuthenticatedSession(
@SerializedName("session_url")
val sessionUrl: String // TODO: null?
val sessionUrl: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<CanvasTheme>()
Original file line number Diff line number Diff line change
Expand Up @@ -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<ColumnDatum>() {
override fun compareTo(other: ColumnDatum): Int = 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<CustomColumn>() {
override val comparisonString get() = title
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<GradeableStudentSubmission>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ 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.
@SerializedName("read_state")
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,
Expand All @@ -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")
Expand Down Expand Up @@ -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<SubmissionComment> = ArrayList(),
var canvasContext: CanvasContext? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Tab>() {
override val id get() = position.toLong()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Long> = ArrayList()
) : Parcelable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 74b1075

Please sign in to comment.