From 3e1088e3a145ed0c610183c8bea4767a3b9f9f52 Mon Sep 17 00:00:00 2001 From: khansadaoudi Date: Mon, 14 Oct 2024 10:23:08 +0200 Subject: [PATCH] add rename sample --- src/api/backend-api.ts | 3 ++ src/components/project/ProjectTable.vue | 34 ++++++++++-- src/components/project/RenameSample.vue | 72 +++++++++++++++++++++++++ src/pages/Project.vue | 2 +- 4 files changed, 106 insertions(+), 5 deletions(-) create mode 100644 src/components/project/RenameSample.vue diff --git a/src/api/backend-api.ts b/src/api/backend-api.ts index aa5f62e0..d20f7a3f 100644 --- a/src/api/backend-api.ts +++ b/src/api/backend-api.ts @@ -122,6 +122,9 @@ export default { deleteSamples(projectName: string, data: any) { return API.patch(`/projects/${projectName}/samples`, data); }, + renameSample(projectName: string, sampleName: string, data: any) { + return API.post(`/projects/${projectName}/samples/${sampleName}/sample-name`, data); + }, tokenizeSample(projectName: string, data: any) { return API.post(`/projects/${projectName}/samples/tokenize`, data, { timeout: 400000 }); }, diff --git a/src/components/project/ProjectTable.vue b/src/components/project/ProjectTable.vue index 2081329d..0fc6fb50 100644 --- a/src/components/project/ProjectTable.vue +++ b/src/components/project/ProjectTable.vue @@ -48,6 +48,19 @@ no-caps > {{ props.row.sampleName }} + + + + Rename sample + + + + + + {{ props.row.sentences }} @@ -79,19 +92,26 @@ + + + diff --git a/src/components/project/RenameSample.vue b/src/components/project/RenameSample.vue new file mode 100644 index 00000000..43a0b771 --- /dev/null +++ b/src/components/project/RenameSample.vue @@ -0,0 +1,72 @@ + + diff --git a/src/pages/Project.vue b/src/pages/Project.vue index 50ce14ad..890c458f 100644 --- a/src/pages/Project.vue +++ b/src/pages/Project.vue @@ -220,7 +220,7 @@ export default defineComponent({ if (newVal > 0) this.loadProjectData(); }, reloadSamples(newVal) { - if (newVal > 0) this.loadProjectData(); + if (newVal) this.loadProjectData(); } }, methods: {