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 21977 INT Part 2 - Fix Office User Select Counseling Office Validation #14603

Open
wants to merge 123 commits into
base: integrationTesting
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 105 commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
3a7181d
Merge branch 'main' into B-21626-main
JonSpight Dec 2, 2024
8b1c41b
Merge branch 'main' into B-21626-main
JonSpight Dec 27, 2024
e2e9a7c
update pdfcpu 0.6.0 to latest 0.9.1
cameroncaci Dec 31, 2024
09c168b
Merge branch 'main' into prod-fix-pdfcpu
cameroncaci Dec 31, 2024
a085aab
adjust pdfcpu tests
cameroncaci Dec 31, 2024
aa564e5
Merge branch 'prod-fix-pdfcpu' of github.com:transcom/mymove into pro…
cameroncaci Dec 31, 2024
2e53987
add missing err checks
cameroncaci Dec 31, 2024
ed49d6e
configure generator to configure font dir manually
cameroncaci Jan 8, 2025
0050c47
set roboto regular in memory instead of file system
cameroncaci Jan 8, 2025
0ea90cd
revert custom config setup to pdfcpu default
cameroncaci Jan 8, 2025
56d7691
deploy to exp
cameroncaci Jan 8, 2025
be195e9
watermark enhancement, cleanup, and deprecation
cameroncaci Jan 8, 2025
3246d8b
Revert "deploy to exp"
cameroncaci Jan 8, 2025
7ed9771
deploy to exp again
cameroncaci Jan 9, 2025
4d3272b
remove proxy wild cards causing 404 on logout
ajlusk Dec 19, 2024
a85a996
Merge remote-tracking branch 'origin/main' into prod-fix-pdfcpu
cameroncaci Jan 9, 2025
94bd7fa
attempt setting pdfcpu config in repo
cameroncaci Jan 9, 2025
fcaa27e
set config path for pdfcpu
cameroncaci Jan 10, 2025
6281f20
self hosted err check
cameroncaci Jan 10, 2025
335347f
persist pdfcpu config to ecs container
cameroncaci Jan 10, 2025
a446315
switched pdfcpu config to be embedded
cameroncaci Jan 10, 2025
27d1c48
disable config
cameroncaci Jan 13, 2025
64dbbff
remove fonts
cameroncaci Jan 13, 2025
86b16f4
Revert "deploy to exp again"
cameroncaci Jan 13, 2025
ea9cf9a
Merge remote-tracking branch 'origin/main' into prod-fix-pdfcpu
cameroncaci Jan 13, 2025
06dd9a2
typo fix
cameroncaci Jan 13, 2025
835b429
Revert "disable config"
cameroncaci Jan 13, 2025
be3f14a
point config to temp dir for aws fargate
cameroncaci Jan 13, 2025
1577290
remove config again
cameroncaci Jan 13, 2025
765b9c4
Reapply "deploy to exp again"
cameroncaci Jan 13, 2025
c6f5817
add ephemeral volume to app-client-tls
cameroncaci Jan 14, 2025
7c51635
tmp dir and ephemeral dir switch case in pdfcpu generator
cameroncaci Jan 14, 2025
4d276d9
add log to mutable check
cameroncaci Jan 14, 2025
ac28349
overload volume over tmp
cameroncaci Jan 14, 2025
b261388
grant full access to tmp ephemeral dir
cameroncaci Jan 14, 2025
7ecc211
mount ephemeral storage to app as well
cameroncaci Jan 14, 2025
e21ce2e
Revert "overload volume over tmp"
cameroncaci Jan 14, 2025
4fb4588
point to new path
cameroncaci Jan 14, 2025
34497e7
switch from ephemeral storage to tmpfs memory use
cameroncaci Jan 15, 2025
fad47fd
Merge branch 'main' into B-21997-UI-Order
antgmann Jan 15, 2025
4832c36
fix typo
cameroncaci Jan 15, 2025
40ec0c1
configure ephemeral perms in build step of docker
cameroncaci Jan 15, 2025
a8c19e1
Revert "fix typo"
cameroncaci Jan 15, 2025
cd03521
Revert "switch from ephemeral storage to tmpfs memory use"
cameroncaci Jan 15, 2025
ef4b867
remove this
cameroncaci Jan 15, 2025
8942fa2
copy from build env
cameroncaci Jan 15, 2025
84071b5
test workdir
josiahzimmerman-caci Jan 15, 2025
f12af20
test --chown=1042 from copy
josiahzimmerman-caci Jan 15, 2025
8029c72
test --chown=nonroot user from copy
josiahzimmerman-caci Jan 15, 2025
7a1c3e9
test volume
josiahzimmerman-caci Jan 15, 2025
ccbbff7
Merge branch 'main' into B-21997-UI-Order
antgmann Jan 15, 2025
1e6a995
switch from user perms to full perms
cameroncaci Jan 15, 2025
a141d1d
change to demo
josiahzimmerman-caci Jan 15, 2025
c626770
Merge branch 'prod-fix-pdfcpu' of github.com:transcom/mymove into pro…
cameroncaci Jan 15, 2025
970809b
change directory to dir
josiahzimmerman-caci Jan 15, 2025
79c7ab5
test nonroot at copy
josiahzimmerman-caci Jan 15, 2025
b048828
last attempt for the night unless it yields different results
josiahzimmerman-caci Jan 15, 2025
3f5936a
last attempt for the night unless it yields different results - just …
josiahzimmerman-caci Jan 16, 2025
e9be06a
last attempt for the night unless it yields different results - just …
josiahzimmerman-caci Jan 16, 2025
fb80adf
some progress
josiahzimmerman-caci Jan 16, 2025
007ddae
some progress
josiahzimmerman-caci Jan 16, 2025
16b1539
ephemeral cleanup
cameroncaci Jan 16, 2025
da789ad
Knew I shouldnt have deleted Josiahs code
cameroncaci Jan 16, 2025
49db121
merging in latest main and fixing conflicts
KonstanceH Jan 16, 2025
94a3333
Revert "change to demo"
cameroncaci Jan 16, 2025
e69f7eb
Revert "Reapply "deploy to exp again""
cameroncaci Jan 16, 2025
4619e1c
comment cleanup
cameroncaci Jan 16, 2025
e0ef628
Reapply "change to demo"
cameroncaci Jan 16, 2025
95504dc
for cleanup seeing if i can remove these
cameroncaci Jan 16, 2025
ea04351
now deploy to demo for real
cameroncaci Jan 16, 2025
df50478
adding missing changes to updater
KonstanceH Jan 16, 2025
c44931c
adding missing change from test
KonstanceH Jan 16, 2025
35b0ff8
pull in latest main and fix conflicts
KonstanceH Jan 16, 2025
d2d8918
Merge branch 'main' into B-21626-main
JonSpight Jan 16, 2025
f551280
adding missing from test
KonstanceH Jan 16, 2025
6c00760
Revert "now deploy to demo for real"
cameroncaci Jan 16, 2025
6760ad3
Revert "Reapply "change to demo""
cameroncaci Jan 16, 2025
a14c54f
adjust comment
cameroncaci Jan 16, 2025
9c81f25
Merge branch 'main' into prod-fix-pdfcpu
cameroncaci Jan 16, 2025
527d58f
update gitlab.yaml withh latest optmizations
josiahzimmerman-caci Jan 16, 2025
f807ee2
remove demo and int test on default
josiahzimmerman-caci Jan 16, 2025
c29a9e7
Merge branch 'main' into B-21997-UI-Order
r-mettler Jan 16, 2025
b064853
Merge pull request #14495 from transcom/prod-fix-pdfcpu
deandreJones Jan 16, 2025
7c07606
Merge branch 'main' into B-21997-UI-Order
r-mettler Jan 16, 2025
c69023e
Merge remote-tracking branch 'origin/main' into B-21977
ajlusk Jan 16, 2025
1ead486
policy removal
josiahzimmerman-caci Jan 16, 2025
9254ad2
fix office user selecting counseling office validation
ajlusk Jan 16, 2025
2c7d25f
Merge pull request #14532 from transcom/B-21997-UI-Order
r-mettler Jan 16, 2025
85563e1
Merge branch 'main' into B-21626-main
pambecker Jan 16, 2025
90935d6
Merge branch 'main' into B-22110-cicd-optimizations
josiahzimmerman-caci Jan 16, 2025
fd50864
Merge branch 'B-21977' into B-21977-INT3
ajlusk Jan 16, 2025
ead22f0
Merge branch 'integrationTesting' into B-21977-INT3
ajlusk Jan 16, 2025
224a40b
fix AddOrdersForm test
ajlusk Jan 16, 2025
e4e2f75
Merge branch 'B-21977' into B-21977-INT3
ajlusk Jan 16, 2025
83994c4
Merge pull request #14300 from transcom/B-21626-main
pambecker Jan 16, 2025
7c94d40
Merge branch 'main' into B-22110-cicd-optimizations
josiahzimmerman-caci Jan 16, 2025
adc98a3
Merge pull request #14600 from transcom/B-22110-cicd-optimizations
josiahzimmerman-caci Jan 16, 2025
7fb141d
Merge branch 'main' into B-21904-NTS-OCONUS-MAIN
KonstanceH Jan 17, 2025
e8042fb
Merge branch 'integrationTesting' into B-21977-INT3
ajlusk Jan 17, 2025
16736fa
Merge pull request #14450 from transcom/B-21904-NTS-OCONUS-MAIN
WeatherfordAaron Jan 17, 2025
bd416ad
Merge branch 'main' into b21576-main-add_order_types_for_sc_too
JamesHawks224 Jan 17, 2025
25f6942
Merge branch 'integrationTesting' into B-21977-INT3
ajlusk Jan 17, 2025
04469ef
Merge branch 'main' into MAIN-B-22196-PPM-SIT-Cost-Defect
brooklyn-welsh Jan 17, 2025
eb05df9
Merge remote-tracking branch 'origin/main' into B-21977
ajlusk Jan 17, 2025
cb4cfaa
consistent required hints on AddOrdersForm.jsx
ajlusk Jan 17, 2025
c25596c
Merge branch 'integrationTesting' into B-21977-INT3
ajlusk Jan 17, 2025
0c90fde
Merge branch 'B-21977' into B-21977-INT3
ajlusk Jan 17, 2025
826cf1a
added intergration scripts
JacintaCallahan Jan 17, 2025
342b061
Merge pull request #14610 from transcom/MAIN-B-22196-PPM-SIT-Cost-Defect
WeatherfordAaron Jan 17, 2025
03cc3c5
Merge branch 'main' into b21576-main-add_order_types_for_sc_too
WeatherfordAaron Jan 17, 2025
82273ba
update docker runner tag; merge health check changes
josiahzimmerman-caci Jan 17, 2025
23f569d
add mtls artifact
josiahzimmerman-caci Jan 17, 2025
cf53cfa
test fixes for 21977
ajlusk Jan 17, 2025
f704154
Merge remote-tracking branch 'origin/main' into B-21977
ajlusk Jan 17, 2025
51227e6
Merge branch 'B-21977' into B-21977-INT3
ajlusk Jan 17, 2025
e6fc65a
Merge branch 'main' into B-22110-cicd-optimizations-jc
josiahzimmerman-caci Jan 17, 2025
c7bbb5c
Merge pull request #14306 from transcom/b21576-main-add_order_types_f…
WeatherfordAaron Jan 17, 2025
bc74194
Merge branch 'main' into B-22110-cicd-optimizations-jc
josiahzimmerman-caci Jan 17, 2025
3c3d645
Merge pull request #14616 from transcom/B-22110-cicd-optimizations-jc
josiahzimmerman-caci Jan 17, 2025
9ad79b6
Merge remote-tracking branch 'origin/main' into B-21977
ajlusk Jan 17, 2025
5b30fcd
test updates for 21977
ajlusk Jan 17, 2025
adf50a8
Merge branch 'B-21977' into B-21977-INT3
ajlusk Jan 17, 2025
dd96fa9
Merge branch 'integrationTesting' into B-21977-INT3
ajlusk Jan 17, 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
48 changes: 37 additions & 11 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ variables:
CLIENT_IGNORE_BRANCH: &client_ignore_branch placeholder_branch_name
SERVER_IGNORE_BRANCH: &server_ignore_branch placeholder_branch_name

