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

Adds Case Page, Signal Graph, and supporting components #3974

Merged
merged 60 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
f0f0516
[WIP] - First pass at migrating case page to Vue 3
wssheldon Nov 9, 2023
4d20ae4
Merge branch 'master' into enhancement/full-width-case-page
kevgliss Nov 10, 2023
9529f8c
Merge branch 'master' into enhancement/full-width-case-page
kevgliss Nov 13, 2023
2180886
Merge branch 'master' into enhancement/full-width-case-page
kevgliss Nov 13, 2023
0eda119
Making some progress
kevgliss Nov 13, 2023
c9addd3
Merge branch 'master' into enhancement/full-width-case-page-kglisson
wssheldon Nov 20, 2023
bbe933b
Fill out sidebar, add custom popover search, style changes
wssheldon Nov 21, 2023
d63516d
Merge branch 'master' into enhancement/full-width-case-page-kglisson
wssheldon Nov 21, 2023
64b68e2
Add fancy components for Menu, Tooltip, and Button group
wssheldon Nov 27, 2023
d63c95c
Add pariticpant folder with participant AvatarGroup component
wssheldon Nov 27, 2023
708e30c
Add composables for Hotkey and EventListener
wssheldon Nov 27, 2023
10110e7
Add Atomics folder for micro components and Hotkey to start
wssheldon Nov 27, 2023
43a4973
Add TipTap, update packages
wssheldon Nov 27, 2023
eddc7d7
Remove PopoverMenu2
wssheldon Nov 27, 2023
7dc6671
Add Signal Graph components
wssheldon Nov 27, 2023
bd235d8
Add PageHeader component
wssheldon Nov 27, 2023
affe228
Add CasePriority popover
wssheldon Nov 27, 2023
5809203
Add API route for pulling case participants
wssheldon Nov 27, 2023
d3a79ea
The rest of the changes
wssheldon Nov 27, 2023
d70b8ad
Add HoverCard and LockButton components
wssheldon Nov 27, 2023
40e9c16
Remove ParticipantChips component
wssheldon Nov 28, 2023
20afe54
Address some linter findings
wssheldon Nov 28, 2023
2358aa2
Remove console logs from graph generation
wssheldon Nov 28, 2023
3483562
Remove dead/refactored components
wssheldon Nov 29, 2023
275c4ef
Add refactored popover super components
wssheldon Nov 29, 2023
f543b69
Add escalate button
wssheldon Nov 29, 2023
91c7497
Add new tiptap component
wssheldon Nov 29, 2023
7c7ffba
Add eslint changes
wssheldon Nov 29, 2023
60ae902
Merge branch 'master' into enhancement/full-width-case-page-kglisson
wssheldon Nov 29, 2023
9bdb171
Remove unused RichEditor component
wssheldon Nov 29, 2023
e466cc3
Remove unused ProjectSelectChip component
wssheldon Nov 29, 2023
41d357f
Remove unused CaseTypeSelectChip
wssheldon Nov 29, 2023
077c9b9
Remove unused CasePrioritySelectChip
wssheldon Nov 29, 2023
d7b4d35
Remove unused CaseSeveritySelectChip
wssheldon Nov 29, 2023
aa17392
Remove unused TagChips component
wssheldon Nov 29, 2023
c048f20
CaseToggleVisibility
wssheldon Nov 29, 2023
7bfda0e
Remove EntitiesTab import from CaseTabs
wssheldon Nov 29, 2023
33963e6
Remove unused imports from NewRawSignalViewer
wssheldon Nov 29, 2023
e30b9f3
More eslint issues, unused vars, defining types, and deprecated veuti…
wssheldon Nov 29, 2023
3a915c6
Remove unused FancyButtonGroup component
wssheldon Nov 29, 2023
638b2d0
Remove unused mapMutations import in Case Table
wssheldon Nov 29, 2023
c027fb4
shadowed menu ref in AvatarGroup
wssheldon Nov 29, 2023
258a3a3
Unused CaseDetailsTabs component
wssheldon Nov 29, 2023
ce23637
unused var assignment of props in HoverCard component
wssheldon Nov 29, 2023
0466415
Use deprecated timeline in Case details page
wssheldon Nov 29, 2023
277e342
Refactor components and move to respective folders
wssheldon Nov 29, 2023
709cba8
More clean up and addressing eslin errors, refactors in SearchPopover
wssheldon Nov 29, 2023
1d91ebb
Remove more unused components CustomMenuInput, EditableTextArea
wssheldon Nov 29, 2023
26ca76a
More refactor, make resolution reason popover component
wssheldon Nov 29, 2023
b2bfb3b
Make the resource buttons work, remove tooltips that are not setup, a…
wssheldon Nov 29, 2023
6f1f6d9
Remove unused component and fix eslinet on drawer
wssheldon Nov 29, 2023
3df2076
Minor typos, unused imports, etc
wssheldon Nov 29, 2023
2d263a0
Remove unused vars and ignore placeholder funcs unused
wssheldon Nov 29, 2023
84d8f52
Addressing many of the comments from kevgliss
wssheldon Nov 29, 2023
e010a26
Moving and renaming various components
wssheldon Nov 29, 2023
a2d64dd
Generalize LockButton
wssheldon Nov 29, 2023
b076902
Make the RichEditor emit instead of directly saving
wssheldon Nov 29, 2023
26dece3
use default slots so we can use styles in SearchPopover for list items
wssheldon Nov 29, 2023
abbe96f
in addition to last commit, rename Fancy to D
wssheldon Nov 29, 2023
12ce01c
Follow similar pattern for expand but use minimal, in get_case_partic…
wssheldon Nov 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions src/dispatch/static/dispatch/src/case/CaseAttributesDrawer.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<template>
<v-navigation-drawer location="right" width="300">
<v-toolbar density="compact" color="transparent">
<v-spacer></v-spacer>

