Commit b62b5f97 authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch '321884-fix-policies-list-drawer' into 'master'

Fix policies drawer header height for list page

See merge request gitlab-org/gitlab!67905
parents af218f4d a9563e88
...@@ -40,3 +40,5 @@ export const POLICY_TYPE_OPTIONS = { ...@@ -40,3 +40,5 @@ export const POLICY_TYPE_OPTIONS = {
text: s__('SecurityPolicies|All policies'), text: s__('SecurityPolicies|All policies'),
}, },
}; };
export const POLICIES_LIST_CONTAINER_CLASS = '.js-security-policies-container-wrapper';
<script> <script>
import { GlButton, GlDrawer } from '@gitlab/ui'; import { GlButton, GlDrawer } from '@gitlab/ui';
import { getContentWrapperHeight, getPolicyKind } from '../../utils'; import { getContentWrapperHeight, getPolicyKind } from '../../utils';
import { POLICY_KINDS } from '../constants'; import { POLICIES_LIST_CONTAINER_CLASS, POLICY_KINDS } from '../constants';
import CiliumNetworkPolicy from './cilium_network_policy.vue'; import CiliumNetworkPolicy from './cilium_network_policy.vue';
import ScanExecutionPolicy from './scan_execution_policy.vue'; import ScanExecutionPolicy from './scan_execution_policy.vue';
...@@ -20,6 +20,11 @@ export default { ...@@ -20,6 +20,11 @@ export default {
ScanExecutionPolicy, ScanExecutionPolicy,
}, },
props: { props: {
containerClass: {
type: String,
required: false,
default: POLICIES_LIST_CONTAINER_CLASS,
},
policy: { policy: {
type: Object, type: Object,
required: false, required: false,
...@@ -41,7 +46,7 @@ export default { ...@@ -41,7 +46,7 @@ export default {
}, },
methods: { methods: {
getDrawerHeaderHeight() { getDrawerHeaderHeight() {
return getContentWrapperHeight('.js-threat-monitoring-container-wrapper'); return getContentWrapperHeight(this.containerClass);
}, },
}, },
// We set the drawer's z-index to 252 to clear flash messages that might be displayed in the page // We set the drawer's z-index to 252 to clear flash messages that might be displayed in the page
......
...@@ -327,6 +327,7 @@ export default { ...@@ -327,6 +327,7 @@ export default {
<policy-drawer <policy-drawer
:open="hasSelectedPolicy" :open="hasSelectedPolicy"
container-class=".js-threat-monitoring-container-wrapper"
:policy="selectedPolicy" :policy="selectedPolicy"
:edit-policy-path="editPolicyPath" :edit-policy-path="editPolicyPath"
data-testid="policyDrawer" data-testid="policyDrawer"
......
- breadcrumb_title _("Policies") - breadcrumb_title _("Policies")
- @content_wrapper_class = 'js-security-policies-container-wrapper'
- disable_security_policy_project = !can_update_security_orchestration_policy_project?(project) - disable_security_policy_project = !can_update_security_orchestration_policy_project?(project)
- default_environment_id = project.default_environment&.id || -1 - default_environment_id = project.default_environment&.id || -1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment