Skip to content

TagSpaces is an offline, open source, document manager with tagging support

improving flow typing

Ilian Sapundshiev989c53de8b62
diff --git a/app/components/TagLibrary.js b/app/components/TagLibrary.js
index e0b39f7b4..885df81bd 100644
--- a/app/components/TagLibrary.js
+++ b/app/components/TagLibrary.js
@@ -85,33 +85,34 @@ type Props = {
};
type State = {
- importExportMenuAnchorEl?: Object | null,
- importExportMenuOpened?: boolean,
- tagGroupMenuAnchorEl?: Object | null,
- tagGroupMenuOpened?: boolean,
- tagMenuAnchorEl?: Object,
- tagMenuOpened?: boolean,
- selectedTagEntry?: TagGroup | null,
- selectedTag?: Tag,
- selectedTagGroupEntry?: TagGroup,
- isCreateTagGroupDialogOpened?: boolean,
- isEditTagGroupDialogOpened?: boolean,
- isDeleteTagGroupDialogOpened?: boolean,
- isCreateTagDialogOpened?: boolean,
- isEditTagDialogOpened?: boolean,
- isDeleteTagDialogOpened?: boolean
+ importExportMenuAnchorEl: Object | null,
+ importExportMenuOpened: boolean,
+ tagGroupMenuAnchorEl: Object | null,
+ tagGroupMenuOpened: boolean,
+ tagMenuAnchorEl: Object,
+ tagMenuOpened: boolean,
+ selectedTagEntry: TagGroup | null,
+ selectedTag: Tag | null,
+ selectedTagGroupEntry: TagGroup | null,
+ isCreateTagGroupDialogOpened: boolean,
+ isEditTagGroupDialogOpened: boolean,
+ isDeleteTagGroupDialogOpened: boolean,
+ isCreateTagDialogOpened: boolean,
+ isEditTagDialogOpened: boolean,
+ isDeleteTagDialogOpened: boolean
};
class TagLibrary extends React.Component<Props, State> {
state = {
tagGroupMenuAnchorEl: null,
tagGroupMenuOpened: false,
- tagMenuAnchorEl: undefined,
+ tagMenuAnchorEl: null,
tagMenuOpened: false,
importExportMenuAnchorEl: null,
importExportMenuOpened: false,
- selectedTagGroupEntry: undefined,
- selectedTag: undefined,
+ selectedTagGroupEntry: null,
+ selectedTagEntry: null,
+ selectedTag: null,
isCreateTagGroupDialogOpened: false,
isEditTagGroupDialogOpened: false,
isDeleteTagGroupDialogOpened: false,
diff --git a/app/components/dialogs/ConfirmDialog.js b/app/components/dialogs/ConfirmDialog.js
index c44dad544..7594fca54 100644
--- a/app/components/dialogs/ConfirmDialog.js
+++ b/app/components/dialogs/ConfirmDialog.js
@@ -32,12 +32,12 @@ type Props = {
open: boolean,
title: string,
content: string,
- cancelDialogTID: string,
- confirmDialogTID: string,
- confirmDialogContentTID: string,
- list: Array<string>,
+ cancelDialogTID?: string,
+ confirmDialogTID?: string,
+ confirmDialogContentTID?: string,
+ list?: Array<string>,
confirmCallback: (result: boolean) => void,
- onClose: () => void
+ onClose: () => void,
};
const ConfirmDialog = (props: Props) => {
@@ -93,4 +93,11 @@ const ConfirmDialog = (props: Props) => {
);
};
+ConfirmDialog.defaultProps = {
+ cancelDialogTID: 'confirmDialogCancelButton',
+ confirmDialogTID: 'confirmDialogOkButton',
+ confirmDialogContentTID: 'confirmDialogContentTID',
+ list: []
+};
+
export default ConfirmDialog;