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

feat: [FC-0047] calendar synchronization design #439

Conversation

IvanStepanok
Copy link
Contributor

@IvanStepanok IvanStepanok commented May 17, 2024

Quick Preview

Screen.Recording.2024-05-20.at.15.32.35.mp4

Pay attention ⚠️

This is just the design of the views, without any logic other than getting a request to access the calendar.
I'm using the "Use relative dates" switch to demonstrate the "calendar reconnect" process.

The "Use relative dates" switch will be implemented in the next scope.

enhancement request:
#443

@openedx-webhooks
Copy link

openedx-webhooks commented May 17, 2024

Thanks for the pull request, @IvanStepanok! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label May 17, 2024
@volodymyr-chekyrta volodymyr-chekyrta marked this pull request as ready for review May 20, 2024 13:10
if !course.active {
Text(ProfileLocalization.CoursesToSync.inactive)
.font(Theme.Fonts.labelSmall)
.foregroundStyle(Theme.Colors.textPrimary.opacity(course.active ? 1 : 0.8))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking course.active ? seems redundant as we are in the if !course.active { block

@@ -69,6 +69,7 @@ public struct StyledButton: View {
}
Spacer()
}
.padding(.horizontal, 20)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please be careful with changes to the base views - it can produce issues like this one

@@ -701,6 +701,28 @@ public class Router: AuthorizationRouter,
navigationController.pushViewController(controller, animated: true)
}

public func showDatesAndCalendar() {
let vm = DatesAndCalendarViewModel(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe will be better to register this viewModel in DI (ScreenAssembly)?
Also name viewModel is more informative than just vm

navigationController.pushViewController(controller, animated: true)
}

public func showSyncCalendarOptions(viewModel: DatesAndCalendarViewModel) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we use here also viewModel from DI instead of send it as parameter?

navigationController.pushViewController(controller, animated: true)
}

public func showCoursesToSync(viewModel: DatesAndCalendarViewModel) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

}

func openAppSettings() {
if let url = URL(string: UIApplication.openSettingsURLString) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe put the conditions separated by a comma instead of having two if constructs?

if isHorizontal {
ScrollView {
content
.frame(maxWidth: 400)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modifications here and for content in else block are same - maybe we need to move them in content view?

}
})
.tint(Theme.Colors.accentColor)
// CustomToggle(isOn: $toggle)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this customToggle be used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not at the moment, but it will be included in the next scope of work. Thanks for checking! 😊

Image(systemName: "chevron.right")
}
})
.accessibilityIdentifier("courses_to_Sync_cell")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

capitalized S by mistake?


public init(router: ProfileRouter) {
self.router = router
self.calendarNameHint = (Bundle.main.applicationName ?? "") + " Course Dates"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps " Course Dates" should be localized too?

@volodymyr-chekyrta volodymyr-chekyrta changed the title feat: calendar synchronization design feat: [FC-0047] calendar synchronization design May 22, 2024
@IvanStepanok IvanStepanok requested a review from rnr May 27, 2024 13:27

StyledButton(ProfileLocalization.CalendarSync.button, action: {
viewModel.requestCalendarPermission()
}, horizontalPadding: true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we please follow code-style 'each parameter on own line' here?

}

// MARK: - Navigation and Title
private var navigationAndTitle: some View {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please attach created ticket here to be sure we wont miss this unification in the future?

rnr
rnr previously approved these changes May 28, 2024
remove old errorAlertView variables
Copy link
Contributor

@rnr rnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@volodymyr-chekyrta volodymyr-chekyrta merged commit a17038f into openedx:develop May 29, 2024
3 checks passed
@openedx-webhooks
Copy link

@IvanStepanok 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@volodymyr-chekyrta volodymyr-chekyrta deleted the feat/Setup-Calendar-Synchronization branch May 29, 2024 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants