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 seasonal calender #185

Merged
merged 23 commits into from
Nov 8, 2023
Merged

Feat seasonal calender #185

merged 23 commits into from
Nov 8, 2023

Conversation

khalifan-kfan
Copy link
Collaborator

Description

This PR is to prototype the seasonal calendar's initial functionality.

Discussion

Dev meeting 5th, Oct 2023

Preview

Screenshots / Videos

Screenshot 2023-10-09 at 11 48 34 Screenshot 2023-10-09 at 11 48 54 Screenshot 2023-10-09 at 11 50 54 Screenshot 2023-10-09 at 11 51 05 Screenshot 2023-10-09 at 11 52 54 Screenshot 2023-10-09 at 11 53 15 Screenshot 2023-10-09 at 11 53 55

@khalifan-kfan
Copy link
Collaborator Author

khalifan-kfan commented Oct 9, 2023

TODO:
Connect data to a database for persistence.
Need to reuse activity and crop selector components.
Add more Icons.
Improve the design.
add delete calender confirmation dialog

@@ -7,6 +7,16 @@ export const ROUTES_COMMON: Routes = [
loadChildren: () => import('./pages/home/home.module').then((m) => m.HomeModule),
title: 'Seasonal Calendar',
},
{
path: 'create-calendar',
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit(non-blocking)
The url will already have /seasonal-calendar/ so probably can just call the child routes /create and /[calendarId] to view

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Alright, thanks for this @chrismclarke

Copy link
Collaborator

@chrismclarke chrismclarke left a comment

Choose a reason for hiding this comment

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

Lots of really nice progress here. See a few comments in-line, but overall happy to merge here and continue to build in follow-up PRs

title: 'Create Calendar',
},
{
path: 'calendar-table',
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit(non-blocking)
The urls might look a bit cleaner if instead of this path you used a route paramater, e.g. path: ':id' which will make the the id available on page load. E.g. picsa.app/seasonal-calendar/abcd123 will be able to load info for seasonal calendar with local id abcd123
https://angular.io/guide/router-reference#configuration

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, Ill try to handle that issue aswell


constructor(
public dialogRef: MatDialogRef<ActivitiesEditorDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: any
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice to see you were able to figure out passing data in/out of dialogs

}

onSubmition(){
if(this.calendarMonths.length > 0 && this.userCrops.length > 0 && this.calenderTitle){
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit(non-blocking)
Custom validation doesn't always provide the nicest user experience as it doesn't track exactly which input is lacking and identify to the user on screen (e.g. showing a red box around missing input)
Angular has a lot of in-built tools for creating forms and validators. It might be worth thinking in the future to refactor to use a reactive form
https://angular.io/guide/reactive-forms

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Going to handle this too, thanks for the guidence

// https://rxdb.info/data-migration.html
migrationStrategies: {
...COLLECTION_V0.migrationStrategies,
1: (data: CalendarDataEntry_v0): CalendarDataEntry_v1 => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

really nice to see not only were you able to setup a database schema, but also provide migration strategy to update local data as you developed the schema. It's a really effective strategy when working with any type of database

Copy link
Collaborator

@chrismclarke chrismclarke left a comment

Choose a reason for hiding this comment

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

Lots of really nice progress here. I've gone ahead created a separate pr to add support for shared form input components (e.g. crop probability select), #195, and added commit 5b45724 to integrate into the seasonal calendar tool which simplifies some of the input logic nicely.

I've also added one additional commit 645b779 with a small amount of code tidying

See a few comments in-line, but overall happy to merge here and continue to build in follow-up PRs, nice work!

@chrismclarke chrismclarke merged commit a2e6824 into main Nov 8, 2023
2 checks passed
@chrismclarke chrismclarke deleted the feat-seasonal-calender branch November 8, 2023 22:48
@khalifan-kfan
Copy link
Collaborator Author

Thanks for the detailed review, it is really helpful.

@chrismclarke chrismclarke added the Tool: Seasonal Calendar Updates related to Seasonal Calendar tool label Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tool: Seasonal Calendar Updates related to Seasonal Calendar tool
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants