Skip to content

Commit

Permalink
Make it so the action craetor for opening the bulk-import-dialgo take…
Browse files Browse the repository at this point in the history
…s the mode.

Part of #688.
  • Loading branch information
jkomoros committed Apr 7, 2024
1 parent 1bcfcae commit a84be87
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
AIModelName,
AuthorsMap,
AutoTODOType,
BulkImportDialogMode,
Card,
CardBooleanMap,
CardDiff,
Expand Down Expand Up @@ -354,6 +355,7 @@ type ActionTurnSuggestedMissingConcepts = {

type ActionBulkImportDialogOpen = {
type: typeof BULK_IMPORT_DIALOG_OPEN
mode: BulkImportDialogMode
};

type ActionBulkImportPending = {
Expand Down
7 changes: 6 additions & 1 deletion src/actions/bulk-import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,17 @@ import {
ThunkSomeAction
} from '../store.js';

import {
BulkImportDialogMode
} from '../types.js';

import {
bulkCreateWorkingNotes
} from './data.js';

export const openBulkImportDialog = () : SomeAction => ({
export const openBulkImportDialog = (mode : BulkImportDialogMode) : SomeAction => ({
type : BULK_IMPORT_DIALOG_OPEN,
mode
});

export const closeBulkImportDialog = () : SomeAction => ({
Expand Down
2 changes: 1 addition & 1 deletion src/components/card-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ class CardView extends connect(store)(PageViewElement) {
}

_handleBulkImportClicked() {
store.dispatch(openBulkImportDialog());
store.dispatch(openBulkImportDialog('import'));
}

_handleEditClicked() {
Expand Down
2 changes: 1 addition & 1 deletion src/reducers/bulk-import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const app = (state : BulkImportState = INITIAL_STATE, action : SomeAction) : Bul
return {
...state,
open: true,
mode: 'import',
mode: action.mode,
pending: false,
bodies: [],
importer: '',
Expand Down

0 comments on commit a84be87

Please sign in to comment.