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

B 21336 int Add bulk assignment button and modal creation #14457

Merged
merged 23 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6aeeb6b
git Bulk assignment FF created
JonSpight Dec 9, 2024
5271b5b
fixed spacing
JonSpight Dec 19, 2024
189d3ba
Merge branch 'main' into B-21336-main
JonSpight Dec 19, 2024
5f7c45e
fixing test
JonSpight Dec 20, 2024
0a400cb
fixed client tests
JonSpight Dec 20, 2024
a6c3f1b
merge
JonSpight Dec 21, 2024
49d883a
PR fixes
JonSpight Dec 23, 2024
a9190c9
Merge branch 'B-21336-main' into B-21336-int
JonSpight Dec 23, 2024
adca233
Added constant - PR Request
JonSpight Dec 30, 2024
e75b892
Merge branch 'B-21336-main' into B-21336-int
JonSpight Dec 30, 2024
59e998d
Merge branch 'integrationTesting' into B-21336-int
JonSpight Dec 30, 2024
deea711
Merge branch 'integrationTesting' into B-21336-int
JonSpight Dec 30, 2024
dfb0668
Merge branch 'main' into B-21336-main
JonSpight Dec 30, 2024
a744161
Merge branch 'integrationTesting' into B-21336-int
JonSpight Jan 2, 2025
b8adfd6
Merge branch 'integrationTesting' into B-21336-int
JonSpight Jan 3, 2025
1c748cb
defaulted FF Values
JonSpight Jan 3, 2025
9bfff1c
Merge branch 'B-21336-main' into B-21336-int
JonSpight Jan 3, 2025
d0678e4
Merge branch 'integrationTesting' into B-21336-int
JonSpight Jan 3, 2025
0ba428f
defaulted config value
JonSpight Jan 3, 2025
a54ddf9
Merge branch 'B-21336-main' into B-21336-int
JonSpight Jan 3, 2025
595b3d6
Merge branch 'B-21336-int' of https://github.com/transcom/mymove into…
JonSpight Jan 3, 2025
638a70a
Merge branch 'integrationTesting' into B-21336-int
JonSpight Jan 3, 2025
f9470de
Merge branch 'integrationTesting' into B-21336-int
JonSpight Jan 3, 2025
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
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,7 @@ commands:
export FEATURE_FLAG_ENABLE_ALASKA=false
export FEATURE_FLAG_UNACCOMPANIED_BAGGAGE=false
export FEATURE_FLAG_ENABLE_HAWAII=false
export FEATURE_FLAG_BULK_ASSIGNMENT=true

# disable for speed, playwright tests can fail otherwise
export DB_DEBUG=false
Expand Down Expand Up @@ -943,6 +944,7 @@ commands:
FEATURE_FLAG_QUEUE_MANAGEMENT: 'false'
FEATURE_FLAG_UNACCOMPANIED_BAGGAGE: 'false'
FEATURE_FLAG_ENABLE_ALASKA: 'false'
FEATURE_FLAG_BULK_ASSIGNMENT: 'true'
command: |
SHARD=$((${CIRCLE_NODE_INDEX}+1))
PLAYWRIGHT_JUNIT_OUTPUT_NAME=playwright-results.xml \
Expand Down
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ export FEATURE_FLAG_BOAT=true
export FEATURE_FLAG_MOBILE_HOME=true
export FEATURE_FLAG_UNACCOMPANIED_BAGGAGE=false

# Feature flag to allow Bulk Assigment options to be displayed
export FEATURE_FLAG_BULK_ASSIGNMENT=true

# Feature flag to allow AK to be entered as a state
export FEATURE_FLAG_ENABLE_ALASKA=true

