Skip to content

Commit

Permalink
Merge pull request #46 from KPMP/KPMP-3848_File_Validation
Browse files Browse the repository at this point in the history
Kpmp 3848 file validation
  • Loading branch information
rlreamy authored Feb 2, 2023
2 parents ddafd6a + 9797886 commit 26fdfbb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/Validation/FilenameValidationPage.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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;
Expand All @@ -47,6 +47,13 @@ class FilenameValidationPage extends Component {
} else {
return (
<Container>
{Object.keys(this.props.validationResult).length !== 0 && this.props.validationResult.constructor === Object && !this.props.validationResult.directoryExists &&

<Alert color="danger">
The package directory doesn't exist in Globus!
</Alert>

}
<form onSubmit={this.handleSubmit}>
<Row className='mt-3'>
<Col sm={3}>
Expand Down

0 comments on commit 26fdfbb

Please sign in to comment.