Skip to content

Commit 06f311d

Browse files
committed
.
1 parent 7074f0f commit 06f311d

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

packages/compass-global-writes/src/components/index.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import ShardKeyCorrect from './states/shard-key-correct';
1515
import ShardKeyInvalid from './states/shard-key-invalid';
1616
import ShardKeyMismatch from './states/shard-key-mismatch';
1717
import ShardingError from './states/sharding-error';
18+
import IncompleteShardingSetup from './states/incomplete-sharding-setup';
1819

1920
const containerStyles = css({
2021
paddingLeft: spacing[400],
@@ -93,6 +94,13 @@ function ShardingStateView({
9394
return <ShardKeyMismatch />;
9495
}
9596

97+
if (
98+
shardingStatus === ShardingStatuses.INCOMPLETE_SHARDING_SETUP ||
99+
shardingStatus === ShardingStatuses.SUBMITTING_FOR_SHARDING_INCOMPLETE
100+
) {
101+
return <IncompleteShardingSetup />;
102+
}
103+
96104
return null;
97105
}
98106

packages/compass-global-writes/src/store/index.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ describe('GlobalWritesStore Store', function () {
341341
});
342342
});
343343

344-
it('valid shard key -> not managed', async function () {
344+
it('valid shard key -> incomplete', async function () {
345345
// initial state === shard key correct
346346
const store = createStore({
347347
isNamespaceManaged: () => true,
@@ -356,7 +356,7 @@ describe('GlobalWritesStore Store', function () {
356356
const promise = store.dispatch(unmanageNamespace());
357357
expect(store.getState().status).to.equal('UNMANAGING_NAMESPACE');
358358
await promise;
359-
expect(store.getState().status).to.equal('UNSHARDED');
359+
expect(store.getState().status).to.equal('INCOMPLETE_SHARDING_SETUP');
360360
});
361361

362362
it('valid shard key -> valid shard key (failed unmanage attempt)', async function () {
@@ -452,7 +452,7 @@ describe('GlobalWritesStore Store', function () {
452452
});
453453
});
454454

455-
it('mismatch -> unmanaged', async function () {
455+
it('mismatch -> incomplete sharding setup', async function () {
456456
// initial state - mismatch
457457
const store = createStore({
458458
isNamespaceManaged: () => true,
@@ -475,7 +475,7 @@ describe('GlobalWritesStore Store', function () {
475475
'UNMANAGING_NAMESPACE_MISMATCH'
476476
);
477477
await promise;
478-
expect(store.getState().status).to.equal('UNSHARDED');
478+
expect(store.getState().status).to.equal('INCOMPLETE_SHARDING_SETUP');
479479
});
480480
});
481481

packages/compass-global-writes/src/store/reducer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ const reducer: Reducer<RootState, Action> = (state = initialState, action) => {
539539
return {
540540
...state,
541541
managedNamespace: undefined,
542-
status: ShardingStatuses.UNSHARDED,
542+
status: ShardingStatuses.INCOMPLETE_SHARDING_SETUP,
543543
};
544544
}
545545

0 commit comments

Comments
 (0)