Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APPEALS-49403. Added buttons Docket Lever Seed #21989

Merged
merged 4 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions app/controllers/case_distribution_levers_tests_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@ def run_demo_aod_hearing_seeds
head :ok
end

def run_demo_ama_docket_goals
Rake::Task["db:seed:demo_ama_docket_goals_lever_test_data"].reenable
Rake::Task["db:seed:demo_ama_docket_goals_lever_test_data"].invoke

head :ok
end

def run_demo_docket_priority
Rake::Task["db:seed:demo_docket_priority_lever_test_data"].reenable
Rake::Task["db:seed:demo_docket_priority_lever_test_data"].invoke

head :ok
end

def appeals_ready_to_distribute
csv_data = AppealsReadyForDistribution.process

Expand Down
52 changes: 52 additions & 0 deletions client/app/caseDistribution/test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class CaseDistributionTest extends React.PureComponent {
this.state = {
isReseedingAod: false,
isReseedingNonAod: false,
isReseedingAmaDocketGoals: false,
isReseedingDocketPriority: false
};
}

Expand Down Expand Up @@ -49,6 +51,34 @@ class CaseDistributionTest extends React.PureComponent {
});
};

reseedAmaDocketGoals = () => {
this.setState({ isReseedingAmaDocketGoals: true });
ApiUtil.post('/case_distribution_levers_tests/run-demo-ama-docket-goals').then(() => {
this.setState({
isReseedingAmaDocketGoals: false,
});
}, (err) => {
console.warn(err);
this.setState({
isReseedingAmaDocketGoals: false,
});
});
};

reseedDocketPriority = () => {
this.setState({ isReseedingDocketPriority: true });
ApiUtil.post('/case_distribution_levers_tests/run-demo-docket-priority').then(() => {
this.setState({
isReseedingDocketPriority: false,
});
}, (err) => {
console.warn(err);
this.setState({
isReseedingDocketPriority: false,
});
});
};

render() {
const Router = this.props.router || BrowserRouter;
const appName = 'Case Distribution';
Expand Down Expand Up @@ -245,6 +275,28 @@ class CaseDistributionTest extends React.PureComponent {
loadingText="Reseeding NON AOD Hearing Held Seeds"
/>
</li>
<li>
{/* <a href="/run-demo-ama-docket-goals">
<button className="btn btn-primary">Run Demo Ama Docket Goals</button>
</a> */}
<Button
onClick={this.reseedAmaDocketGoals}
name="Run Demo Ama Docket Goals"
loading={this.state.isReseedingAmaDocketGoals}
loadingText="Reseeding Ama Docket Goals"
/>
</li>
<li>
{/* <a href="/run-demo-docket-priority">
<button className="btn btn-primary">Run Demo Docket Priority</button>
</a> */}
<Button
onClick={this.reseedDocketPriority}
name="Run Demo Docket Priority"
loading={this.state.isReseedingDocketPriority}
loadingText="Reseeding Docket Priority"
/>
</li>
</ul>
<hr />
<a href="#top"><button className="btn btn-primary">Back to Top</button></a>
Expand Down
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
get 'ineligible_judge_list'
post 'run_demo_aod_hearing_seeds'
post 'run_demo_non_aod_hearing_seeds'
post 'run-demo-ama-docket-goals'
post 'run-demo-docket-priority'
end
end

Expand Down
Loading