Skip to content

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

improving typescript support

Ilian Sapundshiev5cba438c7658
diff --git a/app/components/EntryContainer.tsx b/app/components/EntryContainer.tsx
index 18e3ad287..edb056e2a 100644
--- a/app/components/EntryContainer.tsx
+++ b/app/components/EntryContainer.tsx
@@ -1,4 +1,3 @@
-// @ts-nocheck
/**
* TagSpaces - universal file and folder organizer
* Copyright (C) 2017-present TagSpaces UG (haftungsbeschraenkt)
@@ -914,6 +913,7 @@ class EntryContainer extends React.Component<Props, State> {
resetState = key => {
// this.isPropertiesEditMode = false;
+ // @ts-ignore
this.setState({
[key]: uuidv1()
});
@@ -1116,7 +1116,7 @@ class EntryContainer extends React.Component<Props, State> {
className={classes.fileBadge}
style={{ backgroundColor: currentEntry.color }}
>
- {extractFileExtension(currentEntry.path)}
+ {'.' + extractFileExtension(currentEntry.path)}
</div>
{currentEntry.changed
? String.fromCharCode(0x25cf) + ' '
@@ -1230,8 +1230,6 @@ class EntryContainer extends React.Component<Props, State> {
renameFile={this.props.renameFile}
renameDirectory={this.props.renameDirectory}
editTagForEntry={this.props.editTagForEntry}
- settings={this.props.settings}
- deleteFile={this.props.deleteFile}
shouldCopyFile={this.state.shouldCopyFile}
normalizeShouldCopyFile={() =>
this.setState({ shouldCopyFile: false })
@@ -1317,4 +1315,5 @@ function mapActionCreatorsToProps(dispatch) {
export default connect(
mapStateToProps,
mapActionCreatorsToProps
+ // @ts-ignore
)(withStyles(styles, { withTheme: true })(EntryContainer));
diff --git a/app/components/EntryProperties.tsx b/app/components/EntryProperties.tsx
index 79ddff360..f9e44a2ac 100644
--- a/app/components/EntryProperties.tsx
+++ b/app/components/EntryProperties.tsx
@@ -1,4 +1,3 @@
-// @ts-nocheck
/**
* TagSpaces - universal file and folder organizer
* Copyright (C) 2017-present TagSpaces UG (haftungsbeschraenkt)
@@ -50,6 +49,7 @@ import {
replaceThumbnailURLPromise,
getThumbnailURLPromise
} from '../services/thumbsgenerator';
+import { Tag, TagGroup } from '-/reducers/taglibrary';
// import { actions as AppActions } from '../reducers/app';
const ThumbnailChooserDialog =
@@ -168,9 +168,9 @@ interface Props {
showNotification: (message: string) => void;
reflectUpdateSidecarMeta: (path: string, entryMeta: Object) => void;
updateThumbnailUrl: (path: string, thumbUrl: string) => void;
- addTags: () => void;
- removeTags: () => void;
- removeAllTags: () => void;
+ addTags: (paths: Array<string>, tags: Array<Tag>) => void;
+ removeTags: (paths: Array<string>, tags: Array<Tag>) => void;
+ removeAllTags: (paths: Array<string>) => void;
resetState: (stateName: string) => void;
isReadOnlyMode: boolean;
setPropertiesEditMode: (editMode: boolean) => void;
@@ -183,9 +183,12 @@ interface State {
color: string;
path: string;
size: number;
- tag: any;
+ ldtm: string;
+ tags: Array<Tag>;
tagMenuAnchorEl: boolean | null;
tagMenuOpened: boolean | null;
+ selectedTag: Tag;
+ selectedTagGroupEntry?: TagGroup;
isEditTagDialogOpened: boolean | null;
isDeleteTagDialogOpened: boolean;
isFileThumbChooseDialogOpened: boolean;
@@ -205,6 +208,8 @@ class EntryProperties extends Component<Props, State> {
size: 0,
color: '#3498db',
path: '',
+ ldtm: '',
+ tags: [],
tagMenuAnchorEl: null,
tagMenuOpened: false,
selectedTag: null,
@@ -215,6 +220,7 @@ class EntryProperties extends Component<Props, State> {
isMoveCopyFilesDialogOpened: false,
isFileThumbChooseDialogOpened: false,
displayColorPicker: false,
+ thumbPath: '',
isFile: false
};
@@ -248,6 +254,7 @@ class EntryProperties extends Component<Props, State> {
path: entryProps.path,
size: entryProps.size,
tags: entryProps.tags,
+ // @ts-ignore
ldtm: entryProps.lmdt
? new Date(entryProps.lmdt)
.toISOString()
@@ -479,7 +486,7 @@ class EntryProperties extends Component<Props, State> {
});
};
- handleTagMenu = (event: any, tag, tagGroup) => {
+ handleTagMenu = (event: any, tag: Tag, tagGroup: TagGroup) => {
this.setState({
tagMenuOpened: true,
tagMenuAnchorEl: event.currentTarget,
@@ -490,11 +497,12 @@ class EntryProperties extends Component<Props, State> {
handleCloseTagMenu = () => this.setState({ tagMenuOpened: false });
- handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {
+ handleInputChange = (event: any) => {
const target = event.target;
const value = target.type === 'checkbox' ? target.checked : target.value;
const name = target.name;
+ // @ts-ignore
this.setState({ [name]: value });
};
@@ -924,7 +932,7 @@ class EntryProperties extends Component<Props, State> {
className={classNames(classes.entryLabel, classes.header)}
onClick={this.toggleThumbFilesDialog}
role="button"
- tabIndex="0"
+ tabIndex={0}
style={{
backgroundSize: 'cover',
backgroundImage: thumbPathUrl,
@@ -948,7 +956,6 @@ class EntryProperties extends Component<Props, State> {
selectedTag={selectedTag}
currentEntryPath={entryPath}
removeTags={removeTags}
- editTagForEntry={editTagForEntry}
/>
<MoveCopyFilesDialog
key={uuidv1()}
diff --git a/app/components/FolderContainer.tsx b/app/components/FolderContainer.tsx
index c779da048..6bacef439 100644
--- a/app/components/FolderContainer.tsx
+++ b/app/components/FolderContainer.tsx
@@ -1,4 +1,3 @@
-// @ts-nocheck
/**
* TagSpaces - universal file and folder organizer
* Copyright (C) 2017-present TagSpaces UG (haftungsbeschraenkt)
@@ -102,7 +101,7 @@ const WelcomePanelAsync = props => (
</React.Suspense>
);
-const CounterBadge = withStyles(theme => ({
+const CounterBadge: any = withStyles(theme => ({
badge: {
top: '50%',
right: -15,
@@ -277,7 +276,7 @@ class FolderContainer extends React.Component<Props, State> {
return null;
}
- openDirectoryMenu = (event: React.ChangeEvent<HTMLInputElement>) => {
+ openDirectoryMenu = (event: any) => {
this.setState({
directoryContextMenuOpened: true,
directoryContextMenuAnchorEl: event ? event.currentTarget : null
@@ -540,4 +539,5 @@ function mapActionCreatorsToProps(dispatch) {
export default connect(
mapStateToProps,
mapActionCreatorsToProps
+ // @ts-ignore
)(withStyles(styles)(FolderContainer));
diff --git a/app/components/LocationManager.tsx b/app/components/LocationManager.tsx
index 9ea38e32f..ef103bf9e 100644
--- a/app/components/LocationManager.tsx
+++ b/app/components/LocationManager.tsx
@@ -1,4 +1,4 @@
-// @ts-nocheck
+// @ts-nocheck @ts-ignore
/**
* TagSpaces - universal file and folder organizer
* Copyright (C) 2017-present TagSpaces UG (haftungsbeschraenkt)
@@ -95,7 +95,7 @@ interface Props {
openDirectory: (path: string) => void;
showInFileManager: (path: string) => void;
createDirectoryIndex: (path: string) => void;
- addLocation: (location: Location, openAfterCreate: boolean) => void;
+ addLocation: (location: Location, openAfterCreate?: boolean) => void;
editLocation: () => void;
moveLocationUp: (locationId: string) => void;
moveLocationDown: (locationId: string) => void;
@@ -104,6 +104,7 @@ interface Props {
// renameDirectory: (directoryPath: string, newDirectoryName: string) => void,
reflectCreateEntry: (path: string, isFile: boolean) => void;
deleteDirectory: (directoryPath: string) => void;
+ showUnixHiddenEntries: boolean;
showNotification: (
text: string,
notificationType: string,
@@ -225,6 +226,7 @@ class LocationManager extends React.Component<Props, State> {
getDirectoriesTree = (subFolder: SubFolder, deepLevel: number) =>
// const { settings } = getState();
PlatformIO.listDirectoryPromise(subFolder.path, false)
+ // @ts-ignore
.then(dirEntries => {
const directoryContent = [];
dirEntries.map(entry => {
@@ -269,7 +271,7 @@ class LocationManager extends React.Component<Props, State> {
getMergedDirsCopy = (path: string, arrChildren: Array<SubFolder>) => {
const entries = Object.entries(this.state.dirs);
for (const [uuid, arrSubDirs] of entries) {
- const arr: number = arrSubDirs.length;
+ const arr: number = (arrSubDirs as Array<any>).length;
let a;
for (a = 0; a < arr; a += 1) {
if (path === arrSubDirs[a].path) {
@@ -463,7 +465,7 @@ class LocationManager extends React.Component<Props, State> {
});
};
- handleLocationContextMenuClick = (event: Object, location: Location) => {
+ handleLocationContextMenuClick = (event: any, location: Location) => {
event.preventDefault();
event.stopPropagation();
this.setState({
@@ -509,6 +511,7 @@ class LocationManager extends React.Component<Props, State> {
};
resetState = dialogKey => {
+ // @ts-ignore
this.setState({
[dialogKey]: uuidv1()
});
@@ -580,6 +583,7 @@ class LocationManager extends React.Component<Props, State> {
renderBodyCell = props => (
<td {...props} style={{ position: 'relative' }}>
<TargetMoveFileBox
+ // @ts-ignore
accepts={[DragItemTypes.FILE]}
onDrop={this.handleFileMoveDrop}
>
@@ -620,8 +624,8 @@ class LocationManager extends React.Component<Props, State> {
// expandIcon={this.CustomExpandIcon}
// expandIconAsCell
/* onRow={(record, index) => ({
- onClick: this.onRowClick.bind(null, record, index),
- })} */
+ onClick: this.onRowClick.bind(null, record, index),
+ })} */
/>
);
}
@@ -698,7 +702,7 @@ class LocationManager extends React.Component<Props, State> {
);
};
- handleLocationManagerMenu = (event: React.ChangeEvent<HTMLInputElement>) => {
+ handleLocationManagerMenu = (event: any) => {
this.setState({
locationManagerMenuOpened: true,
locationManagerMenuAnchorEl: event.currentTarget
@@ -712,17 +716,18 @@ class LocationManager extends React.Component<Props, State> {
render() {
const classes = this.props.classes;
return (
- <div className={classes.panel} style={this.props.style}>
+ <div className={classes.panel}>
<CustomLogo />
<div className={classes.toolbar}>
<Typography
className={classNames(classes.panelTitle, classes.header)}
- type="subtitle1"
+ variant="subtitle1"
>
{i18n.t('core:locationManager')}
</Typography>
<IconButton
data-tid="locationManagerMenu"
+ // @ts-ignore
onClick={this.handleLocationManagerMenu}
>
<MoreVertIcon />
@@ -758,9 +763,7 @@ class LocationManager extends React.Component<Props, State> {
open={this.state.isCreateLocationDialogOpened}
onClose={this.handleCloseDialogs}
addLocation={this.props.addLocation}
- perspectives={this.props.perspectives}
showSelectDirectoryDialog={this.showSelectDirectoryDialog}
- selectedDirectoryPath={this.state.selectedDirectoryPath}
/>
<EditLocationDialog
key={this.state.editLocationDialogKey}
@@ -769,7 +772,6 @@ class LocationManager extends React.Component<Props, State> {
onClose={this.handleCloseDialogs}
location={this.state.selectedLocation}
editLocation={this.props.editLocation}
- perspectives={this.props.perspectives}
showSelectDirectoryDialog={this.showSelectDirectoryDialog}
selectedDirectoryPath={this.state.selectedDirectoryPath}
/>
@@ -871,6 +873,7 @@ class LocationManager extends React.Component<Props, State> {
data-tid="locationList"
style={{
maxHeight: 'calc(100vh - 150px)',
+ // @ts-ignore
overflowY: AppConfig.isFirefox ? 'auto' : 'overlay'
}}
>
@@ -883,14 +886,11 @@ class LocationManager extends React.Component<Props, State> {
anchorEl={this.state.directoryContextMenuAnchorEl}
directoryPath={this.state.selectedDirectoryPath}
loadDirectoryContent={this.props.loadDirectoryContent}
- openFileNatively={this.props.openFileNatively}
openDirectory={this.props.openDirectory}
- showInFileManager={this.props.showInFileManager}
openFile={this.props.openFile}
reflectCreateEntry={this.props.reflectCreateEntry}
deleteDirectory={this.props.deleteDirectory}
classes={this.props.classes}
- showNotification={this.props.showNotification}
/>
</div>
);
@@ -930,5 +930,6 @@ function mapDispatchToProps(dispatch) {
}
export default withStyles(styles)(
+ // @ts-ignore
connect(mapStateToProps, mapDispatchToProps)(LocationManager)
);
diff --git a/app/components/dialogs/CreateLocationDialog.tsx b/app/components/dialogs/CreateLocationDialog.tsx
index 8572778b6..4e518034c 100644
--- a/app/components/dialogs/CreateLocationDialog.tsx
+++ b/app/components/dialogs/CreateLocationDialog.tsx
@@ -1,4 +1,3 @@
-// @ts-nocheck
/**
* TagSpaces - universal file and folder organizer
* Copyright (C) 2017-present TagSpaces UG (haftungsbeschraenkt)
@@ -40,7 +39,7 @@ import { Pro } from '-/pro';
import ObjectStoreForm from './ObjectStoreForm';
import LocalForm from './LocalForm';
-const styles = theme => ({
+const styles: any = theme => ({
root: {
display: 'flex'
},
@@ -60,7 +59,7 @@ interface Props {
fullScreen: boolean;
addLocation: (location: Location) => void;
showSelectDirectoryDialog: () => void;
- resetState: () => void;
+ resetState: (stateMember: string) => void;
}
interface State {
@@ -69,12 +68,23 @@ interface State {
disableConfirmButton: boolean;
name: string;
path: string;
- perspective?: string;
+ perspective: string;
isDefault: boolean;
isReadOnly: boolean;
watchForChanges: boolean;
persistIndex: boolean;
fullTextIndex: boolean;
+ storeName: string;
+ cloudErrorTextName: string;
+ cloudErrorAccessKey: string;
+ cloudErrorSecretAccessKey: string;
+ cloudErrorBucketName: string;
+ cloudErrorRegion: string;
+ accessKeyId: string;
+ secretAccessKey: string;
+ bucketName: string;
+ region?: any;
+ storePath: string;
type: string;
}
@@ -91,6 +101,17 @@ class CreateLocationDialog extends React.Component<Props, State> {
watchForChanges: Pro,
persistIndex: false,
fullTextIndex: false,
+ storeName: '',
+ cloudErrorTextName: '',
+ cloudErrorAccessKey: '',
+ cloudErrorSecretAccessKey: '',
+ cloudErrorBucketName: '',
+ cloudErrorRegion: '',
+ accessKeyId: '',
+ secretAccessKey: '',
+ bucketName: '',
+ region: undefined,
+ storePath: '',
type: locationType.TYPE_LOCAL
};
@@ -100,6 +121,7 @@ class CreateLocationDialog extends React.Component<Props, State> {
const name = target.name;
if (target.type === 'radio') {
// type is changed (skip validation)
+ // @ts-ignore
this.setState({
[name]: value
});
@@ -110,6 +132,7 @@ class CreateLocationDialog extends React.Component<Props, State> {
handleChange = (name, value) => {
this.setState(
+ // @ts-ignore
{
[name]: value
},
@@ -147,6 +170,7 @@ class CreateLocationDialog extends React.Component<Props, State> {
return new Promise(resolve =>
this.setState(
{ errorTextName, errorTextPath, disableConfirmButton },
+ // @ts-ignore
resolve(!disableConfirmButton)
)
);
@@ -244,9 +268,9 @@ class CreateLocationDialog extends React.Component<Props, State> {
return new Promise(resolve =>
this.setState(
+ // @ts-ignore
{
cloudErrorTextName,
- // cloudErrorTextPath,
cloudErrorAccessKey,
cloudErrorSecretAccessKey,
cloudErrorBucketName,
@@ -263,6 +287,7 @@ class CreateLocationDialog extends React.Component<Props, State> {
}
onConfirm = () => {
+ // @ts-ignore
this.handleValidation()
.then(success => {
if (success) {
@@ -357,6 +382,7 @@ class CreateLocationDialog extends React.Component<Props, State> {
title={
Pro ? '' : i18n.t('core:thisFunctionalityIsAvailableInPro')
}
+ // @ts-ignore
component="label"
aria-label={i18n.t('core:locationType')}
name="type"
diff --git a/app/components/dialogs/EditLocationDialog.tsx b/app/components/dialogs/EditLocationDialog.tsx
index 7174f5768..32f56e6fa 100644
--- a/app/components/dialogs/EditLocationDialog.tsx
+++ b/app/components/dialogs/EditLocationDialog.tsx
@@ -1,4 +1,3 @@
-// @ts-nocheck
/**
* TagSpaces - universal file and folder organizer
* Copyright (C) 2017-present TagSpaces UG (haftungsbeschraenkt)
@@ -41,30 +40,37 @@ import { Pro } from '-/pro';
interface Props {
open: boolean;
- fullScreen: boolean;
- resetState: () => void;
+ fullScreen?: boolean;
+ resetState: (param: string) => void;
onClose: () => void;
location: Location | null;
editLocation: (location: Location) => void;
showSelectDirectoryDialog: () => void;
selectedDirectoryPath: string | null;
- onCancel: () => void;
+ onCancel?: () => void;
}
interface State {
errorTextPath: boolean;
errorTextName: boolean;
disableConfirmButton: boolean;
- // openDirectoryButtonDisabled?: boolean,
+ cloudErrorTextName: string;
+ cloudErrorBucketName: string;
+ cloudErrorRegion: string;
uuid: string;
name: string;
path: string;
- perspective: '';
isDefault: boolean;
isReadOnly: boolean;
watchForChanges: boolean;
fullTextIndex: boolean;
persistIndex: boolean;
+ storeName: string;
+ accessKeyId: string;
+ secretAccessKey: string;
+ bucketName: string;
+ region?: any;
+ storePath: string;
type: string;
}
@@ -73,16 +79,23 @@ class EditLocationDialog extends React.Component<Props, State> {
errorTextPath: false,
errorTextName: false,
disableConfirmButton: true,
- // openDirectoryButtonDisabled: false,
+ cloudErrorTextName: '',
+ cloudErrorBucketName: '',
+ cloudErrorRegion: '',
uuid: '',
name: '',
path: '',
- perspective: '',
isDefault: false,
isReadOnly: false,
watchForChanges: false,
persistIndex: false,
fullTextIndex: false,
+ storeName: '',
+ accessKeyId: '',
+ secretAccessKey: '',
+ bucketName: '',
+ region: undefined,
+ storePath: '',
type: locationType.TYPE_LOCAL
};
@@ -126,6 +139,7 @@ class EditLocationDialog extends React.Component<Props, State> {
const name = target.name;
if (target.type === 'radio') {
// type is changed (skip validation)
+ // @ts-ignore
this.setState({
[name]: value
});
@@ -136,6 +150,7 @@ class EditLocationDialog extends React.Component<Props, State> {
handleChange = (name, value) => {
this.setState(
+ // @ts-ignore
{
[name]: value
},
@@ -184,11 +199,9 @@ class EditLocationDialog extends React.Component<Props, State> {
disableConfirmButton = true;
}
+ // @ts-ignore
this.setState({
cloudErrorTextName,
- // cloudErrorTextPath,
- // cloudErrorAccessKey,
- // cloudErrorSecretAccessKey,
cloudErrorBucketName,
disableConfirmButton,
cloudErrorRegion
@@ -238,7 +251,6 @@ class EditLocationDialog extends React.Component<Props, State> {
type: locationType.TYPE_LOCAL,
name: this.state.name,
paths: [this.state.path],
- perspective: this.state.perspective,
isDefault: this.state.isDefault,
isReadOnly: this.state.isReadOnly,
persistIndex: this.state.persistIndex,
@@ -255,7 +267,6 @@ class EditLocationDialog extends React.Component<Props, State> {
secretAccessKey: this.state.secretAccessKey,
bucketName: this.state.bucketName,
region: this.state.region.value,
- perspective: this.state.perspective,
isDefault: this.state.isDefault,
isReadOnly: this.state.isReadOnly,
persistIndex: this.state.persistIndex,
@@ -309,6 +320,7 @@ class EditLocationDialog extends React.Component<Props, State> {
title={
Pro ? '' : i18n.t('core:thisFunctionalityIsAvailableInPro')
}
+ // @ts-ignore
component="label"
aria-label={i18n.t('core:locationType')}
name="type"
diff --git a/app/components/dialogs/LocalForm.tsx b/app/components/dialogs/LocalForm.tsx
index 2c05ea167..8c02dc1e5 100644
--- a/app/components/dialogs/LocalForm.tsx
+++ b/app/components/dialogs/LocalForm.tsx
@@ -34,7 +34,7 @@ import PlatformIO from '-/services/platform-io';
interface Props {
state: any;
handleChange: (param1: string, param2: string) => void;
- handleInputChange: () => void;
+ handleInputChange: (event: any) => void;
showSelectDirectoryDialog: () => void;
}
diff --git a/app/components/dialogs/ObjectStoreForm.tsx b/app/components/dialogs/ObjectStoreForm.tsx
index 8492ad762..6e86195f2 100644
--- a/app/components/dialogs/ObjectStoreForm.tsx
+++ b/app/components/dialogs/ObjectStoreForm.tsx
@@ -204,7 +204,7 @@ const components = {
interface Props {
state: any;
handleChange: (name: string, value: any) => void;
- handleInputChange: () => void;
+ handleInputChange: (event: any) => void;
classes: any;
theme: any;
}
diff --git a/app/components/dialogs/SelectDirectoryDialog.tsx b/app/components/dialogs/SelectDirectoryDialog.tsx
index 7f116318b..5c88f3a33 100644
--- a/app/components/dialogs/SelectDirectoryDialog.tsx
+++ b/app/components/dialogs/SelectDirectoryDialog.tsx
@@ -1,4 +1,3 @@
-// @ts-nocheck
/**
* TagSpaces - universal file and folder organizer
* Copyright (C) 2017-present TagSpaces UG (haftungsbeschraenkt)
@@ -39,20 +38,25 @@ import PlatformIO from '-/services/platform-io';
import { loadSubFolders } from '-/services/utils-io';
interface Props {
+ classes?: any;
open: boolean;
+ fullScreen?: boolean;
onClose: () => void;
+ chooseDirectoryPath?: (path: string) => void; // TODO check if needed
+ createNewDirectoryExt?: (path: string) => void; // TODO check if needed
}
interface State {
errorTextPath: boolean;
- errorTextName: boolean;
open: boolean;
drives: Array<string>;
currentPath: string;
+ choosePath: string;
+ subFolders: Array<any>;
isDefault: boolean;
}
-const styles = () => ({
+const styles: any = () => ({
buttonContainer: {
color: '#212121',
backgroundColor: '#f5f5f5',
@@ -121,9 +125,8 @@ const drives = [
class SelectDirectoryDialog extends React.Component<Props, State> {
state = {
errorTextPath: false,
- alertSubFolderText: false,
- disableConfirmButton: true,
open: false,
+ drives,
currentPath: PlatformIO.getUserHomePath(),
subFolders: [],
choosePath: '',
@@ -147,7 +150,7 @@ class SelectDirectoryDialog extends React.Component<Props, State> {
loadListDirectory = (path: string) => {
loadSubFolders(path)
- .then(rootDirContent => {
+ .then((rootDirContent: Array<any>) => {
this.setState({
subFolders: rootDirContent
});
@@ -179,11 +182,12 @@ class SelectDirectoryDialog extends React.Component<Props, State> {
const value = target.type === 'checkbox' ? target.checked : target.value;
const name = target.name;
+ // @ts-ignore
this.setState({
[name]: value,
currentPath: value
});
- this.loadListDirectory(value);
+ this.loadListDirectory(value as string);
};
onBackButton = () => {
@@ -228,7 +232,7 @@ class SelectDirectoryDialog extends React.Component<Props, State> {
>
<DialogTitle>{i18n.t('core:selectDialogTitle')}</DialogTitle>
<DialogContent>
- <FormControl fullWidth={true} error={this.props.errorTextPath}>
+ <FormControl fullWidth={true} error={this.state.errorTextPath}>
<InputLabel htmlFor="name">
{i18n.t('core:selectDialogCurrentPath')}
</InputLabel>
@@ -238,6 +242,7 @@ class SelectDirectoryDialog extends React.Component<Props, State> {
margin="dense"
name="path"
onChange={this.handleInputChange}
+ // @ts-ignore
label={i18n.t('core:selectDialogCurrentPath')}
data-tid="selectDirectoryDialogInput"
value={this.state.currentPath}
@@ -270,13 +275,13 @@ class SelectDirectoryDialog extends React.Component<Props, State> {
<Paper elevation={2}>
<Button
data-tid="onBackButtonSelectDirectoryDialog"
- onClick={e => this.onBackButton(e)}
+ onClick={() => this.onBackButton()}
>
<UndoIcon />
</Button>
<Button
data-tid="createNewFolderSelectDirectoryDialog"
- onClick={e => this.createNewFolder(e)}
+ onClick={() => this.createNewFolder()}
>
<CreateFolderIcon className={this.props.classes.folderIcon} />
{i18n.t('core:createDirectory')}
diff --git a/app/components/dialogs/settings/SettingsDialog.tsx b/app/components/dialogs/settings/SettingsDialog.tsx
index ba40ff2fd..76e74d3dc 100644
--- a/app/components/dialogs/settings/SettingsDialog.tsx
+++ b/app/components/dialogs/settings/SettingsDialog.tsx
@@ -1,4 +1,3 @@
-// @ts-nocheck
/**
* TagSpaces - universal file and folder organizer
* Copyright (C) 2017-present TagSpaces UG (haftungsbeschraenkt)
@@ -39,7 +38,7 @@ import { getSettings, actions } from '-/reducers/settings';
import { extend } from '-/utils/misc';
import AppConfig from '-/config';
-const styles = theme => ({
+const styles: any = theme => ({
mainContent: {
overflowY: AppConfig.isFirefox ? 'auto' : 'overlay'
}
@@ -47,18 +46,19 @@ const styles = theme => ({
interface Props {
open: boolean;
- fullScreen: boolean;
- classes: AttestationConveyancePreference;
+ fullScreen?: boolean;
+ classes?: any;
onClose: () => void;
- setSupportedFileTypes: Array<Object>;
- supportedFileTypes: Array<Object>;
- settings: Array<Object>;
+ setSupportedFileTypes?: (fileTypes: Array<Object>) => void;
+ supportedFileTypes?: Array<Object>;
+ settings?: Array<Object>;
}
interface State {
currentTab: number;
items: Array<Object>;
selectedItem: any;
+ activeItem?: any;
isValidationInProgress: boolean;
isConfirmDialogOpened: boolean;
}
@@ -72,6 +72,8 @@ class SettingsDialog extends React.Component<Props, State> {
isConfirmDialogOpened: false
};
+ settingsFileTypeRef;
+
componentWillReceiveProps = nextProps => {
const { settings } = nextProps;
const supportedFileTypes = settings.supportedFileTypes.reduce(
@@ -193,7 +195,7 @@ class SettingsDialog extends React.Component<Props, State> {
return isValid;
};
- removeItem = (itemForRemoval = Object) => {
+ removeItem = (itemForRemoval: any) => {
const { items } = this.state;
const filteredItems = items.filter(
item => item.type !== itemForRemoval.type
@@ -248,7 +250,7 @@ class SettingsDialog extends React.Component<Props, State> {
}}
cancelDialogTID={'cancelDeleteFileTypeDialog'}
confirmDialogTID={'confirmDeleteFileTypeDialog'}
- confirmDialogContent={'confirmDeleteFileTypeDialogContent'}
+ confirmDialogContentTID={'confirmDeleteFileTypeDialogContent'}
/>
<div
@@ -266,7 +268,6 @@ class SettingsDialog extends React.Component<Props, State> {
setSelectedItem={this.setSelectedItem}
updateItems={this.updateItems}
isValidationInProgress={this.state.isValidationInProgress}
- supportedFileTypes={this.props.settings.supportedFileTypes}
onRemoveItem={selectedItem => {
this.setState({
selectedItem,
diff --git a/app/components/menus/DirectoryMenu.tsx b/app/components/menus/DirectoryMenu.tsx
index ec70cd72a..6539fe083 100644
--- a/app/components/menus/DirectoryMenu.tsx
+++ b/app/components/menus/DirectoryMenu.tsx
@@ -52,7 +52,8 @@ import IOActions from '-/reducers/io-actions';
interface Props {
open: boolean;
- onClose: () => void;
+ classes?: any;
+ onClose: (param?: any) => void;
anchorEl: Element;
directoryPath: string;
loadDirectoryContent: (path: string) => void;
@@ -69,7 +70,7 @@ interface Props {
notificationType: string,
autohide: boolean
) => void;
- isReadOnlyMode: boolean;
+ isReadOnlyMode?: boolean;
}
const DirectoryMenu = (props: Props) => {
diff --git a/app/components/menus/EntryTagMenu.tsx b/app/components/menus/EntryTagMenu.tsx
index 2c3ded5b3..2448a120b 100644
--- a/app/components/menus/EntryTagMenu.tsx
+++ b/app/components/menus/EntryTagMenu.tsx
@@ -41,11 +41,11 @@ interface Props {
selectedTag: Tag | null;
currentEntryPath: string;
removeTags: (paths: Array<string>, tags: Array<Tag>) => void;
- searchLocationIndex: (searchQuery: SearchQuery) => void;
- maxSearchResults: number;
- openSearchPanel: () => void;
- toggleEditTagDialog: (tag: Tag) => void;
- isReadOnlyMode: boolean;
+ searchLocationIndex?: (searchQuery: SearchQuery) => void;
+ maxSearchResults?: number;
+ openSearchPanel?: () => void;
+ toggleEditTagDialog?: (tag: Tag) => void;
+ isReadOnlyMode?: boolean;
}
const EntryTagMenu = (props: Props) => {
diff --git a/app/components/menus/LocationManagerMenu.tsx b/app/components/menus/LocationManagerMenu.tsx
index 5d128b3b3..3ff3ae5e8 100644
--- a/app/components/menus/LocationManagerMenu.tsx
+++ b/app/components/menus/LocationManagerMenu.tsx
@@ -26,7 +26,7 @@ import i18n from '-/services/i18n';
import AppConfig from '-/config';
interface Props {
- classes: any;
+ classes?: any;
open: boolean;
anchorEl: Element;
onClose: () => void;
diff --git a/app/components/menus/TagLibraryMenu.tsx b/app/components/menus/TagLibraryMenu.tsx
index 54c8fc912..2e9c41018 100644
--- a/app/components/menus/TagLibraryMenu.tsx
+++ b/app/components/menus/TagLibraryMenu.tsx
@@ -132,7 +132,6 @@ const TagLibraryMenu = (props: Props) => {
<SelectDirectoryDialog
open={isSelectDirectoryDialogOpened}
onClose={closeSelectDirectoryExtDialog}
- selectedDirectoryPath={selectedDirectoryPath}
/>
<Menu anchorEl={props.anchorEl} open={props.open} onClose={props.onClose}>
<MenuItem
diff --git a/app/reducers/locations.ts b/app/reducers/locations.ts
index bc0d3fc13..677ca4ff9 100644
--- a/app/reducers/locations.ts
+++ b/app/reducers/locations.ts
@@ -42,6 +42,8 @@ export type Location = {
bucketName?: string;
region?: string;
paths: Array<string>;
+ path?: string;
+ children?: Array<any>;
perspective?: string; // id of the perspective
creationDate?: string;
isDefault: boolean;
diff --git a/package.json b/package.json
index 396905490..9f772fa0b 100644
--- a/package.json
+++ b/package.json
@@ -261,7 +261,6 @@
"path": "^0.12.7",
"pdfjs-dist": "^2.0.943",
"rc-table": "^6.4.0",
- "rc-tree": "^1.7.8",
"react": "^16.8.6",
"react-autosuggest": "^9.3.2",
"react-color": "^2.17.3",
diff --git a/yarn.lock b/yarn.lock
index 7c98e3485..48deead3e 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3909,7 +3909,7 @@ babel-preset-jest@^24.9.0:
"@babel/plugin-syntax-object-rest-spread" "^7.0.0"
babel-plugin-jest-hoist "^24.9.0"
[email protected], babel-runtime@^6.22.0, babel-runtime@^6.23.0, babel-runtime@^6.26.0:
[email protected], babel-runtime@^6.22.0, babel-runtime@^6.26.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe"
integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4=
@@ -4825,7 +4825,7 @@ class-utils@^0.3.5:
isobject "^3.0.0"
static-extend "^0.1.1"
[email protected], classnames@^2.2.5:
+classnames@^2.2.5:
version "2.2.6"
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce"
integrity sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q==
@@ -7302,7 +7302,7 @@ fbjs-scripts@^1.2.0:
semver "^5.1.0"
through2 "^2.0.0"
-fbjs@^0.8.16, fbjs@^0.8.4:
+fbjs@^0.8.4:
version "0.8.17"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd"
integrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90=
@@ -10588,11 +10588,6 @@ lodash._createset@~4.0.0:
resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26"
integrity sha1-D0ZZ+7CddRlPqeK4imZE02PJ/iY=
-lodash._getnative@^3.0.0:
- version "3.9.1"
- resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5"
- integrity sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=
-
lodash._reinterpolate@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d"
@@ -10648,16 +10643,6 @@ lodash.get@^4.4.2:
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=
-lodash.isarguments@^3.0.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a"
- integrity sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=
-
-lodash.isarray@^3.0.0:
- version "3.0.4"
- resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55"
- integrity sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=
-
lodash.isequal@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"
@@ -10678,15 +10663,6 @@ lodash.isplainobject@^4.0.6:
resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb"
integrity sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=
-lodash.keys@^3.1.2:
- version "3.1.2"
- resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a"
- integrity sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=
- dependencies:
- lodash._getnative "^3.0.0"
- lodash.isarguments "^3.0.0"
- lodash.isarray "^3.0.0"
-
lodash.map@^4.4.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/lodash.map/-/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3"
@@ -13528,7 +13504,7 @@ promzard@^0.3.0:
dependencies:
read "1"
[email protected], prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.6, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2:
+prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.6, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2:
version "15.7.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
@@ -13689,13 +13665,6 @@ quick-lru@^1.0.0:
resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8"
integrity sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=
-raf@^3.4.0:
- version "3.4.1"
- resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.1.tgz#0742e99a4a6552f445d73e3ee0328af0ff1ede39"
- integrity sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==
- dependencies:
- performance-now "^2.1.0"
-
randomatic@^3.0.0:
version "3.1.1"
resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed"
@@ -13743,60 +13712,30 @@ raw-loader@^3.1.0:
loader-utils "^1.1.0"
schema-utils "^2.0.1"
-rc-animate@^3.0.0-rc.5:
- version "3.0.0-rc.6"
- resolved "https://registry.yarnpkg.com/rc-animate/-/rc-animate-3.0.0-rc.6.tgz#04288eefa118e0cae214536c8a903ffaac1bc3fb"
- integrity sha512-oBLPpiT6Q4t6YvD/pkLcmofBP1p01TX0Otse8Q4+Mxt8J+VSDflLZGIgf62EwkvRwsQUkLPjZVFBsldnPKLzjg==
- dependencies:
- babel-runtime "6.x"
- classnames "^2.2.5"
- component-classes "^1.2.6"
- fbjs "^0.8.16"
- prop-types "15.x"
- raf "^3.4.0"
- rc-util "^4.5.0"
- react-lifecycles-compat "^3.0.4"
-
rc-table@^6.4.0:
- version "6.7.0"
- resolved "https://registry.yarnpkg.com/rc-table/-/rc-table-6.7.0.tgz#8aca002f84a43a2d51a4fcda0f7a51694154286d"
- integrity sha512-zzu7UtEHLTzZibB1EOoeKQejH21suoxRQx3evlGGLwz5NUh2HDUHobSr12z5Kd8EPr1+y/LPzXJdX1ctFPC+hA==
+ version "6.10.11"
+ resolved "https://registry.yarnpkg.com/rc-table/-/rc-table-6.10.11.tgz#fffe9c1b56de49f04d75bab3e28458e8c7a22f33"
+ integrity sha512-YcTlpO4RKlcM7Mio2FjcUOqRUyGU4edtOBG4x5kwZNHwZdfBm7m6VQuyQ/i6qec5S67EP86wiFbmKU54Z2HtFQ==
dependencies:
- babel-runtime "6.x"
classnames "^2.2.5"
component-classes "^1.2.6"
lodash "^4.17.5"
mini-store "^2.0.0"
prop-types "^15.5.8"
- rc-util "^4.0.4"
+ rc-util "^4.13.0"
react-lifecycles-compat "^3.0.2"
shallowequal "^1.0.2"
- warning "^3.0.0"
-
-rc-tree@^1.7.8:
- version "1.15.3"
- resolved "https://registry.yarnpkg.com/rc-tree/-/rc-tree-1.15.3.tgz#4924814c468dc8095cac212fa38ba2b1cb6cb5c9"
- integrity sha512-FIKGKCesbQnILbsjGyu354R5pfrFtOcYz/w3ZIqFkJWIbbUeveWU8BgTKcpeSQgyKju1hsWORAePkeA+V1unFg==
- dependencies:
- babel-runtime "^6.23.0"
- classnames "2.x"
- prop-types "^15.5.8"
- rc-animate "^3.0.0-rc.5"
- rc-util "^4.5.1"
- react-lifecycles-compat "^3.0.4"
- warning "^3.0.0"
-rc-util@^4.0.4, rc-util@^4.5.0, rc-util@^4.5.1:
- version "4.10.0"
- resolved "https://registry.yarnpkg.com/rc-util/-/rc-util-4.10.0.tgz#25da93c78f996a23998c76922f75d54387c9e9fc"
- integrity sha512-bDjf3Yx4rs/777G3TQ3J2Ii8AeEa/z8duR8efBQKH+ShuumtCvWiRA0/iAL2WZNdG3U1z+EIbocNNdcUpsPT7Q==
+rc-util@^4.13.0:
+ version "4.18.1"
+ resolved "https://registry.yarnpkg.com/rc-util/-/rc-util-4.18.1.tgz#5a6312503cd5366ef0bede021dce42d373f404a8"
+ integrity sha512-3aRHG32ZvqBymtJUGoQnbZS+XANzO6XTiFEFAYI3BfuxESEazopAy0kBwcAI6BlLHsW1oLiy3ysE9uYwylh2ag==
dependencies:
add-dom-event-listener "^1.1.0"
babel-runtime "6.x"
prop-types "^15.5.10"
react-lifecycles-compat "^3.0.4"
- shallowequal "^0.2.2"
- warning "^4.0.3"
+ shallowequal "^1.1.0"
rc@^1.0.1, rc@^1.1.6, rc@^1.2.1, rc@^1.2.7, rc@^1.2.8:
version "1.2.8"
@@ -15315,13 +15254,6 @@ shallow-equal@^1.0.0:
resolved "https://registry.yarnpkg.com/shallow-equal/-/shallow-equal-1.2.0.tgz#fd828d2029ff4e19569db7e19e535e94e2d1f5cc"
integrity sha512-Z21pVxR4cXsfwpMKMhCEIO1PCi5sp7KEp+CmOpBQ+E8GpHwKOw2sEzk7sgblM3d/j4z4gakoWEoPcjK0VJQogA==
-shallowequal@^0.2.2:
- version "0.2.2"
- resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-0.2.2.tgz#1e32fd5bcab6ad688a4812cb0cc04efc75c7014e"
- integrity sha1-HjL9W8q2rWiKSBLLDMBO/HXHAU4=
- dependencies:
- lodash.keys "^3.1.2"
-
shallowequal@^1.0.2, shallowequal@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8"