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

[#31] [#64] [Integrate] As a logged-in user, I can see the survey list on the Home screen #65

Merged
merged 6 commits into from
Aug 24, 2023

Conversation

nkhanh44
Copy link
Collaborator

@nkhanh44 nkhanh44 commented Aug 22, 2023

What happened 👀

  • Added Hive for key-value database in dart and implemented survey_storage.
  • Added HomeState to manage state of Home screen.
  • Added HomeViewModel
  • Implemented get_cached_surveys_use_case
  • Added Unit tests

Insight 📝

I faced the error when getting token from SecureStorage:

Screenshot 2023-08-23 at 12 32 13

So I just updated the casting at token_data_source and secure_storage_impl and it works well now.

  • One mistake that took me much time to find out is meta_response should use decodedData instead 🙈 .
  • Load more and refreshing will be handled in other integrate.

Proof Of Work 📹

  • Success:
Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-08-23.at.12.25.56.mp4
Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-08-22.at.23.15.00.mp4
  • Failure:
Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-08-22.at.23.12.27.mp4

@nkhanh44 nkhanh44 added this to the 0.4.0 milestone Aug 22, 2023
@nkhanh44 nkhanh44 self-assigned this Aug 22, 2023
@nkhanh44 nkhanh44 changed the title [#31] [#64] [Integrate] As a logged-in user, I can see the survey list on the Home screen [WIP] [#31] [#64] [Integrate] As a logged-in user, I can see the survey list on the Home screen Aug 22, 2023
@codecov
Copy link

codecov bot commented Aug 22, 2023

Codecov Report

Patch coverage: 59.25% and project coverage change: +3.66% 🎉

Comparison is base (4bfccf6) 45.79% compared to head (8b31157) 49.45%.
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #65      +/-   ##
===========================================
+ Coverage    45.79%   49.45%   +3.66%     
===========================================
  Files           30       33       +3     
  Lines          297      366      +69     
===========================================
+ Hits           136      181      +45     
- Misses         161      185      +24     
Flag Coverage Δ
unittests 49.45% <59.25%> (+3.66%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
lib/api/response_decoder.dart 0.00% <0.00%> (ø)
lib/model/response/meta_response.dart 80.00% <0.00%> (ø)
lib/model/response/survey_response.dart 0.00% <0.00%> (ø)
lib/model/response/surveys_container_response.dart 66.66% <0.00%> (ø)
lib/storage/secure_storage_impl.dart 0.00% <0.00%> (ø)
lib/storage/survey_storage.dart 0.00% <0.00%> (ø)
lib/usecases/base/base_use_case.dart 100.00% <ø> (+33.33%) ⬆️
lib/repositories/survey_repository.dart 58.33% <83.33%> (+2.77%) ⬆️
lib/usecases/get_cached_surveys_use_case.dart 83.33% <83.33%> (ø)
lib/model/survey_model.dart 92.85% <85.71%> (+92.85%) ⬆️
... and 4 more

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nkhanh44 nkhanh44 force-pushed the feature/31-integrate-survey-list branch 3 times, most recently from 74bb112 to bda39bb Compare August 23, 2023 05:12
@nkhanh44 nkhanh44 force-pushed the feature/31-integrate-survey-list branch 3 times, most recently from 440ac04 to 7c04fc8 Compare August 23, 2023 05:26
@nkhanh44 nkhanh44 force-pushed the feature/31-integrate-survey-list branch from 7c04fc8 to 1605823 Compare August 23, 2023 05:34
@nkhanh44 nkhanh44 changed the title [WIP] [#31] [#64] [Integrate] As a logged-in user, I can see the survey list on the Home screen [#31] [#64] [Integrate] As a logged-in user, I can see the survey list on the Home screen Aug 23, 2023
@nkhanh44 nkhanh44 marked this pull request as ready for review August 23, 2023 05:39
Copy link
Collaborator

@Thieurom Thieurom left a comment

Choose a reason for hiding this comment

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

This PR is quite large. These are some initial comments 🙏

lib/model/response/survey_response.dart Outdated Show resolved Hide resolved
lib/storage/secure_storage_impl.dart Show resolved Hide resolved
lib/screens/home/home_view_model.dart Outdated Show resolved Hide resolved
@nkhanh44 nkhanh44 force-pushed the feature/31-integrate-survey-list branch from 968f572 to 3949f75 Compare August 24, 2023 03:51
@nkhanh44 nkhanh44 force-pushed the feature/31-integrate-survey-list branch from 3949f75 to 8003a93 Compare August 24, 2023 03:53
Copy link

@doannimble doannimble 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, rest lgtm 👍

lib/screens/home/home_page_indicator_widget.dart Outdated Show resolved Hide resolved
lib/screens/home/home_pages_widget.dart Outdated Show resolved Hide resolved
lib/screens/home/home_screen.dart Outdated Show resolved Hide resolved
@nkhanh44 nkhanh44 force-pushed the feature/31-integrate-survey-list branch from decaf82 to 8b31157 Compare August 24, 2023 06:14
Copy link

@doannimble doannimble left a comment

Choose a reason for hiding this comment

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

lgtm now 👍

@nkhanh44 nkhanh44 merged commit 5ac9973 into develop Aug 24, 2023
4 checks passed
@nkhanh44 nkhanh44 deleted the feature/31-integrate-survey-list branch August 24, 2023 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants