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

[Prod] Boundary diagram, manual mark goals similar, Worker Transactions, Graceful Shutdown, Remove goals from TR, Support request #2306

Merged
merged 219 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
219 commits
Select commit Hold shift + click to select a range
8a418b5
implement graceful shutdown
GarrettEHill Jun 24, 2024
8b61086
add tests
GarrettEHill Jun 24, 2024
ffda3c0
exports, and connection hooks
GarrettEHill Jun 24, 2024
5178dd2
test coverage
GarrettEHill Jun 24, 2024
c916b9a
Update dataValidation.test.js
GarrettEHill Jun 26, 2024
911cfc8
Update index.test.js
GarrettEHill Jun 26, 2024
5a7fccc
Update index.test.js
GarrettEHill Jun 26, 2024
d9cb075
Update index.test.js
GarrettEHill Jun 26, 2024
5c2e6a7
Update index.test.js
GarrettEHill Jun 26, 2024
ad95542
Update index.test.js
GarrettEHill Jun 26, 2024
ca9e9ce
Update index.test.js
GarrettEHill Jun 26, 2024
24672b4
Update index.test.js
GarrettEHill Jun 26, 2024
bb970b4
Update index.test.js
GarrettEHill Jun 26, 2024
7815f34
adding details
GarrettEHill Jun 27, 2024
36306e2
adding details to graceful shutdown commands
GarrettEHill Jun 27, 2024
b900c79
lint
GarrettEHill Jun 27, 2024
bcf4a07
Update index.js
GarrettEHill Jun 28, 2024
d78ff07
populate output during tests
GarrettEHill Jun 28, 2024
aa51fe3
Merge branch 'main' into TTAHUB-3108-graceful-shutdown
GarrettEHill Jun 28, 2024
d8d9375
Update jest.setup.js
GarrettEHill Jun 28, 2024
7b9d90a
Update jest.setup.js
GarrettEHill Jun 28, 2024
2c79fdc
well that did not work
GarrettEHill Jun 28, 2024
cf606ae
Changes per code review
GarrettEHill Jul 1, 2024
b6eb5e2
lint
GarrettEHill Jul 1, 2024
a9906d0
lint
GarrettEHill Jul 1, 2024
367816d
Update processHandler.test.js
GarrettEHill Jul 1, 2024
82677f8
Update processHandler.test.js
GarrettEHill Jul 1, 2024
88b7ba5
more verbose error
GarrettEHill Jul 2, 2024
2b59986
more useful test
GarrettEHill Jul 2, 2024
d822d38
much better test
GarrettEHill Jul 2, 2024
1eaf8b7
lint
GarrettEHill Jul 2, 2024
7c7fe45
Update processHandler.test.js
GarrettEHill Jul 2, 2024
d2d8fc6
Update HubIdentifier.js
GarrettEHill Jul 3, 2024
9e3e0b6
refactor
GarrettEHill Jul 8, 2024
9a2c7b3
attempting to tweak redis connections
GarrettEHill Jul 8, 2024
cbb44ee
lint
GarrettEHill Jul 8, 2024
fd05315
fix errors
GarrettEHill Jul 8, 2024
a418a04
more cleanup
GarrettEHill Jul 9, 2024
9fe3c56
fix await/async
GarrettEHill Jul 9, 2024
6a207a8
Merge branch 'main' into TTAHUB-3108-graceful-shutdown
GarrettEHill Jul 9, 2024
0ea902d
try this
GarrettEHill Jul 9, 2024
326e6bc
Update processHandler.js
GarrettEHill Jul 9, 2024
df588dd
fix tests
GarrettEHill Jul 11, 2024
1ddad02
Merge branch 'main' into TTAHUB-3108-graceful-shutdown
GarrettEHill Jul 11, 2024
a59ba87
Merge branch 'main' into TTAHUB-3108-graceful-shutdown
GarrettEHill Jul 11, 2024
64dddf9
Merge branch 'main' into TTAHUB-3108-graceful-shutdown
GarrettEHill Jul 11, 2024
69ce898
Update genericFile.test.js
GarrettEHill Jul 11, 2024
1c7887f
locate error
GarrettEHill Jul 12, 2024
cdd7998
Merge branch 'main' into TTAHUB-3108-graceful-shutdown
GarrettEHill Jul 15, 2024
a2e0b31
Merge branch 'main' into TTAHUB-3108-graceful-shutdown
GarrettEHill Jul 15, 2024
f7bc1cf
Update worker.ts
GarrettEHill Jul 15, 2024
b0b0e30
Update apiErrorHandler.test.js
GarrettEHill Jul 15, 2024
dfa957e
cleanup for tests
GarrettEHill Jul 15, 2024
a3b7683
clearmocks
GarrettEHill Jul 15, 2024
39f05af
test of test
kryswisnaskas Jul 16, 2024
81d8b88
Refactor tests
kryswisnaskas Jul 16, 2024
da51921
More refactoring
kryswisnaskas Jul 16, 2024
ec69cc7
Fix more tests
kryswisnaskas Jul 16, 2024
01d59b9
Merge branch 'main' into TTAHUB-3108-graceful-shutdown
GarrettEHill Jul 17, 2024
579bf0e
Update programmaticTransaction.test.js
GarrettEHill Jul 17, 2024
4884e94
Update programmaticTransaction.test.js
GarrettEHill Jul 18, 2024
b7fc27d
Merge branch 'main' into TTAHUB-3108-graceful-shutdown
GarrettEHill Jul 18, 2024
0be523d
changes fix tests
GarrettEHill Jul 18, 2024
a7068c9
Merge branch 'main' into TTAHUB-3108-graceful-shutdown
GarrettEHill Jul 18, 2024
49fe6b9
Revert "Revert "Merge pull request #2233 from HHS/TTAHUB-3097/worker-…
GarrettEHill Jul 19, 2024
bebee3a
Update transactionWrapper.ts
GarrettEHill Jul 19, 2024
132a90f
Update config.yml
GarrettEHill Jul 19, 2024
5b16a06
dont run db maintenance in a transaction
GarrettEHill Jul 19, 2024
a7dfefd
Update config.yml
GarrettEHill Jul 19, 2024
e504309
Update config.yml
GarrettEHill Jul 19, 2024
74600c1
some fixes
GarrettEHill Jul 20, 2024
a28f6ed
fix ar bug
GarrettEHill Jul 22, 2024
fe4ebbc
Merge branch 'main' into TTAHUB-3097/transactions-for-workers-round-2
GarrettEHill Jul 22, 2024
772dc5f
fixes
GarrettEHill Jul 22, 2024
9bf3309
test fix
GarrettEHill Jul 22, 2024
8cd0682
Update activityReports.js
GarrettEHill Jul 23, 2024
dc2f400
initial pass
nvms Jul 24, 2024
5f5b52f
fix import
nvms Jul 24, 2024
c429665
Merge branch 'main' into TTAHUB-3097/transactions-for-workers-round-2
GarrettEHill Jul 24, 2024
642609a
Merge branch 'main' into TTAHUB-3108-graceful-shutdown
GarrettEHill Jul 24, 2024
7e648d0
more to remove
nvms Jul 24, 2024
44aaca5
update migration and remove whitespace for reasons
nvms Jul 24, 2024
2515266
remove join
nvms Jul 24, 2024
6ecc4ab
remove session objectives from rtr?
nvms Jul 24, 2024
5407d9f
update tests
nvms Jul 24, 2024
98a8c33
update migration to:
nvms Jul 24, 2024
4a971d1
adjust test
nvms Jul 25, 2024
16eab01
adjust test
nvms Jul 25, 2024
0d70966
adjust test
nvms Jul 25, 2024
35a342d
fix merge issues
GarrettEHill Jul 25, 2024
6a9d98b
fix tests
GarrettEHill Jul 25, 2024
3bf88eb
Update programmaticTransaction.test.js
GarrettEHill Jul 25, 2024
53ec1ce
Update programmaticTransaction.test.js
GarrettEHill Jul 25, 2024
14a536f
Update programmaticTransaction.ts
GarrettEHill Jul 25, 2024
896de64
Update programmaticTransaction.test.js
GarrettEHill Jul 25, 2024
98d923e
Update programmaticTransaction.test.js
GarrettEHill Jul 25, 2024
aa5b950
Update programmaticTransaction.ts
GarrettEHill Jul 25, 2024
e90a35d
remove logging
GarrettEHill Jul 25, 2024
f731d22
logging
GarrettEHill Jul 25, 2024
42599d1
Update programmaticTransaction.test.js
GarrettEHill Jul 25, 2024
5455809
Update programmaticTransaction.test.js
GarrettEHill Jul 26, 2024
e677e2d
Update programmaticTransaction.test.js
GarrettEHill Jul 26, 2024
d8211bd
Update programmaticTransaction.test.js
GarrettEHill Jul 26, 2024
3e5b8c8
Update package.json
GarrettEHill Jul 26, 2024
df68c53
Update programmaticTransaction.test.js
GarrettEHill Jul 26, 2024
7d39b22
Update programmaticTransaction.test.js
GarrettEHill Jul 26, 2024
7c33b3e
Update activityReports.js
GarrettEHill Jul 29, 2024
717cea7
Update yarn-audit-known-issues
GarrettEHill Jul 29, 2024
dee8791
the fix
GarrettEHill Jul 30, 2024
ce09f33
update tr e2e test
nvms Jul 30, 2024
9a0c280
remove test for TR goal
nvms Jul 30, 2024
ba434c0
remove session objectives test
nvms Jul 30, 2024
9c34aec
changes per code review
GarrettEHill Jul 30, 2024
be5b266
fix lint
GarrettEHill Jul 30, 2024
e9f3511
Merge branch 'main' into TTAHUB-3108-graceful-shutdown
GarrettEHill Jul 30, 2024
780e65e
yarn audit
nvms Aug 1, 2024
02f07f9
fix test
nvms Aug 1, 2024
18a5c39
Merge branch 'main' into TTAHUB-3097/transactions-for-workers-round-2
GarrettEHill Aug 1, 2024
4d423f1
Merge branch 'main' into TTAHUB-3108-graceful-shutdown
GarrettEHill Aug 1, 2024
996d104
lint
GarrettEHill Aug 1, 2024
3af6f65
debugging
GarrettEHill Aug 1, 2024
5e87553
debug
GarrettEHill Aug 1, 2024
7c1102f
wrong PR
GarrettEHill Aug 1, 2024
bad3419
fix sql race condition for testutils
GarrettEHill Aug 1, 2024
aed2a20
reset all mocks before starting tests
GarrettEHill Aug 1, 2024
fbd5e10
Update 20240531163151-remove-unused-objective-tables.js
GarrettEHill Aug 1, 2024
69afe1f
try addinfg a mock bull to clear up random unknown queue related errors
GarrettEHill Aug 1, 2024
add5186
more debugging
GarrettEHill Aug 1, 2024
44c6369
Update db.test.js
GarrettEHill Aug 1, 2024
136dff9
An attempt to address test issues
GarrettEHill Aug 2, 2024
b30b24d
migration to remove commlog 4849
nvms Aug 5, 2024
fc013ba
what does this do?
nvms Aug 5, 2024
0d31459
store_test_results
nvms Aug 5, 2024
9402050
is this the right path?
nvms Aug 5, 2024
38e6948
break this test so I can see the error in CI
nvms Aug 5, 2024
cf5b4e9
fix the path
nvms Aug 5, 2024
c32ee37
Merge pull request #2300 from HHS/jp/3264/remove-comlog-4849
nvms Aug 5, 2024
ba97850
what about this?
nvms Aug 5, 2024
fe7a1d4
getting there.. maybe?
nvms Aug 5, 2024
6ddfec7
path collision bad
nvms Aug 5, 2024
18c3a3a
don't need this any more
nvms Aug 5, 2024
0836558
no need to store test results because we can just view them from the
nvms Aug 5, 2024
360ea5b
Revert "break this test so I can see the error in CI"
nvms Aug 5, 2024
df0aefa
change paths
nvms Aug 5, 2024
c18f49c
Merge pull request #2301 from HHS/jp/playwright-reporters
nvms Aug 6, 2024
1944ce4
new feature flag
GarrettEHill Aug 7, 2024
b4282b1
add new route
GarrettEHill Aug 7, 2024
1bb0b30
implement new route
GarrettEHill Aug 7, 2024
d904896
test new route
GarrettEHill Aug 7, 2024
061bb8d
Create 20240807000000-add-manual_mark_goals_similar.js
GarrettEHill Aug 7, 2024
207ccaa
Update 20240807000000-add-manual_mark_goals_similar.js
GarrettEHill Aug 7, 2024
407595d
add migration
nvms Aug 7, 2024
fc9886f
better comments
nvms Aug 7, 2024
cb06431
Update handlers.js
GarrettEHill Aug 7, 2024
1126ad4
Update handlers.test.js
GarrettEHill Aug 7, 2024
2b9fe18
Update handlers.js
GarrettEHill Aug 7, 2024
163e083
Update handlers.test.js
GarrettEHill Aug 7, 2024
b54a7b4
Update index.js
GarrettEHill Aug 7, 2024
f6ecb60
Update goalSimilarityGroup.ts
GarrettEHill Aug 7, 2024
b2eda4c
model updates
GarrettEHill Aug 7, 2024
201cd48
bug fix
GarrettEHill Aug 7, 2024
718e791
partial frontend
GarrettEHill Aug 7, 2024
2cfe67c
fix FK bug with GoalSimilarityGroupGoals & exclude 83050
nvms Aug 7, 2024
2a599ed
Update handlers.test.js
GarrettEHill Aug 7, 2024
9881bf5
Update GoalsCardsHeader.js
GarrettEHill Aug 7, 2024
e82d78d
Update src/lib/queue.js
GarrettEHill Aug 7, 2024
90a07e6
Update package.json
GarrettEHill Aug 7, 2024
0a01b5c
mv migration
nvms Aug 7, 2024
87e41d9
Update GoalsCardsHeader.js
GarrettEHill Aug 7, 2024
ab908d6
make CI less chatty
GarrettEHill Aug 7, 2024
86e424b
Fix tests
GarrettEHill Aug 7, 2024
c2506b3
can't test when disabled in CI
GarrettEHill Aug 7, 2024
72f0036
Merge branch 'main' into jp/3215/remove-tr-goals
nvms Aug 8, 2024
f7cf572
Merge pull request #2302 from HHS/jp/3265/reset-session-completions
nvms Aug 8, 2024
95ca6e3
Merge pull request #2286 from HHS/jp/3215/remove-tr-goals
nvms Aug 8, 2024
c7897ff
Merge branch 'main' into TTAHUB-3097/transactions-for-workers-round-2
GarrettEHill Aug 8, 2024
f76fb6f
Update src/routes/recipient/index.js
GarrettEHill Aug 8, 2024
9985376
Merge pull request #2224 from HHS/TTAHUB-3108-graceful-shutdown
GarrettEHill Aug 8, 2024
48b1c3d
Merge branch 'main' into TTAHUB-3097/transactions-for-workers-round-2
GarrettEHill Aug 8, 2024
fc6d3af
fixes for merge
GarrettEHill Aug 8, 2024
a81f7b0
Update GoalsCardsHeader.js
GarrettEHill Aug 8, 2024
c15f720
More of an attempt
GarrettEHill Aug 8, 2024
3858d3d
Merge pull request #2282 from HHS/TTAHUB-3097/transactions-for-worker…
GarrettEHill Aug 8, 2024
f528de1
fix lint
GarrettEHill Aug 8, 2024
b3e1fc2
move fetcher
GarrettEHill Aug 8, 2024
af1204c
req.body
nvms Aug 8, 2024
6281b95
recipient*
nvms Aug 8, 2024
004b4cb
Update handlers.js
GarrettEHill Aug 8, 2024
b503395
only show when more then 1 goal is selected
GarrettEHill Aug 8, 2024
56d5c53
more betterer
GarrettEHill Aug 8, 2024
eb065bf
add flag to byPassChecks
GarrettEHill Aug 8, 2024
0619dcd
update tests
GarrettEHill Aug 8, 2024
5911da8
fix lint
GarrettEHill Aug 8, 2024
59ed500
Update handlers.test.js
GarrettEHill Aug 8, 2024
9ef42cf
Merge branch 'main' into TTAHUB-3281/manual-mark-goals-similar
GarrettEHill Aug 8, 2024
c27a99e
fix errors
GarrettEHill Aug 8, 2024
9eec0cb
Update GoalsCardsHeader.js
GarrettEHill Aug 8, 2024
c52df80
Update GoalCards.js
GarrettEHill Aug 8, 2024
e7c70f8
Update handlers.test.js
GarrettEHill Aug 8, 2024
73a2430
more mocks to fix front end tests
GarrettEHill Aug 8, 2024
33f68e4
more mocks
GarrettEHill Aug 8, 2024
61089f0
more mocking
GarrettEHill Aug 8, 2024
0b322df
Update GoalsCardsHeader.js
GarrettEHill Aug 9, 2024
3725b4f
update test
nvms Aug 9, 2024
045f09b
update test
nvms Aug 9, 2024
539c0f3
satisfy linter
nvms Aug 9, 2024
160d34d
whoops
nvms Aug 9, 2024
895648a
fix test
nvms Aug 9, 2024
5a66d6e
use history.go instead of location.reload
nvms Aug 9, 2024
27a48c4
Adding automation
GarrettEHill Aug 9, 2024
070fdd3
Merge pull request #2304 from HHS/TTAHUB-3206/boundry-diagram
GarrettEHill Aug 9, 2024
a4257b8
pushing this suggested change per Garrett
AdamAdHocTeam Aug 9, 2024
6196faa
remove commented code
GarrettEHill Aug 9, 2024
659748a
Update frontend/src/components/GoalCards/GoalsCardsHeader.js
GarrettEHill Aug 9, 2024
0fe2c82
Merge pull request #2303 from HHS/TTAHUB-3281/manual-mark-goals-similar
GarrettEHill Aug 9, 2024
f594468
Fix typos
GarrettEHill Aug 9, 2024
bfd958a
Merge pull request #2305 from HHS/TTAHUB-3206/boundry-diagram-2
GarrettEHill Aug 10, 2024
c91f14e
Update known issues
thewatermethod Aug 12, 2024
f1d558f
Merge pull request #2311 from HHS/mb/update-axios
nvms Aug 13, 2024
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
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ commands:
#!/bin/bash
CONTROL_FILE="/tmp/stop_tail"
rm -f $CONTROL_FILE

