diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-01 15:08:56 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-01 15:08:56 +0300 |
commit | 50d66f5ece57dcfbe074d97703691a8d3c38f4ac (patch) | |
tree | c96aa5ffd1cb73c18e53356680cb9792d24c257b /app/assets/javascripts/members | |
parent | cfec4ed6fe77e4150b1ea83b87f407aa0cca944c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/members')
6 files changed, 14 insertions, 14 deletions
diff --git a/app/assets/javascripts/members/components/avatars/user_avatar.vue b/app/assets/javascripts/members/components/avatars/user_avatar.vue index 658fb43cecb..9687eacb036 100644 --- a/app/assets/javascripts/members/components/avatars/user_avatar.vue +++ b/app/assets/javascripts/members/components/avatars/user_avatar.vue @@ -5,7 +5,6 @@ import { GlBadge, GlSafeHtmlDirective as SafeHtml, } from '@gitlab/ui'; -import { mapState } from 'vuex'; import { generateBadges } from 'ee_else_ce/members/utils'; import { glEmojiTag } from '~/emoji'; import { __ } from '~/locale'; @@ -24,6 +23,7 @@ export default { directives: { SafeHtml, }, + inject: ['canManageMembers'], props: { member: { type: Object, @@ -35,7 +35,6 @@ export default { }, }, computed: { - ...mapState(['canManageMembers']), user() { return this.member.user; }, diff --git a/app/assets/javascripts/members/components/filter_sort/members_filtered_search_bar.vue b/app/assets/javascripts/members/components/filter_sort/members_filtered_search_bar.vue index 039ee9a0207..9e58c7022b8 100644 --- a/app/assets/javascripts/members/components/filter_sort/members_filtered_search_bar.vue +++ b/app/assets/javascripts/members/components/filter_sort/members_filtered_search_bar.vue @@ -37,13 +37,14 @@ export default { ], }, ], + inject: ['sourceId', 'canManageMembers'], data() { return { initialFilterValue: [], }; }, computed: { - ...mapState(['sourceId', 'filteredSearchBar', 'canManageMembers']), + ...mapState(['filteredSearchBar']), tokens() { return this.$options.availableTokens.filter((token) => { if ( diff --git a/app/assets/javascripts/members/components/table/members_table.vue b/app/assets/javascripts/members/components/table/members_table.vue index 9a3edff19ff..5db29951d94 100644 --- a/app/assets/javascripts/members/components/table/members_table.vue +++ b/app/assets/javascripts/members/components/table/members_table.vue @@ -31,8 +31,9 @@ export default { LdapOverrideConfirmationModal: () => import('ee_component/members/components/ldap/ldap_override_confirmation_modal.vue'), }, + inject: ['currentUserId'], computed: { - ...mapState(['members', 'tableFields', 'tableAttrs', 'currentUserId']), + ...mapState(['members', 'tableFields', 'tableAttrs']), filteredFields() { return FIELDS.filter( (field) => this.tableFields.includes(field.key) && this.showField(field), diff --git a/app/assets/javascripts/members/components/table/members_table_cell.vue b/app/assets/javascripts/members/components/table/members_table_cell.vue index 1f537740f94..3436bcab2fc 100644 --- a/app/assets/javascripts/members/components/table/members_table_cell.vue +++ b/app/assets/javascripts/members/components/table/members_table_cell.vue @@ -1,5 +1,4 @@ <script> -import { mapState } from 'vuex'; import { MEMBER_TYPES } from '../../constants'; import { isGroup, @@ -12,6 +11,7 @@ import { export default { name: 'MembersTableCell', + inject: ['currentUserId'], props: { member: { type: Object, @@ -19,7 +19,6 @@ export default { }, }, computed: { - ...mapState(['currentUserId']), isGroup() { return isGroup(this.member); }, diff --git a/app/assets/javascripts/members/index.js b/app/assets/javascripts/members/index.js index fe174d9beb6..2f3589bbf6a 100644 --- a/app/assets/javascripts/members/index.js +++ b/app/assets/javascripts/members/index.js @@ -22,10 +22,11 @@ export const initMembersApp = ( Vue.use(Vuex); Vue.use(GlToast); + const { sourceId, canManageMembers, ...vuexStoreAttributes } = parseDataAttributes(el); + const store = new Vuex.Store( membersStore({ - ...parseDataAttributes(el), - currentUserId: gon.current_user_id || null, + ...vuexStoreAttributes, tableFields, tableAttrs, tableSortableFields, @@ -38,6 +39,11 @@ export const initMembersApp = ( el, components: { App }, store, + provide: { + currentUserId: gon.current_user_id || null, + sourceId, + canManageMembers, + }, render: (createElement) => createElement('app'), }); }; diff --git a/app/assets/javascripts/members/store/state.js b/app/assets/javascripts/members/store/state.js index 23a7983adcc..4006b4b501d 100644 --- a/app/assets/javascripts/members/store/state.js +++ b/app/assets/javascripts/members/store/state.js @@ -1,8 +1,5 @@ export default ({ members, - sourceId, - currentUserId, - canManageMembers, tableFields, tableAttrs, tableSortableFields, @@ -11,9 +8,6 @@ export default ({ filteredSearchBar, }) => ({ members, - sourceId, - currentUserId, - canManageMembers, tableFields, tableAttrs, tableSortableFields, |