Improve bus (#3)

* Improve bus
* Add ticket log
This commit is contained in:
Jonas Plum
2021-12-27 19:08:07 +01:00
committed by GitHub
parent 1fade14ba5
commit b5dd0cfacd
50 changed files with 756 additions and 456 deletions

View File

@@ -612,6 +612,12 @@ export interface LogEntry {
* @memberof LogEntry
*/
reference: string;
/**
*
* @type {string}
* @memberof LogEntry
*/
type: string;
}
/**
*
@@ -2026,6 +2032,12 @@ export interface TicketWithTickets {
* @memberof TicketWithTickets
*/
id: number;
/**
*
* @type {Array<LogEntry>}
* @memberof TicketWithTickets
*/
logs?: Array<LogEntry>;
/**
*
* @type {string}

View File

@@ -200,8 +200,15 @@
</v-btn>
</template>
</v-textarea>
<div v-for="(comment, id) in ticket.comments" :key="id" class="pb-2">
<v-card elevation="0" color="cards">
<div v-for="(comment, id) in logs(ticket)" :key="id" class="pb-2">
<div v-if="'type' in comment && comment.message !== 'AddComment'" style="text-align: center">
<span class="text--disabled" :title="comment.created">
{{ comment.message }} &middot;
<strong> {{ comment.creator }}</strong> &middot;
{{ relDate(comment.created) }}
</span>
</div>
<v-card v-else-if="!('type' in comment)" elevation="0" color="cards">
<v-card-subtitle class="pb-0">
<strong> {{ comment.creator }}</strong>
<span class="text--disabled ml-3" :title="comment.created">
@@ -791,7 +798,7 @@ import {
Task,
Type,
TypeColorEnum,
TaskResponse, PlaybookResponse, UserResponse, TaskTypeEnum
TaskResponse, PlaybookResponse, UserResponse, TaskTypeEnum, TicketWithTickets,
} from "../client";
import {API} from "@/services/api";
@@ -1520,6 +1527,9 @@ export default Vue.extend({
});
}
return relDate;
},
logs: function(ticket: TicketWithTickets) {
return this.lodash.reverse(this.lodash.sortBy(this.lodash.union(ticket.comments, ticket.logs), ['created']))
}
},
mounted() {