Check warning on line 4 in src/dispatch/static/dispatch/src/case/CaseAttributesDrawer.vue

View workflow job for this annotation

GitHub Actions / build

Require self-closing on Vue.js custom components (<v-spacer>)
<!----<avatar-stack v-model="participants" />-->
<v-btn icon>

Check failure on line 6 in src/dispatch/static/dispatch/src/case/CaseAttributesDrawer.vue

View workflow job for this annotation

GitHub Actions / build

default icon button variant is contained, override to variant="text"?
<v-icon>mdi-dots-vertical</v-icon>
</v-btn>
<case-toggle-visibility v-model="visibility" />
</v-toolbar>
</v-navigation-drawer>
</template>
<script>
import { computed } from "vue"
import AvatarStack from "@/components/AvatarStack.vue"
import CaseToggleVisibility from "@/case/CaseToggleVisibility.vue"

export default {
name: "CaseAttributesDrawer",
props: {
modelValue: {
type: Object,
default: () => ({}),
required: true,
},
},
components: {
AvatarStack,

Check failure on line 28 in src/dispatch/static/dispatch/src/case/CaseAttributesDrawer.vue

View workflow job for this annotation

GitHub Actions / build

The "AvatarStack" component has been registered but not used
CaseToggleVisibility,
},
setup(props, { emit }) {
const participants = computed({
get: () => props.modelValue.participants,
set: (value) => emit("update:modelValue", value),
})

const visibility = computed({
get: () => props.modelValue.visibility,
set: (value) => emit("update:modelValue", value),
})

return {
participants,
visibility,
}
},
}
</script>
Empty file.
85 changes: 85 additions & 0 deletions src/dispatch/static/dispatch/src/case/CaseSignalInstanceTab.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<template>
<v-data-table
density="compact"
:headers="headers"
:loading="internalLoading"
:items="signalInstances"
:items-per-page="25"
:footer-props="{
'items-per-page-options': [25, 50, 100],
}"
>
<template #item.signal="{ value }">
<signal-popover :value="value" />
</template>
<template #item.created_at="{ value }">
<v-tooltip location="bottom">
<template #activator="{ props }">
<span v-bind="props">{{ formatRelativeDate(value) }}</span>
</template>
<span>{{ formatDate(value) }}</span>
</v-tooltip>
</template>
<template #item.data-table-actions="{ item }">
<v-btn icon variant="text" @click="showRun({ type: 'signal', data: item })">
<v-icon>mdi-play-circle-outline</v-icon>
</v-btn>
<workflow-run-modal />
<raw-signal-viewer :value="item" />
</template>
</v-data-table>
</template>

<script>
import { ref, toRefs, watch } from "vue"
import { formatRelativeDate, formatDate } from "@/filters"
import SignalPopover from "@/signal/SignalPopover.vue"
import RawSignalViewer from "@/signal/RawSignalViewer.vue"
import WorkflowRunModal from "@/workflow/RunModal.vue"

