[ACA-4644] Inherited & linked rules that are disabled should not be listed (#2843)

* [ACA-4644] Inherited & linked rules that are disabled should not be listed

* Added condition for linked rule sets to need only enabled rules

* Added a bypass for the empty rules list for linked rule sets that have only disabled rules

* Replaced array filter with some
This commit is contained in:
Thomas Hunter
2022-12-13 10:10:17 +00:00
committed by GitHub
parent 49f0cc3b61
commit 8c7c40a3d4
9 changed files with 101 additions and 27 deletions

View File

@@ -26,7 +26,7 @@
import { RuleSet } from '../model/rule-set.model';
import { otherFolderIdMock, otherFolderMock, owningFolderIdMock, owningFolderMock } from './node.mock';
import { Rule } from '../model/rule.model';
import { inheritedRulesMock, linkedRulesMock, ownedRulesMock } from './rules.mock';
import { inheritedRulesMock, linkedRulesMock, ownedRulesMock, ruleMock } from './rules.mock';
export const getRuleSetsResponseMock = {
list: {
@@ -125,6 +125,17 @@ export const inheritedRuleSetWithEmptyRulesMock: RuleSet = {
loadingRules: false
};
export const ruleSetsMock: RuleSet[] = [inheritedRuleSetMock, ownedRuleSetMock, ruleSetWithLinkMock];
export const inheritedRuleSetWithOnlyDisabledRulesMock: RuleSet = {
id: 'inherited-rule-set',
isLinkedTo: false,
owningFolder: otherFolderMock,
linkedToBy: [],
rules: [
{ ...ruleMock('rule1'), isEnabled: false },
{ ...ruleMock('rule2'), isEnabled: false }
],
hasMoreRules: false,
loadingRules: false
};
export const ruleSetsWithEmptyRulesMock: RuleSet[] = [inheritedRuleSetWithEmptyRulesMock];
export const ruleSetsMock: RuleSet[] = [inheritedRuleSetMock, ownedRuleSetMock, ruleSetWithLinkMock];