Skip to content

Commit e539d11

Browse files
committed
rename status val
1 parent 5d0f7c5 commit e539d11

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

packages/compass-collection/src/components/mock-data-generator-modal/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ type MockDataGeneratorIdleState = {
1313
status: 'idle';
1414
};
1515

16-
type MockDataGeneratorGeneratingState = {
17-
status: 'generating';
16+
type MockDataGeneratorInProgressState = {
17+
status: 'in-progress';
1818
requestId: string;
1919
};
2020

@@ -32,6 +32,6 @@ type MockDataGeneratorErrorState = {
3232

3333
export type MockDataGeneratorState =
3434
| MockDataGeneratorIdleState
35-
| MockDataGeneratorGeneratingState
35+
| MockDataGeneratorInProgressState
3636
| MockDataGeneratorCompletedState
3737
| MockDataGeneratorErrorState;

packages/compass-collection/src/modules/collection-tab.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ const reducer: Reducer<CollectionState, Action> = (
382382
}
383383

384384
if (
385-
state.fakerSchemaGeneration.status === 'generating' ||
385+
state.fakerSchemaGeneration.status === 'in-progress' ||
386386
state.fakerSchemaGeneration.status === 'completed'
387387
) {
388388
return state;
@@ -391,7 +391,7 @@ const reducer: Reducer<CollectionState, Action> = (
391391
return {
392392
...state,
393393
fakerSchemaGeneration: {
394-
status: 'generating',
394+
status: 'in-progress',
395395
requestId: action.requestId,
396396
},
397397
};
@@ -403,7 +403,7 @@ const reducer: Reducer<CollectionState, Action> = (
403403
CollectionActions.FakerMappingGenerationCompleted
404404
)
405405
) {
406-
if (state.fakerSchemaGeneration.status !== 'generating') {
406+
if (state.fakerSchemaGeneration.status !== 'in-progress') {
407407
return state;
408408
}
409409

@@ -423,7 +423,7 @@ const reducer: Reducer<CollectionState, Action> = (
423423
CollectionActions.FakerMappingGenerationFailed
424424
)
425425
) {
426-
if (state.fakerSchemaGeneration.status !== 'generating') {
426+
if (state.fakerSchemaGeneration.status !== 'in-progress') {
427427
return state;
428428
}
429429

@@ -581,7 +581,7 @@ export const generateFakerMappings = (
581581
return;
582582
}
583583

584-
if (fakerSchemaGeneration.status === 'generating') {
584+
if (fakerSchemaGeneration.status === 'in-progress') {
585585
logger.debug(
586586
'Faker mapping generation is already in progress, skipping new generation.'
587587
);

packages/compass-collection/src/stores/collection-tab.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ describe('Collection Tab Content store', function () {
474474
const getState = sandbox.stub().returns({
475475
schemaAnalysis: { status: SCHEMA_ANALYSIS_STATE_COMPLETE },
476476
fakerSchemaGeneration: {
477-
status: 'generating',
477+
status: 'in-progress',
478478
},
479479
});
480480
const logger = {
@@ -541,7 +541,7 @@ describe('Collection Tab Content store', function () {
541541
currentStep: MockDataGeneratorStep.SCHEMA_CONFIRMATION,
542542
},
543543
fakerSchemaGeneration: {
544-
status: 'generating',
544+
status: 'in-progress',
545545
requestId: 'existing_id',
546546
},
547547
},
@@ -593,7 +593,7 @@ describe('Collection Tab Content store', function () {
593593
const newState = collectionTabReducer(state, action);
594594

595595
expect(newState.fakerSchemaGeneration).to.deep.equal({
596-
status: 'generating',
596+
status: 'in-progress',
597597
requestId: 'some_request_id',
598598
});
599599

@@ -669,7 +669,7 @@ describe('Collection Tab Content store', function () {
669669
const state: CollectionState = {
670670
...baseState,
671671
fakerSchemaGeneration: {
672-
status: 'generating',
672+
status: 'in-progress',
673673
requestId: 'generating_request_id',
674674
},
675675
};
@@ -743,7 +743,7 @@ describe('Collection Tab Content store', function () {
743743
const state: CollectionState = {
744744
...baseState,
745745
fakerSchemaGeneration: {
746-
status: 'generating',
746+
status: 'in-progress',
747747
requestId: 'generating_request_id',
748748
},
749749
};

0 commit comments

Comments
 (0)