-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat: Ability to shift courses dates if deadlines have been missed #288
Merged
shafqat-muneer
merged 15 commits into
openedx:develop
from
shafqat-muneer:Shafqat/LEARNER-9781
Mar 1, 2024
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
33ca703
feat: Ability to shift courses dates if deadlines have been missed
shafqat-muneer aedcf55
refactor: address failed test cases.
shafqat-muneer 80f6f0a
refactor: address failed test cases.
shafqat-muneer 7e35d91
refactor: address review feedback
shafqat-muneer ca85abb
refactor: address review feedback
shafqat-muneer b56337a
refactor: address review feedback
shafqat-muneer 3bc581c
Merge remote-tracking branch 'upstream/develop' into Shafqat/LEARNER-…
shafqat-muneer 43cd286
refactor: address review feedback
shafqat-muneer bdefe98
fix: resolved failed test cases
shafqat-muneer 50de3dd
refactor: address review feedback
shafqat-muneer 65a5262
refactor: due dates shifted snakbar design updates
shafqat-muneer 0ea59d6
refactor: removed process_config.py file changes
shafqat-muneer 871a262
Merge remote-tracking branch 'origin/develop' into Shafqat/LEARNER-9781
shafqat-muneer fcc45cc
Merge remote-tracking branch 'origin/develop' into Shafqat/LEARNER-9781
shafqat-muneer 1e5c062
refactor: address review feedback
shafqat-muneer 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
This file contains 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 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 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 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,85 @@ | ||
// | ||
// SuccessViewWithButton.swift | ||
// Core | ||
// | ||
// Created by Shafqat Muneer on 2/18/24. | ||
// | ||
|
||
import SwiftUI | ||
import Combine | ||
import Theme | ||
|
||
public struct SuccessViewWithButton: View { | ||
|
||
public static let height: CGFloat = 50 | ||
|
||
@State private var dismiss: Bool = false | ||
private var action: () async -> Void | ||
|
||
public init(action: @escaping () async -> Void) { | ||
self.action = action | ||
} | ||
|
||
public var body: some View { | ||
ZStack { | ||
VStack { | ||
Spacer() | ||
VStack(alignment: .leading, spacing: 10) { | ||
HStack(spacing: 10) { | ||
Text(CoreLocalization.CourseDates.toastSuccessMessage) | ||
.foregroundStyle(.white) | ||
Button { | ||
withAnimation { | ||
dismiss = true | ||
} | ||
} label: { | ||
Image(systemName: "xmark") | ||
} | ||
.padding(.all, 5) | ||
.tint(.white) | ||
} | ||
|
||
Button(CoreLocalization.CourseDates.viewAllDates, | ||
action: { | ||
Task { | ||
await action() | ||
} | ||
withAnimation { | ||
dismiss = true | ||
} | ||
}) | ||
.padding(.horizontal, 16) | ||
.padding(.vertical, 5) | ||
.background(Theme.Colors.thisWeekTimelineColor) | ||
.foregroundStyle(.white) | ||
.overlay( | ||
RoundedRectangle(cornerRadius: 0) | ||
.stroke(Theme.Colors.datesSectionStroke, lineWidth: 1) | ||
) | ||
} | ||
.font(Theme.Fonts.titleSmall) | ||
.padding(.all, 16) | ||
.background(Theme.Colors.thisWeekTimelineColor) | ||
.clipShape(RoundedRectangle(cornerRadius: 8)) | ||
} | ||
.frame(maxWidth: .infinity) | ||
.padding(.all, 8) | ||
} | ||
.onAppear { | ||
DispatchQueue.main.asyncAfter(deadline: .now() + 5) { | ||
withAnimation { | ||
dismiss = true | ||
} | ||
} | ||
} | ||
.offset(y: dismiss ? 100 : 0) | ||
.opacity(dismiss ? 0 : 1) | ||
.transition(.move(edge: .bottom)) | ||
} | ||
} | ||
|
||
struct SuccessViewWithButton_Previews: PreviewProvider { | ||
static var previews: some View { | ||
SuccessViewWithButton(action: {}) | ||
} | ||
} |
This file contains 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 |
---|---|---|
|
@@ -108,6 +108,27 @@ | |
"COURSE_DATES.YESTERDAY" = "Yesterday"; | ||
"COURSE_DATES.ITEMS_HIDDEN" = "Items Hidden"; | ||
"COURSE_DATES.ITEM_HIDDEN" = "Item Hidden"; | ||
"COURSE_DATES.TOAST_SUCCESS_MESSAGE" = "Your due dates have been successfully shifted to help you stay on track."; | ||
"COURSE_DATES.VIEW_ALL_DATES" = "View all dates"; | ||
|
||
"COURSE_DATES.RESET_DATE.RESET_DATE_BANNER.BODY" = "Don't worry - shift our suggested schedule to complete past due assignments without losing any progress."; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be nice if they can move these to course module as they are related to course. |
||
"COURSE_DATES.RESET_DATE.RESET_DATE_BANNER.BUTTON" = "Shift due dates"; | ||
"COURSE_DATES.RESET_DATE.RESET_DATE_BANNER.HEADER" = "Missed some deadlines?"; | ||
|
||
"COURSE_DATES.RESET_DATE.TAB_INFO_BANNER.BODY" = "We built a suggested schedule to help you stay on track. But don’t worry – it’s flexible so you can learn at your own pace. If you happen to fall behind, you’ll be able to adjust the dates to keep yourself on track."; | ||
"COURSE_DATES.RESET_DATE.TAB_INFO_BANNER.HEADER" = ""; | ||
|
||
"COURSE_DATES.RESET_DATE.UPGRADE_TO_COMPLETE_GRADED_BANNER.BODY" = "To complete graded assignments as part of this course, you can upgrade today."; | ||
"COURSE_DATES.RESET_DATE.UPGRADE_TO_COMPLETE_GRADED_BANNER.BUTTON" = ""; | ||
"COURSE_DATES.RESET_DATE.UPGRADE_TO_COMPLETE_GRADED_BANNER.HEADER" = ""; | ||
|
||
"COURSE_DATES.RESET_DATE.UPGRADE_TO_RESET_BANNER.BODY" = "You are auditing this course, which means that you are unable to participate in graded assignments. It looks like you missed some important deadlines based on our suggested schedule. To complete graded assignments as part of this course and shift the past due assignments into the future, you can upgrade today."; | ||
"COURSE_DATES.RESET_DATE.UPGRADE_TO_RESET_BANNER.BUTTON" = ""; | ||
"COURSE_DATES.RESET_DATE.UPGRADE_TO_RESET_BANNER.HEADER" = ""; | ||
|
||
"COURSE_DATES.RESET_DATE.ERROR_MESSAGE" = "Your dates could not be shifted. Please try again."; | ||
"COURSE_DATES.RESET_DATE.SUCCESS_MESSAGE" = "Your dates have been successfully shifted."; | ||
"COURSE_DATES.RESET_DATE.TITLE" = "Course Dates"; | ||
|
||
"SOCIAL_SIGN_CANCELED" = "The user canceled the sign-in flow."; | ||
|
||
|
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about renaming it to
DatesShiftedSuccessView
Thoughts?