Commit 8a384e0b authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '213061-ordered-keys' into 'master'

Preserve the order of snippet visibility options

Closes #213061

See merge request gitlab-org/gitlab!28526
parents b1080c15 cf06b9a0
<script> <script>
import { GlIcon, GlFormGroup, GlFormRadio, GlFormRadioGroup, GlLink } from '@gitlab/ui'; import { GlIcon, GlFormGroup, GlFormRadio, GlFormRadioGroup, GlLink } from '@gitlab/ui';
import { SNIPPET_VISIBILITY, SNIPPET_VISIBILITY_PRIVATE } from '~/snippets/constants'; import {
SNIPPET_VISIBILITY,
SNIPPET_VISIBILITY_PRIVATE,
SNIPPET_VISIBILITY_INTERNAL,
SNIPPET_VISIBILITY_PUBLIC,
} from '~/snippets/constants';
export default { export default {
components: { components: {
...@@ -29,14 +34,11 @@ export default { ...@@ -29,14 +34,11 @@ export default {
}, },
computed: { computed: {
visibilityOptions() { visibilityOptions() {
const options = []; return [
Object.keys(SNIPPET_VISIBILITY).forEach(key => { SNIPPET_VISIBILITY_PRIVATE,
options.push({ SNIPPET_VISIBILITY_INTERNAL,
value: key, SNIPPET_VISIBILITY_PUBLIC,
...SNIPPET_VISIBILITY[key], ].map(key => ({ value: key, ...SNIPPET_VISIBILITY[key] }));
});
});
return options;
}, },
}, },
}; };
......
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