Skip to content

Commit

Permalink
Removes minimal models from pagination endpoints (#2932)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevgliss authored Feb 2, 2023
1 parent 15964e9 commit a4ee58d
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/dispatch/incident/priority/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ class IncidentPriorityReadMinimal(DispatchBase):

class IncidentPriorityPagination(DispatchBase):
total: int
items: List[IncidentPriorityReadMinimal] = []
items: List[IncidentPriorityRead] = []
2 changes: 1 addition & 1 deletion src/dispatch/incident/severity/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ class IncidentSeverityReadMinimal(DispatchBase):

class IncidentSeverityPagination(DispatchBase):
total: int
items: List[IncidentSeverityReadMinimal] = []
items: List[IncidentSeverityRead] = []
2 changes: 1 addition & 1 deletion src/dispatch/incident/type/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@ class IncidentTypeReadMinimal(DispatchBase):

class IncidentTypePagination(DispatchBase):
total: int
items: List[IncidentTypeReadMinimal] = []
items: List[IncidentTypeRead] = []
2 changes: 1 addition & 1 deletion src/dispatch/participant_role/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ class ParticipantRoleReadMinimal(ParticipantRoleRead):

class ParticipantRolePagination(ParticipantRoleBase):
total: int
items: List[ParticipantRoleReadMinimal] = []
items: List[ParticipantRoleRead] = []
10 changes: 8 additions & 2 deletions src/dispatch/static/dispatch/src/tag/TagFilterAutoComplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,21 @@
</template>
<template v-slot:selection="{ item, index }">
<v-chip close @click:close="value.splice(index, 1)">
<span v-if="item.tag_type"> {{ item.tag_type.name }}/ </span>
<span v-if="item.tag_type">
<span v-if="!project">{{ item.project.name }}/</span>{{ item.tag_type.name }}/
</span>
<a :href="item.uri" target="_blank" :title="item.description">
{{ item.name }}
</a>
</v-chip>
</template>
<template v-slot:item="data">
<v-list-item-content>
<v-list-item-title> {{ data.item.tag_type.name }}/{{ data.item.name }} </v-list-item-title>
<v-list-item-title>
<span v-if="!project">{{ data.item.project.name }}/</span>{{ data.item.tag_type.name }}/{{
data.item.name
}}
</v-list-item-title>
<v-list-item-subtitle style="width: 200px" class="text-truncate">
{{ data.item.description }}
</v-list-item-subtitle>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</template>
<template v-slot:item="data">
<v-list-item-content>
<v-list-item-title> {{ data.item.name }} </v-list-item-title>
<v-list-item-title> {{ data.item.project.name }}/{{ data.item.name }} </v-list-item-title>
<v-list-item-subtitle style="width: 200px" class="text-truncate">
{{ data.item.description }}
</v-list-item-subtitle>
Expand Down
4 changes: 2 additions & 2 deletions src/dispatch/tag/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ class TagReadMinimal(DispatchBase):
uri: Optional[str] = Field(None, nullable=True)
discoverable: Optional[bool] = True
description: Optional[str] = Field(None, nullable=True)
tag_type: Optional[TagTypeReadMinimal]
tag_type: Optional[TagTypeRead]


class TagPagination(DispatchBase):
items: List[TagReadMinimal]
items: List[TagRead]
total: int
2 changes: 1 addition & 1 deletion src/dispatch/tag_type/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ class TagTypeReadMinimal(DispatchBase):


class TagTypePagination(DispatchBase):
items: List[TagTypeReadMinimal]
items: List[TagTypeRead]
total: int

0 comments on commit a4ee58d

Please sign in to comment.