diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-12 03:12:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-12 03:12:46 +0300 |
commit | 06071708b3802b9aa624e194cfdfeaf1bb49f0c6 (patch) | |
tree | 3d66a9c027c35d6d1251e5780ba47bc3a998d310 /app/assets/javascripts/projects | |
parent | f8dfaa8d4140328fa63282d3d6ac159d571dab84 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/projects')
-rw-r--r-- | app/assets/javascripts/projects/settings/components/transfer_project_form.vue | 11 | ||||
-rw-r--r-- | app/assets/javascripts/projects/settings/init_transfer_project_form.js | 10 |
2 files changed, 15 insertions, 6 deletions
diff --git a/app/assets/javascripts/projects/settings/components/transfer_project_form.vue b/app/assets/javascripts/projects/settings/components/transfer_project_form.vue index ee896ccc01e..fe968e74c6d 100644 --- a/app/assets/javascripts/projects/settings/components/transfer_project_form.vue +++ b/app/assets/javascripts/projects/settings/components/transfer_project_form.vue @@ -11,8 +11,12 @@ export default { ConfirmDanger, }, props: { - namespaces: { - type: Object, + groupNamespaces: { + type: Array, + required: true, + }, + userNamespaces: { + type: Array, required: true, }, confirmationPhrase: { @@ -46,7 +50,8 @@ export default { <namespace-select data-testid="transfer-project-namespace" :full-width="true" - :data="namespaces" + :group-namespaces="groupNamespaces" + :user-namespaces="userNamespaces" :selected-namespace="selectedNamespace" @select="handleSelect" /> diff --git a/app/assets/javascripts/projects/settings/init_transfer_project_form.js b/app/assets/javascripts/projects/settings/init_transfer_project_form.js index 47b49031dc9..a5f720bffaa 100644 --- a/app/assets/javascripts/projects/settings/init_transfer_project_form.js +++ b/app/assets/javascripts/projects/settings/init_transfer_project_form.js @@ -3,10 +3,14 @@ import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; import TransferProjectForm from './components/transfer_project_form.vue'; const prepareNamespaces = (rawNamespaces = '') => { + if (!rawNamespaces) { + return { groupNamespaces: [], userNamespaces: [] }; + } + const data = JSON.parse(rawNamespaces); return { - group: data?.group.map(convertObjectPropsToCamelCase), - user: data?.user.map(convertObjectPropsToCamelCase), + groupNamespaces: data?.group?.map(convertObjectPropsToCamelCase) || [], + userNamespaces: data?.user?.map(convertObjectPropsToCamelCase) || [], }; }; @@ -35,7 +39,7 @@ export default () => { props: { confirmButtonText, confirmationPhrase, - namespaces: prepareNamespaces(namespaces), + ...prepareNamespaces(namespaces), }, on: { selectNamespace: (id) => { |