From 9ecd6dfaec8da3e944b358403b1ef0281d818b2d Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 15 Oct 2021 17:06:07 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Disable=20editing=20a=20notebook?= =?UTF-8?q?=20while=20it's=20locked=20or=20started?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/notebook/NotebookCreateBox.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/notebook/NotebookCreateBox.tsx b/frontend/src/components/notebook/NotebookCreateBox.tsx index 12a664b..5ee8c18 100644 --- a/frontend/src/components/notebook/NotebookCreateBox.tsx +++ b/frontend/src/components/notebook/NotebookCreateBox.tsx @@ -15,7 +15,7 @@ export interface NotebookCreateBoxProps { } -export function NotebookCreateBox({viewSet, resource}: NotebookCreateBoxProps): JSX.Element { +export function NotebookCreateBox({viewSet, resource}: NotebookCreateBoxProps): JSX.Element | null { const authorization = useAuthorizationContext() const project = useProjectContext() @@ -54,6 +54,15 @@ export function NotebookCreateBox({viewSet, resource}: NotebookCreateBoxProps): [viewSet, resource], ) + if(resource) { + if(resource.value.locked_by) { + return null + } + if(resource.value.is_running) { + return null + } + } + return (