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

Adding project setting to allow visibility selection of incident command #5129

Merged
merged 8 commits into from
Aug 26, 2024
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""Adding column for select_commander_visibility

Revision ID: d6b3853be8e4
Revises: 71cd7ed999c4
Create Date: 2024-08-26 14:42:48.423369

"""
from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = 'd6b3853be8e4'
down_revision = '71cd7ed999c4'
branch_labels = None
depends_on = None


def upgrade():
op.add_column('project', sa.Column('select_commander_visibility', sa.Boolean(), server_default='t', nullable=True))

def downgrade():
op.drop_column('project', 'select_commander_visibility')
3 changes: 3 additions & 0 deletions src/dispatch/project/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class Project(Base):

send_daily_reports = Column(Boolean)

select_commander_visibility = Column(Boolean, default=True, server_default="t")

stable_priority_id = Column(Integer, nullable=True)
stable_priority = relationship(
IncidentPriority,
Expand Down Expand Up @@ -86,6 +88,7 @@ class ProjectBase(DispatchBase):
storage_use_folder_one_as_primary: Optional[bool] = Field(True, nullable=True)
storage_use_title: Optional[bool] = Field(False, nullable=True)
allow_self_join: Optional[bool] = Field(True, nullable=True)
select_commander_visibility: Optional[bool] = Field(True, nullable=True)


class ProjectCreate(ProjectBase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<v-icon size="small">mdi-open-in-new</v-icon>
</a>
</p>

<v-row>
<v-col cols="12">
<v-textarea
Expand Down Expand Up @@ -73,7 +74,8 @@
model="incident"
/>
</v-col>
<v-col cols="12">

<v-col cols="12" v-if="project?.select_commander_visibility">
<participant-select
v-model="local_commander"
label="Optional: Incident Commander"
Expand Down
8 changes: 8 additions & 0 deletions src/dispatch/static/dispatch/src/project/NewEditSheet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@
hint="Use the title of the incident as the name of the storage folder."
/>
</v-col>
<v-col cols="12">
<v-checkbox
v-model="select_commander_visibility"
label="Allow incident commander selection"
hint="Enable the option to select a specific incident commander in the UI"
/>
</v-col>
</v-row>
</v-container>
</v-card-text>
Expand Down Expand Up @@ -199,6 +206,7 @@ export default {
"selected.storage_use_folder_one_as_primary",
"selected.storage_use_title",
"selected.allow_self_join",
"selected.select_commander_visibility",
"dialogs.showCreateEdit",
]),
},
Expand Down
1 change: 1 addition & 0 deletions src/dispatch/static/dispatch/src/project/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const getDefaultSelectedState = () => {
storage_use_folder_one_as_primary: false,
storage_use_title: false,
allow_self_join: null,
select_commander_visibility: null,
}
}

Expand Down
Loading