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 baseline scenario day selection for initial scenar… #369

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

hudaif747
Copy link
Collaborator

@hudaif747 hudaif747 commented Jul 3, 2024

…io list

Description

On initial load we had only case data card activated by default. Made changes to also activate the first scenario card (assuming it to be baseline scenario). The initial date would be the end date available for the particular scenario. Also added startDate and endDate calculating function in DataCardList component for reusability.

Related Issues

#364

Design Decisions

Performance & Quality

Checklist

I, the author of this PR checked the following requirements for good software quality:

  • The code is properly formatted (I ran the formatter)
  • The code is written with our software quality standards (I ran the linter)
  • The code is written using our code style
  • Extensive in source documentation has been added
  • Unit and/or integration tests have been added
  • All texts have been internationalized with at least the following languages:
    • English
    • German
  • I tried addressing all new accessibility problems displayed in the console and documented if they can't be fixed
  • I attached performance measurements to prevent performance degradation
  • I added the changes to the next release section of the changelog

I, the reviewer checked the following things:

  • I ran the software once and tried all new and related functionality to this PR
  • I looked at all new and changed lines of code and commented on possible problems
  • I read the added documentation and checked if it is understandable and clear
  • I checked the added tests for completeness
  • I checked the internationalized strings for spelling errors
  • I checked the performance metrics for problems or unexplained degradation
  • I checked that the changes are noted in the changelog

@hudaif747 hudaif747 requested a review from JonasGilg July 5, 2024 13:14
@hudaif747 hudaif747 self-assigned this Jul 5, 2024
Copy link
Collaborator

@JonasGilg JonasGilg left a comment

Choose a reason for hiding this comment

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

Thank you very much, for a first time visitor this already works as inteded. This sadly interferes with the persistence, since the state for revisiting users gets overridden each time.

Can you try to prefer the state from the store and only do this when a user visits ESID for the first time?

@hudaif747
Copy link
Collaborator Author

hudaif747 commented Jul 11, 2024

@JonasGilg My bad. I completely overlooked the persistance part.

Is it okay to set the activeScenarios directly in the DataSelectionSlice initial setting (activeScenarios: [0,1])?
Also, can we track the user visit in the store using a boolean flag called "userVisited" to keep track of the users initial visit?

@JonasGilg
Copy link
Collaborator

@JonasGilg My bad. I completely overlooked the persistance part.

Is it okay to set the activeScenarios directly in the DataSelectionSlice initial setting (activeScenarios: [0,1])? Also, can we track the user visit in the store using a boolean flag called "userVisited" to keep track of the users initial visit?

Yes, both should be possible. As long as it works. I don't see a problem with this solution. Just be sure, that the site doesn't break if for some reason no scenario is available.

Copy link

github-actions bot commented Jul 15, 2024

Test Results

68 tests  +1   67 ✅ ±0   15s ⏱️ -1s
29 suites ±0    0 💤 ±0 
 1 files   ±0    1 ❌ +1 

For more details on these failures, see this check.

Results for commit 29ba089. ± Comparison against base commit d51f9b4.

♻️ This comment has been updated with latest results.

@hudaif747 hudaif747 force-pushed the feature/smart-day-selection branch 3 times, most recently from 07e8add to e709827 Compare July 15, 2024 16:15
@hudaif747
Copy link
Collaborator Author

@JonasGilg I've implemented your suggestions. I added a userVisited flag in the UserPreference slice to track initial user visits. The baseline scenario card is now initialized by default in activeScenarios in the DataSelection slice. The useEffect in DataCardList component selects the baseline scenario if available. I reverted earlier changes to the DataCardList component as they are not required anymore.

Do you have any suggestions for checking the user's initial visit without using the redux store? I tried a few approaches but couldn't find a suitable solution other than this.

JonasGilg
JonasGilg previously approved these changes Jul 25, 2024
@hudaif747 hudaif747 closed this Aug 14, 2024
@hudaif747 hudaif747 deleted the feature/smart-day-selection branch August 14, 2024 16:01
@hudaif747 hudaif747 restored the feature/smart-day-selection branch August 14, 2024 16:03
@hudaif747 hudaif747 deleted the feature/smart-day-selection branch August 14, 2024 16:03
@hudaif747 hudaif747 restored the feature/smart-day-selection branch August 14, 2024 16:04
@hudaif747 hudaif747 deleted the feature/smart-day-selection branch August 14, 2024 16:11
@hudaif747 hudaif747 restored the feature/smart-day-selection branch August 14, 2024 16:11
@hudaif747 hudaif747 reopened this Aug 14, 2024
@hudaif747
Copy link
Collaborator Author

@JonasGilg I had some issues with merging this Pull Request as it was stale after the update of the application to use VVAFER components. I ran into some trouble while merging with the develop with the stale PR. I have made the changes now could you please go through it and review the changes?

@JonasGilg JonasGilg merged commit a71bc2c into develop Aug 15, 2024
6 of 7 checks passed
@JonasGilg JonasGilg deleted the feature/smart-day-selection branch August 15, 2024 08:25
@JonasGilg
Copy link
Collaborator

@JonasGilg I've implemented your suggestions. I added a userVisited flag in the UserPreference slice to track initial user visits. The baseline scenario card is now initialized by default in activeScenarios in the DataSelection slice. The useEffect in DataCardList component selects the baseline scenario if available. I reverted earlier changes to the DataCardList component as they are not required anymore.

Do you have any suggestions for checking the user's initial visit without using the redux store? I tried a few approaches but couldn't find a suitable solution other than this.

The implementation with the redux store is good. It is easily reusable for other components, if needed.

@hudaif747 hudaif747 restored the feature/smart-day-selection branch November 13, 2024 09:42
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.

2 participants