Skip to content
代码片段 群组 项目
未验证 提交 9a8e21b7 编辑于 作者: Alexander Turinske's avatar Alexander Turinske 提交者: GitLab
浏览文件

Merge branch '443594-policies-remove-feature-toggle-policy-scope' into 'master'

No related branches found
No related tags found
无相关合并请求
......@@ -60,7 +60,7 @@ export default {
},
directives: { GlModal: GlModalDirective, GlTooltip: GlTooltipDirective },
mixins: [glFeatureFlagsMixin()],
inject: ['namespaceType', 'policiesPath', 'securityPoliciesPolicyScopeToggleEnabled'],
inject: ['namespaceType', 'policiesPath'],
props: {
customSaveButtonText: {
type: String,
......@@ -138,11 +138,9 @@ export default {
return this.namespaceType === NAMESPACE_TYPES.GROUP;
},
shouldShowScope() {
const featureFlagEnabled = this.isGroupLevel
return this.isGroupLevel
? this.glFeatures.securityPoliciesPolicyScope
: this.glFeatures.securityPoliciesPolicyScopeProject;
return featureFlagEnabled && this.securityPoliciesPolicyScopeToggleEnabled;
},
deleteModalTitle() {
return sprintf(s__('SecurityOrchestration|Delete policy: %{policy}'), {
......
......@@ -30,7 +30,6 @@ export default (el, namespaceType) => {
scanResultApprovers,
softwareLicenses,
timezones,
securityPoliciesPolicyScopeToggleEnabled,
} = el.dataset;
const policyProject = JSON.parse(assignedPolicyProject);
......@@ -87,9 +86,6 @@ export default (el, namespaceType) => {
scanPolicyDocumentationPath,
scanResultPolicyApprovers,
parsedSoftwareLicenses,
securityPoliciesPolicyScopeToggleEnabled: parseBoolean(
securityPoliciesPolicyScopeToggleEnabled,
),
timezones: parsedTimezones,
existingPolicy: policy ? { type: policyType, ...JSON.parse(policy) } : undefined,
assignedPolicyProject: policyProject
......
......@@ -42,7 +42,6 @@ describe('EditorLayout component', () => {
...propsData,
},
provide: {
securityPoliciesPolicyScopeToggleEnabled: false,
policiesPath,
namespaceType,
...provide,
......@@ -300,29 +299,18 @@ describe('EditorLayout component', () => {
describe('policy scope', () => {
it.each`
flagEnabledGroup | flagEnabledProject | securityPoliciesPolicyScopeToggleEnabled | type | expectedResult
${true} | ${false} | ${true} | ${NAMESPACE_TYPES.GROUP} | ${true}
${true} | ${false} | ${true} | ${NAMESPACE_TYPES.PROJECT} | ${false}
${false} | ${false} | ${false} | ${NAMESPACE_TYPES.GROUP} | ${false}
${false} | ${false} | ${false} | ${NAMESPACE_TYPES.PROJECT} | ${false}
${true} | ${false} | ${false} | ${NAMESPACE_TYPES.GROUP} | ${false}
${true} | ${false} | ${false} | ${NAMESPACE_TYPES.PROJECT} | ${false}
${false} | ${false} | ${true} | ${NAMESPACE_TYPES.GROUP} | ${false}
${false} | ${true} | ${true} | ${NAMESPACE_TYPES.PROJECT} | ${true}
${false} | ${false} | ${false} | ${NAMESPACE_TYPES.PROJECT} | ${false}
${true} | ${true} | ${false} | ${NAMESPACE_TYPES.GROUP} | ${false}
flagEnabledGroup | flagEnabledProject | type | expectedResult
${false} | ${false} | ${NAMESPACE_TYPES.GROUP} | ${false}
${false} | ${false} | ${NAMESPACE_TYPES.PROJECT} | ${false}
${true} | ${false} | ${NAMESPACE_TYPES.GROUP} | ${true}
${true} | ${false} | ${NAMESPACE_TYPES.PROJECT} | ${false}
${false} | ${true} | ${NAMESPACE_TYPES.PROJECT} | ${true}
${true} | ${true} | ${NAMESPACE_TYPES.GROUP} | ${true}
`(
'renders policy scope conditionally for $namespaceType level based on feature flag',
({
flagEnabledGroup,
flagEnabledProject,
securityPoliciesPolicyScopeToggleEnabled,
type,
expectedResult,
}) => {
({ flagEnabledGroup, flagEnabledProject, type, expectedResult }) => {
factory({
provide: {
securityPoliciesPolicyScopeToggleEnabled,
namespaceType: type,
glFeatures: {
securityPoliciesPolicyScope: flagEnabledGroup,
......
......@@ -26,6 +26,5 @@ export const DEFAULT_PROVIDE = {
rootNamespacePath: 'path/to/root',
parsedSoftwareLicenses: [],
timezones: [],
securityPoliciesPolicyScopeToggleEnabled: true,
customCiToggleEnabled: true,
};
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册