Skip to content

Commit

Permalink
Merge branch 'main' into COMPASS-7308
Browse files Browse the repository at this point in the history
  • Loading branch information
mcasimir authored Oct 23, 2023
2 parents c1ee866 + 84a3060 commit 409d8ed
Show file tree
Hide file tree
Showing 111 changed files with 5,860 additions and 3,626 deletions.
688 changes: 519 additions & 169 deletions THIRD-PARTY-NOTICES.md

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions configs/eslint-config-compass/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ module.exports = {
'error',
{ root: path.resolve(__dirname, '..', '..') },
],
'no-restricted-syntax': [
'error',
{
selector: 'CallExpression[callee.name="setImmediate"]',
message: 'Use browser-compatible `setTimeout(...)` instead',
},
{
selector:
'CallExpression[callee.object.name="process"][callee.property.name="nextTick"]',
message: 'Use browser-compatible `queueMicrotask(...)` instead',
},
],
},
env: {
...shared.env,
Expand Down
2 changes: 1 addition & 1 deletion configs/eslint-config-compass/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mongodb-js/eslint-config-compass",
"version": "1.0.9",
"version": "1.0.10",
"description": "Shared Compass eslint configuration",
"license": "SSPL",
"main": "index.js",
Expand Down
4 changes: 2 additions & 2 deletions configs/webpack-config-compass/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"email": "[email protected]"
},
"homepage": "https://github.com/mongodb-js/compass",
"version": "1.2.2",
"version": "1.2.3",
"repository": {
"type": "git",
"url": "https://github.com/mongodb-js/compass.git"
Expand Down Expand Up @@ -45,7 +45,7 @@
"reformat": "npm run prettier -- --write . && npm run eslint . --fix"
},
"devDependencies": {
"@mongodb-js/eslint-config-compass": "^1.0.9",
"@mongodb-js/eslint-config-compass": "^1.0.10",
"@mongodb-js/prettier-config-compass": "^1.0.1",
"@mongodb-js/tsconfig-compass": "^1.0.3",
"@types/cli-progress": "^3.9.2",
Expand Down
5,091 changes: 2,525 additions & 2,566 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions packages/atlas-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"email": "[email protected]"
},
"homepage": "https://github.com/mongodb-js/compass",
"version": "0.6.1",
"version": "0.7.0",
"repository": {
"type": "git",
"url": "https://github.com/mongodb-js/compass.git"
Expand Down Expand Up @@ -48,7 +48,7 @@
"reformat": "npm run prettier -- --write . && npm run eslint . --fix"
},
"devDependencies": {
"@mongodb-js/eslint-config-compass": "^1.0.9",
"@mongodb-js/eslint-config-compass": "^1.0.10",
"@mongodb-js/mocha-config-compass": "^1.3.1",
"@mongodb-js/prettier-config-compass": "^1.0.1",
"@mongodb-js/tsconfig-compass": "^1.0.3",
Expand All @@ -69,12 +69,12 @@
"typescript": "^5.0.4"
},
"dependencies": {
"@mongodb-js/compass-components": "^1.15.0",
"@mongodb-js/compass-logging": "^1.2.2",
"@mongodb-js/compass-utils": "^0.5.1",
"@mongodb-js/compass-components": "^1.16.0",
"@mongodb-js/compass-logging": "^1.2.3",
"@mongodb-js/compass-utils": "^0.5.2",
"@mongodb-js/devtools-connect": "^2.4.2",
"@mongodb-js/oidc-plugin": "^0.3.0",
"compass-preferences-model": "^2.15.1",
"compass-preferences-model": "^2.15.2",
"electron": "^25.8.4",
"keytar": "^7.9.0",
"node-fetch": "^2.6.7",
Expand Down
12 changes: 11 additions & 1 deletion packages/atlas-service/src/store/atlas-signin-reducer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,16 @@ describe('atlasSignInReducer', function () {
});

it('should reject if provided signal was aborted', async function () {
let resolveSignInCalled = () => {};
const signInCalled: Promise<void> = new Promise(
(resolve) => (resolveSignInCalled = resolve)
);
const mockAtlasService = {
isAuthenticated: sandbox.stub().resolves(false),
signIn: sandbox.stub().resolves({ sub: '1234' }),
signIn: sandbox.stub().callsFake(() => {
resolveSignInCalled();
return { sub: '1234' };
}),
getUserInfo: sandbox.stub().resolves({ sub: '1234' }),
emit: sandbox.stub(),
};
Expand All @@ -337,6 +344,9 @@ describe('atlasSignInReducer', function () {
expect(err).to.have.property('message', 'Aborted from outside');
}
expect(store.getState()).to.have.property('state', 'canceled');

// Ensure that we are not leaving a dangling store operation that would conflict with our mocks being reset.
await signInCalled;
});
});
});
4 changes: 1 addition & 3 deletions packages/atlas-service/src/store/atlas-signin-reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,7 @@ const startAttempt = (fn: () => void): AtlasSignInThunkAction<AttemptState> => {
// noop for the promise created by `finally`, original promise rejection
// should be handled by the service user
});
setImmediate(function () {
fn();
});
setTimeout(fn);
return attempt;
};
};
Expand Down
8 changes: 4 additions & 4 deletions packages/collection-model/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mongodb-collection-model",
"description": "MongoDB collection model",
"author": "Lucas Hrabovsky <[email protected]>",
"version": "5.12.1",
"version": "5.12.2",
"bugs": {
"url": "https://jira.mongodb.org/projects/COMPASS/issues",
"email": "[email protected]"
Expand Down Expand Up @@ -34,16 +34,16 @@
"mongodb-ns": "^2.4.0"
},
"peerDependencies": {
"mongodb-data-service": "^22.12.1"
"mongodb-data-service": "^22.12.2"
},
"devDependencies": {
"@mongodb-js/eslint-config-compass": "^1.0.9",
"@mongodb-js/eslint-config-compass": "^1.0.10",
"@mongodb-js/prettier-config-compass": "^1.0.1",
"depcheck": "^1.4.1",
"electron-mocha": "^10.1.0",
"eslint": "^7.25.0",
"mocha": "^10.2.0",
"mongodb-data-service": "^22.12.1",
"mongodb-data-service": "^22.12.2",
"xvfb-maybe": "^0.2.1"
}
}
62 changes: 31 additions & 31 deletions packages/compass-aggregations/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@mongodb-js/compass-aggregations",
"productName": "Aggregations plugin",
"version": "9.16.1",
"version": "9.17.0",
"apiVersion": "3.0.0",
"description": "Compass Aggregation Pipeline Builder",
"main": "dist/index.js",
Expand Down Expand Up @@ -38,20 +38,20 @@
},
"license": "SSPL",
"peerDependencies": {
"@mongodb-js/atlas-service": "^0.6.1",
"@mongodb-js/compass-components": "^1.15.0",
"@mongodb-js/compass-crud": "^13.15.1",
"@mongodb-js/compass-editor": "^0.14.1",
"@mongodb-js/compass-generative-ai": "^0.1.0",
"@mongodb-js/compass-logging": "^1.2.2",
"@mongodb-js/compass-user-data": "^0.1.4",
"@mongodb-js/compass-utils": "^0.5.1",
"@mongodb-js/explain-plan-helper": "^1.1.2",
"@mongodb-js/mongodb-constants": "^0.8.5",
"@mongodb-js/mongodb-redux-common": "^2.0.12",
"@mongodb-js/atlas-service": "^0.7.0",
"@mongodb-js/compass-components": "^1.16.0",
"@mongodb-js/compass-crud": "^13.16.0",
"@mongodb-js/compass-editor": "^0.15.0",
"@mongodb-js/compass-generative-ai": "^0.2.0",
"@mongodb-js/compass-logging": "^1.2.3",
"@mongodb-js/compass-user-data": "^0.1.5",
"@mongodb-js/compass-utils": "^0.5.2",
"@mongodb-js/explain-plan-helper": "^1.1.3",
"@mongodb-js/mongodb-constants": "^0.8.6",
"@mongodb-js/mongodb-redux-common": "^2.0.13",
"bson": "^6.0.0",
"compass-preferences-model": "^2.15.1",
"hadron-document": "^8.4.1",
"compass-preferences-model": "^2.15.2",
"hadron-document": "^8.4.2",
"hadron-type-checker": "^7.1.0",
"react": "^17.0.2"
},
Expand All @@ -62,11 +62,11 @@
"@dnd-kit/core": "^6.0.7",
"@dnd-kit/sortable": "^7.0.2",
"@dnd-kit/utilities": "^3.2.1",
"@mongodb-js/eslint-config-compass": "^1.0.9",
"@mongodb-js/eslint-config-compass": "^1.0.10",
"@mongodb-js/mocha-config-compass": "^1.3.1",
"@mongodb-js/prettier-config-compass": "^1.0.1",
"@mongodb-js/tsconfig-compass": "^1.0.3",
"@mongodb-js/webpack-config-compass": "^1.2.2",
"@mongodb-js/webpack-config-compass": "^1.2.3",
"@testing-library/react": "^12.1.4",
"@testing-library/user-event": "^13.5.0",
"@types/lodash": "^4.14.188",
Expand All @@ -77,11 +77,11 @@
"ejson-shell-parser": "^1.2.4",
"enzyme": "^3.11.0",
"eslint": "^7.25.0",
"hadron-app-registry": "^9.0.11",
"hadron-app-registry": "^9.0.12",
"lodash": "^4.17.21",
"mocha": "^10.2.0",
"mongodb": "^6.0.0",
"mongodb-data-service": "^22.12.1",
"mongodb-data-service": "^22.12.2",
"mongodb-ns": "^2.4.0",
"mongodb-query-parser": "^3.1.3",
"mongodb-schema": "^11.2.1",
Expand All @@ -99,20 +99,20 @@
"xvfb-maybe": "^0.2.1"
},
"dependencies": {
"@mongodb-js/atlas-service": "^0.6.1",
"@mongodb-js/compass-components": "^1.15.0",
"@mongodb-js/compass-crud": "^13.15.1",
"@mongodb-js/compass-editor": "^0.14.1",
"@mongodb-js/compass-generative-ai": "^0.1.0",
"@mongodb-js/compass-logging": "^1.2.2",
"@mongodb-js/compass-user-data": "^0.1.4",
"@mongodb-js/compass-utils": "^0.5.1",
"@mongodb-js/explain-plan-helper": "^1.1.2",
"@mongodb-js/mongodb-constants": "^0.8.5",
"@mongodb-js/mongodb-redux-common": "^2.0.12",
"@mongodb-js/atlas-service": "^0.7.0",
"@mongodb-js/compass-components": "^1.16.0",
"@mongodb-js/compass-crud": "^13.16.0",
"@mongodb-js/compass-editor": "^0.15.0",
"@mongodb-js/compass-generative-ai": "^0.2.0",
"@mongodb-js/compass-logging": "^1.2.3",
"@mongodb-js/compass-user-data": "^0.1.5",
"@mongodb-js/compass-utils": "^0.5.2",
"@mongodb-js/explain-plan-helper": "^1.1.3",
"@mongodb-js/mongodb-constants": "^0.8.6",
"@mongodb-js/mongodb-redux-common": "^2.0.13",
"bson": "^6.0.0",
"compass-preferences-model": "^2.15.1",
"hadron-document": "^8.4.1",
"compass-preferences-model": "^2.15.2",
"hadron-document": "^8.4.2",
"hadron-type-checker": "^7.1.0"
},
"homepage": "https://github.com/mongodb-js/compass",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import BasicGroupUseCase from './group/basic-group';
import GroupWithStatistics from './group/group-with-statistics';
import MatchUseCase from './match/match';
import GroupWithSubset from './group/group-with-subset';
import TextSearch from './search/text-search';
import type { FieldSchema } from '../../../utils/get-schema';

export type StageWizardFields = FieldSchema[];
Expand All @@ -21,6 +22,7 @@ export type StageWizardUseCase = {
stageOperator: string;
wizardComponent: React.FunctionComponent<WizardComponentProps>;
serverVersion?: string;
isAtlasOnly?: boolean;
};

export const STAGE_WIZARD_USE_CASES: StageWizardUseCase[] = [
Expand Down Expand Up @@ -63,10 +65,17 @@ export const STAGE_WIZARD_USE_CASES: StageWizardUseCase[] = [
},
{
id: 'group-with-subset',
title: 'Return a subset of values based on their order or rank',
title: 'Return a subset of values based on their order or rank',
stageOperator: '$group',
wizardComponent: GroupWithSubset,
},
{
id: 'text-search',
title: 'Search for a text field across all documents in a collection',
stageOperator: '$search',
wizardComponent: TextSearch,
isAtlasOnly: true,
},
];

export { UseCaseCard };
Loading

0 comments on commit 409d8ed

Please sign in to comment.