# Start tailing logs
cf logs tta-automation &

Expand Down Expand Up @@ -509,7 +509,7 @@ commands:
# Signal the log monitoring to stop
CONTROL_FILE="/tmp/stop_tail"
touch $CONTROL_FILE

# Wait for the log monitoring process to terminate
sleep 5

Expand Down Expand Up @@ -551,7 +551,7 @@ parameters:
type: string
dev_git_branch: # change to feature branch to test deployment
description: "Name of github branch that will deploy to dev"
default: "al-ttahub-2939-add-fei-root-cause-to-goal-card"
default: "TTAHUB-3097/transactions-for-workers-round-2"
type: string
sandbox_git_branch: # change to feature branch to test deployment
default: "mb/TTAHUB-3198/training-report-alerts"
Expand Down Expand Up @@ -799,7 +799,7 @@ jobs:
name: Run playwright tests
command: yarn e2e:ci
- store_artifacts:
path: playwright/e2e
path: tests/e2e
resource_class: large
test_api:
executor: docker-postgres-executor
Expand Down Expand Up @@ -836,7 +836,7 @@ jobs:
name: Run playwright tests
command: yarn e2e:api
- store_artifacts:
path: playwright/api
path: tests/api
resource_class: large
test_utils:
executor: docker-postgres-executor
Expand Down Expand Up @@ -868,7 +868,7 @@ jobs:
name: Run playwright tests
command: yarn e2e:utils
- store_artifacts:
path: playwright/utilsTests
path: tests/utilsTests
resource_class: large
cucumber_test:
executor: docker-postgres-executor
Expand Down
44 changes: 44 additions & 0 deletions docs/boundary_diagram.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,37 @@ Boundary(aws, "AWS GovCloud") {
Container(similarity_api, "Similarity API", "Python", "AI application to identify similarity of text")
Container(clamav, "File scanning API", "ClamAV", "Internal application for scanning user uploads\n\n docker: ajilaag/clamav-rest:20211026")
}
Boundary(auto, "Automation") {
Container(auto_prod_backup, "<&layers> Automation (Production backup)", "bash", "Streams database backup directly to s3(backup) in a password protected encrypted zip compressed format") #green
Container(auto_prod_restore, "<&layers> Automation (Restore for processing)", "bash", "Streams database backup directly from s3(backup) in a password protected encrypted zip compressed format to processing DB") #green
Container(auto_prod_proc, "<&layers> Automation (Processing to remove PII)", "NodeJS", "Processes restored production data to remove PII for use in lower environments") #green
Container(auto_proc_backup, "<&layers> Automation (Backup processed DB)", "bash", "Streams processed database backup directly to s3(backup) in a password protected encrypted zip compressed format") #green
Container(auto_proc_restore, "<&layers> Automation (Restore processed data to lower environments)", "bash", "Streams processed database backup directly from s3(backup) in a password protected encrypted zip compressed format to lower environment DB") #green
}
note right of auto
At any one time, a max of only one of these configurations is enabled.
All connections are unbound when not in use.
No routes are configured.
Resources (RAM, Disk) are minimized to only what is needed for the singular automation task.
end note
Boundary(cloudgov_services, "Services") {
ContainerDb(www_db, "PostgreSQL Database", "AWS RDS", "Contains content and configuration for the TTA Hub")
ContainerDb(www_s3, "AWS S3 bucket", "AWS S3", "Stores static file assets")
ContainerDb(www_redis, "Redis Database", "AWS Elasticache", "Queue of background jobs to work on")

ContainerDb(auto_db, "Automation PostgreSQL Database", "AWS RDS", "Used to process production data to remove PII") #green
ContainerDb(auto_s3, "Automation AWS S3 bucket", "AWS S3", "Stores production and processed DB backups") #green

ContainerDb(logs_s3, "Log transfer AWS S3 bucket", "AWS S3", "Stores production DB logs when requested from cloud.gov") #orange
}
Boundary(cloudgov_services_staging, "Services - Staging") {
ContainerDb(staging_db, "PostgreSQL Database", "AWS RDS", "Contains PII-free content and configuration for the TTA Hub testing") #violet
}
Boundary(cloudgov_services_dev, "Services - Dev") {
ContainerDb(dev_db, "PostgreSQL Database", "AWS RDS", "Contains PII-free content and configuration for the TTA Hub testing") #violet
}
Boundary(cloudgov_services_sandbox, "Services - Sandbox") {
ContainerDb(sandbox_db, "PostgreSQL Database", "AWS RDS", "Contains PII-free content and configuration for the TTA Hub testing") #violet
}
}
}
Expand All @@ -48,6 +75,23 @@ Boundary(gsa_saas, "SaaS") {
Boundary(gsa_fed_saas, "FedRAMP-approved SaaS") {
System_Ext(newrelic, "New Relic", "Continuous Monitoring")
}

Rel(www_db, auto_prod_backup, "backup", "pg_dump")
Rel(auto_prod_backup, auto_s3, "store", "aws s3")

Rel(auto_s3, auto_prod_restore, "retrieve", "aws s3")
Rel(auto_prod_restore, auto_db, "restore", "psql")

BiRel(auto_db, auto_prod_proc, "process", "psql")

Rel(auto_db, auto_proc_backup, "backup", "pg_dump")
Rel(auto_proc_backup, auto_s3, "store", "aws s3")

Rel(auto_s3, auto_proc_restore, "retrieve", "aws s3")
Rel(auto_proc_restore, staging_db, "restore", "psql")
Rel(auto_proc_restore, dev_db, "restore", "psql")
Rel(auto_proc_restore, sandbox_db, "restore", "psql")

Rel(developer, newrelic, "Manage performance & logging", "https GET/POST/PUT/DELETE (443)")
Rel(www_app, newrelic, "reports telemetry", "tcp (443)")
Rel(developer, google_tag_manager, "Configure tags")
Expand Down
2 changes: 1 addition & 1 deletion docs/boundary_diagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/logical_data_model.encoded

Large diffs are not rendered by default.

31 changes: 1 addition & 30 deletions docs/logical_data_model.puml
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,6 @@ class Courses{
deletedAt : timestamp with time zone
}

class EventReportPilotGoals{
* id : integer : <generated>
sessionId : integer : REFERENCES "SessionReportPilots".id
* eventId : integer : REFERENCES "EventReportPilots".id
* goalId : integer : REFERENCES "Goals".id
* grantId : integer : REFERENCES "Grants".id
* createdAt : timestamp with time zone
* updatedAt : timestamp with time zone
}

class EventReportPilotNationalCenterUsers{
* id : integer : <generated>
* eventReportPilotId : integer : REFERENCES "EventReportPilots".id
Expand Down Expand Up @@ -1106,6 +1096,7 @@ class Users{
enum enum_Users_flags {
anv_statistics
closed_goal_merge_override
manual_mark_goals_similar
quality_assurance_dashboard
regional_goal_dashboard
training_reports_dashboard
Expand Down Expand Up @@ -1413,20 +1404,6 @@ class ZALDDL{
session_sig : text
}

class ZALEventReportPilotGoals{
* id : bigint : <generated>
* data_id : bigint
* dml_as : bigint
* dml_by : bigint
* dml_timestamp : timestamp with time zone
* dml_txid : uuid
* dml_type : enum
descriptor_id : integer
new_row_data : jsonb
old_row_data : jsonb
session_sig : text
}

class ZALEventReportPilotNationalCenterUsers{
* id : bigint : <generated>
* data_id : bigint
Expand Down Expand Up @@ -2478,7 +2455,6 @@ CollaboratorTypes "1" --[#black,dashed,thickness=2]--{ "n" ObjectiveCollaborato
CommunicationLogs "1" --[#black,dashed,thickness=2]--{ "n" CommunicationLogFiles : communicationLog, communicationLogFiles
Courses "1" --[#black,dashed,thickness=2]--{ "n" ActivityReportObjectiveCourses : course, activityReportObjectiveCourses
Courses "1" --[#black,dashed,thickness=2]--{ "n" Courses : mapsFromCourse, mapsToCourse
EventReportPilots "1" --[#black,dashed,thickness=2]--{ "n" EventReportPilotGoals : event, eventReportPilotGoals
EventReportPilots "1" --[#black,dashed,thickness=2]--{ "n" EventReportPilotNationalCenterUsers : event, eventReportPilotNationalCenterUsers
EventReportPilots "1" --[#black,dashed,thickness=2]--{ "n" SessionReportPilots : sessionReports, event
Files "1" --[#black,dashed,thickness=2]--{ "n" ActivityReportFiles : file, reportFiles
Expand All @@ -2494,7 +2470,6 @@ GoalTemplates "1" --[#black,dashed,thickness=2]--{ "n" GoalTemplateObjectiveTem
GoalTemplates "1" --[#black,dashed,thickness=2]--{ "n" GoalTemplateResources : goalTemplate, goalTemplateResources
GoalTemplates "1" --[#black,dashed,thickness=2]--{ "n" Goals : goals, goalTemplate
Goals "1" --[#black,dashed,thickness=2]--{ "n" ActivityReportGoals : goal, originalGoal, activityReportGoals, reassignedActivityReportGoals
Goals "1" --[#black,dashed,thickness=2]--{ "n" EventReportPilotGoals : goal, eventReportPilotGoals
Goals "1" --[#black,dashed,thickness=2]--{ "n" GoalCollaborators : goal, goalCollaborators
Goals "1" --[#black,dashed,thickness=2]--{ "n" GoalFieldResponses : goal, responses
Goals "1" --[#black,dashed,thickness=2]--{ "n" GoalResources : goal, goalResources
Expand All @@ -2507,7 +2482,6 @@ Goals "1" --[#black,dashed,thickness=2]--{ "n" SimScoreGoalCaches : scoreOne, s
GrantNumberLinks "1" --[#black,dashed,thickness=2]--{ "n" MonitoringClassSummaries : monitoringClassSummaries, grantNumberLink
GrantNumberLinks "1" --[#black,dashed,thickness=2]--{ "n" MonitoringReviewGrantees : monitoringReviewGrantees, grantNumberLink
Grants "1" --[#black,dashed,thickness=2]--{ "n" ActivityRecipients : grant, activityRecipients
Grants "1" --[#black,dashed,thickness=2]--{ "n" EventReportPilotGoals : grant, eventReportPilotGoals
Grants "1" --[#black,dashed,thickness=2]--{ "n" Goals : grant, goals
Grants "1" --[#black,dashed,thickness=2]--{ "n" Grants : oldGrants, grant
Grants "1" --[#black,dashed,thickness=2]--{ "n" GroupGrants : groupGrants, grant
Expand Down Expand Up @@ -2570,7 +2544,6 @@ Roles "1" --[#black,dashed,thickness=2]--{ "n" CollaboratorRoles : role, collab
Roles "1" --[#black,dashed,thickness=2]--{ "n" RoleTopics : role, roleTopics
Roles "1" --[#black,dashed,thickness=2]--{ "n" UserRoles : userRoles, role
Scopes "1" --[#black,dashed,thickness=2]--{ "n" Permissions : scope, permissions
SessionReportPilots "1" --[#black,dashed,thickness=2]--{ "n" EventReportPilotGoals : session, eventReportPilotGoals
SessionReportPilots "1" --[#black,dashed,thickness=2]--{ "n" SessionReportPilotFiles : sessionReport, sessionFiles
SessionReportPilots "1" --[#black,dashed,thickness=2]--{ "n" SessionReportPilotSupportingAttachments : sessionReport, sessionSupportingAttachments
Topics "1" --[#black,dashed,thickness=2]--{ "n" ActivityReportObjectiveTopics : topic, activityReportObjectiveTopics
Expand Down Expand Up @@ -2611,8 +2584,6 @@ CollaboratorTypes "n" }--[#black,dotted,thickness=2]--{ "n" Groups : groups, col
CollaboratorTypes "n" }--[#black,dotted,thickness=2]--{ "n" Objectives : objectives, collaboratorTypes
CollaboratorTypes "n" }--[#black,dotted,thickness=2]--{ "n" Users : usersThroughGoalCollaborators, usersThroughGroupCollaborators, usersThroughObjectiveCollaborators, collaboratorTypesThroughGoalCollaborator, collaboratorTypesThroughGroupCollaborator, collaboratorTypesThroughObjectiveCollaborator
CommunicationLogs "n" }--[#black,dotted,thickness=2]--{ "n" Files : files, logs
EventReportPilots "n" }--[#black,dotted,thickness=2]--{ "n" Goals : goals, eventReportPilots
EventReportPilots "n" }--[#black,dotted,thickness=2]--{ "n" Grants : grants, eventReports
Files "n" }--[#black,dotted,thickness=2]--{ "n" SessionReportPilots : sessions, sessionsWithSupportingAttachments, files, supportingAttachments
GoalSimilarityGroups "n" }--[#black,dotted,thickness=2]--{ "n" Goals : goals, similarityGroups
GoalTemplateFieldPrompts "n" }--[#black,dotted,thickness=2]--{ "n" Goals : goals, prompts
Expand Down
2 changes: 1 addition & 1 deletion email_templates/changes_requested_by_manager/html.pug
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ style
include ../email.css
p Hello,
p
p #{managerName} requested changed to report #{displayId}.
p #{managerName} requested changes to report #{displayId}.
if comments
p #{managerName} provided the following comments:
blockquote !{comments}
Expand Down
11 changes: 11 additions & 0 deletions email_templates/tr_poc_vision_complete/html.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
style
include ../email.css
p Hello,
p The POC has completed the vision section of Training Report #{displayId}.
p Access this report in the TTA Hub:
ul
li
a(href=reportPath)= displayId
p Best Regards,
br
| Your TTA Hub team
1 change: 1 addition & 0 deletions email_templates/tr_poc_vision_complete/subject.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
= `The vision for Training Report ${displayId} has been completed`
11 changes: 0 additions & 11 deletions email_templates/tr_poc_vision_goal_complete/html.pug

This file was deleted.

1 change: 0 additions & 1 deletion email_templates/tr_poc_vision_goal_complete/subject.pug

This file was deleted.

35 changes: 10 additions & 25 deletions frontend/src/components/GoalCards/GoalCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import ExpanderButton from '../ExpanderButton';
import './GoalCard.scss';
import { goalPropTypes } from './constants';
import colors from '../../colors';
import SessionObjectiveCard from './SessionObjectiveCard';
import Tooltip from '../Tooltip';
import isAdmin, { hasApproveActivityReportInRegion, canEditOrCreateGoals } from '../../permissions';
import UserContext from '../../UserContext';
Expand All @@ -29,34 +28,21 @@ import AppLoadingContext from '../../AppLoadingContext';
import GoalStatusChangeAlert from './components/GoalStatusChangeAlert';
import useObjectiveStatusMonitor from '../../hooks/useObjectiveStatusMonitor';

const SESSION_TYPE = 'session';

export const ObjectiveSwitch = ({
objective,
objectivesExpanded,
regionId,
goalStatus,
dispatchStatusChange,
}) => {
if (objective.type === SESSION_TYPE) {
return (
<SessionObjectiveCard
objective={objective}
objectivesExpanded={objectivesExpanded}
/>
);
}

return (
<ObjectiveCard
objective={objective}
objectivesExpanded={objectivesExpanded}
goalStatus={goalStatus}
regionId={regionId}
dispatchStatusChange={dispatchStatusChange}
/>
);
};
}) => (
<ObjectiveCard
objective={objective}
objectivesExpanded={objectivesExpanded}
goalStatus={goalStatus}
regionId={regionId}
dispatchStatusChange={dispatchStatusChange}
/>
);

ObjectiveSwitch.propTypes = {
objective: PropTypes.shape({
Expand Down Expand Up @@ -92,7 +78,6 @@ export default function GoalCard({
objectiveCount,
reasons,
objectives,
sessionObjectives,
previousStatus,
createdVia,
collaborators,
Expand All @@ -103,7 +88,7 @@ export default function GoalCard({
const { user } = useContext(UserContext);
const { setIsAppLoading } = useContext(AppLoadingContext);
const [invalidStatusChangeAttempted, setInvalidStatusChangeAttempted] = useState();
const sortedObjectives = [...objectives, ...(sessionObjectives || [])];
const sortedObjectives = [...objectives];
sortedObjectives.sort((a, b) => ((new Date(a.endDate) < new Date(b.endDate)) ? 1 : -1));
const hasEditButtonPermissions = canEditOrCreateGoals(user, parseInt(regionId, DECIMAL_BASE));
const {
Expand Down
45 changes: 44 additions & 1 deletion frontend/src/components/GoalCards/GoalsCardsHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { canEditOrCreateGoals } from '../../permissions';
import colors from '../../colors';
import SelectPagination from '../SelectPagination';
import { similarity } from '../../fetchers/goals';
import { markSimilarGoals } from '../../fetchers/recipient';
import { getFeatureFlags } from '../../fetchers/users';

export default function GoalCardsHeader({
title,
Expand Down Expand Up @@ -41,7 +43,9 @@ export default function GoalCardsHeader({
allSelectedGoalIds,
goalBuckets,
}) {
const [retrieveSimilarGoals, setRetrieveSimilarGoals] = useState(false);
const [goalMergeGroups, setGoalMergeGroups] = useState([]);
const [hasManualMarkGoalsSimilar, setHasManualMarkGoalsSimilar] = useState(false);
const history = useHistory();
const { user } = useContext(UserContext);
const hasButtonPermissions = canEditOrCreateGoals(user, parseInt(regionId, DECIMAL_BASE));
Expand Down Expand Up @@ -69,7 +73,16 @@ export default function GoalCardsHeader({
if (canMergeGoals) {
getSimilarGoals();
}
}, [canMergeGoals, recipientId, regionId]);
}, [canMergeGoals, recipientId, regionId, retrieveSimilarGoals]);

useEffect(() => {
async function checkFeatureFlags() {
const flags = await getFeatureFlags();
setHasManualMarkGoalsSimilar(flags.includes('manual_mark_goals_similar'));
}

checkFeatureFlags();
}, []);

const showAddNewButton = hasActiveGrants && hasButtonPermissions;
const onPrint = () => {
Expand All @@ -92,6 +105,25 @@ export default function GoalCardsHeader({
});
};

const onMarkSimilarGoals = async () => {
let similarGoals = Object.keys(allSelectedGoalIds).filter(
(key) => allSelectedGoalIds[key],
).map((key) => parseInt(key, DECIMAL_BASE));

// If we don't just print the page.
if (!similarGoals.length) {
similarGoals = pageGoalIds;
}
// Get all the goals and associated goals from the buckets.
similarGoals = goalBuckets.filter(
(bucket) => similarGoals.includes(bucket.id),
).map((bucket) => bucket.goalIds).flat();

await markSimilarGoals(recipientId, similarGoals); // PUT request to mark similar goals
selectAllGoalCheckboxSelect({ target: { checked: false } }); // Deselect all goals
setRetrieveSimilarGoals(!retrieveSimilarGoals);
};

const setSortBy = (e) => {
const [sortBy, direction] = e.target.value.split('-');
requestSort(sortBy, direction);
Expand Down Expand Up @@ -220,6 +252,17 @@ export default function GoalCardsHeader({
>
{`Preview and print ${hasGoalsSelected ? 'selected' : ''}`}
</Button>
{ numberOfSelectedGoals > 1
&& hasManualMarkGoalsSimilar
&& (
<Button
unstyled
className="display-flex flex-align-center margin-left-3 margin-y-0"
onClick={onMarkSimilarGoals}
>
Mark goals as similar
</Button>
)}
</div>
<div>
{showRttapaValidation && (
Expand Down
Loading