From c7278ebdd8a20c3548ad8909a22e0e653e18ffb1 Mon Sep 17 00:00:00 2001 From: Christian Gill Date: Tue, 7 Jul 2020 16:54:38 +0200 Subject: [PATCH] add excel import to frontend --- frontend/store/projects.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/frontend/store/projects.js b/frontend/store/projects.js index c4f4666b..4a3b5502 100644 --- a/frontend/store/projects.js +++ b/frontend/store/projects.js @@ -65,6 +65,11 @@ export const getters = { text: 'CoNLL', accept: '.conll' } + const excel = { + type: 'excel', + text: 'Excel', + accept: '.xlsx' + } if (state.current.project_type === 'DocumentClassification') { json.examples = [ '{"text": "Terrible customer service.", "labels": ["negative"]}\n', @@ -77,10 +82,17 @@ export const getters = { '"Really great transaction.","positive"\n', '"Great price.","positive"' ] + excel.examples = [ + 'text,label\n', + '"Terrible customer service.","negative"\n', + '"Really great transaction.","positive"\n', + '"Great price.","positive"' + ] return [ plain, csv, - json + json, + excel ] } else if (state.current.project_type === 'SequenceLabeling') { json.examples = [ @@ -118,10 +130,17 @@ export const getters = { '"Good morning.","おはようございます。"\n', '"See you.","さようなら。"' ] + excel.examples = [ + 'text,label\n', + '"Hello!","こんにちは!"\n', + '"Good morning.","おはようございます。"\n', + '"See you.","さようなら。"' + ] return [ plain, csv, - json + json, + excel ] } else { return []