feat(FR-2451): add Prometheus Query Preset create modal#7085
Open
agatha197 wants to merge 1 commit into04-27-feat_fr-2451_implement_prometheus_query_preset_list_tablefrom
Conversation
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Contributor
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🔴 | Statements | 8.99% (-0.02% 🔻) |
1858/20673 |
| 🔴 | Branches | 8.15% (-0.03% 🔻) |
1187/14571 |
| 🔴 | Functions | 5.28% (-0.01% 🔻) |
296/5607 |
| 🔴 | Lines | 8.72% (-0.02% 🔻) |
1749/20056 |
Show new covered files 🐣
St.❔ |
File | Statements | Branches | Functions | Lines |
|---|---|---|---|---|---|
| 🔴 | ... / PrometheusQueryPresetEditorModal.tsx |
0% | 0% | 0% | 0% |
Test suite run success
865 tests passing in 40 suites.
Report generated by 🧪jest coverage report action from 66852a9
2c15caf to
ebd1d50
Compare
130e2af to
98a23f6
Compare
This was referenced Apr 27, 2026
Open
nowgnuesLee
requested changes
Apr 28, 2026
ebd1d50 to
31cd4e2
Compare
98a23f6 to
f34e805
Compare
nowgnuesLee
requested changes
Apr 28, 2026
31cd4e2 to
c074b00
Compare
f34e805 to
57c25be
Compare
nowgnuesLee
requested changes
Apr 28, 2026
57c25be to
8f6b3c7
Compare
c074b00 to
0eebe06
Compare
8f6b3c7 to
66852a9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Resolves #6357 (FR-2451)
Stacked on top of #7084.
Summary
Sub-task 3 of the Prometheus Query Preset Admin feature (
.specs/draft-auto-scaling-rule-management/dev-plan.md-> Sub-task 3). Adds the Create Preset modal and wires it to the toolbar's "Add Preset" button (which was disabled in #7084).PrometheusQueryPresetEditorModal.tsx: a unified Create/Edit modal driven by an optional fragment ref. This PR ships the Create path; Sub-task 4 (next PR in the stack) will fill in the Edit path on the same modal.Form,layout="vertical"):name(required, with "must be unique" hint)description(optional,TextArea)categoryId(optional,Selectdriven by a siblingprometheusQueryPresetCategoriesquery)rank(InputNumber, default0)metricName(required)queryTemplate(required, multi-lineTextArea)timeWindow(optional plainInput, e.g.5m)options.filterLabels/options.groupLabels(Select mode="tags")adminCreatePrometheusQueryPreset(input: CreateQueryDefinitionInput!)via RelayuseMutation. On success: success toast, transition-drivenupdateFetchKey()to refetch the list, and modal close. On error: keep modal open and surface the error.Notes / risk callouts
prometheusQueryPresetCategoriesmay return[]in dev environments. The form still submits cleanly withcategoryId = nulland theSelectshows a "No category" empty-state message.filterLabels/groupLabelsare required[String!]!inCreateQueryDefinitionInputbut accept[]. We submit[]whenever the user leaves the tags input untouched.prometheusQueryPresetCategory(id: UUID!)/prometheusQueryPresetCategories) returnsQueryPresetCategory.id: UUID!, which matches theCreateQueryDefinitionInput.categoryId: UUIDfield. NotoLocalId()conversion is needed.i18n keys added (
prometheusQueryPreset.*)Description,Category,NoCategory,Rank,FilterLabels,GroupLabels,CreatePreset,EditPreset,NameRequired,NameMustBeUnique,MetricNameRequired,QueryTemplateRequired,SuccessfullyCreated. English source only.Verification