-
Notifications
You must be signed in to change notification settings - Fork 9
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
Scenario cards list (PLAN-1363) #1666
Conversation
…pe into scenario-cards-list
src/interface/src/app/plan/plan-summary/saved-scenarios/saved-scenarios.component.ts
Outdated
Show resolved
Hide resolved
TIMED_OUT: 'failed', | ||
}; | ||
|
||
readonly chipLabel: Record<ScenarioResultStatus, ScenarioResultLabel> = { |
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.
I'm tempted to write this as Record<StatusChipStatus, ScenarioResultLabel>
, because this is just a difference of capitalization and "Done" instead of "success", but not sure what's easiest to maintain.
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.
Im not sure why we have chipStatus record and chipLabel. Doesn't seem great.
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.
Maybe something like
export type ScenarioStatus = 'FAILURE' | 'LOADING' | 'SUCCESS' | 'PENDING';
// ...
// (...)
// ...
readonly chipsStatus: Record<
ScenarioStatus,
{ status: StatusChipStatus; label: string }
> = {
FAILURE: { status: 'failed', label: 'Failed' },
PENDING: { status: 'inProgress', label:'In progress'}
SUCCESS: { status: 'success', label:'Great success'}
};
Though ScenarioStatus should probably live somewhere else, on scenario.types?
src/interface/src/app/plan/plan-summary/scenarios-card-list/scenarios-card-list.component.ts
Outdated
Show resolved
Hide resolved
src/interface/src/styleguide/scenario-card/scenario-card.component.ts
Outdated
Show resolved
Hide resolved
TIMED_OUT: 'failed', | ||
}; | ||
|
||
readonly chipLabel: Record<ScenarioResultStatus, ScenarioResultLabel> = { |
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.
Im not sure why we have chipStatus record and chipLabel. Doesn't seem great.
src/interface/src/styleguide/scenario-card/scenario-card.component.ts
Outdated
Show resolved
Hide resolved
src/interface/src/styleguide/scenario-card/scenario-card.component.ts
Outdated
Show resolved
Hide resolved
src/interface/src/styleguide/scenario-card/scenario-card.component.ts
Outdated
Show resolved
Hide resolved
src/interface/src/app/plan/plan-summary/saved-scenarios/saved-scenarios.component.html
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!
import { MatLegacyDialogModule as MatDialogModule } from '@angular/material/legacy-dialog'; | ||
import { MatLegacySnackBarModule as MatSnackBarModule } from '@angular/material/legacy-snack-bar'; | ||
import { MatDialogModule } from '@angular/material/dialog'; | ||
import { MatSnackBarModule } from '@angular/material/snack-bar'; |
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.
did you test we are not getting any of those annoying errors about conflicting versions with old vs new dependencies?
@@ -15,6 +15,10 @@ import { UploadProjectAreasModalComponent } from '../../upload-project-areas-mod | |||
import { ScenarioCreateConfirmationComponent } from '../../scenario-create-confirmation/scenario-create-confirmation.component'; | |||
export interface ScenarioRow extends Scenario { | |||
selected?: boolean; | |||
max_treatment_area?: number; |
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.
is this part of the scenario payload? If so it should be part of Scenario
Awaiting final info on how we should style/handle Uploaded cards, since this likely isn't something we want to put in a chip.