#RUNNER_TAG: &runner_tag milmove
RUNNER_TAG: &runner_tag milmove
DOCKER_RUNNER_TAG: &docker_runner_tag eks_cluster_runner

Expand Down Expand Up @@ -75,31 +74,31 @@ stages:
- |
if [[ "$DP3_ENV" == "exp" || "$DP3_ENV" == "loadtest" || "$DP3_ENV" == "demo" ]]; then
export ENV=$(echo ${DP3_ENV} | tr '[:lower:]' '[:upper:]');
export TLS_CERT=$(eval echo \$${ENV^^}_DP3_CERT);
export TLS_KEY=$(eval echo \$${ENV^^}_DP3_KEY);
export TLS_CA=$(eval echo \$${ENV^^}_DP3_CA);
export TLS_CERT=$(eval echo \$${ENV}_DP3_CERT);
export TLS_KEY=$(eval echo \$${ENV}_DP3_KEY);
export TLS_CA=$(eval echo \$${ENV}_DP3_CA);
fi

.setup_aws_vars_dp3: &setup_aws_vars_dp3
- |
if [[ "$DP3_ENV" == "exp" || "$DP3_ENV" == "loadtest" || "$DP3_ENV" == "demo" ]]; then
export ENV=$(echo ${DP3_ENV} | tr '[:lower:]' '[:upper:]');
export AWS_DEFAULT_REGION=$(eval echo \$${ENV^^}_REGION);
export AWS_ACCOUNT_ID=$(eval echo \$${ENV^^}_ACCOUNT_ID);
export AWS_ACCESS_KEY_ID=$(eval echo \$${ENV^^}_ACCESS_KEY_ID);
export AWS_SECRET_ACCESS_KEY=$(eval echo \$${ENV^^}_SECRET_ACCESS_KEY);
export AWS_DEFAULT_REGION=$(eval echo \$${ENV}_REGION);
export AWS_ACCOUNT_ID=$(eval echo \$${ENV}_ACCOUNT_ID);
export AWS_ACCESS_KEY_ID=$(eval echo \$${ENV}_ACCESS_KEY_ID);
export AWS_SECRET_ACCESS_KEY=$(eval echo \$${ENV}_SECRET_ACCESS_KEY);
fi

