diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-04 21:09:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-04 21:09:51 +0300 |
commit | bd979acf95124119d41f75d34cab231229f4dd81 (patch) | |
tree | a7ce5127c8ab6d42b27aa8342889c54d2f0090b2 /app/assets/javascripts/invite_members | |
parent | 4bdfcf93f224edb9c4daff90d95b0c6c92766ea3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/invite_members')
-rw-r--r-- | app/assets/javascripts/invite_members/components/group_select.vue | 20 | ||||
-rw-r--r-- | app/assets/javascripts/invite_members/components/invite_groups_modal.vue | 2 |
2 files changed, 20 insertions, 2 deletions
diff --git a/app/assets/javascripts/invite_members/components/group_select.vue b/app/assets/javascripts/invite_members/components/group_select.vue index 0e9781d77fe..5bb3b6b98e6 100644 --- a/app/assets/javascripts/invite_members/components/group_select.vue +++ b/app/assets/javascripts/invite_members/components/group_select.vue @@ -8,7 +8,7 @@ import { } from '@gitlab/ui'; import { debounce } from 'lodash'; import { s__ } from '~/locale'; -import { getGroups, getDescendentGroups } from '~/rest_api'; +import { getGroups, getDescendentGroups, getProjectShareLocations } from '~/rest_api'; import { SEARCH_DELAY, GROUP_FILTERS } from '../constants'; export default { @@ -29,6 +29,10 @@ export default { required: false, default: GROUP_FILTERS.ALL, }, + sourceId: { + type: String, + required: true, + }, parentGroupId: { type: Number, required: false, @@ -38,6 +42,10 @@ export default { type: Array, required: true, }, + isProject: { + type: Boolean, + required: true, + }, }, data() { return { @@ -79,7 +87,7 @@ export default { const rawGroups = response.map((group) => ({ id: group.id, name: group.full_name, - path: group.path, + path: group.full_path, avatarUrl: group.avatar_url, })); @@ -94,6 +102,14 @@ export default { this.$emit('input', this.selectedGroup); }, fetchGroups() { + if (this.isProject) { + return new Promise((resolve, reject) => { + getProjectShareLocations(this.sourceId, { search: this.searchTerm }) + .then(({ data }) => resolve(data)) + .catch(reject); + }); + } + switch (this.groupsFilter) { case GROUP_FILTERS.DESCENDANT_GROUPS: return getDescendentGroups( diff --git a/app/assets/javascripts/invite_members/components/invite_groups_modal.vue b/app/assets/javascripts/invite_members/components/invite_groups_modal.vue index 51355baef99..03513f74aa6 100644 --- a/app/assets/javascripts/invite_members/components/invite_groups_modal.vue +++ b/app/assets/javascripts/invite_members/components/invite_groups_modal.vue @@ -203,8 +203,10 @@ export default { <group-select v-model="groupToBeSharedWith" :groups-filter="groupSelectFilter" + :source-id="id" :parent-group-id="groupSelectParentId" :invalid-groups="invalidGroups" + :is-project="isProject" @input="clearValidation" /> </template> |