export default {
name: "SignalInstanceTab",
components: {
SignalPopover,
RawSignalViewer,
WorkflowRunModal,
},
props: {
modelValue: {
type: Array,
default: () => [],
required: true,
},
loading: {
type: Boolean,
default: false,
required: true,
},
},
setup(props) {
const { modelValue, loading } = toRefs(props)
const signalInstances = ref(props.modelValue)
const internalLoading = ref(props.loading)

watch(modelValue, (newValue) => {
signalInstances.value = newValue
})

watch(loading, (newValue) => {
internalLoading.value = newValue
})

const headers = ref([
{ title: "Signal", key: "signal", sortable: false },
{ title: "Created At", key: "created_at" },
{ title: "", key: "data-table-actions", sortable: false, align: "end" },
])

function showRun(payload) {
store.dispatch("workflow/showRun", payload)

Check failure on line 79 in src/dispatch/static/dispatch/src/case/CaseSignalInstanceTab.vue

View workflow job for this annotation

GitHub Actions / build

'store' is not defined
}

return { formatRelativeDate, formatDate, signalInstances, headers, showRun, internalLoading }
},
}
</script>
179 changes: 179 additions & 0 deletions src/dispatch/static/dispatch/src/case/CaseStatusSelectGroup.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
<template>
<v-item-group mandatory>
<v-dialog v-model="dialogVisable" max-width="600">
<v-card>
<v-card-title>Update Case Status</v-card-title>
<v-card-text
>Are you sure you want to change the case status from {{ _case.status }} to

Check warning on line 7 in src/dispatch/static/dispatch/src/case/CaseStatusSelectGroup.vue

View workflow job for this annotation

GitHub Actions / build

Expected 1 line break after opening tag (`<v-card-text>`), but no line breaks found
{{ selectedStatus }}</v-card-text

Check warning on line 8 in src/dispatch/static/dispatch/src/case/CaseStatusSelectGroup.vue

View workflow job for this annotation

GitHub Actions / build

Expected 1 line break before closing tag (`</v-card-text>`), but no line breaks found
>

<v-btn
class="ml-6 mb-4"
small

Check failure on line 13 in src/dispatch/static/dispatch/src/case/CaseStatusSelectGroup.vue

View workflow job for this annotation

GitHub Actions / build

'small' has been replaced with 'size="small"'
color="info"
elevation="1"
@click="changeStatus(selectedStatus)"
>
Submit
</v-btn>
</v-card>
</v-dialog>

<v-container fluid>
<v-row no-gutters>
<v-col v-for="status in statuses" :key="status.name" cols="6" md="2">
<v-item v-slot="{ active, toggle }">

Check failure on line 26 in src/dispatch/static/dispatch/src/case/CaseStatusSelectGroup.vue

View workflow job for this annotation

GitHub Actions / build

'active' is defined but never used
<div class="overlap-card" :class="status.hoverClass" @click="openDialog(status.name)">
<v-tooltip bottom>

Check failure on line 28 in src/dispatch/static/dispatch/src/case/CaseStatusSelectGroup.vue

View workflow job for this annotation

GitHub Actions / build

'bottom' has been replaced with 'location="bottom"'
<template v-slot:activator="{ on, attrs }">

Check warning on line 29 in src/dispatch/static/dispatch/src/case/CaseStatusSelectGroup.vue

View workflow job for this annotation

GitHub Actions / build

Expected '#activator' instead of 'v-slot:activator'

Check failure on line 29 in src/dispatch/static/dispatch/src/case/CaseStatusSelectGroup.vue

View workflow job for this annotation

GitHub Actions / build

v-tooltip's 'activator' slot has changed props
<v-sheet outlined color="grey lighten-1" :class="status.sheetClass">

Check failure on line 30 in src/dispatch/static/dispatch/src/case/CaseStatusSelectGroup.vue

View workflow job for this annotation

GitHub Actions / build

'outlined' has been removed

Check failure on line 30 in src/dispatch/static/dispatch/src/case/CaseStatusSelectGroup.vue

View workflow job for this annotation

GitHub Actions / build

'grey lighten-1' has been replaced with 'grey-lighten-1'
<v-card
class="d-flex align-center"
:class="status.sheetClass"
height="30"
width="100%"
@click="toggle"
flat
color="grey lighten-4"

