diff --git a/.prettierignore b/.prettierignore index b655c93ae7..64f2848920 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,15 +1,14 @@ -src/index.html *.json -.*.sw[po] -*.xml -*.sh -Dockerfile -.DS_Store *.md -*.png *.mp4 +*.png *.po +*.sh +*.xml +.*.sw[po] +.DS_Store +.eslintrc +Dockerfile test/cypress.env.json.template -test/cypress/fixtures/ test/cypress/e2e/*/compose.env -.eslintrc +test/cypress/fixtures/ diff --git a/CHANGES/3073.bug b/CHANGES/3073.bug new file mode 100644 index 0000000000..ad8666c804 --- /dev/null +++ b/CHANGES/3073.bug @@ -0,0 +1 @@ +insights: hardcode list of default filter tags diff --git a/src/components/collection-list/collection-filter.ts b/src/components/collection-list/collection-filter.ts index 334acf1072..c3476403ce 100644 --- a/src/components/collection-list/collection-filter.ts +++ b/src/components/collection-list/collection-filter.ts @@ -12,14 +12,34 @@ const loadRepos = (inputText) => })), ); +// insights-only +const defaultTags = [ + 'application', + 'cloud', + 'database', + 'eda', + 'infrastructure', + 'linux', + 'monitoring', + 'networking', + 'security', + 'storage', + 'tools', + 'windows', +].map((tag) => ({ id: tag, title: tag })); + const loadTags = (inputText) => - TagAPI.listCollections({ name__icontains: inputText, sort: '-count' }).then( - ({ data: { data } }) => - data.map(({ name, count }) => ({ - id: name, - title: count === undefined ? name : t`${name} (${count})`, - })), - ); + !inputText && IS_INSIGHTS + ? Promise.resolve(defaultTags) + : TagAPI.listCollections({ + name__icontains: inputText, + sort: '-count', + }).then(({ data: { data } }) => + data.map(({ name, count }) => ({ + id: name, + title: count === undefined ? name : t`${name} (${count})`, + })), + ); export const collectionFilter = ({ featureFlags: { display_signatures, display_repositories }, diff --git a/src/index.html b/src/index.html index 825e55204b..99bdc7312b 100644 --- a/src/index.html +++ b/src/index.html @@ -1,10 +1,10 @@ - + - - - <%= htmlWebpackPlugin.options.applicationName %> - - -
- + + + <%= htmlWebpackPlugin.options.applicationName %> + + +
+