Skip to content

Commit 75eea68

Browse files
Anemymcasimir
andauthored
fix(compass-shell): Show mongosh version in help panel, increase panel height, update text COMPASS-4844 (#2333)
* Show mongosh version in help panel, increase size of the panel, tweak type * remove beta * update mongosh product naming * update test for new type * fix capital letter in description * fix capital letter in description * revert uppercase * revert uppercase Co-authored-by: Maurizio Casimirri <[email protected]>
1 parent a75da27 commit 75eea68

File tree

7 files changed

+28
-23
lines changed

7 files changed

+28
-23
lines changed

packages/compass-shell/src/components/compass-shell/compass-shell.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const resizeableDirections = {
2222
topLeft: false
2323
};
2424

25-
const defaultShellHeightClosed = 24;
25+
const defaultShellHeightClosed = 32;
2626
const defaultShellHeightOpened = 240;
2727

2828
export class CompassShell extends Component {

packages/compass-shell/src/components/compass-shell/compass-shell.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ describe('CompassShell', () => {
126126
});
127127

128128
context('when it is clicked to collapse', () => {
129-
it('sets the collapsed height to 24', () => {
129+
it('sets the collapsed height to 32', () => {
130130
const shell = new CompassShell({ isExpanded: true });
131131
let sizeSetTo = {};
132132
shell.resizableRef = {
@@ -141,7 +141,7 @@ describe('CompassShell', () => {
141141

142142
expect(sizeSetTo).to.deep.equal({
143143
width: '100%',
144-
height: 24
144+
height: 32
145145
});
146146
});
147147

packages/compass-shell/src/components/info-modal/info-modal.jsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,42 @@ import PropTypes from 'prop-types';
33
import React, { PureComponent } from 'react';
44
import { Modal } from 'react-bootstrap';
55
import { connect } from 'react-redux';
6+
import packageJson from '../../../package.json';
67

78
import { SET_SHOW_INFO_MODAL } from '../../modules/info-modal';
89

10+
const mongoshVersion = `v${packageJson.dependencies['@mongosh/browser-repl'].replace('^', '')}`;
11+
912
import styles from './info-modal.less';
1013

1114
const hotkeys = [
1215
{
1316
key: 'Ctrl+A',
14-
description: 'Moves the cursor to the begining of the line.'
17+
description: 'Moves the cursor to the beginning of the line.'
1518
},
1619
{
1720
key: 'Ctrl+B',
18-
description: 'Moves the cursor backwards one character.'
21+
description: 'Moves the cursor Backward one character.'
1922
},
2023
{
2124
key: 'Ctrl+C',
2225
description: 'Stop currently running command.'
2326
},
2427
{
2528
key: 'Ctrl+D',
26-
description: 'Erases the next character.'
29+
description: 'Deletes the next character.'
2730
},
2831
{
2932
key: 'Ctrl+E',
3033
description: 'Moves the cursor to the end of the line.'
3134
},
3235
{
3336
key: 'Ctrl+F',
34-
description: 'Moves the cursor forwards one character.'
37+
description: 'Moves the cursor Forward one character.'
3538
},
3639
{
3740
key: 'Ctrl+H',
38-
description: 'Erases one character. Similar to hitting backspace.'
41+
description: 'Erases one character, similar to hitting backspace.'
3942
},
4043
{
4144
key: 'Ctrl+L',
@@ -47,7 +50,7 @@ const hotkeys = [
4750
},
4851
{
4952
key: 'Ctrl+U',
50-
description: 'Changes the line to uppercase.'
53+
description: 'Changes the line to Uppercase.'
5154
}
5255
];
5356

@@ -74,18 +77,18 @@ export class InfoModal extends PureComponent {
7477
return (
7578
<Modal show={isInfoModalVisible}>
7679
<Modal.Header closeButton onHide={hideInfoModal}>
77-
<h4>MongoSH Beta</h4>
80+
<h4>mongosh {mongoshVersion}</h4>
7881
</Modal.Header>
7982
<Modal.Body>
8083
<div className={styles['info-modal-banner']}>
81-
More information on this release of&nbsp;
84+
More information on this release of the&nbsp;
8285
<a
8386
className={styles['info-modal-banner-link']}
8487
id="mongosh-info-link"
8588
rel="noreopener"
8689
href="https://docs.mongodb.com/compass/beta/embedded-shell/"
8790
target="_blank"
88-
>MongoSH Beta</a>
91+
>MongoDB Shell</a>
8992
</div>
9093
<div className={styles['info-modal-shortcuts-title']}>
9194
Keyboard Shortcuts

packages/compass-shell/src/components/info-modal/info-model.spec.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ describe('InfoModal [Component]', () => {
2121
});
2222

2323
it('renders the title text', () => {
24-
expect(component.find('h4')).to.have.text(
25-
'MongoSH Beta'
26-
);
24+
const title = component.find('h4').text();
25+
const hasVersionZero = title.includes('mongosh v0.');
26+
const hasVersionOne = title.includes('mongosh v1.');
27+
const titleIsAccurate = hasVersionZero || hasVersionOne;
28+
expect(titleIsAccurate).to.equal(true);
2729
});
2830

2931
it('renders the hotkeys key', () => {
@@ -34,7 +36,7 @@ describe('InfoModal [Component]', () => {
3436

3537
it('renders the hotkeys description', () => {
3638
expect(component.find(`.${styles['info-modal-shortcuts-hotkey']}`).at(5)).to.have.text(
37-
'Ctrl+FMoves the cursor forwards one character.'
39+
'Ctrl+FMoves the cursor Forward one character.'
3840
);
3941
});
4042
});

packages/compass-shell/src/components/resize-handle/resize-handle.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
left: -@handle-half-width-width-padding;
1111
margin-left: 50%;
1212
width: @handle-width-with-padding;
13-
height: 24px;
13+
height: 32px;
1414
}
1515

1616
.resize-handle::after {
1717
content: "";
1818
position: absolute;
1919
left: -@handle-half-width;
20-
top: 8px;
20+
top: 12px;
2121
margin-left: 50%;
2222
margin-top: 4px;
2323
width: @handle-width;

packages/compass-shell/src/components/shell-header/shell-header.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class ShellHeader extends Component {
3838
className={styles['compass-shell-header-toggle']}
3939
onClick={onShellToggleClicked}
4040
>
41-
&gt;_MongoSH
41+
&gt;_MONGOSH
4242
{!isExpanded && isOperationInProgress && (
4343
<>
4444
<ShellLoader

packages/compass-shell/src/components/shell-header/shell-header.less

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
.compass-shell-header {
44
width: 100%;
5-
height: 24px;
5+
height: 32px;
66
display: flex;
77
color: @leafygreen__gray--light-1;
88

@@ -12,6 +12,8 @@
1212

1313
&-right-actions {
1414
display: flex;
15+
padding-top: 2px;
16+
padding-right: 4px;
1517
}
1618

1719
&-toggle {
@@ -27,7 +29,7 @@
2729
margin: auto 0;
2830
font-weight: bold;
2931
font-size: 12px;
30-
line-height: 24px;
32+
line-height: 32px;
3133

3234
transition: all 200ms;
3335
user-select: none;
@@ -51,7 +53,5 @@
5153

5254
&-btn {
5355
margin-right: 4px;
54-
width: 24px;
55-
height: 24px;
5656
}
5757
}

0 commit comments

Comments
 (0)