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

Scenario cards list (PLAN-1363) #1666

Merged
merged 26 commits into from
Sep 3, 2024
Merged

Scenario cards list (PLAN-1363) #1666

merged 26 commits into from
Sep 3, 2024

Conversation

lastminutediorama
Copy link
Contributor

@lastminutediorama lastminutediorama commented Aug 9, 2024

Awaiting final info on how we should style/handle Uploaded cards, since this likely isn't something we want to put in a chip.

@lastminutediorama lastminutediorama changed the title Scenario cards list [WIP] Scenario cards list (PLAN-1363) [WIP] Aug 13, 2024
TIMED_OUT: 'failed',
};

readonly chipLabel: Record<ScenarioResultStatus, ScenarioResultLabel> = {
Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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?

@lastminutediorama lastminutediorama marked this pull request as ready for review August 14, 2024 22:39
@lastminutediorama lastminutediorama changed the title Scenario cards list (PLAN-1363) [WIP] Scenario cards list (PLAN-1363) Aug 14, 2024
TIMED_OUT: 'failed',
};

readonly chipLabel: Record<ScenarioResultStatus, ScenarioResultLabel> = {
Copy link
Contributor

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.

Copy link
Contributor

@pflopez pflopez left a 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';
Copy link
Contributor

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;
Copy link
Contributor

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

@lastminutediorama lastminutediorama merged commit 43840b4 into main Sep 3, 2024
6 checks passed
@lastminutediorama lastminutediorama deleted the scenario-cards-list branch September 3, 2024 14:17
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