From 1a0a8236f6077bbaf11e39e77dd4558854b4e3d3 Mon Sep 17 00:00:00 2001 From: Zach Wright Date: Tue, 31 Jan 2023 15:56:47 -0500 Subject: [PATCH 1/3] KPMP-3848: Check if dir exists --- src/components/Validation/FilenameValidationPage.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/Validation/FilenameValidationPage.js b/src/components/Validation/FilenameValidationPage.js index 294b978..aa06ff1 100644 --- a/src/components/Validation/FilenameValidationPage.js +++ b/src/components/Validation/FilenameValidationPage.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { Container, Row, Col, Button } from 'reactstrap'; +import { Container, Row, Col, Button, } from 'reactstrap'; import ValidationResult from './ValidationResult'; class FilenameValidationPage extends Component { @@ -31,7 +31,7 @@ class FilenameValidationPage extends Component { render() { const { packageId, filenames } = this.state; const isEnabled = packageId.length > 0 && filenames.length > 0; - if (Object.keys(this.props.validationResult).length !== 0 && this.props.validationResult.constructor === Object) { + if (Object.keys(this.props.validationResult).length !== 0 && this.props.validationResult.constructor === Object && this.props.validationResult.directoryExists) { let filesNotInGlobus = this.props.validationResult.metadataFilesNotFoundInGlobus; let filesNotInMetadata = this.props.validationResult.globusFilesNotFoundInMetadata; let isSuccess = !filesNotInGlobus && !filesNotInMetadata; @@ -47,6 +47,13 @@ class FilenameValidationPage extends Component { } else { return ( + { this.props.validationResult && !this.props.validationResult.directoryExists && + + + The package directory doesn't exist in Globus! + + + }
From 2a3c1277c711b4127a8fce35d611bdf6c6b389cf Mon Sep 17 00:00:00 2001 From: Zach Wright Date: Tue, 31 Jan 2023 16:09:07 -0500 Subject: [PATCH 2/3] KPMP-3848: Add import --- src/components/Validation/FilenameValidationPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Validation/FilenameValidationPage.js b/src/components/Validation/FilenameValidationPage.js index aa06ff1..11b4548 100644 --- a/src/components/Validation/FilenameValidationPage.js +++ b/src/components/Validation/FilenameValidationPage.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { Container, Row, Col, Button, } from 'reactstrap'; +import { Container, Row, Col, Button, Alert } from 'reactstrap'; import ValidationResult from './ValidationResult'; class FilenameValidationPage extends Component { From 97978869454b434fe10282bc54a1a4b1dc9717a4 Mon Sep 17 00:00:00 2001 From: Zach Wright Date: Wed, 1 Feb 2023 15:41:14 -0500 Subject: [PATCH 3/3] KPMP-3848: Check that prop --- src/components/Validation/FilenameValidationPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Validation/FilenameValidationPage.js b/src/components/Validation/FilenameValidationPage.js index 11b4548..15d4ee8 100644 --- a/src/components/Validation/FilenameValidationPage.js +++ b/src/components/Validation/FilenameValidationPage.js @@ -47,7 +47,7 @@ class FilenameValidationPage extends Component { } else { return ( - { this.props.validationResult && !this.props.validationResult.directoryExists && + {Object.keys(this.props.validationResult).length !== 0 && this.props.validationResult.constructor === Object && !this.props.validationResult.directoryExists && The package directory doesn't exist in Globus!