Expand Down
3 changes: 2 additions & 1 deletion config/env/demo.app-client-tls.env
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ FEATURE_FLAG_THIRD_ADDRESS_AVAILABLE=false
FEATURE_FLAG_QUEUE_MANAGEMENT=false
FEATURE_FLAG_DODID_UNIQUE=false
FEATURE_FLAG_ENABLE_ALASKA=false
FEATURE_FLAG_ENABLE_HAWAII=false
FEATURE_FLAG_ENABLE_HAWAII=false
FEATURE_FLAG_BULK_ASSIGNMENT=true
3 changes: 2 additions & 1 deletion config/env/demo.app.env
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ FEATURE_FLAG_THIRD_ADDRESS_AVAILABLE=false
FEATURE_FLAG_QUEUE_MANAGEMENT=false
FEATURE_FLAG_DODID_UNIQUE=false
FEATURE_FLAG_ENABLE_ALASKA=false
FEATURE_FLAG_ENABLE_HAWAII=false
FEATURE_FLAG_ENABLE_HAWAII=false
FEATURE_FLAG_BULK_ASSIGNMENT=true
3 changes: 2 additions & 1 deletion config/env/exp.app-client-tls.env
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ FEATURE_FLAG_THIRD_ADDRESS_AVAILABLE=false
FEATURE_FLAG_QUEUE_MANAGEMENT=false
FEATURE_FLAG_DODID_UNIQUE=false
FEATURE_FLAG_ENABLE_ALASKA=false
FEATURE_FLAG_ENABLE_HAWAII=false
FEATURE_FLAG_ENABLE_HAWAII=false
FEATURE_FLAG_BULK_ASSIGNMENT=true
3 changes: 2 additions & 1 deletion config/env/exp.app.env
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ FEATURE_FLAG_THIRD_ADDRESS_AVAILABLE=false
FEATURE_FLAG_QUEUE_MANAGEMENT=false
FEATURE_FLAG_DODID_UNIQUE=false
FEATURE_FLAG_ENABLE_ALASKA=false
FEATURE_FLAG_ENABLE_HAWAII=false
FEATURE_FLAG_ENABLE_HAWAII=false
FEATURE_FLAG_BULK_ASSIGNMENT=true
3 changes: 2 additions & 1 deletion config/env/loadtest.app-client-tls.env
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@ FEATURE_FLAG_THIRD_ADDRESS_AVAILABLE=false
FEATURE_FLAG_QUEUE_MANAGEMENT=false
FEATURE_FLAG_DODID_UNIQUE=false
FEATURE_FLAG_ENABLE_ALASKA=false
FEATURE_FLAG_ENABLE_HAWAII=false
FEATURE_FLAG_ENABLE_HAWAII=false
FEATURE_FLAG_BULK_ASSIGNMENT=true
3 changes: 2 additions & 1 deletion config/env/loadtest.app.env
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@ FEATURE_FLAG_THIRD_ADDRESS_AVAILABLE=false
FEATURE_FLAG_QUEUE_MANAGEMENT=false
FEATURE_FLAG_DODID_UNIQUE=false
FEATURE_FLAG_ENABLE_ALASKA=false
FEATURE_FLAG_ENABLE_HAWAII=false
FEATURE_FLAG_ENABLE_HAWAII=false
FEATURE_FLAG_BULK_ASSIGNMENT=true
3 changes: 2 additions & 1 deletion config/env/prd.app-client-tls.env
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ FEATURE_FLAG_THIRD_ADDRESS_AVAILABLE=false
FEATURE_FLAG_QUEUE_MANAGEMENT=false
FEATURE_FLAG_DODID_UNIQUE=false
FEATURE_FLAG_ENABLE_ALASKA=false
FEATURE_FLAG_ENABLE_HAWAII=false
FEATURE_FLAG_ENABLE_HAWAII=false
FEATURE_FLAG_BULK_ASSIGNMENT=true
3 changes: 2 additions & 1 deletion config/env/prd.app.env
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ FEATURE_FLAG_THIRD_ADDRESS_AVAILABLE=false
FEATURE_FLAG_QUEUE_MANAGEMENT=false
FEATURE_FLAG_DODID_UNIQUE=false
FEATURE_FLAG_ENABLE_ALASKA=false
FEATURE_FLAG_ENABLE_HAWAII=false
FEATURE_FLAG_ENABLE_HAWAII=false
FEATURE_FLAG_BULK_ASSIGNMENT=true
3 changes: 2 additions & 1 deletion config/env/stg.app-client-tls.env
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ FEATURE_FLAG_THIRD_ADDRESS_AVAILABLE=false
FEATURE_FLAG_QUEUE_MANAGEMENT=false
FEATURE_FLAG_DODID_UNIQUE=false
FEATURE_FLAG_ENABLE_ALASKA=false
FEATURE_FLAG_ENABLE_HAWAII=false
FEATURE_FLAG_ENABLE_HAWAII=false
FEATURE_FLAG_BULK_ASSIGNMENT=true
3 changes: 2 additions & 1 deletion config/env/stg.app.env
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ FEATURE_FLAG_THIRD_ADDRESS_AVAILABLE=false
FEATURE_FLAG_QUEUE_MANAGEMENT=false
FEATURE_FLAG_DODID_UNIQUE=false
FEATURE_FLAG_ENABLE_ALASKA=false
FEATURE_FLAG_ENABLE_HAWAII=false
FEATURE_FLAG_ENABLE_HAWAII=false
FEATURE_FLAG_BULK_ASSIGNMENT=true
8 changes: 8 additions & 0 deletions config/flipt/storage/development.features.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ flags:
- segment:
key: mil-app
value: true
- key: bulk_assignment
name: bulk assignment feature flag
type: BOOLEAN_FLAG_TYPE
enabled: true
rollouts:
- segment:
key: mil-app
value: true
- key: dodid_unique
name: DODID validation feature flag that ensures unique DODIDs
type: BOOLEAN_FLAG_TYPE
Expand Down
50 changes: 50 additions & 0 deletions src/components/BulkAssignment/BulkAssignmentModal.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Button } from '@trussworks/react-uswds';

