diff options
author | Phil Hughes <me@iamphill.com> | 2019-07-05 11:14:56 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-07-05 12:16:46 +0100 |
commit | 77c35d5d001a0ce0626bc8aeec574eca36c2233b (patch) | |
tree | 2a98e40e56b6d5820d8ee95a75675276e11b603b /app/assets/javascripts/confidential_merge_request/index.js | |
parent | 9a4b5f08dbf5e0900145b5127f50e7ab3578d05c (diff) | |
download | gitlab-ce-77c35d5d001a0ce0626bc8aeec574eca36c2233b.tar.gz |
Create private merge requests in forks
https://gitlab.com/gitlab-org/gitlab-ce/issues/58583
Diffstat (limited to 'app/assets/javascripts/confidential_merge_request/index.js')
-rw-r--r-- | app/assets/javascripts/confidential_merge_request/index.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/app/assets/javascripts/confidential_merge_request/index.js b/app/assets/javascripts/confidential_merge_request/index.js new file mode 100644 index 00000000000..9672821d30e --- /dev/null +++ b/app/assets/javascripts/confidential_merge_request/index.js @@ -0,0 +1,30 @@ +import Vue from 'vue'; +import { parseBoolean } from '../lib/utils/common_utils'; +import ProjectFormGroup from './components/project_form_group.vue'; +import state from './state'; + +export function isConfidentialIssue() { + return parseBoolean(document.querySelector('.js-create-mr').dataset.isConfidential); +} + +export function canCreateConfidentialMergeRequest() { + return isConfidentialIssue() && Object.keys(state.selectedProject).length > 0; +} + +export function init() { + const el = document.getElementById('js-forked-project'); + + return new Vue({ + el, + render(h) { + return h(ProjectFormGroup, { + props: { + namespacePath: el.dataset.namespacePath, + projectPath: el.dataset.projectPath, + newForkPath: el.dataset.newForkPath, + helpPagePath: el.dataset.helpPagePath, + }, + }); + }, + }); +} |