Commit a9563e88 authored by Alexander Turinske's avatar Alexander Turinske

Fix policies drawer header height for list page

- the drawer on the policies list page does not have
  the correct header height
- update the policy_drawer component to be configuraable
  for any header height
parent f98b5fad
......@@ -40,3 +40,5 @@ export const POLICY_TYPE_OPTIONS = {
text: s__('SecurityPolicies|All policies'),
},
};
export const POLICIES_LIST_CONTAINER_CLASS = '.js-security-policies-container-wrapper';
<script>
import { GlButton, GlDrawer } from '@gitlab/ui';
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 ScanExecutionPolicy from './scan_execution_policy.vue';
......@@ -20,6 +20,11 @@ export default {
ScanExecutionPolicy,
},
props: {
containerClass: {
type: String,
required: false,
default: POLICIES_LIST_CONTAINER_CLASS,
},
policy: {
type: Object,
required: false,
......@@ -41,7 +46,7 @@ export default {
},
methods: {
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
......
......@@ -327,6 +327,7 @@ export default {
<policy-drawer
:open="hasSelectedPolicy"
container-class=".js-threat-monitoring-container-wrapper"
:policy="selectedPolicy"
:edit-policy-path="editPolicyPath"
data-testid="policyDrawer"
......
- breadcrumb_title _("Policies")
- @content_wrapper_class = 'js-security-policies-container-wrapper'
- disable_security_policy_project = !can_update_security_orchestration_policy_project?(project)
- 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