.setup_release_dp3: &setup_release_dp3
- |
if [[ "$DP3_ENV" == "exp" || "$DP3_ENV" == "loadtest" || "$DP3_ENV" == "demo" ]]; then
export ENV=$(echo ${DP3_ENV} | tr '[:lower:]' '[:upper:]');
export AWS_REGION=$(eval echo \$${ENV}_REGION);
export AWS_DEFAULT_REGION=$(eval echo \$${ENV}_REGION);
export AWS_ACCOUNT_ID=$(eval echo \$${ENV}_ACCOUNT_ID);
export ECR_REPOSITORY_URI=$(echo ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com)
export ECR_REPOSITORY_URI=$(echo ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com)
export APP_DOCKER_FILE=Dockerfile.dp3
export TASK_DOCKER_FILE=Dockerfile.tasks_dp3
export APP_ENVIRONMENT=$ENV
export APP_ENVIRONMENT=$DP3_ENV
fi

.setup_aws_vars_stg: &setup_aws_vars_stg
Expand Down Expand Up @@ -185,6 +184,7 @@ stages:
- yarn.lock
paths:
- .cache/yarn
policy: pull-push

.go_cache: &go_cache
key:
Expand All @@ -193,6 +193,7 @@ stages:
paths:
- $GOPATH/pkg/mod
- /builds/milmove/mymove/bin
policy: pull-push

