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

Implement export maintenance events #345

Merged

Conversation

OmarHegazy93
Copy link
Contributor

@OmarHegazy93 OmarHegazy93 commented Oct 19, 2024

What it Does

  1. Make the user able to export the maintenance events for a specific vehicle
  2. Sort the records based on the date ascendingy

How I Tested

  1. Run the App
  2. Make sure that there is at least one vehicle added
  3. Add a maintenance event from the dashboard screen
  4. The share button will appear at the top left corner, tap on it
  5. Select the vehicle you want to export the report for
  6. See the result

@mikaelacaron
Copy link
Owner

mikaelacaron commented Oct 21, 2024

@OmarHegazy93 can you also please add a screenshot for this PR, and add back the heading, be sure not to delete the PR template headings

can you also write some more about how this code works, and why it's written the way that it's written, there's several new protocols, what are they for? what do they do? etc?

Copy link
Owner

@mikaelacaron mikaelacaron left a comment

Choose a reason for hiding this comment

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

good work @OmarHegazy93 ! I've left a bunch of comments that are mainly around code formatting
If you could update it, that would be great!
If you have any questions, you can comment directly on that thread, as always, otherwise click the resolve button once you've addressed my comment. Once you fix everything, please click the re-review button

Comment on lines 12 to 14
protocol PDFGeneratable {
func generatePDF() -> URL?
}
Copy link
Owner

Choose a reason for hiding this comment

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

what does this protocol do, when it's only implemented in one place?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added it so that if we used it in a viewModel, we can mock it, but since it's currently used directly inside ExportOptionsView then yes, no need to have it

Copy link
Owner

@mikaelacaron mikaelacaron left a comment

Choose a reason for hiding this comment

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

great work!! thanks for joining my stream for this review!

https://youtube.com/live/I_pXpNRryjI?feature=share

This PR was reviewed live on my YouTube channel

ShareLink(item: url) {
VStack {
Image(uiImage: thumbnail)
Label("Share", image: SFSymbol.share)
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
Label("Share", image: SFSymbol.share)
Label("Share", systemImage: SFSymbol.share)

Should be systemImage, rather than image

Comment on lines +26 to +28
NavigationView {
VStack(alignment: .leading, spacing: 16) {
Text("Select the vehicle you want to export the maintenance events for:")
Copy link
Owner

Choose a reason for hiding this comment

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

this could be a scroll view to be able to accommodate dynamic type sizes

struct ExportOptionsView: View {
@Environment(\.dismiss) var dismiss
@State private var selectedVehicle: Vehicle?
@State private var isShowingShareSheet = false
Copy link
Owner

Choose a reason for hiding this comment

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

renamed to isShowingThumbnail because it's not technically showing the share sheet yet, the ShareLink does that

@mikaelacaron mikaelacaron merged commit ba71d02 into mikaelacaron:dev Oct 25, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FEATURE - PDF Export of Maintenance Events Only
2 participants