Skip to content
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

ladislas/feature/contentkit refactor exercise model is right answer #714

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
}
.frame(maxWidth: .infinity)
}
// TODO: (@ladislas) remove if not necessary

Check warning on line 79 in Apps/LekaApp/Sources/_NEWCodeBase/Views/MainView/MainView.swift

View workflow job for this annotation

GitHub Actions / swiftlint

TODOs should be resolved ((@ladislas) remove if not nece...) (todo)
// .disabled(navigation.disableUICompletly)
} detail: {
NavigationStack(path: self.$navigation.path) {
Expand Down Expand Up @@ -125,7 +125,7 @@
.fullScreenCover(isPresented: self.$viewModel.isRobotConnectionPresented) {
RobotConnectionView(viewModel: RobotConnectionViewModel())
}
// TODO: (@team) - Update this onReceive when caregiver are managed by AccountKit

Check warning on line 128 in Apps/LekaApp/Sources/_NEWCodeBase/Views/MainView/MainView.swift

View workflow job for this annotation

GitHub Actions / swiftlint

TODOs should be resolved ((@team) - Update this onReceiv...) (todo)
.onReceive(self.rootOwnerViewModel.$currentCaregiver) { caregiver in
if !self.authManagerViewModel.isUserLoggedOut {
self.isCaregiverPickerPresented = (caregiver == nil)
Expand All @@ -140,7 +140,7 @@
ActivityView(activity: activity)
}
.sheet(isPresented: self.$rootOwnerViewModel.isSettingsViewPresented) {
SettingsView()
SettingsView(isCaregiverPickerPresented: self.$isCaregiverPickerPresented)
}
.sheet(isPresented: self.$rootOwnerViewModel.isEditCaregiverViewPresented) {
EditCaregiverView(modifiedCaregiver: self.rootOwnerViewModel.currentCaregiver!)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ extension SettingsView {
struct ProfilesSection: View {
// MARK: Internal

@Binding var isCaregiverPickerPresented: Bool

var body: some View {
Section(String(l10n.SettingsView.ProfilesSection.header.characters)) {
Button {
self.rootOwnerViewModel.isSettingsViewPresented = false
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
self.rootOwnerViewModel.currentCaregiver = nil
self.isCaregiverPickerPresented = true
}
} label: {
Label(String(l10n.SettingsView.ProfilesSection.switchProfileButtonLabel.characters), systemImage: "person.2.gobackward")
Expand All @@ -32,5 +34,5 @@ extension SettingsView {
}

#Preview {
SettingsView.ProfilesSection()
SettingsView.ProfilesSection(isCaregiverPickerPresented: .constant(false))
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import SwiftUI
// MARK: - SettingsView

struct SettingsView: View {
@ObservedObject var rootOwnerViewModel: RootOwnerViewModel = .shared
@ObservedObject var styleManager: StyleManager = .shared
@ObservedObject private var rootOwnerViewModel: RootOwnerViewModel = .shared
@ObservedObject private var styleManager: StyleManager = .shared
@Binding var isCaregiverPickerPresented: Bool

var body: some View {
NavigationStack {
Form {
CredentialsSection()
ProfilesSection()
ProfilesSection(isCaregiverPickerPresented: self.$isCaregiverPickerPresented)
AccountSection()
}
.navigationTitle(String(l10n.SettingsView.navigationTitle.characters))
Expand All @@ -34,5 +35,5 @@ struct SettingsView: View {
}

#Preview {
SettingsView()
SettingsView(isCaregiverPickerPresented: .constant(false))
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,11 @@ exercises_payload:
interface: touchToSelect
gameplay: findTheRightAnswers
payload:
shuffle_choices: true
choices:
- value: yellow
type: color
isRightAnswer: true
is_right_answer: true
- value: red
type: color
- value: green
Expand All @@ -114,17 +115,18 @@ exercises_payload:
interface: touchToSelect
gameplay: findTheRightAnswers
payload:
shuffle_choices: true
choices:
- value: yellow
type: color
- value: red
type: color
- value: green
type: color
isRightAnswer: true
is_right_answer: true
- value: blue
type: color
isRightAnswer: true
is_right_answer: true

- group:
- instructions:
Expand All @@ -135,10 +137,11 @@ exercises_payload:
interface: touchToSelect
gameplay: findTheRightAnswers
payload:
shuffle_choices: true
choices:
- value: 🍉
type: emoji
isRightAnswer: true
is_right_answer: true
- value: 🍌
type: emoji
- value: 🍒
Expand All @@ -154,13 +157,14 @@ exercises_payload:
interface: touchToSelect
gameplay: findTheRightAnswers
payload:
shuffle_choices: true
choices:
- value: 🐱
type: emoji
isRightAnswer: true
is_right_answer: true
- value: 🐶
type: emoji
isRightAnswer: true
is_right_answer: true
- value: 🐷
type: emoji
- value: 🐹
Expand All @@ -174,13 +178,14 @@ exercises_payload:
interface: touchToSelect
gameplay: findTheRightAnswers
payload:
shuffle_choices: true
choices:
- value: 🔨
type: emoji
isRightAnswer: true
is_right_answer: true
- value: 🪚
type: emoji
isRightAnswer: true
is_right_answer: true
- value: 🪛
type: emoji
- value: 🪜
Expand All @@ -195,12 +200,13 @@ exercises_payload:
interface: touchToSelect
gameplay: findTheRightAnswers
payload:
shuffle_choices: true
choices:
- value: circle
type: sfsymbol
- value: square
type: sfsymbol
isRightAnswer: true
is_right_answer: true
- value: triangle
type: sfsymbol
- value: rhombus
Expand All @@ -214,12 +220,13 @@ exercises_payload:
interface: touchToSelect
gameplay: findTheRightAnswers
payload:
shuffle_choices: true
choices:
- value: figure.climbing
type: sfsymbol
- value: figure.tennis
type: sfsymbol
isRightAnswer: true
is_right_answer: true
- value: figure.pool.swim
type: sfsymbol
- value: figure.soccer
Expand All @@ -233,14 +240,15 @@ exercises_payload:
interface: touchToSelect
gameplay: findTheRightAnswers
payload:
shuffle_choices: true
choices:
- value: sun.max
type: sfsymbol
- value: cloud.sun
type: sfsymbol
- value: cloud.bolt.rain
type: sfsymbol
isRightAnswer: true
is_right_answer: true
- value: cloud.snow
type: sfsymbol

Expand All @@ -252,10 +260,11 @@ exercises_payload:
interface: touchToSelect
gameplay: findTheRightAnswers
payload:
shuffle_choices: true
choices:
- value: bicycle
type: sfsymbol
isRightAnswer: true
is_right_answer: true
- value: car
type: sfsymbol
- value: airplane
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,11 @@ exercises_payload:
interface: touchToSelect
gameplay: findTheRightAnswers
payload:
shuffle_choices: true
choices:
- value: yellow
type: color
isRightAnswer: true
is_right_answer: true
- value: red
type: color
- value: green
Expand All @@ -114,17 +115,18 @@ exercises_payload:
interface: touchToSelect
gameplay: findTheRightAnswers
payload:
shuffle_choices: true
choices:
- value: yellow
type: color
- value: red
type: color
- value: green
type: color
isRightAnswer: true
is_right_answer: true
- value: blue
type: color
isRightAnswer: true
is_right_answer: true

- group:
- instructions:
Expand All @@ -135,10 +137,11 @@ exercises_payload:
interface: touchToSelect
gameplay: findTheRightAnswers
payload:
shuffle_choices: true
choices:
- value: 🍉
type: emoji
isRightAnswer: true
is_right_answer: true
- value: 🍌
type: emoji
- value: 🍒
Expand All @@ -154,13 +157,14 @@ exercises_payload:
interface: touchToSelect
gameplay: findTheRightAnswers
payload:
shuffle_choices: true
choices:
- value: 🐱
type: emoji
isRightAnswer: true
is_right_answer: true
- value: 🐶
type: emoji
isRightAnswer: true
is_right_answer: true
- value: 🐷
type: emoji
- value: 🐹
Expand All @@ -174,13 +178,14 @@ exercises_payload:
interface: touchToSelect
gameplay: findTheRightAnswers
payload:
shuffle_choices: true
choices:
- value: 🔨
type: emoji
isRightAnswer: true
is_right_answer: true
- value: 🪚
type: emoji
isRightAnswer: true
is_right_answer: true
- value: 🪛
type: emoji
- value: 🪜
Expand All @@ -195,12 +200,13 @@ exercises_payload:
interface: touchToSelect
gameplay: findTheRightAnswers
payload:
shuffle_choices: true
choices:
- value: circle
type: sfsymbol
- value: square
type: sfsymbol
isRightAnswer: true
is_right_answer: true
- value: triangle
type: sfsymbol
- value: rhombus
Expand All @@ -214,12 +220,13 @@ exercises_payload:
interface: touchToSelect
gameplay: findTheRightAnswers
payload:
shuffle_choices: true
choices:
- value: figure.climbing
type: sfsymbol
- value: figure.tennis
type: sfsymbol
isRightAnswer: true
is_right_answer: true
- value: figure.pool.swim
type: sfsymbol
- value: figure.soccer
Expand All @@ -233,14 +240,15 @@ exercises_payload:
interface: touchToSelect
gameplay: findTheRightAnswers
payload:
shuffle_choices: true
choices:
- value: sun.max
type: sfsymbol
- value: cloud.sun
type: sfsymbol
- value: cloud.bolt.rain
type: sfsymbol
isRightAnswer: true
is_right_answer: true
- value: cloud.rain
type: sfsymbol

Expand All @@ -252,10 +260,11 @@ exercises_payload:
interface: touchToSelect
gameplay: findTheRightAnswers
payload:
shuffle_choices: true
choices:
- value: bicycle
type: sfsymbol
isRightAnswer: true
is_right_answer: true
- value: car
type: sfsymbol
- value: airplane
Expand Down
Loading
Loading