-
Notifications
You must be signed in to change notification settings - Fork 2
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
Digital guide API foundation and adapted toilets #514
base: main
Are you sure you want to change the base?
Digital guide API foundation and adapted toilets #514
Conversation
…ted toilets with initial presentation
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.
Good job on the task! I noticed a few things that could be refined.
lib/features/digital_guide_view/presentation/widgets/digital_guide_features_section.dart
Outdated
Show resolved
Hide resolved
...eatures/digital_guide_view/tabs/adapted_toilets/presentation/adapted_toilet_detail_view.dart
Outdated
Show resolved
Hide resolved
...tal_guide_view/tabs/adapted_toilets/presentation/adapted_toilets_expansion_tile_content.dart
Outdated
Show resolved
Hide resolved
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.
Now LGTM!
Ready to merge? |
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.
Good work here. That was a good idea with implementing Level
it could reduce some complexities later on. Please write documentation about how it works and how to use it, some diagrams are welcome as well 😄
Some part of code are imo hard to read and understand but that's the nature of this API and we can't do much with it unless some better responses'd come :/ I'm leaning towards some kind of wrapper even more rn 😆
Below I left few minor comments and suggestions of mine.
lib/features/digital_guide_view/tabs/adapted_toilets/data/models/adapted_toilet_not_full.dart
Outdated
Show resolved
Hide resolved
...eatures/digital_guide_view/tabs/adapted_toilets/presentation/adapted_toilet_detail_view.dart
Outdated
Show resolved
Hide resolved
...tal_guide_view/tabs/adapted_toilets/presentation/adapted_toilets_expansion_tile_content.dart
Outdated
Show resolved
Hide resolved
...tal_guide_view/tabs/adapted_toilets/presentation/adapted_toilets_expansion_tile_content.dart
Outdated
Show resolved
Hide resolved
...tal_guide_view/tabs/adapted_toilets/presentation/adapted_toilets_expansion_tile_content.dart
Outdated
Show resolved
Hide resolved
...tal_guide_view/tabs/adapted_toilets/presentation/adapted_toilets_expansion_tile_content.dart
Outdated
Show resolved
Hide resolved
...tal_guide_view/tabs/adapted_toilets/presentation/adapted_toilets_expansion_tile_content.dart
Outdated
Show resolved
Hide resolved
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.
lgtm, good job!
with merging let's wait for Szymon's approval
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.
so good job here, but uh - this is complex shit - but the api is pretty nasty structured so this isn't our fault.
As far as I understand we load levels and regions and then all other data is somehow grouped by it. It seems like a fine idea to load it up-front.
At first I was skeptical, but as far as I understand, we would need to get this and group by it in any other case too.
So as far as I can tell it, this looks like a fine job done. Maybe I'll think how to improve it in some future, but for now we can go with it and merge it.
My biggest concern now is the "NotFull" things - does it only mean that we load without proper url, only id and need to get the url from the other endpoint? Are there any other differences bewteen full and not full models?? If there's no difference than this, then I would refactor the whole thing completely and load the proper url in some new DigitalGuidePhoto
widget. Unless there are some extra differences I've missed. Cause basically duplicating every models is nasty.
Apart from it, few small notes I've picked.
Tell me what you think
lib/features/digital_guide_view/data/models/digital_guide_response_extended.dart
Show resolved
Hide resolved
lib/features/digital_guide_view/data/repository/digital_guide_repository.dart
Outdated
Show resolved
Hide resolved
...ures/digital_guide_view/tabs/adapted_toilets/data/repository/adapted_toilets_repository.dart
Outdated
Show resolved
Hide resolved
...ures/digital_guide_view/tabs/adapted_toilets/data/repository/adapted_toilets_repository.dart
Outdated
Show resolved
Hide resolved
...eatures/digital_guide_view/tabs/adapted_toilets/presentation/adapted_toilet_detail_view.dart
Outdated
Show resolved
Hide resolved
lib/features/digital_guide_view/presentation/widgets/digital_guide_features_section.dart
Outdated
Show resolved
Hide resolved
lib/features/digital_guide_view/tabs/adapted_toilets/data/models/adapted_toilet_not_full.dart
Show resolved
Hide resolved
...ures/digital_guide_view/tabs/adapted_toilets/data/repository/adapted_toilets_repository.dart
Show resolved
Hide resolved
...ures/digital_guide_view/tabs/adapted_toilets/data/repository/adapted_toilets_repository.dart
Outdated
Show resolved
Hide resolved
...tal_guide_view/tabs/adapted_toilets/presentation/adapted_toilets_expansion_tile_content.dart
Outdated
Show resolved
Hide resolved
So this applies to both This and Olivier's PR (and basically all previous ones too): is there any difference between original models and the "Extended" / "Full" ones besides the fact that we need to load image urls from our photo's ids? If not, then I would change our approach completely, cause now we're duplicating the models. I have a pretty nice idea in my opinion which would be a new custom widget But maybe I'm missing something. Tell me what you think and do you undestand my idea? Also Am I right that this can be done this way and are there more differences between "NotFull" and "Extended" models? I can help to do this if you don't understand my idea and let's coordinate the thing so the two of you won't do it twice and duplicate the same work. |
I will implement the mentioned improvements soon. No worries! @simon-the-shark Regarding your question I think it's a decent idea and probably there aren't any contraindications right now. However, the concept of the DigitalGuideImage widget and related refactoring of models for simplicity should be performed in another task. Each model pairs (Extended / NotFull) have to be analyzed separately. If the issue is the image URL solely, we should implement your idea. Otherwise, figure out a better idea because I don't like the current model structure in the digital guide either |
Yeah. It can be a separate task |
Please let me know whether I put too many commits. Should I do less commits with more changes or such separation is alright |
So about the commits first: I don’t care veery much, cause I’m gonna probably squash them all to one commit before merging to main anyway. But since, you’re asking:
Hopefully u get what I mean. As I said, every company have its own convention. I don’t care here that much, cause I prefer to do a squash before merging anyway - but this again is a matter of convention. Some people prefer simple rebase that preserves all atomic commits. |
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.
Oh it looks goood now. I like it. Good job. Last small notes and we're merging
lib/features/digital_guide_view/data/models/digital_guide_response_extended.dart
Show resolved
Hide resolved
...tal_guide_view/tabs/adapted_toilets/presentation/adapted_toilets_expansion_tile_content.dart
Outdated
Show resolved
Hide resolved
Thank You for such an insightful explanation, I found it very informative |
Always happy to help |
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.
Sorry I'm still blocking this, but one thing I've noticed in the recent changes. I hope we can get it merged soon. Also u have some conflicts with main that u need to resolve first :)
return AdaptedToiletLevel( | ||
level: level, | ||
adaptedToilets: adaptedToiletsData[level.id] != null | ||
? adaptedToiletsData[level.id]!.lock |
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.
adaptedToiletsData
could be of a type that also has IList
, like IMap<int, IList<AdaptedToilet>>
, and then you wouldn't need to do that if, right? If I'm not mistaken?
What has been made
Why did I structure models like this
Digital guide response -> Levels -> Regions
Such models and endpoints structure are used by multiple unimplemented tiles in the digital guide. Therefore, it will be efficient to fetch this necessary data once instead of doing it on expanding individual tiles
I am familiar with most of the endpoints and db structure of this API and want to connect all of the implemented features once they are implemented. I think I can make it efficient.
Why doors are not implemented?
Doors details are used in a few tiles which is why it's better to implement them separately
Fun fact
Asked about what I do in this student organization by my family, I could answer toilets hehe