Skip to content

Commit

Permalink
Enable Caesar fetching through a Workflow configuration key. Add togg…
Browse files Browse the repository at this point in the history
…le to enable in the Admin section, alongside another toggle within the specific workflow. (#7148)
  • Loading branch information
kieftrav authored Aug 15, 2024
1 parent c0e17f9 commit 6873987
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/pages/admin/project-status/experimental-features.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
28 changes: 28 additions & 0 deletions app/pages/lab-fem/workflow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 (
<div className="edit-workflow-page">
<h3>{this.props.workflow.display_name} #{this.props.workflow.id}{' '}
Expand Down Expand Up @@ -506,6 +514,26 @@ class EditWorkflowPage extends Component {

<hr />

{Array.from(this.props.project.experimental_tools).includes('caesarDataFetching') ?
<div>
<p>
<label>
<input
type='checkbox'
checked={isCaesarDataFetchingEnabled}
onChange={this.toggleCaesarDataFetching}
/>
Enable Caesar Data Fetching
</label>
<br />
<small className="form-help">Enabling Caesar data fetching allows the website to pull in subject reductions when the subject loads in the classifier.</small>
</p>

<hr />

</div> : undefined}


{Array.from(this.props.project.experimental_tools).includes('worldwide telescope') ?
<div>
<div className="deprecated">
Expand Down

0 comments on commit 6873987

Please sign in to comment.