.setup_generic_app_env_variables: &setup_generic_app_env_variables
- |
Expand Down Expand Up @@ -423,6 +424,7 @@ build_storybook:
- anti_virus
cache:
- <<: *yarn_cache
policy: pull
before_script:
- *setup_milmove_env
- *install_yarn
Expand Down Expand Up @@ -464,6 +466,7 @@ compile_app_client:
image: $DOCKER_APP_IMAGE
cache:
- <<: *yarn_cache
policy: pull
variables:
KUBERNETES_CPU_REQUEST: "6"
KUBERNETES_MEMORY_REQUEST: "8Gi"
Expand Down Expand Up @@ -495,7 +498,9 @@ compile_app_server:
image: $DOCKER_APP_IMAGE
cache:
- <<: *go_cache
policy: pull
- <<: *yarn_cache
policy: pull
variables:
KUBERNETES_CPU_REQUEST: "6"
KUBERNETES_MEMORY_REQUEST: "6Gi"
Expand Down Expand Up @@ -541,7 +546,9 @@ pre_test:
image: $DOCKER_APP_IMAGE
cache:
- <<: *go_cache
policy: pull
- <<: *yarn_cache
policy: pull
needs:
- pre_deps_golang
- pre_deps_yarn
Expand Down Expand Up @@ -584,6 +591,7 @@ pre_test:
- echo "Run spectral linter on all files"
- ./scripts/ensure-spectral-lint /tmp/spectral_baseline spectral
- ./scripts/pre-commit-go-mod || exit 0
allow_failure: true
after_script:
- *announce_failure
rules:
Expand Down Expand Up @@ -646,6 +654,7 @@ server_test:
# - go install gotest.tools/gotestsum@latest
# - go mod tidy
#- bin/gotestsum --junitfile server_test_report.xml --format server_test
allow_failure: true
artifacts:
paths:
- /builds/milmove/mymove/bin/gotestsum
Expand Down Expand Up @@ -675,6 +684,7 @@ server_test_coverage:
./scripts/ensure-go-test-coverage \
tmp/baseline-go-coverage/go-coverage.txt \
tmp/test-results/gotest/app/go-coverage.txt
allow_failure: true
after_script:
- *announce_failure
rules:
Expand All @@ -700,6 +710,7 @@ client_test:
- pre_deps_yarn
cache:
- <<: *yarn_cache
policy: pull
before_script:
- *setup_milmove_env
- *install_yarn
Expand Down Expand Up @@ -788,6 +799,7 @@ integration_test_devseed:
export MOVE_MIL_DOD_TLS_CERT=$(cat config/tls/devlocal-https.pem)
export MOVE_MIL_DOD_TLS_KEY=$(cat config/tls/devlocal-https.key)
- make db_dev_fresh
allow_failure: true
after_script:
- *announce_failure
rules:
Expand All @@ -811,6 +823,7 @@ integration_tests:
script:
- echo "TODO Add steps"
- echo "integration_tests"
allow_failure: true
after_script:
- *announce_failure
rules:
Expand All @@ -828,6 +841,7 @@ integration_test_mtls:
script:
- echo "TODO Add steps"
- echo "integration_test_mtls"
allow_failure: true
after_script:
- *announce_failure
rules:
Expand Down Expand Up @@ -866,6 +880,7 @@ integration_test_my:
script:
- echo "TODO Add steps"
- echo "integration_test_my"
allow_failure: true
after_script:
- *announce_failure
rules:
Expand All @@ -885,6 +900,7 @@ integration_test_office:
script:
- echo "TODO Add steps"
- echo "integration_test_office"
allow_failure: true
after_script:
- *announce_failure
rules:
Expand Down Expand Up @@ -968,6 +984,9 @@ push_otel_collector_image_dp3:
tags:
- $RUNNER_TAG
environment: DP3_ENV
before_script:
- *setup_aws_vars_dp3
- *setup_release_dp3
image:
name: $DOCKER_BASE_IMAGE
entrypoint: [""]
Expand Down Expand Up @@ -1001,6 +1020,7 @@ deploy_migrations_dp3:
name: $DOCKER_APP_IMAGE
entrypoint: [""]
needs:
- push_otel_collector_image_dp3
- build_push_migrations_dp3
- compile_app_server
- compile_app_client
Expand Down Expand Up @@ -1030,10 +1050,12 @@ deploy_tasks_dp3:
name: $DOCKER_APP_IMAGE
entrypoint: [""]
needs:
- deploy_migrations_dp3
- build_push_tasks_dp3
- compile_app_server
- compile_app_client
before_script:
- *setup_aws_vars_dp3
- *setup_release_dp3
script:
- echo "Getting Digest from AWS"
Expand Down Expand Up @@ -1250,6 +1272,7 @@ deploy_migrations_stg:
name: $DOCKER_APP_IMAGE
entrypoint: [""]
needs:
- push_otel_collector_image_stg
- build_push_migrations_stg
- compile_app_server
- compile_app_client
Expand Down Expand Up @@ -1280,6 +1303,7 @@ deploy_tasks_stg:
name: $DOCKER_APP_IMAGE
entrypoint: [""]
needs:
- deploy_migrations_stg
- build_push_tasks_stg
- compile_app_server
- compile_app_client
Expand Down Expand Up @@ -1517,6 +1541,7 @@ deploy_migrations_prd:
name: $DOCKER_APP_IMAGE
entrypoint: [""]
needs:
- push_otel_collector_image_prd
- build_push_migrations_prd
- compile_app_server
- compile_app_client
Expand Down Expand Up @@ -1547,6 +1572,7 @@ deploy_tasks_prd:
name: $DOCKER_APP_IMAGE
entrypoint: [""]
needs:
- deploy_migrations_prd
- build_push_tasks_prd
- compile_app_server
- compile_app_client
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ COPY swagger/* /swagger/
COPY build /build
COPY public/static/react-file-viewer /public/static/react-file-viewer

# Keep the tmp!
# Mount mutable tmp for app packages like pdfcpu
VOLUME ["/tmp"]

ENTRYPOINT ["/bin/milmove"]
Expand Down
5 changes: 1 addition & 4 deletions Dockerfile.dp3
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
FROM debian:stable AS build-env

## Give full perms to tmp for the server to have a read/write location
RUN mkdir -p /tmp && chmod 777 /tmp

# hadolint ignore=DL3007
FROM gcr.io/distroless/base-debian11@sha256:ac69aa622ea5dcbca0803ca877d47d069f51bd4282d5c96977e0390d7d256455

Expand Down Expand Up @@ -35,7 +32,7 @@ COPY swagger/* /swagger/
COPY build /build
COPY public/static/react-file-viewer /public/static/react-file-viewer

# Keep the tmp!
# Mount mutable tmp for app packages like pdfcpu
VOLUME ["/tmp"]

ENTRYPOINT ["/bin/milmove"]
Expand Down
24 changes: 19 additions & 5 deletions src/components/Office/AddOrdersForm/AddOrdersForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ const AddOrdersForm = ({
.required('Required'),
hasDependents: Yup.mixed().oneOf(['yes', 'no']).required('Required'),
originDutyLocation: Yup.object().nullable().required('Required'),
counselingOfficeId: currentDutyLocation.provides_services_counseling
? Yup.string().required('Required')
: Yup.string().notRequired(),
newDutyLocation: Yup.object().nullable().required('Required'),
grade: Yup.mixed().oneOf(Object.keys(ORDERS_PAY_GRADE_OPTIONS)).required('Required'),
accompaniedTour: showAccompaniedTourField
Expand Down Expand Up @@ -193,9 +196,10 @@ const AddOrdersForm = ({
handleOrderTypeChange(e);
}}
isDisabled={isSafetyMoveSelected || isBluebarkMoveSelected}
hint="Required"
/>
<DatePickerInput name="issueDate" label="Orders date" required />
<DatePickerInput name="reportByDate" label="Report by date" required />
<DatePickerInput name="issueDate" label="Orders date" required hint="Required" />
<DatePickerInput name="reportByDate" label="Report by date" required hint="Required" />

<DutyLocationInput
label="Current duty location"
Expand All @@ -207,6 +211,7 @@ const AddOrdersForm = ({
}}
metaOverride={originMeta}
required
hint="Required"
/>
{currentDutyLocation.provides_services_counseling && (
<div>
Expand Down Expand Up @@ -256,6 +261,7 @@ const AddOrdersForm = ({
displayAddress={false}
placeholder="Enter a city or ZIP"
metaOverride={newDutyMeta}
hint="Required"
onDutyLocationChange={(e) => {
setNewDutyLocation(e);
}}
Expand All @@ -266,6 +272,7 @@ const AddOrdersForm = ({
name="newDutyLocation"
label="New duty location"
required
hint="Required"
metaOverride={newDutyMeta}
onDutyLocationChange={(e) => {
setNewDutyLocation(e);
Expand All @@ -274,7 +281,7 @@ const AddOrdersForm = ({
)}

<FormGroup>
<Label>Are dependents included in the orders?</Label>
<Label hint="Required">Are dependents included in the orders?</Label>
<div>
<Field
as={Radio}
Expand Down Expand Up @@ -309,7 +316,7 @@ const AddOrdersForm = ({

{showAccompaniedTourField && (
<FormGroup>
<Label>Is this an accompanied tour?</Label>
<Label hint="Required">Is this an accompanied tour?</Label>
<div>
<div className={styles.radioWithToolTip}>
<Field
Expand Down Expand Up @@ -383,7 +390,14 @@ const AddOrdersForm = ({
</FormGroup>
)}

<DropdownInput label="Pay grade" name="grade" id="grade" required options={payGradeOptions} />
<DropdownInput
label="Pay grade"
name="grade"
id="grade"
required
options={payGradeOptions}
hint="Required"
/>
</SectionWrapper>

<div className={formStyles.formActions}>
Expand Down
32 changes: 32 additions & 0 deletions src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,38 @@ describe('AddOrdersForm - With Counseling Office', () => {
const nextBtn = screen.getByRole('button', { name: 'Next' });
expect(nextBtn.getAttribute('disabled')).toBeFalsy();
});

it('disabled submit if counseling office is required and blank', async () => {
isBooleanFlagEnabled.mockImplementation(() => Promise.resolve(true));
render(
<Provider store={mockStore.store}>
<AddOrdersForm {...testProps} />
</Provider>,
);

await userEvent.selectOptions(await screen.findByLabelText(/Orders type/), 'PERMANENT_CHANGE_OF_STATION');
await userEvent.type(screen.getByLabelText(/Orders date/), '08 Nov 2024');
await userEvent.type(screen.getByLabelText(/Report by date/), '26 Nov 2024');

// Test Current Duty Location Search Box interaction
await userEvent.type(screen.getByLabelText(/Current duty location/), 'AFB', { delay: 100 });
const selectedOptionCurrent = await screen.findByText(/Scott/);
await userEvent.click(selectedOptionCurrent);

// Test New Duty Location Search Box interaction
await userEvent.type(screen.getByLabelText(/New duty location/), 'AFB', { delay: 100 });
const selectedOptionNew = await screen.findByText(/Luke/);
await userEvent.click(selectedOptionNew);

const counselingOfficeLabel = await screen.queryByText(/Counseling office/);
expect(counselingOfficeLabel).toBeTruthy(); // If the field is visible then it it required

await userEvent.selectOptions(screen.getByLabelText(/Pay grade/), ['E_5']);
await userEvent.click(screen.getByLabelText('No'));

const nextBtn = await screen.getByRole('button', { name: 'Next' }, { delay: 100 });
expect(nextBtn).toBeDisabled();
});
});
describe('AddOrdersForm - Edge Cases and Additional Scenarios', () => {
it('disables orders type when safety move is selected', async () => {
Expand Down
Loading