-
Notifications
You must be signed in to change notification settings - Fork 121
[MBL-19529][S] Learner Dashboard - Settings Enhancements #3940
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
rh12
merged 46 commits into
master
from
feature/MBL-19529-Learner-Dashboard-Settings-Enhancements
Mar 17, 2026
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
d75edfe
Create UI
petkybenedek 7323f78
Merge branch 'master' into feature/MBL-19529-Dashboard-simple-edit-mode
petkybenedek aeb8276
Merge master
petkybenedek 3713440
Correct animation
petkybenedek 35fdfc9
Correct logic
petkybenedek bffad74
Correct tests and claude findings
petkybenedek eb5320a
Requested changes
petkybenedek eeb566e
Color selector corrections
petkybenedek 52aac49
Merge branch 'master' into feature/MBL-19529-Dashboard-simple-edit-mode
petkybenedek 2336355
Remove no longer set variable tests.
vargaat 4742afb
Remove unnecessary test
petkybenedek 3e2bca1
Merge branch 'feature/MBL-19529-Dashboard-simple-edit-mode' of https:…
petkybenedek 19bd6ab
Increase popver size
petkybenedek 198391f
- Split DashboardWidgetIdentifier into SystemWidgetIdentifier (fixe…
vargaat 7c4c007
Add color saving.
vargaat 2afe479
Add course settings switches. Move converences to system widgets.
vargaat 70ad1d1
Add unit tests.
vargaat 2ed5649
Use ID based color saving.
vargaat a7ebd90
Requested changes, change settings presentation logic
petkybenedek 09d93cb
Update unit tests.
vargaat 40bac3e
Merge branch 'feature/MBL-19529-Dashboard-simple-edit-mode' into feat…
vargaat 763f10a
Rename dashboard settings view to screen.
vargaat 704c4d6
Move factory methods to widget enums.
vargaat 3dbcdcd
Also move custom settings view factory to widget id file.
vargaat afeca50
Update colors.
vargaat 3bad66c
Update hidden widget update logic.
vargaat 614361b
Fix unit test. Update done button color.
vargaat 82f547c
Merge branch 'master' into feature/MBL-19529-Dashboard-simple-edit-mode
vargaat 47f125f
Merge branch 'feature/MBL-19529-Dashboard-simple-edit-mode' into feat…
vargaat 08f384c
Implement code review suggestions.
vargaat 3359454
Merge branch 'master' into feature/MBL-19529-Learner-Dashboard-settin…
vargaat df062d5
Shorten test file name.
vargaat 617c604
Create FlexibleGrid and place the dashboard colors in it.
petkybenedek 9c8dd1e
Extract default course colors from interactor.
vargaat a83bbaa
Remove unnecessary helper.
vargaat fc45bfb
Implement multiple UI related code review suggestions.
vargaat c0f9aa0
Add back bottom padding.
vargaat 882f35a
Fix lint violation.
vargaat c6b9674
Add customize dashboard button.
vargaat ef05d64
Add no widgets view.
vargaat e11edec
Hide sub-settings view from dashboard settings if the widget is turne…
vargaat e92b516
Fix color selection checkmark not being visible in dark mode.
vargaat 695d41e
Fix edit dialog not updating when dark mode changes when being presen…
vargaat 4b18748
Hide up and down widget actions from voiceover when they are disabled.
vargaat 0e49fc8
Update unit tests.
vargaat c45fc64
Merge branch 'master' into feature/MBL-19529-Learner-Dashboard-Settin…
vargaat 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
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
...ent/Student/LearnerDashboard/Container/View/LearnerDashboardAllWidgetsTurnedOffView.swift
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,43 @@ | ||
| // | ||
| // This file is part of Canvas. | ||
| // Copyright (C) 2026-present Instructure, Inc. | ||
| // | ||
| // This program is free software: you can redistribute it and/or modify | ||
| // it under the terms of the GNU Affero General Public License as | ||
| // published by the Free Software Foundation, either version 3 of the | ||
| // License, or (at your option) any later version. | ||
| // | ||
| // This program is distributed in the hope that it will be useful, | ||
| // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| // GNU Affero General Public License for more details. | ||
| // | ||
| // You should have received a copy of the GNU Affero General Public License | ||
| // along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| // | ||
|
|
||
| import Core | ||
| import SwiftUI | ||
|
|
||
| struct LearnerDashboardAllWidgetsTurnedOffView: View { | ||
|
|
||
| var body: some View { | ||
| InteractivePanda( | ||
| scene: SpacePanda(), | ||
| title: String(localized: "All widgets are turned off", bundle: .student), | ||
| subtitle: String(localized: "Add widgets using Customize Dashboard or Dashboard Settings.", bundle: .student) | ||
| ) | ||
| .paddingStyle(.top, .standard) | ||
| .paddingStyle(.top, .standard) | ||
| .frame(maxWidth: .infinity) | ||
| } | ||
| } | ||
|
|
||
| #if DEBUG | ||
|
|
||
| #Preview { | ||
| LearnerDashboardAllWidgetsTurnedOffView() | ||
| .padding() | ||
| } | ||
|
|
||
| #endif |
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
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
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
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
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
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
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
75 changes: 75 additions & 0 deletions
75
...tudentUnitTests/LearnerDashboard/Widgets/Common/Model/DashboardWidgetViewModelTests.swift
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,75 @@ | ||
| // | ||
| // This file is part of Canvas. | ||
| // Copyright (C) 2026-present Instructure, Inc. | ||
| // | ||
| // This program is free software: you can redistribute it and/or modify | ||
| // it under the terms of the GNU Affero General Public License as | ||
| // published by the Free Software Foundation, either version 3 of the | ||
| // License, or (at your option) any later version. | ||
| // | ||
| // This program is distributed in the hope that it will be useful, | ||
| // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| // GNU Affero General Public License for more details. | ||
| // | ||
| // You should have received a copy of the GNU Affero General Public License | ||
| // along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| // | ||
|
|
||
| import Combine | ||
| @testable import Core | ||
| @testable import Student | ||
| import SwiftUI | ||
| import XCTest | ||
|
|
||
| final class DashboardWidgetViewModelArrayTests: XCTestCase { | ||
|
|
||
| // MARK: - allEditableWidgetsTurnedOff | ||
|
|
||
| func test_allEditableWidgetsTurnedOff_withEmptyArray_shouldBeTrue() { | ||
| let widgets: [any DashboardWidgetViewModel] = [] | ||
|
|
||
| XCTAssertTrue(widgets.allEditableWidgetsTurnedOff) | ||
| } | ||
|
|
||
| func test_allEditableWidgetsTurnedOff_withOnlySystemWidgets_shouldBeTrue() { | ||
| let widgets: [any DashboardWidgetViewModel] = [ | ||
| MockDashboardWidgetViewModel(id: SystemWidgetIdentifier.courseInvitations.rawValue) | ||
| ] | ||
|
|
||
| XCTAssertTrue(widgets.allEditableWidgetsTurnedOff) | ||
| } | ||
|
|
||
| func test_allEditableWidgetsTurnedOff_withEditableWidget_shouldBeFalse() { | ||
| let widgets: [any DashboardWidgetViewModel] = [ | ||
| MockDashboardWidgetViewModel(id: EditableWidgetIdentifier.helloWidget.rawValue) | ||
| ] | ||
|
|
||
| XCTAssertFalse(widgets.allEditableWidgetsTurnedOff) | ||
| } | ||
|
|
||
| func test_allEditableWidgetsTurnedOff_withSystemAndEditableWidgets_shouldBeFalse() { | ||
| let widgets: [any DashboardWidgetViewModel] = [ | ||
| MockDashboardWidgetViewModel(id: SystemWidgetIdentifier.courseInvitations.rawValue), | ||
| MockDashboardWidgetViewModel(id: EditableWidgetIdentifier.coursesAndGroups.rawValue) | ||
| ] | ||
|
|
||
| XCTAssertFalse(widgets.allEditableWidgetsTurnedOff) | ||
| } | ||
| } | ||
|
|
||
| private final class MockDashboardWidgetViewModel: DashboardWidgetViewModel { | ||
| let id: String | ||
| let state: InstUI.ScreenState = .data | ||
| let isHiddenInEmptyState = false | ||
|
|
||
| init(id: String) { | ||
| self.id = id | ||
| } | ||
|
|
||
| func makeView() -> AnyView { AnyView(EmptyView()) } | ||
|
|
||
| func refresh(ignoreCache: Bool) -> AnyPublisher<Void, Never> { | ||
| Just(()).eraseToAnyPublisher() | ||
| } | ||
| } |
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.