Skip to content

Commit

Permalink
feat: Add preparation_state to feedback email
Browse files Browse the repository at this point in the history
The preparation state was not part of the email, only the state.
  • Loading branch information
MoritzWeber0 committed Dec 11, 2024
1 parent d4de17f commit a81095f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
7 changes: 6 additions & 1 deletion backend/capellacollab/feedback/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ class AnonymizedSession(core_pydantic.BaseModel):

version: tools_models.MinimalToolVersionWithTool

state: str = pydantic.Field(default="UNKNOWN")
preparation_state: sessions_models.SessionPreparationState = (
pydantic.Field(default=sessions_models.SessionPreparationState.UNKNOWN)
)
state: sessions_models.SessionState = pydantic.Field(
default=sessions_models.SessionState.UNKNOWN
)
warnings: list[core_models.Message] = pydantic.Field(default=[])

connection_method: (
Expand Down
2 changes: 1 addition & 1 deletion backend/tests/test_feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def test_send_feedback_with_session(
"name": "6.1.0",
"tool": {"id": 1, "name": "Capella"},
},
"state": "Started",
"state": "Running",
"warnings": [],
"connection_method": {
"id": "xpra",
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/app/openapi/model/anonymized-session.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions frontend/src/app/sessions/session/session-viewer.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import { SafeResourceUrl } from '@angular/platform-browser';
import { Meta, moduleMetadata, StoryObj } from '@storybook/angular';
import { BehaviorSubject } from 'rxjs';
import { SessionPreparationState, SessionState } from 'src/app/openapi';
import {
SessionViewerService,
ViewerSession,
Expand Down Expand Up @@ -116,13 +117,13 @@ export const TwoSessionsTilingPending: Story = {
mockSessionServiceProvider([
{
...mockPersistentViewerSession,
preparation_state: 'Pending',
state: 'Pending',
preparation_state: SessionPreparationState.Pending,
state: SessionState.Pending,
},
{
...mockReadOnlyViewerSession,
preparation_state: 'Completed',
state: 'Failed',
preparation_state: SessionPreparationState.Completed,
state: SessionState.Failed,
},
]),
],
Expand All @@ -140,8 +141,8 @@ export const OneSessionTilingPending: Story = {
mockSessionServiceProvider([
{
...mockPersistentViewerSession,
preparation_state: 'Completed',
state: 'Pending',
preparation_state: SessionPreparationState.Completed,
state: SessionState.Pending,
},
]),
],
Expand Down

0 comments on commit a81095f

Please sign in to comment.