Skip to content

Commit

Permalink
#10: Remove UI options for uploading .nq files, and disable in the co…
Browse files Browse the repository at this point in the history
…ntroller. TODO: if we are sure that this feature is no longer required, we should remove the functionality in uploadNewDomainVersion.
  • Loading branch information
kenmeacham committed May 26, 2023
1 parent cd27113 commit 3288a47
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ public ResponseEntity<?> uploadNewDomainVersion(@RequestParam("file") MultipartF
boolean rdf = file.getOriginalFilename().endsWith(".rdf") || file.getOriginalFilename().endsWith(".rdf.gz");
boolean gz = file.getOriginalFilename().endsWith(".gz");
boolean zip = file.getOriginalFilename().endsWith(".zip");

//N.B. It is likely that we will remove support for uploading domain models as .nq files, etc (without the corresponding icons, etc)
//so for now we throw an exception if the uploaded file is not a .zip bundle
if (!zip) {
throw new IOException("Only domain .zip bundles may be uploaded!");
}

File f = File.createTempFile(domainModelName, zip ? ".zip" : (rdf ? ".rdf" : ".nq"));

Expand Down
12 changes: 1 addition & 11 deletions src/main/webapp/app/domainManager/components/DomainManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,23 +105,13 @@ class DomainManager extends Component {
<Modal.Title>{modalTitle}</Modal.Title>
</Modal.Header>
<Modal.Body>
{this.state.uploadModal.newDomain ?
<Grid fluid>
<Row>
<Col xs={6}><span className="text-bold">New Domain bundle (*.zip): </span></Col>
<Col xs={6}><span className="text-bold">Domain bundle (*.zip): </span></Col>
<Col xs={6}><input placeholder="file" type="file" accept=".zip"
ref="file-upload"/></Col>
</Row>
</Grid>
:
<Grid fluid>
<Row>
<Col xs={6}><span className="text-bold">New Domain file/bundle (*.rdf, *.rdf.gz, *.nq, *.nq.gz, *.zip): </span></Col>
<Col xs={6}><input placeholder="file" type="file" accept=".rdf,.rdf.gz,.nq,.nq.gz,.zip"
ref="file-upload"/></Col>
</Row>
</Grid>
}
<hr/>
<ProgressBar active now={this.props.upload.progress}/>
{this.props.upload.progress === 100 || this.props.upload.completed ?
Expand Down

0 comments on commit 3288a47

Please sign in to comment.