diff --git a/configs/webpack.config.web.prod.babel.js b/configs/webpack.config.web.prod.babel.js index 214fc4773d..bffe500985 100644 --- a/configs/webpack.config.web.prod.babel.js +++ b/configs/webpack.config.web.prod.babel.js @@ -25,9 +25,10 @@ export default merge(commonConfig, { target: 'web', entry: ['regenerator-runtime/runtime', './index.tsx'], output: { - filename: 'js/bundle.[fullhash].min.js', + filename: 'js/bundle.[name].min.js', path: resolve(__dirname, '../redisinsight/ui/dist'), publicPath: '/', + chunkFilename: '[id].[chunkhash].js' }, optimization: { minimize: true, @@ -37,6 +38,34 @@ export default merge(commonConfig, { }), new CssMinimizerPlugin(), ], + runtimeChunk: 'single', + splitChunks: { + chunks: 'all', + maxInitialRequests: Infinity, + minSize: 0, + cacheGroups: { + reactVendor: { + test: /[\\/]node_modules[\\/](react|react-dom)[\\/]/, + name: "reactVendor" + }, + elasticVendor: { + test: /[\\/]node_modules[\\/](@elastic)[\\/]/, + name: "elasticVendor" + }, + monacoVendor: { + test: /[\\/]node_modules[\\/](monaco-editor)[\\/]/, + name: "monacoVendor" + }, + utilityVendor: { + test: /[\\/]node_modules[\\/](lodash)[\\/]/, + name: "utilityVendor" + }, + vendor: { + test: /[\\/]node_modules[\\/](!@elastic)(!monaco-editor)(!lodash)[\\/]/, + name: "vendor" + }, + }, + }, }, plugins: [ new MiniCssExtractPlugin({ diff --git a/redisinsight/ui/src/assets/img/workbench/vis_tag_cloud.svg b/redisinsight/ui/src/assets/img/workbench/vis_tag_cloud.svg new file mode 100644 index 0000000000..22259f5eab --- /dev/null +++ b/redisinsight/ui/src/assets/img/workbench/vis_tag_cloud.svg @@ -0,0 +1,3 @@ + + + diff --git a/redisinsight/ui/src/components/query-card/QueryCard.tsx b/redisinsight/ui/src/components/query-card/QueryCard.tsx index 166fe60835..694ed6187b 100644 --- a/redisinsight/ui/src/components/query-card/QueryCard.tsx +++ b/redisinsight/ui/src/components/query-card/QueryCard.tsx @@ -4,7 +4,7 @@ import cx from 'classnames' import { EuiLoadingContent, keys } from '@elastic/eui' import { useParams } from 'react-router-dom' -import { WBQueryType } from 'uiSrc/pages/workbench/constants' +import { WBQueryType, ProfileQueryType } from 'uiSrc/pages/workbench/constants' import { RunQueryMode, ResultsMode, ResultsSummary } from 'uiSrc/slices/interfaces/workbench' import { getWBQueryType, @@ -44,6 +44,7 @@ export interface Props { onQueryDelete: () => void onQueryReRun: () => void onQueryOpen: () => void + onQueryProfile: (type: ProfileQueryType) => void } const getDefaultPlugin = (views: IPluginVisualization[], query: string) => @@ -75,6 +76,7 @@ const QueryCard = (props: Props) => { createdAt, onQueryOpen, onQueryDelete, + onQueryProfile, onQueryReRun, loading, emptyCommand, @@ -186,6 +188,7 @@ const QueryCard = (props: Props) => { setSelectedValue={changeViewTypeSelected} onQueryDelete={onQueryDelete} onQueryReRun={onQueryReRun} + onQueryProfile={onQueryProfile} /> {isOpen && ( <> diff --git a/redisinsight/ui/src/components/query-card/QueryCardHeader/QueryCardHeader.tsx b/redisinsight/ui/src/components/query-card/QueryCardHeader/QueryCardHeader.tsx index 9aeb779b54..09de6cefa7 100644 --- a/redisinsight/ui/src/components/query-card/QueryCardHeader/QueryCardHeader.tsx +++ b/redisinsight/ui/src/components/query-card/QueryCardHeader/QueryCardHeader.tsx @@ -32,7 +32,7 @@ import { numberWithSpaces } from 'uiSrc/utils/numbers' import { ThemeContext } from 'uiSrc/contexts/themeContext' import { appPluginsSelector } from 'uiSrc/slices/app/plugins' import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry' -import { getViewTypeOptions, WBQueryType } from 'uiSrc/pages/workbench/constants' +import { getViewTypeOptions, WBQueryType, getProfileViewTypeOptions, ProfileQueryType, isCommandAllowedForProfile } from 'uiSrc/pages/workbench/constants' import { IPluginVisualization } from 'uiSrc/slices/interfaces' import { RunQueryMode, ResultsMode, ResultsSummary } from 'uiSrc/slices/interfaces/workbench' import { appRedisCommandsSelector } from 'uiSrc/slices/app/redis-commands' @@ -70,6 +70,7 @@ export interface Props { setSelectedValue: (type: WBQueryType, value: string) => void onQueryDelete: () => void onQueryReRun: () => void + onQueryProfile: (type: ProfileQueryType) => void } const getExecutionTimeString = (value: number): string => { @@ -109,6 +110,7 @@ const QueryCardHeader = (props: Props) => { setSelectedValue, onQueryDelete, onQueryReRun, + onQueryProfile, db, } = props @@ -237,6 +239,30 @@ const QueryCardHeader = (props: Props) => { } }) + const profileOptions: EuiSuperSelectOption[] = (getProfileViewTypeOptions() as any[]).map((item) => { + const { value, id, text } = item + return { + value: id ?? value, + inputDisplay: ( +
+ +
+ ), + dropdownDisplay: ( +
+ {truncateText(text, 20)} +
+ ), + 'data-test-subj': `profile-type-option-${value}-${id}`, + } + }) + + const canCommandProfile = isCommandAllowedForProfile(query) + const indexForSeparator = findIndex(pluginsOptions, (option) => !option.internal) if (indexForSeparator > -1) { modifiedOptions.splice(indexForSeparator + 1, 0, { @@ -320,6 +346,26 @@ const QueryCardHeader = (props: Props) => { )} + {isOpen && canCommandProfile && !summaryText && ( + +
+
+ onQueryProfile(value)} + data-testid="run-profile-type" + /> +
+
+
+ )} (