debian-mirror-gitlab/app/assets/javascripts/groups/members/components/app.vue

43 lines
1.2 KiB
Vue
Raw Normal View History

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';
2021-02-22 17:27:13 +05:30
import MembersTable from '~/members/components/table/members_table.vue';
import FilterSortContainer from '~/members/components/filter_sort/filter_sort_container.vue';
2021-01-03 14:25:43 +05:30
import { scrollToElement } from '~/lib/utils/common_utils';
2021-02-22 17:27:13 +05:30
import { HIDE_ERROR } from '~/members/store/mutation_types';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
2021-01-03 14:25:43 +05:30
2020-11-24 15:15:51 +05:30
export default {
name: 'GroupMembersApp',
2021-02-22 17:27:13 +05:30
components: { MembersTable, FilterSortContainer, GlAlert },
mixins: [glFeatureFlagsMixin()],
2021-01-03 14:25:43 +05:30
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>
2021-02-22 17:27:13 +05:30
<filter-sort-container v-if="glFeatures.groupMembersFilteredSearch" />
2021-01-03 14:25:43 +05:30
<members-table />
</div>
2020-11-24 15:15:51 +05:30
</template>