Skip to content

Commit

Permalink
Merge branch 'feature/6688_stockage_sql' into 'modis_master'
Browse files Browse the repository at this point in the history
#88 : #6688 upload sql file

See merge request datalake/docker_datalake!91
  • Loading branch information
xuenru committed Jul 28, 2021
2 parents 20ba761 + 6668b36 commit fbcd38e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ export class Upload extends React.Component {
alert('Format de fichier non accepté.')
}
files.map((file) => {
const typeFile = file.type;
let typeFile = file.type;
const filename = file.name;
if (!typeFile && filename.split('.').pop().toLowerCase() ==="sql") {
typeFile = "application/sql"
}
if(this.state.type_file_accepted.includes(typeFile) === false) {
alert("Format de fichier non accepté.\nVeuillez ajouter un fichier qui correspond à un de ses types : \n" + this.state.type_file_accepted)
} else {
Expand Down Expand Up @@ -209,7 +212,7 @@ export class Upload extends React.Component {
</div>
<Metadonnees />
<div class="form-group required">
<Dropzone value={this.state.file} name="file" onDrop={this.onDrop} accept="image/*,application/JSON,.csv,text/plain">
<Dropzone value={this.state.file} name="file" onDrop={this.onDrop} accept="image/*,application/JSON,.csv,text/plain,.sql">
{({getRootProps, getInputProps}) => (
<section>
<div {...getRootProps({className: 'drop'})}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const config = {
{
"id": 1,
"label": "Texte",
"type_file_accepted": ["text/plain", "application/csv", "application/vnd.ms-excel"],
"type_file_accepted": ["text/plain", "application/csv", "application/vnd.ms-excel", "application/sql"],
"metadonnees": [
{
"id": 1,
Expand Down

0 comments on commit fbcd38e

Please sign in to comment.