From 494c622cf693bfb52d95eb53e4b253ccd6c9a123 Mon Sep 17 00:00:00 2001 From: Mike Laventure Date: Thu, 11 Apr 2024 11:01:50 -0700 Subject: [PATCH 1/8] Adding new project level attribute --- src/dispatch/project/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dispatch/project/models.py b/src/dispatch/project/models.py index 61020475bcea..60cb0e0176fd 100644 --- a/src/dispatch/project/models.py +++ b/src/dispatch/project/models.py @@ -40,6 +40,7 @@ class Project(Base): ) enabled = Column(Boolean, default=True, server_default="t") + allow_self_join = Column(Boolean, default=True, server_default="t") send_daily_reports = Column(Boolean) @@ -71,6 +72,7 @@ class ProjectBase(DispatchBase): color: Optional[str] = Field(None, nullable=True) send_daily_reports: Optional[bool] = Field(True, nullable=True) enabled: Optional[bool] = Field(True, nullable=True) + allow_self_join: Optional[bool] = Field(True, nullable=Tru class ProjectCreate(ProjectBase): From 60408264ac43771a2fdcc8a9677aef2ce4484efd Mon Sep 17 00:00:00 2001 From: Mike Laventure Date: Mon, 29 Apr 2024 10:27:04 -0700 Subject: [PATCH 2/8] adding attribute to project --- .devcontainer/docker-compose.yml | 2 +- docker/docker-compose.yml | 2 +- src/dispatch/project/models.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index c9e650c0ed0f..a9b6932733a6 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -25,7 +25,7 @@ services: PGADMIN_DEFAULT_PASSWORD: admin PGADMIN_CONFIG_PROXY_X_HOST_COUNT: 1 PGADMIN_CONFIG_PROXY_X_PREFIX_COUNT: 1 - PGADMIN_LISTEN_PORT: 80 + PGADMIN_LISTEN_PORT: 5555 restart: unless-stopped network_mode: service:db diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index a64a05395984..897a5c1a1bed 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,7 +1,7 @@ version: "3.1" services: postgres: - image: postgres:14.6 + image: postgres:14.11 hostname: postgres ports: - "5432:5432" diff --git a/src/dispatch/project/models.py b/src/dispatch/project/models.py index 60cb0e0176fd..f42065333f24 100644 --- a/src/dispatch/project/models.py +++ b/src/dispatch/project/models.py @@ -72,7 +72,7 @@ class ProjectBase(DispatchBase): color: Optional[str] = Field(None, nullable=True) send_daily_reports: Optional[bool] = Field(True, nullable=True) enabled: Optional[bool] = Field(True, nullable=True) - allow_self_join: Optional[bool] = Field(True, nullable=Tru + allow_self_join: Optional[bool] = Field(True, nullable=True) class ProjectCreate(ProjectBase): From 1fa6ca9cdaa65fad488811f3faf3fe11023208ff Mon Sep 17 00:00:00 2001 From: Mike Laventure Date: Mon, 29 Apr 2024 11:13:51 -0700 Subject: [PATCH 3/8] Modified UI to show self-join checkbox --- .../versions/2024-04-29_a836d4850a75.py | 27 ++++++ src/dispatch/incident/models.py | 1 + .../static/dispatch/src/incident/Table.vue | 58 +++-------- .../src/incident/status/IncidentStatus.vue | 25 ++--- .../dispatch/src/project/NewEditSheet.vue | 95 +++++-------------- .../static/dispatch/src/project/store.js | 1 + 6 files changed, 75 insertions(+), 132 deletions(-) create mode 100644 src/dispatch/database/revisions/tenant/versions/2024-04-29_a836d4850a75.py diff --git a/src/dispatch/database/revisions/tenant/versions/2024-04-29_a836d4850a75.py b/src/dispatch/database/revisions/tenant/versions/2024-04-29_a836d4850a75.py new file mode 100644 index 000000000000..c9fb4fdc2873 --- /dev/null +++ b/src/dispatch/database/revisions/tenant/versions/2024-04-29_a836d4850a75.py @@ -0,0 +1,27 @@ +"""Adding in "allow_self_join" column to enable self join in dispatch UI + +Revision ID: a836d4850a75 +Revises: 3a33bc153e7e +Create Date: 2024-04-29 10:28:37.777618 + +""" +from alembic import op +import sqlalchemy as sa + +# revision identifiers, used by Alembic. +revision = 'a836d4850a75' +down_revision = '3a33bc153e7e' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('project', sa.Column('allow_self_join', sa.Boolean(), server_default='t', nullable=True)) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('project', 'allow_self_join') + # ### end Alembic commands ### diff --git a/src/dispatch/incident/models.py b/src/dispatch/incident/models.py index aac934c31e1c..3ac0bbd74b99 100644 --- a/src/dispatch/incident/models.py +++ b/src/dispatch/incident/models.py @@ -250,6 +250,7 @@ class ProjectRead(DispatchBase): name: NameStr color: Optional[str] stable_priority: Optional[IncidentPriorityRead] = None + allow_self_join: Optional[bool] = Field(True, nullable=True) class CaseRead(DispatchBase): diff --git a/src/dispatch/static/dispatch/src/incident/Table.vue b/src/dispatch/static/dispatch/src/incident/Table.vue index 5c8de6bf3097..3412fdd63c16 100644 --- a/src/dispatch/static/dispatch/src/incident/Table.vue +++ b/src/dispatch/static/dispatch/src/incident/Table.vue @@ -18,12 +18,7 @@ mdi-fire Report incident - + New @@ -32,34 +27,15 @@ - + - + }" v-model:sort-by="sortBy" v-model:sort-desc="descending" :loading="loading" + data-testid="incident-data-table" v-model="selected" loading-text="Loading... Please wait" show-select + return-object @click:row="showIncidentEditSheet"> - + View / Edit Create Report - + Run Workflow diff --git a/src/dispatch/static/dispatch/src/incident/status/IncidentStatus.vue b/src/dispatch/static/dispatch/src/incident/status/IncidentStatus.vue index 1bbf4b7090e5..335338a4c32b 100644 --- a/src/dispatch/static/dispatch/src/incident/status/IncidentStatus.vue +++ b/src/dispatch/static/dispatch/src/incident/status/IncidentStatus.vue @@ -4,27 +4,16 @@ {{ status }} @@ -46,6 +35,10 @@ export default { type: Number, required: true, }, + allowSelfJoin: { + type: Boolean, + required: true, + }, }, computed: { diff --git a/src/dispatch/static/dispatch/src/project/NewEditSheet.vue b/src/dispatch/static/dispatch/src/project/NewEditSheet.vue index 0d40aae7260c..32e576e21911 100644 --- a/src/dispatch/static/dispatch/src/project/NewEditSheet.vue +++ b/src/dispatch/static/dispatch/src/project/NewEditSheet.vue @@ -8,14 +8,7 @@ Project