TagSpaces is an offline, open source, document manager with tagging support
making s3 path optional
Ilian Sapundshiev0131bceabad4
diff --git a/app/components/dialogs/CreateLocationDialog.js b/app/components/dialogs/CreateLocationDialog.jsindex b62879a3f..92c4d5f91 100644--- a/app/components/dialogs/CreateLocationDialog.js+++ b/app/components/dialogs/CreateLocationDialog.js@@ -167,7 +167,7 @@ class CreateLocationDialog extends React.Component<Props, State> {return new Promise(resolve => this.setState({ errorTextName, errorTextPath, disableConfirmButton }, resolve(!disableConfirmButton)));} else if (this.state.type === locationType.TYPE_CLOUD) {let cloudErrorTextName = false;- let cloudErrorTextPath = false;+ // let cloudErrorTextPath = false;let cloudErrorAccessKey = false;let cloudErrorSecretAccessKey = false;let cloudErrorBucketName = false;@@ -178,7 +178,7 @@ class CreateLocationDialog extends React.Component<Props, State> {disableConfirmButton = true;} else if (field === 'storeName'&& !this.state.cloudErrorTextName- && !this.state.cloudErrorTextPath+ // && !this.state.cloudErrorTextPath&& !this.state.cloudErrorAccessKey&& !this.state.cloudErrorSecretAccessKey&& !this.state.cloudErrorBucketName@@ -189,12 +189,12 @@ class CreateLocationDialog extends React.Component<Props, State> {}));}- if (!this.state.storePath || this.state.storePath.length === 0) {+ /* if (!this.state.storePath || this.state.storePath.length === 0) {cloudErrorTextPath = true;disableConfirmButton = true;} else if (field === 'storePath'&& !this.state.cloudErrorTextName- && !this.state.cloudErrorTextPath+ // && !this.state.cloudErrorTextPath&& !this.state.cloudErrorAccessKey&& !this.state.cloudErrorSecretAccessKey&& !this.state.cloudErrorBucketName@@ -203,14 +203,14 @@ class CreateLocationDialog extends React.Component<Props, State> {return new Promise(((resolve) => {resolve(true);}));- }+ } */if (!this.state.accessKeyId || this.state.accessKeyId.length === 0) {cloudErrorAccessKey = true;disableConfirmButton = true;} else if (field === 'accessKeyId'&& !this.state.cloudErrorTextName- && !this.state.cloudErrorTextPath+ // && !this.state.cloudErrorTextPath&& !this.state.cloudErrorAccessKey&& !this.state.cloudErrorSecretAccessKey&& !this.state.cloudErrorBucketName@@ -226,7 +226,7 @@ class CreateLocationDialog extends React.Component<Props, State> {disableConfirmButton = true;} else if (field === 'secretAccessKey'&& !this.state.cloudErrorTextName- && !this.state.cloudErrorTextPath+ // && !this.state.cloudErrorTextPath&& !this.state.cloudErrorAccessKey&& !this.state.cloudErrorSecretAccessKey&& !this.state.cloudErrorBucketName@@ -242,7 +242,7 @@ class CreateLocationDialog extends React.Component<Props, State> {disableConfirmButton = true;} else if (field === 'bucketName'&& !this.state.cloudErrorTextName- && !this.state.cloudErrorTextPath+ // && !this.state.cloudErrorTextPath&& !this.state.cloudErrorAccessKey&& !this.state.cloudErrorSecretAccessKey&& !this.state.cloudErrorBucketName@@ -260,7 +260,7 @@ class CreateLocationDialog extends React.Component<Props, State> {return new Promise(resolve => this.setState({cloudErrorTextName,- cloudErrorTextPath,+ // cloudErrorTextPath,cloudErrorAccessKey,cloudErrorSecretAccessKey,cloudErrorBucketName,@@ -307,7 +307,7 @@ class CreateLocationDialog extends React.Component<Props, State> {this.props.onClose();this.props.resetState('createLocationDialogKey');}- return haveErrors;+ return true;}).catch((error) => {console.debug('Failed validation', error);});diff --git a/app/components/dialogs/EditLocationDialog.js b/app/components/dialogs/EditLocationDialog.jsindex 7476f9522..d347e815d 100644--- a/app/components/dialogs/EditLocationDialog.js+++ b/app/components/dialogs/EditLocationDialog.js@@ -139,7 +139,7 @@ class EditLocationDialog extends React.Component<Props, State> {// const nameRegex = this.state.name.match('^[A-Z][-a-zA-Z]+$');if (this.state.type === locationType.TYPE_CLOUD) {let cloudErrorTextName = false;- let cloudErrorTextPath = false;+ // let cloudErrorTextPath = false;let cloudErrorAccessKey = false;let cloudErrorSecretAccessKey = false;let cloudErrorBucketName = false;@@ -150,10 +150,10 @@ class EditLocationDialog extends React.Component<Props, State> {disableConfirmButton = true;}- if (!this.state.storePath || this.state.storePath.length === 0) {+ /* if (!this.state.storePath || this.state.storePath.length === 0) {cloudErrorTextPath = true;disableConfirmButton = true;- }+ } */if (!this.state.accessKeyId || this.state.accessKeyId.length === 0) {cloudErrorAccessKey = true;@@ -177,7 +177,7 @@ class EditLocationDialog extends React.Component<Props, State> {this.setState({cloudErrorTextName,- cloudErrorTextPath,+ // cloudErrorTextPath,cloudErrorAccessKey,cloudErrorSecretAccessKey,cloudErrorBucketName,