Skip to content
Snippets Groups Projects
Commit f76abf79 authored by Paul Gascou-Vaillancourt's avatar Paul Gascou-Vaillancourt
Browse files

Revert initial tab changes and invert tab fallbacks

parent b477ebde
No related branches found
No related tags found
1 merge request!62134Simplify network policy sidebar
......@@ -15,6 +15,9 @@ export default {
},
},
computed: {
initialTab() {
return this.policy ? 0 : 1;
},
policy() {
const policy = fromYaml(this.value);
return policy.error ? null : policy;
......@@ -49,6 +52,7 @@ export default {
<policy-preview
class="gl-mt-4"
:initial-tab="initialTab"
:policy-yaml="policyYaml"
:policy-description="humanizedPolicy"
/>
......
......@@ -70,7 +70,7 @@ exports[`PolicyDrawer component unsupported YAML renders policy preview tabs 1`]
<policy-preview-stub
class="gl-mt-4"
initialtab="0"
initialtab="1"
policyyaml="unsupportedPrimaryKey: test"
/>
</div>
......
......@@ -68,7 +68,7 @@ describe('PolicyDrawer component', () => {
it('does render the policy preview', () => {
expect(findPolicyPreview().exists()).toBe(true);
expect(findPolicyPreview().props()).toStrictEqual({
initialTab: 0,
initialTab: 1,
policyDescription: null,
policyYaml: unsupportedYaml,
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment