Check input schema (#33)

This commit is contained in:
Jonas Plum
2022-02-27 12:25:41 +01:00
committed by GitHub
parent 54312893a2
commit 338aba8342
38 changed files with 3221 additions and 1676 deletions

View File

@@ -203,7 +203,7 @@ export default Vue.extend({
return icon;
},
statusColor: function (status: string) {
let color = TypeColorEnum.Info;
let color = TypeColorEnum.Info as TypeColorEnum;
this.lodash.forEach(this.$store.state.settings.artifactStates, (state: Type) => {
if (status === state.id && state.color) {
color = state.color

View File

@@ -152,7 +152,7 @@ export default Vue.extend({
}
},
loadAutomations() {
API.listAutomations(this.$route.params.id).then((response) => {
API.listAutomations().then((response) => {
this.automations = response.data;
});
},

View File

@@ -1145,30 +1145,13 @@ export default Vue.extend({
this.selectedTask = undefined;
this.selectedTaskPlaybook = undefined;
},
toTaskForm(task: TaskResponse): Task {
return {
automation: task.automation,
closed: task.closed,
created: task.created,
data: task.data,
done: task.done,
join: task.join,
payload: task.payload,
name: task.name,
next: task.next,
owner: task.owner,
schema: task.schema,
type: task.type.toString() as TaskTypeEnum,
} as Task
},
save(playbookID: string, taskID: string) {
if (!this.ticket || !this.ticket.id || !this.ticket.playbooks) {
return;
}
let task = this.ticket.playbooks[playbookID].tasks[taskID]
task.data = this.tdata[playbookID.toString() + "-" + taskID];
API.setTask(this.ticket.id, playbookID, taskID, this.toTaskForm(task)).then((response) => {
let data = this.tdata[playbookID.toString() + "-" + taskID];
API.setTaskData(this.ticket.id, playbookID, taskID, data).then((response) => {
this.$store.dispatch("alertSuccess", { name: "Task saved" });
this.setTicket(response.data);
});
@@ -1181,9 +1164,7 @@ export default Vue.extend({
return;
}
let task = this.ticket.playbooks[playbookID].tasks[taskID]
task.owner = owner
API.setTask(this.ticket.id, playbookID, taskID, this.toTaskForm(task)).then((response) => {
API.setTaskOwner(this.ticket.id, playbookID, taskID, owner).then((response) => {
this.$store.dispatch("alertSuccess", { name: "Owner saved" });
this.setTicket(response.data);
if (response.data.playbooks) {

View File

@@ -49,7 +49,7 @@
<script lang="ts">
import Vue from "vue";
import { NewUserResponse, UserResponse } from "../client";
import { NewUserResponse, UserResponse } from "@/client";
import {API} from "@/services/api";
interface State {