2020-11-24 15:15:51 +05:30
|
|
|
<script>
|
2021-01-03 14:25:43 +05:30
|
|
|
import { mapState, mapMutations } from 'vuex';
|
|
|
|
import { GlAlert } from '@gitlab/ui';
|
|
|
|
import MembersTable from '~/vue_shared/components/members/table/members_table.vue';
|
|
|
|
import { scrollToElement } from '~/lib/utils/common_utils';
|
|
|
|
import { HIDE_ERROR } from '~/vuex_shared/modules/members/mutation_types';
|
|
|
|
|
2020-11-24 15:15:51 +05:30
|
|
|
export default {
|
|
|
|
name: 'GroupMembersApp',
|
2021-01-03 14:25:43 +05:30
|
|
|
components: { MembersTable, GlAlert },
|
|
|
|
computed: {
|
|
|
|
...mapState(['showError', 'errorMessage']),
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
showError(value) {
|
|
|
|
if (value) {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
scrollToElement(this.$refs.errorAlert.$el);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
...mapMutations({
|
|
|
|
hideError: HIDE_ERROR,
|
|
|
|
}),
|
|
|
|
},
|
2020-11-24 15:15:51 +05:30
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2021-01-03 14:25:43 +05:30
|
|
|
<div>
|
|
|
|
<gl-alert v-if="showError" ref="errorAlert" variant="danger" @dismiss="hideError">{{
|
|
|
|
errorMessage
|
|
|
|
}}</gl-alert>
|
|
|
|
<members-table />
|
|
|
|
</div>
|
2020-11-24 15:15:51 +05:30
|
|
|
</template>
|