Check failure on line 38 in src/dispatch/static/dispatch/src/case/CaseStatusSelectGroup.vue

View workflow job for this annotation

GitHub Actions / build

'grey lighten-4' has been replaced with 'grey-lighten-4'
v-bind="attrs"
v-on="on"
>
<v-scroll-y-transition>
<div v-if="isActiveStatus(status.name)" class="flex-grow-1 text-center">
<v-badge

Check warning on line 44 in src/dispatch/static/dispatch/src/case/CaseStatusSelectGroup.vue

View workflow job for this annotation

GitHub Actions / build

Require self-closing on Vue.js custom components (<v-badge>)
:color="status.color"
bordered
dot
left
offset-x="-10"
offset-y="0"
>
</v-badge
>{{ status.label }}
</div>

<div v-else class="flex-grow-1 text-center text--disabled">
{{ status.label }}
</div>
<span>{{
status.tooltip ? status.tooltip : `Not yet ${status.label.toLowerCase()}`
}}</span>
</v-scroll-y-transition>
</v-card>
</v-sheet>
</template>
<span>{{
status.tooltip ? status.tooltip : `Not yet ${status.label.toLowerCase()}`
}}</span>
</v-tooltip>
</div>
</v-item>
</v-col>
</v-row>
</v-container>
</v-item-group>
</template>

<script>
import { mapActions } from "vuex"
export default {
name: "CaseStatusSelectGroup",
props: {
_case: {

Check warning on line 83 in src/dispatch/static/dispatch/src/case/CaseStatusSelectGroup.vue

View workflow job for this annotation

GitHub Actions / build

Prop "_case" is not in camelCase
type: Object,
required: false,
default: () => ({}),
},
},
data() {
return {
selectedStatus: null,
dialogVisable: false,
}
},
computed: {
statuses() {
return [
{
name: "New",
label: "New",
color: "red",
hoverClass: "hover-card-three",
sheetClass: "rounded-l-xl arrow",
tooltip: this._case.created_at,
},
{
name: "Triage",
label: "Triaged",
color: "red",
hoverClass: "hover-card-two",
sheetClass: "arrow",
tooltip: this._case.triage_at,
},
{
name: "Closed",
label: "Resolved",
color: "green",
hoverClass: "hover-card",
sheetClass: "arrow",
tooltip: this._case.closed_at,
},
{
name: "Escalated",
label: "Escalated",
color: "red",
hoverClass: "",
sheetClass: "rounded-r-xl",
tooltip: this._case.escalated_at,
},
]
},
},
methods: {
...mapActions("case_management", ["save_page"]),
changeStatus(newStatus) {
this._case.status = newStatus
this.save_page()
this.dialogVisable = false
this.selectedStatus = null
},
openDialog(newStatus) {
this.selectedStatus = newStatus
this.dialogVisable = true
},
isActiveStatus(status) {
return this._case.status === status
},
},
}
</script>

<style scoped>
.arrow {
clip-path: polygon(0% 0%, 95% 0%, 100% 50%, 95% 100%, 0% 100%);
}
.overlap-card {
margin-left: -15px;
border-radius: 75%;
box-shadow: 0 1px 6px 0px rgba(0, 0, 0, 0.1);
}
.overlap-card:first-child {
margin-left: 0;
}
.overlap-card:last-child {
margin-right: -15px;
}
.hover-card {
position: relative;
z-index: 1;
}
.hover-card-two {
position: relative;
z-index: 2;
}
.hover-card-three {
position: relative;
z-index: 3;
}
</style>
34 changes: 34 additions & 0 deletions src/dispatch/static/dispatch/src/case/CaseStatusToggle.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<template>
<v-btn-toggle v-model="toggleExclusive">
<v-btn class="arrow"> New </v-btn>
<v-btn> Triaged </v-btn>
<v-btn> Resolved </v-btn>
<v-btn> Escalated </v-btn>
</v-btn-toggle>
</template>

<script>
import { ref } from "vue"

export default {
name: "CaseToggleButton",
props: {
modelValue: {
type: String,
default: () => "New",
required: true,
},
},
setup(props, { emit }) {
const toggleExclusive = ref(props.modelValue)

return { toggleExclusive }
},
}
</script>

<style scoped>
.arrow {
clip-path: polygon(0% 0%, 95% 0%, 100% 50%, 95% 100%, 0% 100%);
}
</style>
Loading
Loading