Object.freeze(resolvePayload(data.value!)))
-export function getRuleFromName(name: string): RuleInfo | undefined {
- return payload.value.rules[name]
+export function getRuleFromName(name: string): RuleInfo {
+ return payload.value.rules[name] || {
+ name,
+ invalid: true,
+ }
}
export function getRuleStates(name: string): RuleConfigStates | undefined {
diff --git a/shared/types.ts b/shared/types.ts
index 526413e..022e9ec 100644
--- a/shared/types.ts
+++ b/shared/types.ts
@@ -75,6 +75,10 @@ export interface PayloadMeta {
export interface RuleInfo extends RuleMetaData
{
name: string
plugin: string
+ /**
+ * The rule may be removed
+ */
+ invalid?: boolean
}
export interface FiltersConfigsPage {