-
Notifications
You must be signed in to change notification settings - Fork 4.6k
seperate v1 and v2 seeds, make groupMode to add default in case its not provided through api but primary groupBy is present #15815
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
base: main
Are you sure you want to change the base?
Conversation
Greptile OverviewGreptile SummarySeparated v1 and v2 dashboard seed data and added default stacking mode for charts with secondary grouping.
Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Client as API Client
participant Seeder as DevSeederService
participant SeedUtil as seedPageLayoutWidgets
participant GetSeeds as getPageLayoutWidgetDataSeeds
participant GetSeedsV2 as getPageLayoutWidgetDataSeedsV2
participant Validator as validateAndTransformWidgetConfiguration
Client->>Seeder: Request seed data (isDashboardV2Enabled)
Seeder->>SeedUtil: seedPageLayoutWidgets(workspaceId, objectMetadata, isDashboardV2Enabled)
SeedUtil->>GetSeeds: getPageLayoutWidgetDataSeeds(workspaceId, objectMetadata, isDashboardV2Enabled)
alt isDashboardV2Enabled = false
GetSeeds->>GetSeeds: Return v1 widgets only
else isDashboardV2Enabled = true
GetSeeds->>GetSeedsV2: getPageLayoutWidgetDataSeedsV2(workspaceId, objectMetadata)
GetSeedsV2-->>GetSeeds: Return v2 widgets (LINE, PIE, GAUGE)
GetSeeds->>GetSeeds: Combine v1 + v2 widgets
end
GetSeeds-->>SeedUtil: Return combined widget seeds
loop For each widget
SeedUtil->>Validator: validateAndTransformWidgetConfiguration(type, config, isDashboardV2Enabled)
alt Widget has secondaryAxisGroupByFieldMetadataId
alt BarChart && groupMode undefined
Validator->>Validator: Set groupMode = STACKED
else LineChart && isStacked undefined
Validator->>Validator: Set isStacked = true
end
end
Validator-->>SeedUtil: Return validated configuration
end
SeedUtil->>SeedUtil: Insert widgets into database
SeedUtil-->>Seeder: Seeding complete
Seeder-->>Client: Success
|
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.
4 files reviewed, no comments
|
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:54160 This environment will automatically shut down when the PR is closed or after 5 hours. |
…ot provided through api
3d4cc34 to
70df123
Compare
Context -
refactoring v1 and v2 seeds to test v2 dashboard flag both on and off
Right now, the db reset command fails if the feature flag is off
whenever there is a groupBy field -- we should add a default groupMode - we already do that on the front -- but implementing the same on server so that api users get the same response
This is also the reason why the second seed on dashboards lags a lot -- because on that particular dashboard's widget -- we set groupBy but no groupMode (in seeding util) -- and the effect of limiting the bars to fifty runs depending on the groupMode