Commit 0873a512 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch '332073-update-yaml-editor-styling' into 'master'

Fix yaml viewer padding not changing color

See merge request gitlab-org/gitlab!69563
parents c978c0b2 92586629
<script>
import { GlButton, GlDrawer } from '@gitlab/ui';
import { getContentWrapperHeight } from '../../utils';
import { getContentWrapperHeight, removeUnnecessaryDashes } from '../../utils';
import { POLICIES_LIST_CONTAINER_CLASS, POLICY_TYPE_COMPONENT_OPTIONS } from '../constants';
import CiliumNetworkPolicy from './cilium_network_policy.vue';
import ScanExecutionPolicy from './scan_execution_policy.vue';
......@@ -45,6 +45,9 @@ export default {
policyComponent() {
return policyComponent[this.policyType] || null;
},
policyYaml() {
return removeUnnecessaryDashes(this.policy.yaml);
},
},
methods: {
getDrawerHeaderHeight() {
......@@ -84,13 +87,7 @@ export default {
<p>
{{ s__("NetworkPolicies|Define this policy's location, conditions and actions.") }}
</p>
<div class="gl-p-3 gl-bg-gray-50">
<policy-yaml-editor
:value="policy.yaml"
data-testid="policy-yaml-editor"
class="network-policy-editor"
/>
</div>
<policy-yaml-editor :value="policyYaml" data-testid="policy-yaml-editor" />
</div>
</div>
</gl-drawer>
......
......@@ -111,7 +111,7 @@ export default {
/>
</gl-form-group>
<div class="gl-display-flex gl-sm-flex-direction-column">
<section class="gl-w-full gl-p-5">
<section class="gl-w-full" :class="{ 'gl-p-5': shouldShowRuleEditor }">
<div v-if="shouldShowRuleEditor" data-testid="rule-editor">
<slot name="rule-editor"></slot>
</div>
......
......@@ -21,8 +21,8 @@ export default {
return {
lineNumbers: 'off',
folding: false,
// Investigate the necessity of `glyphMargin` with #326746
glyphMargin: false,
// This represents 14px, which matches the number of pixels added to the left via glyphMargin
padding: { top: 14 },
renderIndentGuides: false,
renderWhitespace: 'boundary',
renderLineHighlight: 'none',
......
.network-policy-editor {
.monaco-editor,
.monaco-editor-background,
.monaco-editor .inputarea.ime-input {
background-color: $gray-50;
}
}
.threat-monitoring-alert-drawer .gl-drawer-header {
align-items: flex-start;
}
......
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