Skip to content

Commit

Permalink
Merge branch 'master' into enhancement/improved-task-edit
Browse files Browse the repository at this point in the history
  • Loading branch information
whitdog47 authored Oct 9, 2024
2 parents e37aaba + 6448c06 commit 4501ba8
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 73 deletions.
4 changes: 2 additions & 2 deletions src/dispatch/static/dispatch/src/case/CaseSummaryTable.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<v-data-table :headers="headers" :items="items" :loading="loading">
<template #item.case_priority.name="{ value }">
<case-priority :priority="value" />
<template #item.case_priority.name="{ item, value }">
<case-priority :priority="value" :color="item.case_priority.color" />
</template>
<template #item.status="{ item, value }">
<case-status :status="value" :id="item.id" />
Expand Down
8 changes: 4 additions & 4 deletions src/dispatch/static/dispatch/src/case/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@
'items-per-page-options': [10, 25, 50, 100],
}"
>
<template #item.case_severity.name="{ value }">
<case-severity :severity="value" />
<template #item.case_severity.name="{ item, value }">
<case-severity :severity="value" :color="item.case_severity.color" />
</template>
<template #item.case_priority.name="{ value }">
<case-priority :priority="value" />
<template #item.case_priority.name="{ item, value }">
<case-priority :priority="value" :color="item.case_priority.color" />
</template>
<template #item.status="{ item }">
<case-status
Expand Down
10 changes: 8 additions & 2 deletions src/dispatch/static/dispatch/src/case/TableExportDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,16 @@
:loading="previewRowsLoading"
>
<template #item.case_severity.name="{ item }">
<case-severity :severity="item.case_severity.name" />
<case-severity
:severity="item.case_severity.name"
:color="item.case_severity.color"
/>
</template>
<template #item.case_priority.name="{ item }">
<case-priority :priority="item.case_priority.name" />
<case-priority
:priority="item.case_priority.name"
:color="item.case_priority.color"
/>
</template>
<template #item.status="{ item }">
<case-status :status="item.status" :id="item.id" />
Expand Down
13 changes: 3 additions & 10 deletions src/dispatch/static/dispatch/src/case/priority/CasePriority.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,10 @@ export default {
type: String,
required: true,
},
},
computed: {
color() {
return (
{
Low: "green",
Medium: "orange",
High: "red",
}[this.priority] || "red"
)
color: {
type: String,
default: "grey",
},
},
}
Expand Down
29 changes: 7 additions & 22 deletions src/dispatch/static/dispatch/src/case/severity/CaseSeverity.vue
Original file line number Diff line number Diff line change
@@ -1,27 +1,7 @@
<template>
<div class="pl-5">
<div v-if="severity == 'Low'">
<v-badge bordered color="green" dot location="left" offset-x="-10" offset-y="12">
{{ severity }}
</v-badge>
</div>
<div v-else-if="severity == 'Medium'">
<v-badge bordered color="orange" dot location="left" offset-x="-10" offset-y="12">
{{ severity }}
</v-badge>
</div>
<div v-else-if="severity == 'High'">
<v-badge bordered color="red" dot location="left" offset-x="-10" offset-y="12">
{{ severity }}
</v-badge>
</div>
<div v-else-if="severity == 'Critical'">
<v-badge bordered color="purple" dot location="left" offset-x="-10" offset-y="12">
{{ severity }}
</v-badge>
</div>
<div v-else>
<v-badge bordered color="grey" dot location="left" offset-x="-10" offset-y="12">
<div>
<v-badge bordered :color="color" dot location="left" offset-x="-10" offset-y="12">
{{ severity }}
</v-badge>
</div>
Expand All @@ -37,6 +17,11 @@ export default {
type: String,
required: true,
},
color: {
type: String,
default: "grey",
},
},
}
</script>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<v-data-table hover :headers="headers" :items="items" :loading="loading">
<template #item.incident_priority.name="{ value }">
<incident-priority :priority="value" />
<template #item.incident_priority.name="{ item, value }">
<incident-priority :priority="value" :color="item.incident_priority.color" />
</template>
<template #item.status="{ item, value }">
<incident-status :status="value" :id="item.id" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
<v-list-item>
<v-list-item-title>Priority</v-list-item-title>
<v-list-item-subtitle class="text-right">
<incident-priority :priority="incident_priority.name" />
<incident-priority
:priority="incident_priority.name"
:color="incident_priority.color"
/>
</v-list-item-subtitle>
</v-list-item>
<v-list-item>
Expand Down
4 changes: 2 additions & 2 deletions src/dispatch/static/dispatch/src/incident/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
{{ value }}
</v-chip>
</template>
<template #item.incident_severity.name="{ value }">
<incident-severity :severity="value" />
<template #item.incident_severity.name="{ item, value }">
<incident-severity :severity="value" :color="item.incident_severity.color" />
</template>
<template #item.incident_priority.name="{ item, value }">
<incident-priority :priority="value" :color="item.incident_priority.color" />
Expand Down
10 changes: 8 additions & 2 deletions src/dispatch/static/dispatch/src/incident/TableExportDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,16 @@
:loading="previewRowsLoading"
>
<template #item.incident_severity.name="{ item }">
<incident-severity :severity="item.incident_severity.name" />
<incident-severity
:severity="item.incident_severity.name"
:color="item.incident_severity.color"
/>
</template>
<template #item.incident_priority.name="{ item }">
<incident-priority :priority="item.incident_priority.name" />
<incident-priority
:priority="item.incident_priority.name"
:color="item.incident_priority.color"
/>
</template>
<template #item.status="{ item }">
<incident-status :status="item.status" :id="item.id" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,7 @@
<template>
<div class="pl-5">
<div v-if="severity == 'Low'">
<v-badge bordered color="green" dot location="left" offset-x="-10" offset-y="12">
{{ severity }}
</v-badge>
</div>
<div v-else-if="severity == 'Medium'">
<v-badge bordered color="orange" dot location="left" offset-x="-10" offset-y="12">
{{ severity }}
</v-badge>
</div>
<div v-else-if="severity == 'High'">
<v-badge bordered color="red" dot location="left" offset-x="-10" offset-y="12">
{{ severity }}
</v-badge>
</div>
<div v-else-if="severity == 'Critical'">
<v-badge bordered color="purple" dot location="left" offset-x="-10" offset-y="12">
{{ severity }}
</v-badge>
</div>
<div v-else>
<v-badge bordered color="grey" dot location="left" offset-x="-10" offset-y="12">
<div>
<v-badge bordered :color="color" dot location="left" offset-x="-10" offset-y="12">
{{ severity }}
</v-badge>
</div>
Expand All @@ -37,6 +17,11 @@ export default {
type: String,
required: true,
},
color: {
type: String,
default: "grey",
},
},
}
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@
:loading="previewRowsLoading"
>
<template #item.incident_priority.name="{ item }">
<incident-priority :priority="item.incident_priority.name" />
<incident-priority
:priority="item.incident_priority.name"
:color="item.incident_priority.color"
/>
</template>
<template #item.status="{ item }">
<incident-status :status="item.status" :id="item.id" />
Expand Down
5 changes: 4 additions & 1 deletion src/dispatch/static/dispatch/src/task/TableExportDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@
<incident-status :status="item.incident.status" :id="item.id" />
</template>
<template #item.incident_priority.name="{ item }">
<incident-priority :priority="item.incident.incident_priority.name" />
<incident-priority
:priority="item.incident.incident_priority.name"
:color="item.incident.incident_priority.color"
/>
</template>
<template #item.creator.individual_contact.name="{ item }">
<participant :participant="item.creator" />
Expand Down
4 changes: 2 additions & 2 deletions src/dispatch/static/dispatch/src/task/TaskSummaryTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
{{ value }}
</v-chip>
</template>
<template #item.incident_priority.name="{ value }">
<incident-priority :priority="value" />
<template #item.incident_priority.name="{ item, value }">
<incident-priority :priority="value" :color="item.incident_priority.color" />
</template>
<template #item.creator="{ value }">
<participant :participant="value" />
Expand Down

0 comments on commit 4501ba8

Please sign in to comment.