Skip to content
Snippets Groups Projects
Verified Commit 0e9575a3 authored by Martin Weise's avatar Martin Weise
Browse files

Hotfix column mapping and more error messages in the frontend

parent 88219178
Branches
Tags
6 merge requests!296Dev,!293Dev,!289Dev,!287Dev,!285Dev,!284Dev
......@@ -829,8 +829,9 @@ public interface MetadataMapper {
final Pattern WHITESPACE = Pattern.compile("[\\s]");
String nowhitespace = WHITESPACE.matcher(data).replaceAll("_");
String normalized = Normalizer.normalize(nowhitespace, Normalizer.Form.NFD);
String slug = NONLATIN.matcher(normalized).replaceAll("");
final String name = slug.toLowerCase(Locale.ENGLISH);
String slug = NONLATIN.matcher(normalized).replaceAll("_");
final String name = slug.toLowerCase(Locale.ENGLISH)
.replaceAll("-", "_");
log.debug("mapping name {} to internal name {}", data, name);
return name;
}
......
......@@ -19,7 +19,6 @@ import at.tuwien.exception.*;
import at.tuwien.gateway.DataServiceGateway;
import at.tuwien.gateway.SearchServiceGateway;
import at.tuwien.mapper.MetadataMapper;
import at.tuwien.mapper.SparqlMapper;
import at.tuwien.repository.DatabaseRepository;
import at.tuwien.service.*;
import lombok.extern.log4j.Log4j2;
......
......@@ -325,10 +325,9 @@ export default {
this.table = table
resolve(table)
})
.catch((error) => {
console.error('Failed to create table', error)
.catch(({code, message}) => {
const toast = useToastInstance()
toast.error(this.$t(error.code))
toast.error(`${this.$t(code)}: ${message}`)
this.loading = false
reject(error)
})
......@@ -347,10 +346,10 @@ export default {
toast.success(this.$t('success.import.dataset'))
this.cacheStore.reloadDatabase()
})
.catch(({code}) => {
.catch(({code, message}) => {
console.error('Failed to import csv')
const toast = useToastInstance()
toast.error(this.$t(code))
toast.error(`${this.$t(code)}: ${message}`)
this.loading = false
})
.finally(() => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment