Skip to content

Commit

Permalink
Merge branch 'master' into feat/dispatch_aws-decompress
Browse files Browse the repository at this point in the history
  • Loading branch information
mvilanova authored Dec 9, 2024
2 parents 1db8d7e + a679c3d commit b94f96f
Show file tree
Hide file tree
Showing 44 changed files with 1,579 additions and 621 deletions.
64 changes: 23 additions & 41 deletions data/dispatch-sample-data.dump
Original file line number Diff line number Diff line change
Expand Up @@ -2996,7 +2996,7 @@ CREATE TABLE dispatch_organization_default.entity (
name character varying,
description character varying,
value character varying,
source boolean,
source character varying,
entity_type_id integer NOT NULL,
search_vector tsvector,
project_id integer,
Expand Down Expand Up @@ -3037,7 +3037,7 @@ CREATE TABLE dispatch_organization_default.entity_type (
id integer NOT NULL,
name character varying,
description character varying,
jpath character varying NOT NULL,
jpath character varying,
regular_expression character varying,
enabled boolean,
search_vector tsvector,
Expand Down Expand Up @@ -3967,7 +3967,6 @@ ALTER SEQUENCE dispatch_organization_default.participant_role_id_seq OWNED BY di
CREATE TABLE dispatch_organization_default.plugin_instance (
id integer NOT NULL,
enabled boolean,
configuration json,
plugin_id integer,
project_id integer,
_configuration character varying
Expand Down Expand Up @@ -7666,7 +7665,7 @@ COPY dispatch_core.plugin_event (id, name, slug, description, plugin_id, search_
--

COPY dispatch_organization_default.alembic_version (version_num) FROM stdin;
3edb0476365a
928b725d64f6
\.


Expand Down Expand Up @@ -7724,7 +7723,6 @@ COPY dispatch_organization_default.assoc_document_tags (document_id, tag_id) FRO

COPY dispatch_organization_default.assoc_incident_tags (incident_id, tag_id) FROM stdin;
2 1
7 1
\.


Expand Down Expand Up @@ -8080,9 +8078,6 @@ COPY dispatch_organization_default.event (id, uuid, started_at, ended_at, source
56 6fe13da1-de96-41dd-ba9a-29a752060b46 2021-07-27 20:11:48.28756 2021-07-27 20:11:48.28756 Dispatch Core App Conversation added to incident null \N 6 'ad':5B 'app':3A 'convers':4B 'core':2A 'dispatch':1A 'incid':7B 2021-07-27 20:11:48.307412 2021-07-27 20:11:48.290557 \N \N \N \N \N
58 d66ec104-af72-46df-80a8-2b32a6fa8944 2021-07-27 20:11:59.021607 2021-07-27 20:11:59.021607 Dispatch Core App Incident notifications sent null \N 6 'app':3A 'core':2A 'dispatch':1A 'incid':4B 'notif':5B 'sent':6B 2021-07-27 20:11:59.04991 2021-07-27 20:11:59.022365 \N \N \N \N \N
59 7e011a9d-9bb9-4770-b5e3-1a21197e60c2 2021-07-28 17:13:49.192243 2021-07-28 17:13:49.192243 Dispatch Core App New incident task created by Kevin Glisson {"weblink": null} \N 4 'app':3A 'core':2A 'creat':7B 'dispatch':1A 'glisson':10B 'incid':5B 'kevin':9B 'new':4B 'task':6B 2021-07-28 17:13:49.218153 2021-07-28 17:13:49.199624 \N \N \N \N \N
60 2627886d-5466-47d8-a702-6596a17561a8 2024-02-04 02:51:26.185354 2024-02-04 02:51:26.185354 Dispatch Core App Incident created {"title": "Incident Test Created by Playwright", "description": "Test description created by Playwright", "type": "Denial of Service", "severity": "Undetermined", "priority": "Low", "status": "Active", "visibility": "Open"} \N 7 'app':3A 'core':2A 'creat':5B 'dispatch':1A 'incid':4B 2024-02-04 02:51:26.366892 2024-02-04 02:51:26.190379 \N \N Other \N t
61 5501e170-a4a6-4c29-a582-9d8e6367c35b 2024-02-04 02:51:26.752647 2024-02-04 02:51:26.752647 Dispatch Core App [email protected] added to incident with Reporter role null \N 7 '[email protected]':4B 'ad':5B 'app':3A 'core':2A 'dispatch':1A 'incid':7B 'report':9B 'role':10B 2024-02-04 02:51:26.940241 2024-02-04 02:51:26.753164 \N \N Participant updated f
62 c1baff75-d46a-4cae-a793-9dab11d749e1 2024-02-04 02:51:27.112502 2024-02-04 02:51:27.112502 Dispatch Core App [email protected] added to incident with Incident Commander role null \N 7 '[email protected]':4B 'ad':5B 'app':3A 'command':10B 'core':2A 'dispatch':1A 'incid':7B,9B 'role':11B 2024-02-04 02:51:27.222527 2024-02-04 02:51:27.113162 \N \N Participant updated f
\.


Expand Down Expand Up @@ -8135,7 +8130,6 @@ COPY dispatch_organization_default.incident (id, name, title, description, statu
4 dispatch-default-default-4 Heartbleed Sad PKI noises Stable Open 2021-07-27 19:52:57.757214 2021-07-27 19:54:03.96021 \N '4':9A 'default':7A,8A 'dispatch':6A 'dispatch-default-default':5A 'heartble':1B 'nois':4C 'pki':3C 'sad':2C 1 1 \N 1 2021-07-27 19:52:57.757221 2021-07-28 17:13:49.216785 Description of the actions taken to resolve the incident. Unknown America/Los_Angeles America/Los_Angeles America/Los_Angeles 2 2 2 \N \N \N 3 4 1 \N \N
5 dispatch-default-default-5 Solarwinds More like a solar tornado. Active Open 2021-07-27 20:06:15.252697 \N \N '5':11A 'default':9A,10A 'dispatch':8A 'dispatch-default-default':7A 'like':3C 'solar':5C 'solarwind':1B 'tornado':6C 2 1 \N 1 2021-07-27 20:06:15.252705 2021-07-27 20:06:41.627061 Description of the actions taken to resolve the incident. Unknown America/Los_Angeles America/Los_Angeles America/Los_Angeles 3 3 3 \N \N \N 5 6 1 \N \N
6 dispatch-default-default-6 Kaseya Those backups are good right? Active Open 2021-07-27 20:11:30.525883 \N \N '6':11A 'backup':3C 'default':9A,10A 'dispatch':8A 'dispatch-default-default':7A 'good':5C 'kaseya':1B 'right':6C 3 1 \N 1 2021-07-27 20:11:30.525893 2021-07-27 20:11:59.048666 Description of the actions taken to resolve the incident. Unknown America/Los_Angeles America/Los_Angeles America/Los_Angeles 4 4 4 \N \N \N 7 8 1 \N \N
7 \N Incident Test Created by Playwright Test description created by Playwright Active Open 2024-02-04 02:51:26.109901 \N \N 'creat':3B,8C 'descript':7C 'incid':1B 'playwright':5B,10C 'test':2B,6C 3 5 \N 1 2024-02-04 02:51:26.109912 2024-02-04 02:51:27.220352 Description of the actions taken to resolve the incident. example.com Unknown Unknown Unknown 5 5 \N \N \N \N \N \N 1 \N \N
\.


Expand Down Expand Up @@ -8272,7 +8266,6 @@ COPY dispatch_organization_default.participant (id, team, department, location,
2 Unknown Unknown America/Los_Angeles \N \N f \N 4 2 \N \N
3 Unknown Unknown America/Los_Angeles \N \N f \N 5 2 \N \N
4 Unknown Unknown America/Los_Angeles \N \N f \N 6 2 \N \N
5 example.com Unknown Unknown \N \N f \N 7 3 \N \N
\.


Expand Down Expand Up @@ -8301,29 +8294,26 @@ COPY dispatch_organization_default.participant_role (id, assumed_at, renounced_a
10 2021-07-27 20:11:32.314039 \N Reporter 4 1
11 2021-07-27 20:11:32.427753 \N Incident Commander 4 1
12 2021-07-27 20:11:32.491482 \N Liaison 4 1
13 2024-02-04 02:51:26.570736 \N Reporter 5 0
14 2024-02-04 02:51:27.008425 \N Incident Commander 5 0
\.


--
-- Data for Name: plugin_instance; Type: TABLE DATA; Schema: dispatch_organization_default; Owner: postgres
--

COPY dispatch_organization_default.plugin_instance (id, enabled, configuration, plugin_id, project_id, _configuration) FROM stdin;
1 t {} 2 1 \N
3 t {} 4 1 \N
9 \N {} 16 1 \N
11 f {} 19 1 \N
8 f {} 18 1 \N
7 f {} 13 1 \N
6 f {} 12 1 \N
14 f {} 10 1 \N
13 f {} 9 1 \N
12 f {} 8 1 \N
5 t {} 6 1 \N
2 t {} 3 1 \N
4 t {} 7 1 \N
COPY dispatch_organization_default.plugin_instance (id, enabled, plugin_id, project_id, _configuration) FROM stdin;
1 t 2 1 \N
9 \N 16 1 \N
11 f 19 1 \N
8 f 18 1 \N
7 f 13 1 \N
6 f 12 1 \N
14 f 10 1 \N
13 f 9 1 \N
12 f 8 1 \N
5 t 6 1 \N
2 t 3 1 \N
4 t 7 1 \N
\.


Expand Down Expand Up @@ -11676,6 +11666,13 @@ CREATE INDEX definition_search_vector_idx ON dispatch_organization_default.defin
CREATE INDEX document_search_vector_idx ON dispatch_organization_default.document USING gin (search_vector);


--
-- Name: entity_search_vector_idx; Type: INDEX; Schema: dispatch_organization_default; Owner: postgres
--

CREATE INDEX entity_search_vector_idx ON dispatch_organization_default.entity USING gin (search_vector);


--
-- Name: entity_type_search_vector_idx; Type: INDEX; Schema: dispatch_organization_default; Owner: postgres
--
Expand Down Expand Up @@ -11739,13 +11736,6 @@ CREATE INDEX incident_type_search_vector_idx ON dispatch_organization_default.in
CREATE INDEX individual_contact_search_vector_idx ON dispatch_organization_default.individual_contact USING gin (search_vector);


--
-- Name: ix_entity_search_vector; Type: INDEX; Schema: dispatch_organization_default; Owner: postgres
--

CREATE INDEX ix_entity_search_vector ON dispatch_organization_default.entity USING gin (search_vector);


--
-- Name: notification_search_vector_idx; Type: INDEX; Schema: dispatch_organization_default; Owner: postgres
--
Expand Down Expand Up @@ -13664,14 +13654,6 @@ ALTER TABLE ONLY dispatch_organization_default.project
ADD CONSTRAINT project_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES dispatch_core.organization(id);


--
-- Name: project project_stable_priority_id_fkey; Type: FK CONSTRAINT; Schema: dispatch_organization_default; Owner: postgres
--

ALTER TABLE ONLY dispatch_organization_default.project
ADD CONSTRAINT project_stable_priority_id_fkey FOREIGN KEY (stable_priority_id) REFERENCES dispatch_organization_default.incident_priority(id);


--
-- Name: query query_project_id_fkey; Type: FK CONSTRAINT; Schema: dispatch_organization_default; Owner: postgres
--
Expand Down
6 changes: 3 additions & 3 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ const config: PlaywrightTestConfig = {
screenshot: "on",
},
/* Maximum time one test can run for. */
timeout: 100 * 1000,
timeout: 200 * 1000,
expect: {
/**
* Maximum time expect() should wait for the condition to be met.
* For example in `await expect(locator).toHaveText();`
*/
timeout: 10000,
timeout: 20000,
},
/* Run tests in files in parallel */
fullyParallel: true,
Expand Down
23 changes: 11 additions & 12 deletions requirements-base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ aiofiles==24.1.0
# via -r requirements-base.in
aiohappyeyeballs==2.4.3
# via aiohttp
aiohttp==3.11.0
aiohttp==3.11.9
# via -r requirements-base.in
aiosignal==1.3.1
# via aiohttp
Expand All @@ -31,7 +31,7 @@ attrs==22.1.0
# jsonschema
backoff==2.2.1
# via schemathesis
bcrypt==4.2.0
bcrypt==4.2.1
# via -r requirements-base.in
blis==1.0.1
# via thinc
Expand Down Expand Up @@ -118,15 +118,15 @@ email-validator==2.2.0
# via -r requirements-base.in
emails==0.6
# via -r requirements-base.in
fastapi==0.115.5
fastapi==0.115.6
# via -r requirements-base.in
frozenlist==1.5.0
# via
# aiohttp
# aiosignal
google-api-core==2.22.0
# via google-api-python-client
google-api-python-client==2.153.0
google-api-python-client==2.154.0
# via -r requirements-base.in
google-auth==2.36.0
# via
Expand Down Expand Up @@ -154,7 +154,7 @@ httplib2==0.22.0
# google-api-python-client
# google-auth-httplib2
# oauth2client
httpx==0.27.2
httpx==0.28.0
# via
# -r requirements-base.in
# openai
Expand Down Expand Up @@ -228,7 +228,7 @@ mdurl==0.1.2
# via markdown-it-py
more-itertools==10.5.0
# via cssutils
msal==1.31.0
msal==1.31.1
# via -r requirements-base.in
multidict==6.1.0
# via
Expand Down Expand Up @@ -256,7 +256,7 @@ oauthlib[signedtoken]==3.2.2
# atlassian-python-api
# jira
# requests-oauthlib
openai==1.54.4
openai==1.56.1
# via -r requirements-base.in
packaging==24.2
# via
Expand Down Expand Up @@ -300,7 +300,7 @@ protobuf==4.23.4
# proto-plus
psycopg2-binary==2.9.10
# via -r requirements-base.in
pyarrow==18.0.0
pyarrow==18.1.0
# via -r requirements-base.in
pyasn1==0.6.1
# via
Expand Down Expand Up @@ -353,7 +353,7 @@ python-dateutil==2.9.0.post0
# pandas
python-jose==3.3.0
# via -r requirements-base.in
python-multipart==0.0.17
python-multipart==0.0.19
# via -r requirements-base.in
python-slugify==8.0.4
# via -r requirements-base.in
Expand Down Expand Up @@ -425,7 +425,7 @@ six==1.16.0
# validators
slack-bolt==1.21.2
# via -r requirements-base.in
slack-sdk==3.33.3
slack-sdk==3.33.4
# via
# -r requirements-base.in
# slack-bolt
Expand All @@ -436,7 +436,6 @@ smart-open==7.0.5
sniffio==1.3.1
# via
# anyio
# httpx
# openai
sortedcontainers==2.4.0
# via hypothesis
Expand Down Expand Up @@ -510,7 +509,7 @@ urllib3==2.2.3
# pdpyras
# requests
# sentry-sdk
uvicorn==0.32.0
uvicorn==0.32.1
# via -r requirements-base.in
uvloop==0.21.0
# via -r requirements-base.in
Expand Down
8 changes: 4 additions & 4 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ click==8.1.7
# via
# -r requirements-dev.in
# black
coverage==7.6.4
coverage==7.6.8
# via -r requirements-dev.in
decorator==5.1.1
# via ipython
Expand All @@ -32,7 +32,7 @@ executing==2.1.0
# stack-data
factory-boy==3.3.1
# via -r requirements-dev.in
faker==32.1.0
faker==33.1.0
# via
# -r requirements-dev.in
# factory-boy
Expand All @@ -42,7 +42,7 @@ identify==2.6.1
# via pre-commit
iniconfig==2.0.0
# via pytest
ipython==8.29.0
ipython==8.30.0
# via -r requirements-dev.in
jedi==0.19.1
# via ipython
Expand Down Expand Up @@ -86,7 +86,7 @@ python-dateutil==2.9.0.post0
# via faker
pyyaml==6.0.2
# via pre-commit
ruff==0.7.3
ruff==0.8.1
# via -r requirements-dev.in
six==1.16.0
# via
Expand Down
33 changes: 29 additions & 4 deletions src/dispatch/case/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
from dispatch.conversation import flows as conversation_flows
from dispatch.decorators import background_task
from dispatch.document import flows as document_flows
from dispatch.email_templates import service as email_template_service
from dispatch.email_templates.enums import EmailTemplateTypes
from dispatch.enums import DocumentResourceTypes, EventType, Visibility
from dispatch.event import service as event_service
from dispatch.group import flows as group_flows
Expand Down Expand Up @@ -130,10 +132,19 @@ def case_add_or_reactivate_participant_flow(
case, [participant.individual.email], db_session
)

# we send the welcome messages to the participant
send_case_welcome_participant_message(
participant_email=user_email, case=case, db_session=db_session
)
# check to see if there is an override welcome message template
welcome_template = email_template_service.get_by_type(
db_session=db_session,
project_id=case.project_id,
email_template_type=EmailTemplateTypes.welcome,
)

send_case_welcome_participant_message(
participant_email=user_email,
case=case,
db_session=db_session,
welcome_template=welcome_template,
)

return participant

Expand Down Expand Up @@ -1040,13 +1051,27 @@ def case_create_resources_flow(
conversation_target=conversation_target,
)

# check to see if there is an override welcome message template
welcome_template = email_template_service.get_by_type(
db_session=db_session,
project_id=case.project_id,
email_template_type=EmailTemplateTypes.welcome,
)

for user_email in set(individual_participants):
send_participant_announcement_message(
db_session=db_session,
participant_email=user_email,
subject=case,
)

send_case_welcome_participant_message(
participant_email=user_email,
case=case,
db_session=db_session,
welcome_template=welcome_template,
)

event_service.log_case_event(
db_session=db_session,
source="Dispatch Core App",
Expand Down
Loading

0 comments on commit b94f96f

Please sign in to comment.