16 lines
568 B
TypeScript
16 lines
568 B
TypeScript
|
|
import { initialForm, type FormState } from './form-state';
|
||
|
|
import type { AlertRuleResponse } from '../../../api/queries/alertRules';
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Prefill the wizard form from a source rule being promoted from another env.
|
||
|
|
*
|
||
|
|
* Task 19 scaffolding: reuses the edit-prefill path and renames the rule.
|
||
|
|
* Task 24 rewrites this to compute scope-adjustment warnings and return
|
||
|
|
* `{ form, warnings }`.
|
||
|
|
*/
|
||
|
|
export function prefillFromPromotion(source: AlertRuleResponse): FormState {
|
||
|
|
const f = initialForm(source);
|
||
|
|
f.name = `${source.name ?? 'rule'} (copy)`;
|
||
|
|
return f;
|
||
|
|
}
|