-
Notifications
You must be signed in to change notification settings - Fork 12
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
Dive Results dashboard #4
Conversation
xlebod
commented
Feb 9, 2024
- Take data from services instead of TestData class
- Add example data injection
- Add Dive Results table
projects/planner/src/app/diff/diveinfo/results/diff-diveinfo-results.component.ts
Show resolved
Hide resolved
projects/planner/src/app/diff/diveinfo/results/diff-diveinfo-results.component.ts
Show resolved
Hide resolved
projects/planner/src/app/diff/diveinfo/results/diff-diveinfo-results.component.ts
Outdated
Show resolved
Hide resolved
projects/planner/src/app/diff/diveinfo/results/diff-diveinfo-results.component.ts
Show resolved
Hide resolved
{{cnsTextOfProfile(profileB)}} | ||
</div> | ||
</td> | ||
<td *ngIf="areResultsCalculated" class="{{getBgColor('cns', cnsDifference)}}"> |
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.
move as much as out of the html.
export class ProfileComparatorService { | ||
|
||
private _profileAIndex = 0; | ||
private _profileBIndex = 1; |
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.
Profile B cant be second profile, because it is not guaranteed to exist. By default there is only one dive.
Proposal: set 0 for both.
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.
btw. services are singletons, e.g. after you remove dive from dives list and navigate to the diff, you need to ensure, that previously selected index still exists and this cant be done in constructor, since it is called only once. You need to do it in component OnInit, e.g. , if there are at least 2 select A=0, B=1, if index is out of range reset to 0. So you can leave 0 for both A and B while initializing.
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.
btw. services are singletons, e.g. after you remove dive from dives list and navigate to the diff, you need to ensure, that previously selected index still exists and this cant be done in constructor, since it is called only once. You need to do it in component OnInit, e.g. , if there are at least 2 select A=0, B=1, if index is out of range reset to 0. So you can leave 0 for both A and B while initializing.
Setting of indexes will be done in the upcoming ProfileSelectorTabs component. For now the out of range was handled in diff.component.html which wouldn't render the diff page unless at least 2 profiles were created. But I've removed that and implemented proposed change above.
7230416
to
bbbf2f9
Compare