Commit 3e60f389 authored by Mike Greiling's avatar Mike Greiling

Merge branch '32664-disallow-changing-of-insights-tab-whilst-page-is-loading' into 'master'

Disable tab navigation whilst current page loads

Closes #32664

See merge request gitlab-org/gitlab!17678
parents 42853d8b ae7f1cef
......@@ -23,7 +23,13 @@ export default {
},
},
computed: {
...mapState('insights', ['configData', 'configLoading', 'activeTab', 'activePage']),
...mapState('insights', [
'configData',
'configLoading',
'activeTab',
'activePage',
'pageLoading',
]),
pages() {
const { configData, activeTab } = this;
......@@ -68,6 +74,7 @@ export default {
menu-class="w-100 mw-100"
toggle-class="dropdown-menu-toggle w-100 gl-field-error-outline"
:text="__('Select Page')"
:disabled="pageLoading"
>
<gl-dropdown-item
v-for="page in pages"
......
---
title: Disable insights tab navigation whilst current page loads
merge_request: 17678
author:
type: added
......@@ -68,6 +68,21 @@ describe('Insights component', () => {
done();
});
});
describe('when loading page', () => {
beforeEach(() => {
vm.$store.state.insights.pageLoading = true;
});
it('disables the tab selector', done => {
vm.$nextTick(() => {
expect(
vm.$el.querySelector('.js-insights-dropdown > button').getAttribute('disabled'),
).toBe('disabled');
done();
});
});
});
});
describe('empty config', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment