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