Skip to content

Commit

Permalink
fix(data): Cant import data with standard provenance if doesnt exist
Browse files Browse the repository at this point in the history
OpenSILEX/opensilex-dev!1169
  • Loading branch information
PRADO SEBASTIEN committed Feb 5, 2024
1 parent db20320 commit 2c45e9a
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,12 @@ export default class DataImportForm extends Vue {
this.$opensilex.getService<DataService>("opensilex.DataService")
.searchProvenance("standard_provenance")
.then((http: HttpResponse<OpenSilexResponse<Array<ProvenanceGetDTO>>>) => {
if(http.response.result[0] === undefined) {
this.standardProvURI = undefined;
} else {
this.standardProvURI = http.response.result[0].uri;
});
}
});
}
getEmptyForm() {
Expand Down Expand Up @@ -354,6 +358,15 @@ export default class DataImportForm extends Vue {
}
}
}).catch((e) => {
if(this.standardProvURI === undefined) {
let message =
this.$t("DataImportForm.errorStandardProvenance") +
" : '" +
this.standardProvURI +
"' . " +
this.$t("DataImportForm.errorStandardProvenanceTwo")
this.$opensilex.showErrorToast(message);
}
console.error(e);
this.$opensilex.errorHandler(e);
});
Expand Down Expand Up @@ -503,6 +516,8 @@ en:
data-duplicated: Duplicated data
data-not-imported: Data has not been imported. An error has occured during the importation process
error: Erreur
errorStandardProvenance: The selected provenance is
errorStandardProvenanceTwo: To use the standard provenance, define it beforehand.
message: Message
reset-file: Reset file
import-file : Import data CSV
Expand Down Expand Up @@ -531,6 +546,8 @@ fr:
data-duplicated: Données dupliquées
data-not-imported: Données non importées. Une erreur s'est produite durant le processus d'importation
error: Error
errorStandardProvenance: La provenance selectionnée est
errorStandardProvenanceTwo: Pour utiliser la provenance standard, définissez-la au préalable.
message: Message
reset-file: Reinitialiser fichier
import-file : Importez des données
Expand Down

0 comments on commit 2c45e9a

Please sign in to comment.