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

Rename from CaseflowDistribution to CaseDistribution #20428

Merged
merged 13 commits into from
Jan 5, 2024
2 changes: 1 addition & 1 deletion app/views/case_distribution_levers/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% content_for :full_page_content do %>
<%= react_component("CaseflowDistribution", props: {
<%= react_component("CaseDistribution", props: {
userDisplayName: current_user.display_name,
dropdownUrls: dropdown_urls,
applicationUrls: application_urls,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import NumberField from 'app/components/NumberField';
import TextField from 'app/components/TextField';
import COPY from '../../../COPY';
import ACD_LEVERS from '../../../constants/ACD_LEVERS';
import { ACTIONS } from '../reducers/Levers/leversActionTypes.js';
import { ACTIONS } from '../reducers/levers/leversActionTypes.js';
import leverInputValidation from './LeverInputValidation';
import { checkIfOtherChangesExist } from '../utils.js';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useState } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import PropTypes, { object } from 'prop-types';
import { ACTIONS } from 'app/caseflowDistribution/reducers/Levers/leversActionTypes';
import { ACTIONS } from 'app/caseDistribution/reducers/levers/leversActionTypes';
import { css } from 'glamor';
import styles from 'app/styles/caseDistribution/InteractableLevers.module.scss';
import NumberField from 'app/components/NumberField';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
anchorJumpLinkStyling } from 'app/queue/StickyNavContentArea';
import COPY from '../../../COPY';

const CaseflowDistributionContent = ({
const CaseDistributionContent = ({
levers,
formattedHistory,
isAdmin,
Expand Down Expand Up @@ -66,7 +66,7 @@ const CaseflowDistributionContent = ({
);
};

CaseflowDistributionContent.propTypes = {
CaseDistributionContent.propTypes = {
levers: PropTypes.object.isRequired,
saveChanges: PropTypes.func.isRequired,
formattedHistory: PropTypes.array.isRequired,
Expand All @@ -75,4 +75,4 @@ CaseflowDistributionContent.propTypes = {
sectionTitles: PropTypes.array.isRequired,
};

export default CaseflowDistributionContent;
export default CaseDistributionContent;
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PropTypes, { object } from 'prop-types';
import { css } from 'glamor';
import cx from 'classnames';
import styles from 'app/styles/caseDistribution/InteractableLevers.module.scss';
import { ACTIONS } from 'app/caseflowDistribution/reducers/Levers/leversActionTypes';
import { ACTIONS } from 'app/caseDistribution/reducers/levers/leversActionTypes';
import ToggleSwitch from 'app/components/ToggleSwitch/ToggleSwitch';
import NumberField from 'app/components/NumberField';
import leverInputValidation from './LeverInputValidation';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import React from 'react';
import PropTypes from 'prop-types';
import { ACTIONS } from 'app/caseflowDistribution/reducers/Levers/leversActionTypes';
import { ACTIONS } from 'app/caseDistribution/reducers/levers/leversActionTypes';
import Button from 'app/components/Button';

const cancelLeverChanges = (leverStore) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, useEffect } from 'react';
import PropTypes from 'prop-types';
import { ACTIONS } from 'app/caseflowDistribution/reducers/Levers/leversActionTypes';
import { ACTIONS } from 'app/caseDistribution/reducers/levers/leversActionTypes';
import ApiUtil from '../../util/ApiUtil';
import Modal from 'app/components/Modal';
import Button from 'app/components/Button';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ import AppFrame from '../components/AppFrame';
import AppSegment from '@department-of-veterans-affairs/caseflow-frontend-toolkit/components/AppSegment';
import { LOGO_COLORS } from '../constants/AppConstants';
import Footer from '@department-of-veterans-affairs/caseflow-frontend-toolkit/components/Footer';
import leversReducer from './reducers/Levers/leversReducer';
import leversReducer from './reducers/levers/leversReducer';
import CaseSearchLink from '../components/CaseSearchLink';
import BannerDisplay from './components/BannerDisplay';
import ACD_LEVERS from '../../constants/ACD_LEVERS';
import DISTRIBUTION from '../../constants/DISTRIBUTION';

import CaseflowDistributionApp from './pages/CaseflowDistributionApp';
import CaseDistributionApp from './pages/CaseDistributionApp';
import { createStore } from 'redux';
import rootReducer from '../caseflowDistribution/reducers/root';
import rootReducer from '../caseDistribution/reducers/root';

class CaseflowDistribution extends React.PureComponent {
class CaseDistribution extends React.PureComponent {

render() {
const preloadedState = {
Expand All @@ -30,7 +30,7 @@ class CaseflowDistribution extends React.PureComponent {

const leverStore = createStore(leversReducer, preloadedState);
const Router = this.props.router || BrowserRouter;
const appName = 'Caseflow Distribution';
const appName = 'Case Distribution';

const staticLevers = [
DISTRIBUTION.maximum_direct_review_proportion,
Expand Down Expand Up @@ -144,10 +144,10 @@ class CaseflowDistribution extends React.PureComponent {
<PageRoute
exact
path={['/acd-controls', '/case-distribution-controls']}
title="CaseflowDistribution | Caseflow"
title="Case Distribution | Caseflow"
component={() => {
return (
<CaseflowDistributionApp
<CaseDistributionApp
acdLeversForStore={this.props.acdLeversForStore}
acd_levers={leversList}
acd_history={this.props.acd_history}
Expand All @@ -174,4 +174,4 @@ class CaseflowDistribution extends React.PureComponent {
}
}

export default CaseflowDistribution;
export default CaseDistribution;
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react';
import PropTypes from 'prop-types';
import CaseflowDistributionContent from '../components/CaseflowDistributionContent';
import CaseDistributionContent from '../components/CaseDistributionContent';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import {
initialLoad
} from '../reducers/Levers/leversActions';
} from '../reducers/levers/leversActions';

class CaseflowDistributionApp extends React.PureComponent {
class CaseDistributionApp extends React.PureComponent {
constructor(props) {
super(props);
this.props.initialLoad(this.props.acdLeversForStore);
Expand All @@ -17,7 +17,7 @@ class CaseflowDistributionApp extends React.PureComponent {
return (
<div>
<div> {/* Wrapper*/}
<CaseflowDistributionContent
<CaseDistributionContent
levers = {this.props.acd_levers}
saveChanges = {() => {}}
formattedHistory={this.props.acd_history}
Expand All @@ -32,7 +32,7 @@ class CaseflowDistributionApp extends React.PureComponent {
}
}

CaseflowDistributionApp.propTypes = {
CaseDistributionApp.propTypes = {
acd_levers: PropTypes.object,
acd_history: PropTypes.array,
user_is_an_acd_admin: PropTypes.bool,
Expand All @@ -55,4 +55,4 @@ const mapDispatchToProps = (dispatch) => (
export default connect(
mapStateToProps,
mapDispatchToProps
)(CaseflowDistributionApp);
)(CaseDistributionApp);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import leverStore from './reducers/Levers/leversReducer';
import leverStore from './reducers/levers/leversReducer';

export const checkIfOtherChangesExist = (currentLever) => {
const leversWithChangesList = leverStore.getState().levers.filter(
Expand Down
6 changes: 3 additions & 3 deletions client/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import Inbox from 'app/inbox';
import Explain from 'app/explain';
import MPISearch from 'app/mpi/MPISearch';
import Admin from 'app/admin';
import CaseflowDistribution from 'app/caseflowDistribution';
import CaseDistribution from 'app/caseDistribution';
import uuid from 'uuid';

const COMPONENTS = {
Expand Down Expand Up @@ -93,7 +93,7 @@ const COMPONENTS = {
Explain,
MPISearch,
Admin,
CaseflowDistribution
CaseDistribution
};

const componentWrapper = (component) => (props, railsContext, domNodeId) => {
Expand Down Expand Up @@ -178,7 +178,7 @@ const componentWrapper = (component) => (props, railsContext, domNodeId) => {
'./explain/index',
'./mpi/MPISearch',
'./admin/index',
'./caseflowDistribution/index'
'./caseDistribution/index'
],
() => renderApp(component)
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { render, fireEvent } from '@testing-library/react';
import AffinityDays from 'app/caseflowDistribution/components/AffinityDays';
import AffinityDays from 'app/caseDistribution/components/AffinityDays';
import { levers } from 'test/data/adminCaseDistributionLevers';

jest.mock('app/styles/caseDistribution/InteractableLevers.module.scss', () => '');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { render, fireEvent } from '@testing-library/react';
import BatchSize from 'app/caseflowDistribution/components/BatchSize';
import BatchSize from 'app/caseDistribution/components/BatchSize';
import { levers } from 'test/data/adminCaseDistributionLevers';

jest.mock('app/styles/caseDistribution/InteractableLevers.module.scss', () => '');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import CaseflowDistributionContent from 'app/caseflowDistribution/components/CaseflowDistributionContent';
import CaseDistributionContent from 'app/caseDistribution/components/CaseDistributionContent';
import { formattedHistory, formattedLevers } from 'test/data/formattedCaseDistributionData';
import { createStore } from 'redux';
import leversReducer from 'app/caseflowDistribution/reducers/Levers/leversReducer';
import leversReducer from 'app/caseDistribution/reducers/levers/leversReducer';

jest.mock('app/styles/caseDistribution/InteractableLevers.module.scss', () => '');
jest.mock('app/styles/caseDistribution/StaticLevers.module.scss', () => '');
jest.mock('app/styles/caseDistribution/LeverHistory.module.scss', () => '');
jest.mock('app/styles/caseDistribution/ExclusionTable.module.scss', () => '');

describe('CaseflowDistributionContent', () => {
describe('CaseDistributionContent', () => {

afterEach(() => {
jest.clearAllMocks();
});

const setup = (testProps) =>
render(
<CaseflowDistributionContent {...testProps} />
<CaseDistributionContent {...testProps} />
);

it('renders the "CaseflowDistributionContent Component" with the data imported', () => {
it('renders the "CaseDistributionContent Component" with the data imported', () => {
const preloadedState = {
levers: JSON.parse(JSON.stringify(formattedLevers)),
initial_levers: JSON.parse(JSON.stringify(formattedLevers))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { render, fireEvent } from '@testing-library/react';
import DocketTimeGoals from 'app/caseflowDistribution/components/DocketTimeGoals';
import DocketTimeGoals from 'app/caseDistribution/components/DocketTimeGoals';
import { levers } from 'test/data/adminCaseDistributionLevers';

jest.mock('app/styles/caseDistribution/InteractableLevers.module.scss', () => '');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react';
import { render } from '@testing-library/react';
import { createStore } from '@reduxjs/toolkit';
import LeverButtonsWrapper from './LeverButtonsWrapper';
import leversReducer from '../reducers/Levers/leversReducer';
import { ACTIONS } from 'app/caseflowDistribution/reducers/Levers/leversActionTypes';
import leversReducer from '../reducers/levers/leversReducer';
import { ACTIONS } from 'app/caseDistribution/reducers/levers/leversActionTypes';
import * as leverData from 'test/data/adminCaseDistributionLevers';

describe('LeverButtonsWrapper', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import LeverHistory from 'app/caseflowDistribution/components/LeverHistory';
import LeverHistory from 'app/caseDistribution/components/LeverHistory';

jest.mock('app/styles/caseDistribution/LeverHistory.module.scss', () => '');
describe('LeverHistory', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { render, screen, fireEvent } from '@testing-library/react';
import { leverSaveButton } from 'app/caseflowDistribution/components/LeverModal';
import { leverSaveButton } from 'app/caseDistribution/components/LeverModal';
import { createStore } from '@reduxjs/toolkit';
import COPY from 'COPY';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { shallow } from 'enzyme';
import StaticLever from 'app/caseflowDistribution/components/StaticLever';
import StaticLever from 'app/caseDistribution/components/StaticLever';

jest.mock('app/styles/caseDistribution/StaticLevers.module.scss', () => '');
describe('StaticLever', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import { render } from '@testing-library/react';
import StaticLeverWrapper from 'app/caseflowDistribution/components/StaticLeversWrapper';
import StaticLeverWrapper from 'app/caseDistribution/components/StaticLeversWrapper';
import { levers } from 'test/data/adminCaseDistributionLevers';
import leversReducer from 'app/caseflowDistribution/reducers/Levers/leversReducer';
import leversReducer from 'app/caseDistribution/reducers/levers/leversReducer';
import { createStore } from 'redux';

const preloadedState = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import leversReducer from '../../../app/caseflowDistribution/reducers/Levers/leversReducer';
import { ACTIONS } from '../../../app/caseflowDistribution/reducers/Levers/leversActionTypes';
import * as leverData from '../../data/adminCaseDistributionLevers';
import leversReducer from 'app/caseDistribution/reducers/levers/leversReducer';
import { ACTIONS } from 'app/caseDistribution/reducers/levers/leversActionTypes';
import * as leverData from 'test/data/adminCaseDistributionLevers';
import { createStore } from "@reduxjs/toolkit";

/* eslint-disable no-undefined */
Expand Down
4 changes: 2 additions & 2 deletions db/migrate/20231106174051_create_case_distribution_levers.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CreateCaseDistributionLevers < Caseflow::Migration
def change
create_table :case_distribution_levers, comment:"A generalized table for Caseflow Distribution lever records within caseflow" do |t|
t.string :item, null: false, comment:"Is unique value to identify the Caseflow Distribution lever"
create_table :case_distribution_levers, comment:"A generalized table for Case Distribution lever records within caseflow" do |t|
t.string :item, null: false, comment:"Is unique value to identify the Case Distribution lever"
t.string :title, null: false, comment:"Indicates the Lever title"
t.text :description, null: true, comment:"Indicates the description of the Lever"
t.string :data_type, null: false, comment:"Indicates which type of record either BOOLEAN/RADIO/COMBO"
Expand Down
4 changes: 2 additions & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,15 @@
t.index ["user_id"], name: "index_case_distribution_audit_lever_entries_on_user_id"
end

create_table "case_distribution_levers", comment: "A generalized table for Caseflow Distribution lever records within caseflow", force: :cascade do |t|
create_table "case_distribution_levers", comment: "A generalized table for Case Distribution lever records within caseflow", force: :cascade do |t|
t.json "algorithms_used", comment: "Indicates the algorithms used"
t.json "control_group", comment: "Indicates the group which contain json formatted data that controls the Case Distribution Levers"
t.datetime "created_at", null: false
t.string "data_type", null: false, comment: "Indicates which type of record either BOOLEAN/RADIO/COMBO"
t.text "description", comment: "Indicates the description of the Lever"
t.boolean "is_active", null: false, comment: "Indicates the active lever"
t.boolean "is_disabled", null: false, comment: "Used to diabled the row"
t.string "item", null: false, comment: "Is unique value to identify the Caseflow Distribution lever"
t.string "item", null: false, comment: "Is unique value to identify the Case Distribution lever"
t.string "lever_group", default: "", null: false, comment: "Case Distribution lever grouping"
t.integer "max_value", comment: "Set max value for the input"
t.integer "min_value", comment: "Set min value for the input"
Expand Down
Loading