|
|
@ -16,25 +16,6 @@ export const getters = { |
|
|
|
isDocumentSelected(state) { |
|
|
|
return state.selected.length > 0 |
|
|
|
}, |
|
|
|
formatList() { |
|
|
|
return [ |
|
|
|
{ |
|
|
|
type: 'csv', |
|
|
|
text: 'Upload a CSV file from your computer', |
|
|
|
accept: '.csv' |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'plain', |
|
|
|
text: 'Upload text items from your computer', |
|
|
|
accept: '.txt' |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'json', |
|
|
|
text: 'Upload a JSON file from your computer', |
|
|
|
accept: '.json,.jsonl' |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
headers() { |
|
|
|
return [ |
|
|
|
{ |
|
|
@ -51,6 +32,9 @@ export const getters = { |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
approved(state) { |
|
|
|
return state.items[state.current].annotation_approver !== null |
|
|
|
}, |
|
|
|
parsedDoc(state) { |
|
|
|
if ('data' in state.parsed) { |
|
|
|
return state.parsed.data |
|
|
@ -226,5 +210,18 @@ export const actions = { |
|
|
|
.catch((error) => { |
|
|
|
alert(error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
approve({ commit, getters }, payload) { |
|
|
|
const documentId = getters.currentDoc.id |
|
|
|
const data = { |
|
|
|
approved: !getters.currentDoc.annotation_approver |
|
|
|
} |
|
|
|
DocumentService.approveDocument(payload.projectId, documentId, data) |
|
|
|
.then((response) => { |
|
|
|
commit('updateDocument', response) |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
alert(error) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |