From da09f2e2885aeb3fcb96b09ea8dd30681db3b395 Mon Sep 17 00:00:00 2001 From: Blackchai Date: Wed, 23 Sep 2020 12:31:14 -0600 Subject: [PATCH] [Teacher][RC 1.11.2 / 34] Remove student view flag, bump version code (#1013) --- apps/teacher/build.gradle | 2 +- .../teacher/presenters/CourseBrowserPresenter.kt | 9 +++------ .../instructure/canvasapi2/utils/RemoteConfigUtils.kt | 1 - 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/apps/teacher/build.gradle b/apps/teacher/build.gradle index 6513c3e226..ce3c3c2962 100644 --- a/apps/teacher/build.gradle +++ b/apps/teacher/build.gradle @@ -41,7 +41,7 @@ android { defaultConfig { minSdkVersion Versions.MIN_SDK targetSdkVersion Versions.TARGET_SDK - versionCode = 33 + versionCode = 34 versionName = '1.11.2' vectorDrawables.useSupportLibrary = true multiDexEnabled true diff --git a/apps/teacher/src/main/java/com/instructure/teacher/presenters/CourseBrowserPresenter.kt b/apps/teacher/src/main/java/com/instructure/teacher/presenters/CourseBrowserPresenter.kt index 1c30776390..8009430520 100644 --- a/apps/teacher/src/main/java/com/instructure/teacher/presenters/CourseBrowserPresenter.kt +++ b/apps/teacher/src/main/java/com/instructure/teacher/presenters/CourseBrowserPresenter.kt @@ -41,23 +41,20 @@ class CourseBrowserPresenter(val canvasContext: CanvasContext, val filter: (Tab, onRefreshStarted() mApiCalls = tryWeave { - val studentViewEnabled = RemoteConfigUtils.getBoolean(RemoteConfigParam.STUDENT_VIEW_ENABLED_TEACHER) == true - // Check to see if we should show the student view tab - skip if Student View isn't enabled - val canUseStudentView = if (studentViewEnabled) - awaitApiResponse { + val canUseStudentView = awaitApiResponse { CourseManager.getCoursePermissions( canvasContext.id, emptyList(), it, true ) - } else null + } val tabs = awaitApi> { TabManager.getTabs(canvasContext, it, forceNetwork) } .filter { !(it.isExternal && it.isHidden) } // We don't want to list external tools that are hidden .toMutableList().apply { - if (studentViewEnabled && canUseStudentView?.isSuccessful == true && canUseStudentView.body()?.canUseStudentView == true) + if (canUseStudentView.isSuccessful && canUseStudentView.body()?.canUseStudentView == true) // Add extra tab for the student view and make sure it's at the very end of the list add(Tab(tabId = Tab.STUDENT_VIEW, position = 1000)) }.toList() // Turn back into a non-mutable list diff --git a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/utils/RemoteConfigUtils.kt b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/utils/RemoteConfigUtils.kt index 03be78f2bd..b73a863dca 100644 --- a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/utils/RemoteConfigUtils.kt +++ b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/utils/RemoteConfigUtils.kt @@ -14,7 +14,6 @@ enum class RemoteConfigParam(val rc_name: String, val safeValueAsString: String) QR_LOGIN_ENABLED("qr_login_enabled", "true"), QR_LOGIN_ENABLED_TEACHER("qr_login_enabled_teacher", "false"), QR_PAIR_OBSERVER_ENABLED("qr_pair_observer_enabled", "false"), - STUDENT_VIEW_ENABLED_TEACHER("student_view_enabled_teacher", "false"), TEST_BOOL("test_bool", "false"), TEST_FLOAT("test_float", "0f"), TEST_LONG("test_long", "42"),