+
+
+ ),
+ dropdownDisplay: (
+
+
{truncateText(text, 20)}
),
@@ -314,7 +282,6 @@ const QueryCardHeader = (props: Props) => {
className={cx(styles.dropdownOption, styles.dropdownProfileOption)}
>
@@ -350,7 +317,7 @@ const QueryCardHeader = (props: Props) => {
}
return (
-
{}}
@@ -364,7 +331,7 @@ const QueryCardHeader = (props: Props) => {
data-testid="query-card-open"
role="button"
>
-
+
{
-
+
{!!createdAt && (
-
+
)}
{!!message && !isOpen && (
-
+
{truncateText(message, 13)}
)}
{isNumber(executionTime) && (
{
anchorClassName={styles.executionTime}
data-testid="execution-time-tooltip"
>
- <>
+
{getTruncatedExecutionTimeString(executionTime)}
- >
+
)}
- {!hideFields?.includes(HIDE_FIELDS.profiler) && (
-
- {isOpen && canCommandProfile && !summaryText && (
-
- onQueryProfile(value as ProfileQueryType)
- }
- className="profiler"
- options={profileOptions}
- data-testid="run-profile-type"
- valueRender={({ option, isOptionValue }) => {
- if (isOptionValue) {
- return option.dropdownDisplay as JSX.Element
+
+ {!hideFields?.includes(HIDE_FIELDS.profiler) && (
+
+ {isOpen && canCommandProfile && !summaryText && (
+
+ onQueryProfile(value as ProfileQueryType)
}
- return option.inputDisplay as JSX.Element
- }}
- />
- )}
-
- )}
- {!hideFields?.includes(HIDE_FIELDS.viewType) && (
+ className="profiler"
+ options={profileOptions}
+ data-testid="run-profile-type"
+ valueRender={({ option, isOptionValue }) => {
+ if (isOptionValue) {
+ return option.dropdownDisplay as JSX.Element
+ }
+ return option.inputDisplay as JSX.Element
+ }}
+ />
+ )}
+
+ )}
+ {!hideFields?.includes(HIDE_FIELDS.viewType) && (
+
+ {isOpen && options.length > 1 && !summaryText && (
+ {
+ if (isOptionValue) {
+ return option.dropdownDisplay as JSX.Element
+ }
+ return option.inputDisplay as JSX.Element
+ }}
+ value={selectedValue}
+ onChange={(value: string) => onChangeView(value)}
+ className="toggle-view"
+ data-testid="select-view-type"
+ />
+ )}
+
+ )}
- {isOpen && options.length > 1 && !summaryText && (
- {
- if (isOptionValue) {
- return option.dropdownDisplay as JSX.Element
- }
- return option.inputDisplay as JSX.Element
- }}
- value={selectedValue}
- onChange={(value: string) => onChangeView(value)}
- className="toggle-view"
- data-testid="select-view-type"
+ {(isOpen || isFullScreen) && (
+
)}
- )}
-
- {(isOpen || isFullScreen) && (
-
- )}
-
-
-
-
-
-
- {!isFullScreen && (
-
-
+
+
- )}
- {!isFullScreen && (
+ {!isFullScreen && (
+
+
+
+
+
+ )}
+ {!isFullScreen && (
+
+ {!isSilentModeWithoutError(resultsMode, summary?.fail) && (
+
+ )}
+
+ )}
- {!isSilentModeWithoutError(resultsMode, summary?.fail) && (
-
+ {(isRawMode(mode) || isGroupResults(resultsMode)) && (
+
+ {isGroupMode(resultsMode) && (
+
+
+
+ )}
+ {isSilentMode(resultsMode) && (
+
+
+
+ )}
+ {isRawMode(mode) && (
+
+ -r
+
+ )}
+ >
+ }
+ position="bottom"
+ data-testid="parameters-tooltip"
+ >
+
+
)}
- )}
-
- {(isRawMode(mode) || isGroupResults(resultsMode)) && (
-
- {isGroupMode(resultsMode) && (
-
-
-
- )}
- {isSilentMode(resultsMode) && (
-
-
-
- )}
- {isRawMode(mode) && (
-
- -r
-
- )}
- >
- }
- position="bottom"
- data-testid="parameters-tooltip"
- >
-
-
- )}
-
+
-
+
)
}
diff --git a/redisinsight/ui/src/components/query/query-card/QueryCardHeader/styles.module.scss b/redisinsight/ui/src/components/query/query-card/QueryCardHeader/styles.module.scss
index 53195af51c..2aa57af874 100644
--- a/redisinsight/ui/src/components/query/query-card/QueryCardHeader/styles.module.scss
+++ b/redisinsight/ui/src/components/query/query-card/QueryCardHeader/styles.module.scss
@@ -6,8 +6,6 @@ $breakpoint-xl: 1650px;
$marginIcon: 12px;
.container {
- display: flex;
- align-items: center;
height: 45px;
padding: 0 20px;
cursor: pointer;
@@ -19,29 +17,11 @@ $marginIcon: 12px;
}
}
- :global(.euiFlexGroup--gutterLarge > .euiFlexItem) {
- margin: $marginIcon calc($marginIcon/2) !important;
-
- @media (min-width: $breakpoint-m) {
- margin: $marginIcon !important;
- }
- }
-
&.notExpanded {
cursor: default;
}
}
-.isOpen {
- &.container {
- color: var(--euiColorPrimary);
- background-color: var(--tableRowSelectedColor) !important;
- }
-
- .title {
- color: var(--euiColorFullShade) !important;
- }
-}
.title {
display: inline-block;
@@ -118,7 +98,6 @@ $marginIcon: 12px;
.executionTime {
min-width: 13px;
width: 13px;
- display: flex;
@media (min-width: $breakpoint-m) {
min-width: 92px;
@@ -173,21 +152,6 @@ $marginIcon: 12px;
flex-shrink: 0;
}
-.iconDropdownOption {
- width: auto;
- height: 16px;
-}
-
-.iconExecutingTime {
- width: 13px !important;
- height: 13px !important;
- margin-right: 6px;
-
- path {
- fill: var(--iconsDefaultColor);
- }
-}
-
.dropdownOptionSeparator:after {
content: "";
display: block;
@@ -254,13 +218,13 @@ $marginIcon: 12px;
z-index: 2;
}
-.container :global(.euiFlexItem).viewTypeIcon {
+.container :global(.RI-flex-item).viewTypeIcon {
width: 54px;
min-width: 54px;
margin: 0 calc($marginIcon/3) !important;
}
-.container :global(.euiFlexItem).playIcon {
+.container :global(.RI-flex-item).playIcon {
margin-right: calc($marginIcon/3) !important;
}
diff --git a/redisinsight/ui/src/components/query/query-card/QueryCardTooltip/QueryCardTooltip.tsx b/redisinsight/ui/src/components/query/query-card/QueryCardTooltip/QueryCardTooltip.tsx
index 56b1521f99..dc6a3fc897 100644
--- a/redisinsight/ui/src/components/query/query-card/QueryCardTooltip/QueryCardTooltip.tsx
+++ b/redisinsight/ui/src/components/query/query-card/QueryCardTooltip/QueryCardTooltip.tsx
@@ -73,7 +73,7 @@ const QueryCardTooltip = (props: Props) => {
{contentItems}>}
+ content={contentItems}
position="bottom"
>
{
// turn on Raw mode
fireEvent.click(screen.getByTestId('btn-change-mode'))
- expect(sendEventTelemetry).toBeCalledWith({
+ expect(sendEventTelemetry).toHaveBeenCalledWith({
event: TelemetryEvent.WORKBENCH_MODE_CHANGED,
eventData: {
databaseId: INSTANCE_ID_MOCK,
@@ -159,7 +160,7 @@ describe('Telemetry', () => {
// send command without Raw mode
fireEvent.click(screen.getByTestId('btn-submit'))
- expect(sendEventTelemetry).toBeCalledWith({
+ expect(sendEventTelemetry).toHaveBeenCalledWith({
event: TelemetryEvent.WORKBENCH_COMMAND_SUBMITTED,
eventData: {
command: 'INFO',
@@ -184,7 +185,7 @@ describe('Telemetry', () => {
// send command with Raw mode
fireEvent.click(screen.getByTestId('btn-submit'))
- expect(sendEventTelemetry).toBeCalledWith({
+ expect(sendEventTelemetry).toHaveBeenCalledWith({
event: TelemetryEvent.WORKBENCH_COMMAND_SUBMITTED,
eventData: {
command: 'INFO',
@@ -208,7 +209,7 @@ describe('Telemetry', () => {
fireEvent.click(screen.getByTestId('re-run-command'))
- expect(sendEventTelemetry).toBeCalledWith({
+ expect(sendEventTelemetry).toHaveBeenCalledWith({
event: TelemetryEvent.WORKBENCH_COMMAND_RUN_AGAIN,
eventData: {
auto: undefined,
@@ -233,7 +234,7 @@ describe('Telemetry', () => {
fireEvent.click(screen.getByTestId('delete-command'))
- expect(sendEventTelemetry).toBeCalledWith({
+ expect(sendEventTelemetry).toHaveBeenCalledWith({
event: TelemetryEvent.WORKBENCH_CLEAR_RESULT_CLICKED,
eventData: {
databaseId: 'instanceId',
@@ -244,7 +245,7 @@ describe('Telemetry', () => {
fireEvent.click(screen.getByTestId('clear-history-btn'))
- expect(sendEventTelemetry).toBeCalledWith({
+ expect(sendEventTelemetry).toHaveBeenCalledWith({
event: TelemetryEvent.WORKBENCH_CLEAR_ALL_RESULTS_CLICKED,
eventData: {
databaseId: 'instanceId',
@@ -306,21 +307,26 @@ describe('Raw mode', () => {
})
it('check button clickable and selected', async () => {
+ const sendEventTelemetryMock = jest.fn()
+ ;(sendEventTelemetry as jest.Mock).mockImplementation(
+ () => sendEventTelemetryMock,
+ )
+
render()
const btn = screen.getByTestId(/btn-change-mode/)
-
expect(btn).not.toBeDisabled()
- expect(btn).toHaveStyle('background: #000 !important')
-
- fireEvent.click(btn)
-
- expect(btn).toHaveStyle(
- 'background: var(--browserComponentActive) !important',
- )
- fireEvent.click(btn)
+ await userEvent.click(btn)
- expect(btn).toHaveStyle('background: #000 !important')
+ expect(sendEventTelemetry).toHaveBeenCalledWith({
+ event: TelemetryEvent.WORKBENCH_MODE_CHANGED,
+ eventData: {
+ databaseId: INSTANCE_ID_MOCK,
+ changedFromMode: RunQueryMode.ASCII,
+ changedToMode: RunQueryMode.Raw,
+ },
+ })
+ ;(sendEventTelemetry as jest.Mock).mockRestore()
})
})