Skip to content

Commit

Permalink
Merge branch 'master' into enhancement/eslint-typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
wssheldon authored Nov 29, 2023
2 parents f0d0b3a + 65aef6e commit eba6c2b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""Removes search vector from signal instance model
Revision ID: bdaeabba3e53
Revises: f2605bfc1f59
Create Date: 2023-11-29 12:59:45.408085
"""
from alembic import op

# revision identifiers, used by Alembic.
revision = "bdaeabba3e53"
down_revision = "f2605bfc1f59"
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(
"signal_instance_search_vector_idx", table_name="signal_instance", postgresql_using="gin"
)
op.drop_column("signal_instance", "search_vector")
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
4 changes: 2 additions & 2 deletions src/dispatch/plugins/dispatch_slack/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ def entity_select(
):
"""Creates an entity select."""
entity_options = [
{"text": entity.entity_type.name[:75], "value": entity.id}
{"text": entity.value[:75], "value": entity.id}
for entity in entity_service.get_all_desc_by_signal(
db_session=db_session, signal_id=signal_id
)
Expand Down Expand Up @@ -664,7 +664,7 @@ def signal_definition_select(
signals: list[Signal],
action_id: str = DefaultActionIds.signal_definition_select,
block_id: str = DefaultBlockIds.signal_definition_select,
label: str = "Signal Defintions",
label: str = "Signal Definitions",
initial_option: Participant = None,
**kwargs,
):
Expand Down
10 changes: 9 additions & 1 deletion src/dispatch/static/dispatch/src/signal/store.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getField, updateField } from "vuex-map-fields"
import { debounce } from "lodash"
import { debounce, filter } from "lodash"

import SearchUtils from "@/search/utils"
import SignalApi from "@/signal/api"
Expand Down Expand Up @@ -117,6 +117,14 @@ const actions = {
return SignalApi.getAllInstances(params)
.then((response) => {
commit("SET_INSTANCE_TABLE_LOADING", false)

// We filter out instances based on the given query parameter provided
if (params.q) {
response.data.items = filter(response.data.items, function (item) {
return item.signal.name.includes(params.q) || item.signal.description.includes(params.q)
})
}

commit("SET_INSTANCE_TABLE_ROWS", response.data)
})
.catch(() => {
Expand Down

0 comments on commit eba6c2b

Please sign in to comment.