diff --git a/app/components/RuleItem.vue b/app/components/RuleItem.vue index c2b586e..c4f80b0 100644 --- a/app/components/RuleItem.vue +++ b/app/components/RuleItem.vue @@ -72,6 +72,7 @@ function capitalize(str?: string) {
- {{ capitalize(rule.docs?.description) }} + {{ rule.invalid ? 'Invalid rule has no description' : capitalize(rule.docs?.description) }}
-
- DEPRECATED +
+ {{ rule.invalid ? 'INVALID' : 'DEPRECATED' }}
-
- DEPRECATED +
+ {{ rule.invalid ? 'INVALID' : 'DEPRECATED' }}
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 {