From 1607eebcae5347a5d71d9ffc857b958e97671db9 Mon Sep 17 00:00:00 2001 From: Mark Florian Date: Tue, 7 Apr 2020 16:47:02 +0100 Subject: [PATCH] Remove unused store module As part of [Update dependencies table UI][1], the Dependency List is being reduced from _two_ tabbed lists to just one. That work is taking place behind the `dependency_list_ui` feature flag. When it's disabled, the old UI will be rendered, which means the store needs to be created with list modules for both the "All" and "Vulnerable components" tabs. When the flag is _enabled_, only the default "All" list module needs to be set up. Otherwise, the UI would make an initial unnecessary network request for the "Vulnerable components" tab/list, which isn't being rendered. [1]: https://gitlab.com/gitlab-org/gitlab/-/issues/195928 --- ee/app/assets/javascripts/dependencies/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ee/app/assets/javascripts/dependencies/index.js b/ee/app/assets/javascripts/dependencies/index.js index d084e6c5eb1bd6..c00a54c6a546f0 100644 --- a/ee/app/assets/javascripts/dependencies/index.js +++ b/ee/app/assets/javascripts/dependencies/index.js @@ -9,7 +9,10 @@ export default () => { const { endpoint, emptyStateSvgPath, documentationPath, supportDocumentationPath } = el.dataset; const store = createStore(); - addListType(store, DEPENDENCY_LIST_TYPES.vulnerable); + + if (!gon.features?.dependencyListUi) { + addListType(store, DEPENDENCY_LIST_TYPES.vulnerable); + } return new Vue({ el, -- GitLab