import Modal, { ModalTitle, ModalClose, ModalActions, connectModal } from 'components/Modal/Modal';

export const BulkAssignmentModal = ({ onClose, onSubmit, title, content, submitText, closeText }) => (
<Modal>
<ModalClose handleClick={() => onClose()} />
<ModalTitle>
<h3>{title}</h3>
</ModalTitle>
<p>{content}</p>
<ModalActions autofocus="true">
<Button
data-focus="true"
className="usa-button--destructive"
type="submit"
data-testid="modalSubmitButton"
onClick={() => onSubmit()}
>
{submitText}
</Button>
<Button className="usa-button--secondary" type="button" onClick={() => onClose()} data-testid="modalBackButton">
{closeText}
</Button>
</ModalActions>
</Modal>
);

BulkAssignmentModal.propTypes = {
onClose: PropTypes.func.isRequired,
onSubmit: PropTypes.func.isRequired,

title: PropTypes.string,
content: PropTypes.string,
submitText: PropTypes.string,
closeText: PropTypes.string,
};

BulkAssignmentModal.defaultProps = {
title: 'Bulk Assignment',
content: 'Here we will display moves to be assigned in bulk.',
submitText: 'Save',
closeText: 'Cancel',
};

BulkAssignmentModal.displayName = 'BulkAssignmentModal';

export default connectModal(BulkAssignmentModal);
18 changes: 18 additions & 0 deletions src/components/BulkAssignment/BulkAssignmentModal.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';

import BulkAssignmentModal from './BulkAssignmentModal';

export default {
title: 'Components/BulkAssignmentModal',
component: BulkAssignmentModal,
argTypes: {
onClose: { action: 'close button clicked' },
onSubmit: { action: 'submit button clicked' },
},
};

const ConnectedTemplate = (args) => <BulkAssignmentModal {...args} />;
export const ConnectedModal = ConnectedTemplate.bind({});
ConnectedModal.args = {
isOpen: true,
};
50 changes: 50 additions & 0 deletions src/components/BulkAssignment/BulkAssignmentModal.test.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';

import { BulkAssignmentModal } from 'components/BulkAssignment/BulkAssignmentModal';

let onClose;
let onSubmit;
beforeEach(() => {
onClose = jest.fn();
onSubmit = jest.fn();
});

describe('BulkAssignmentModal', () => {
it('renders the component', async () => {
render(<BulkAssignmentModal onSubmit={onSubmit} onClose={onClose} />);

expect(await screen.findByRole('heading', { level: 3, name: 'Bulk Assignment' })).toBeInTheDocument();
});

it('closes the modal when close icon is clicked', async () => {
render(<BulkAssignmentModal onSubmit={onSubmit} onClose={onClose} />);

const closeButton = await screen.findByTestId('modalCloseButton');

await userEvent.click(closeButton);

expect(onClose).toHaveBeenCalledTimes(1);
});

it('closes the modal when the Cancel button is clicked', async () => {
render(<BulkAssignmentModal onSubmit={onSubmit} onClose={onClose} />);

const cancelButton = await screen.findByRole('button', { name: 'Cancel' });

await userEvent.click(cancelButton);

expect(onClose).toHaveBeenCalledTimes(1);
});

it('calls the submit function when Save button is clicked', async () => {
render(<BulkAssignmentModal onSubmit={onSubmit} onClose={onClose} />);

const saveButton = await screen.findByRole('button', { name: 'Save' });

await userEvent.click(saveButton);

expect(onSubmit).toHaveBeenCalledTimes(1);
});
});
Loading
Loading