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

FOUR-18994 Improve Webentry API endpoints performance [SUMMER] #1733

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions src/components/task.vue
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,7 @@ export default {

if (
elementDestinationValue &&
elementDestinationValue !== 'taskSource' &&
data?.params[0]?.tokenId === this.taskId &&
data?.params[0]?.requestStatus === 'ACTIVE'
) {
Expand Down
102 changes: 102 additions & 0 deletions tests/components/TaskMobile.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<template>
<b-row>
<b-col cols="8">
<b-tabs>
<b-tab active title="Form">
<task
v-model="data"
:initial-request-id="task.process_request.id"
:initial-task-id="task.id"
@submit="submit"
/>
</b-tab>
<b-tab title="Data">
<monaco-editor
class="data-editor"
language="json"
:value="JSON.stringify(data, null, 4)"
:options="{ automaticLayout: true, minimap: { enabled: false } }"
/>
<div class="text-right">
<b-button variant="secondary">{{ __("Save") }}</b-button>
</div>
</b-tab>
</b-tabs>
</b-col>
</b-row>
</template>

<script>
import moment from "moment";
import MonacoEditor from "vue-monaco";
import Screens from "../e2e/fixtures/webentry.json";

export default {
components: { MonacoEditor },
data() {
return {
data: {},
task: {
id: 1,
advanceStatus: "open",
component: "task-screen",
created_at: moment().toISOString(),
completed_at: moment().toISOString(),
due_at: moment().add(1, "day").toISOString(),
user: {
avatar: "",
fullname: "Assigned User"
},
screen: Screens.screens[0],
process_request: {
id: 1,
status: "ACTIVE",
user: {
avatar: "",
fullname: "Requester User"
}
},
process: {
id: 1,
name: "Process Name"
},
request_data: {}
}
};
},
methods: {
moment(...args) {
return moment(...args);
},
__(text) {
return text;
},
formatDate(date) {
return moment(date).format("YYYY-MM-DD HH:mm");
},
submit(task) {
if (this.disabled) {
return;
}
this.disabled = true;
const taskId = task.id;
const formData = task.request_data;
window.ProcessMaker.apiClient
.put(`/tasks/${taskId}`, { status: "COMPLETED", data: formData })
.then(() => {
alert("Task Completed Successfully");
})
.finally(() => {
this.disabled = false;
});
}
}
};
</script>

<style scoped>
.data-editor {
border: 1px solid gray;
min-height: 400px;
}
</style>
Loading
Loading