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

41 lines
985 B
Vue
Raw Normal View History

2020-11-24 15:15:51 +05:30
<script>
2021-01-03 14:25:43 +05:30
import { GlAlert } from '@gitlab/ui';
2021-03-11 19:13:27 +05:30
import { mapState, mapMutations } from 'vuex';
2021-01-03 14:25:43 +05:30
import { scrollToElement } from '~/lib/utils/common_utils';
2021-03-11 19:13:27 +05:30
import { HIDE_ERROR } from '../store/mutation_types';
import FilterSortContainer from './filter_sort/filter_sort_container.vue';
import MembersTable from './table/members_table.vue';
2021-01-03 14:25:43 +05:30
2020-11-24 15:15:51 +05:30
export default {
2021-03-11 19:13:27 +05:30
name: 'MembersApp',
2021-02-22 17:27:13 +05:30
components: { MembersTable, FilterSortContainer, GlAlert },
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-03-08 18:12:59 +05:30
<filter-sort-container />
2021-01-03 14:25:43 +05:30
<members-table />
</div>
2020-11-24 15:15:51 +05:30
</template>