Skip to content

Commit 3cf9b4c

Browse files
committed
Merge remote-tracking branch 'origin/main' into 1.33-releases
2 parents 9364cb3 + fd32f1d commit 3cf9b4c

File tree

11 files changed

+52
-12
lines changed

11 files changed

+52
-12
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
### Checklist
1717
- [ ] New tests and/or benchmarks are included
1818
- [ ] Documentation is changed or added
19+
- [ ] I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)
1920

2021
## Motivation and Context
2122
<!--- Why is this change required? What problem does it solve? -->

THIRD-PARTY-NOTICES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
The following third-party software is used by and included in **compass**.
2-
This document was automatically generated on Thu Sep 08 2022.
2+
This document was automatically generated on Fri Sep 09 2022.
33

44
## List of dependencies
55

packages/compass-collection/src/components/collection-header-actions/collection-header-actions.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const collectionHeaderActionsStyles = css({
1717
display: 'flex',
1818
marginLeft: 'auto',
1919
alignItems: 'center',
20+
overflow: 'hidden',
2021
});
2122

2223
const collectionHeaderActionsReadonlyStyles = css({

packages/compass-collection/src/components/collection-header/collection-header.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ const collectionHeaderStyles = css({
3434
const collectionHeaderTitleStyles = css({
3535
display: 'flex',
3636
alignItems: 'center',
37-
flex: '1 1 100%',
3837
padding: `0 ${String(spacing[3])}px`,
3938
margin: 0,
40-
width: '100%',
39+
overflow: 'hidden',
4140
});
4241

4342
const collectionHeaderDBLinkStyles = css({
@@ -51,7 +50,7 @@ const collectionHeaderDBLinkStyles = css({
5150
},
5251
backgroundColor: 'transparent',
5352
border: 'none',
54-
display: 'inline',
53+
display: 'inline-block',
5554
padding: 0,
5655
});
5756

@@ -69,12 +68,12 @@ const collectionHeaderNamespaceStyles = css({
6968
display: 'flex',
7069
whiteSpace: 'nowrap',
7170
overflow: 'hidden',
72-
textOverflow: 'ellipsis',
7371
});
7472

7573
const collectionHeaderDBNameStyles = css({
76-
display: 'flex',
77-
alignItems: 'center',
74+
overflow: 'hidden',
75+
textOverflow: 'ellipsis',
76+
whiteSpace: 'nowrap',
7877
});
7978

8079
const collectionHeaderDBNameLightStyles = css({

packages/compass-crud/src/components/crud-toolbar.spec.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ const mockQueryBarStore = {
3939
},
4040
};
4141

42+
const testOutdatedMessageId = 'crud-outdated-message-id';
43+
4244
function renderCrudToolbar(
4345
props?: Partial<React.ComponentProps<typeof CrudToolbar>>
4446
) {
@@ -61,6 +63,7 @@ function renderCrudToolbar(
6163
onApplyClicked={noop}
6264
onResetClicked={noop}
6365
openExportFileDialog={noop}
66+
outdated={false}
6467
page={0}
6568
readonly={false}
6669
refreshDocuments={noop}
@@ -241,6 +244,12 @@ describe('CrudToolbar Component', function () {
241244
expect(exportSpy.calledOnce).to.be.true;
242245
});
243246

247+
it('should not render the outdated message', function () {
248+
renderCrudToolbar();
249+
250+
expect(screen.queryByTestId(testOutdatedMessageId)).to.not.exist;
251+
});
252+
244253
describe('when the instance is in a writable state (`isWritable` is true)', function () {
245254
beforeEach(function () {
246255
renderCrudToolbar({
@@ -268,4 +277,16 @@ describe('CrudToolbar Component', function () {
268277
).to.exist;
269278
});
270279
});
280+
281+
describe('when the documents are outdated', function () {
282+
beforeEach(function () {
283+
renderCrudToolbar({
284+
outdated: true,
285+
});
286+
});
287+
288+
it('should render the outdated message', function () {
289+
expect(screen.getByTestId(testOutdatedMessageId)).to.be.visible;
290+
});
291+
});
271292
});

packages/compass-crud/src/components/crud-toolbar.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
css,
1414
spacing,
1515
useId,
16+
WarningSummary,
1617
} from '@mongodb-js/compass-components';
1718

1819
import { AddDataMenu } from './add-data-menu';
@@ -55,10 +56,15 @@ const exportCollectionButtonStyles = css({
5556
whiteSpace: 'nowrap',
5657
});
5758

59+
const OUTDATED_WARNING = `The content is outdated and no longer in sync
60+
with the current query. Press "Find" again to see the results for
61+
the current query.`;
62+
5863
type CrudToolbarProps = {
5964
activeDocumentView: string;
6065
count?: number;
6166
end: number;
67+
error?: Error;
6268
getPage: (page: number) => void;
6369
insertDataHandler: (openInsertKey: 'insert-document' | 'import-file') => void;
6470
instanceDescription: string;
@@ -69,6 +75,7 @@ type CrudToolbarProps = {
6975
onApplyClicked: () => void;
7076
onResetClicked: () => void;
7177
openExportFileDialog: () => void;
78+
outdated: boolean;
7279
page: number;
7380
readonly: boolean;
7481
refreshDocuments: () => void;
@@ -81,6 +88,7 @@ const CrudToolbar: React.FunctionComponent<CrudToolbarProps> = ({
8188
activeDocumentView,
8289
count,
8390
end,
91+
error,
8492
getPage,
8593
insertDataHandler,
8694
instanceDescription,
@@ -91,6 +99,7 @@ const CrudToolbar: React.FunctionComponent<CrudToolbarProps> = ({
9199
onApplyClicked,
92100
onResetClicked,
93101
openExportFileDialog,
102+
outdated,
94103
page,
95104
readonly,
96105
refreshDocuments,
@@ -236,6 +245,12 @@ const CrudToolbar: React.FunctionComponent<CrudToolbarProps> = ({
236245
</SegmentedControl>
237246
</div>
238247
</div>
248+
{outdated && !error && (
249+
<WarningSummary
250+
data-testid="crud-outdated-message-id"
251+
warnings={[OUTDATED_WARNING]}
252+
/>
253+
)}
239254
</Toolbar>
240255
);
241256
};

packages/compass-crud/src/components/document-list.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ class DocumentList extends React.Component {
269269
{useNewToolbars ? (
270270
<CrudToolbar
271271
activeDocumentView={this.props.view}
272+
error={this.props.error}
272273
count={this.props.count}
273274
loadingCount={this.props.loadingCount}
274275
start={this.props.start}
@@ -281,6 +282,7 @@ class DocumentList extends React.Component {
281282
onApplyClicked={this.onApplyClicked.bind(this)}
282283
onResetClicked={this.onResetClicked.bind(this)}
283284
openExportFileDialog={this.props.openExportFileDialog}
285+
outdated={this.props.outdated}
284286
readonly={!this.props.isEditable}
285287
viewSwitchHandler={this.props.viewChanged}
286288
isWritable={this.props.isWritable}

packages/compass-databases-navigation/src/collection-item.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ export const CollectionItem: React.FunctionComponent<
135135
{...hoverProps}
136136
>
137137
<CollectionIcon type={type} />
138-
<ItemLabel className={collectionItemLabel}>{name}</ItemLabel>
138+
<ItemLabel className={collectionItemLabel} title={name}>
139+
{name}
140+
</ItemLabel>
139141
<ItemActionControls<Actions>
140142
className={collectionActions}
141143
onAction={onAction}

packages/compass-databases-navigation/src/database-item.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ export const DatabaseItem: React.FunctionComponent<
181181
? databaseItemLabelNewSpacing
182182
: databaseItemLabelOldSpacing
183183
}
184+
title={name}
184185
>
185186
{name}
186187
</ItemLabel>

packages/compass-sidebar/src/components-legacy/sidebar/navigation-items.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ const navItemButton = css({
3131
backgroundColor: uiColors.gray.dark2,
3232
':hover': {
3333
cursor: 'pointer',
34-
// removed the hover background color change and bolding the text so the old
35-
// sidebar fits with the compass-databases-navigation colour changes.
36-
fontWeight: 'bold',
34+
backgroundColor: uiColors.gray.dark3,
3735
},
3836
});
3937

0 commit comments

Comments
 (0)