From 68739878229e42229c90363c189a9a0c0fe9324e Mon Sep 17 00:00:00 2001 From: kieftrav Date: Thu, 15 Aug 2024 10:51:36 -0500 Subject: [PATCH] Enable Caesar fetching through a Workflow configuration key. Add toggle to enable in the Admin section, alongside another toggle within the specific workflow. (#7148) --- .../project-status/experimental-features.jsx | 1 + app/pages/lab-fem/workflow.jsx | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/app/pages/admin/project-status/experimental-features.jsx b/app/pages/admin/project-status/experimental-features.jsx index 53d950fec6..469ea83bbd 100644 --- a/app/pages/admin/project-status/experimental-features.jsx +++ b/app/pages/admin/project-status/experimental-features.jsx @@ -5,6 +5,7 @@ import AutoSave from '../../../components/auto-save'; const experimentalFeatures = [ 'allow workflow query', 'anchoredEllipse', + 'caesarDataFetching', // Indicates that the Project should pull data from Caesar 'combo', 'crop', 'dropdown', diff --git a/app/pages/lab-fem/workflow.jsx b/app/pages/lab-fem/workflow.jsx index 797a4baaf8..d9641db655 100644 --- a/app/pages/lab-fem/workflow.jsx +++ b/app/pages/lab-fem/workflow.jsx @@ -49,6 +49,7 @@ class EditWorkflowPage extends Component { this.showCreateWorkflow = this.showCreateWorkflow.bind(this); this.showTaskAddButtons = this.showTaskAddButtons.bind(this); this.handleTaskDelete = this.handleTaskDelete.bind(this); + this.toggleCaesarDataFetching = this.toggleCaesarDataFetching.bind(this); this.state = { selectedTaskKey: props.workflow.first_task, @@ -118,6 +119,11 @@ class EditWorkflowPage extends Component { return this.setState(prevState => ({ showTaskAddButtons: !prevState.showTaskAddButtons })); } + toggleCaesarDataFetching(e) { + return this.props.workflow.update({ + 'configuration.enable_caesar_data_fetching': e.target.checked + }).save() + } render() { let definition; @@ -145,6 +151,8 @@ class EditWorkflowPage extends Component { } = this.props.workflow.configuration; if (hide_classification_summaries === undefined) { hide_classification_summaries = true; } + const isCaesarDataFetchingEnabled = this.props.workflow?.configuration?.enable_caesar_data_fetching ?? false; + return (

{this.props.workflow.display_name} #{this.props.workflow.id}{' '} @@ -506,6 +514,26 @@ class EditWorkflowPage extends Component {
+ {Array.from(this.props.project.experimental_tools).includes('caesarDataFetching') ? +
+

+ +
+ Enabling Caesar data fetching allows the website to pull in subject reductions when the subject loads in the classifier. +

+ +
+ +
: undefined} + + {Array.from(this.props.project.experimental_tools).includes('worldwide telescope') ?