Skip to content

Commit

Permalink
Add ContentUnavailableView to Education page (#94)
Browse files Browse the repository at this point in the history
# Add ContentUnavailableView to Education page

## ♻️ Current situation & Problem
This is just a copy of the changes made in #90 - This is mostly trying
to debug why tests are failing by simply recreating the same changes and
checking if the CI reacts differently here...


## ⚙️ Release Notes 
- Handle Education Video fetching failure with content unavailable view
(#90) by @PaulGoldschmidt


## 📚 Documentation
*Please ensure that you properly document any additions in conformance
to [Spezi Documentation
Guide](https://github.com/StanfordSpezi/.github/blob/main/DOCUMENTATIONGUIDE.md).*
*You can use this section to describe your solution, but we encourage
contributors to document your reasoning and changes using in-line
documentation.*


## ✅ Testing
*Please ensure that the PR meets the testing requirements set by CodeCov
and that new functionality is appropriately tested.*
*This section describes important information about the tests and why
some elements might not be testable.*


### Code of Conduct & Contributing Guidelines 

By submitting creating this pull request, you agree to follow our [Code
of
Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md):
- [x] I agree to follow the [Code of
Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md).
  • Loading branch information
pauljohanneskraft authored Oct 3, 2024
1 parent 7ee5b83 commit 606ea1e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ENGAGEHF/Education/Education.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,18 @@ struct Education: View {
@Bindable var navigationManager = navigationManager

NavigationStack(path: $navigationManager.educationPath) {
VideoList(videoCollections: videoManager.videoCollections)
Group {
let videoCollections = videoManager.videoCollections.filter { !$0.videos.isEmpty }
if videoCollections.isEmpty {
ContentUnavailableView(
"No Educational Videos",
systemImage: "video.slash",
description: Text("There are currently no educational videos available.")
)
} else {
VideoList(videoCollections: videoCollections)
}
}
.accessibilityIdentifier("Video List")
.navigationTitle("Education")
.toolbar {
Expand Down
6 changes: 6 additions & 0 deletions ENGAGEHF/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,9 @@
},
"No Data" : {

},
"No Educational Videos" : {

},
"No medication recommendations" : {

Expand Down Expand Up @@ -646,6 +649,9 @@
},
"The user isn't currently set up correctly. Please try closing the app and opening it back up." : {

},
"There are currently no educational videos available." : {

},
"Thumbnail Image: %@" : {

Expand Down

0 comments on commit 606ea1e

Please sign in to comment.