Compare commits
No commits in common. "1429f68b9e58f76f40040fe9589c9f506101e2a6" and "ddf758f4b6dfea4a8bee8d9c4f645f8b4d335103" have entirely different histories.
1429f68b9e
...
ddf758f4b6
2 changed files with 5 additions and 28 deletions
|
|
@ -12,7 +12,7 @@ def set_task_status(task_name, new_status):
|
||||||
return build_success_response(f"Task {task_name} status updated to {new_status}.")
|
return build_success_response(f"Task {task_name} status updated to {new_status}.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return build_error_response(str(e), 500)
|
return build_error_response(str(e), 500)
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_job_task_list(job_id=""):
|
def get_job_task_list(job_id=""):
|
||||||
|
|
@ -61,12 +61,10 @@ def get_tasks_table_data(filters={}, sortings=[], page=1, page_size=10):
|
||||||
fields=["*"],
|
fields=["*"],
|
||||||
filters=processed_filters,
|
filters=processed_filters,
|
||||||
limit=page_size,
|
limit=page_size,
|
||||||
start=(page-1) * page_size,
|
start=page * page_size,
|
||||||
order_by=processed_sortings
|
order_by=processed_sortings
|
||||||
)
|
)
|
||||||
|
|
||||||
print("TASKS?", tasks, page, page_size)
|
|
||||||
|
|
||||||
tableRows = []
|
tableRows = []
|
||||||
for task in tasks:
|
for task in tasks:
|
||||||
tableRow = {}
|
tableRow = {}
|
||||||
|
|
|
||||||
|
|
@ -21,22 +21,18 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import DataTable from "../common/DataTable.vue";
|
import DataTable from "../common/DataTable.vue";
|
||||||
import { ref, onMounted, watch, computed } from "vue";
|
import { ref, onMounted, watch, computed } from "vue";
|
||||||
import { useRouter, useRoute } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import Api from "../../api";
|
import Api from "../../api";
|
||||||
import { useLoadingStore } from "../../stores/loading";
|
import { useLoadingStore } from "../../stores/loading";
|
||||||
import { usePaginationStore } from "../../stores/pagination";
|
import { usePaginationStore } from "../../stores/pagination";
|
||||||
import { useFiltersStore } from "../../stores/filters";
|
import { useFiltersStore } from "../../stores/filters";
|
||||||
import { useNotificationStore } from "../../stores/notifications-primevue";
|
import { useNotificationStore } from "../../stores/notifications-primevue";
|
||||||
import { FilterMatchMode } from "@primevue/core";
|
|
||||||
|
|
||||||
const loadingStore = useLoadingStore();
|
const loadingStore = useLoadingStore();
|
||||||
const paginationStore = usePaginationStore();
|
const paginationStore = usePaginationStore();
|
||||||
const filtersStore = useFiltersStore();
|
const filtersStore = useFiltersStore();
|
||||||
const notifications = useNotificationStore();
|
const notifications = useNotificationStore();
|
||||||
|
|
||||||
const route = useRoute();
|
|
||||||
const subject = route.query.subject;
|
|
||||||
|
|
||||||
const tableData = ref([]);
|
const tableData = ref([]);
|
||||||
const totalRecords = ref(0);
|
const totalRecords = ref(0);
|
||||||
const isLoading = ref(false);
|
const isLoading = ref(false);
|
||||||
|
|
@ -50,18 +46,13 @@ const statusOptions = ref([
|
||||||
"Cancelled",
|
"Cancelled",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const filters = {
|
|
||||||
subject: { value: null, matchMode: FilterMatchMode.CONTAINS },
|
|
||||||
};
|
|
||||||
|
|
||||||
// Computed property to get current filters for the chart
|
// Computed property to get current filters for the chart
|
||||||
const currentFilters = computed(() => {
|
const currentFilters = computed(() => {
|
||||||
return filtersStore.getTableFilters("tasks");
|
return filtersStore.getTableFilters("tasks");
|
||||||
});
|
});
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{ label: "Task", fieldName: "subject", type: "text", sortable: true, filterable: true,
|
{ label: "Task", fieldName: "subject", type: "text", sortable: true, filterable: true },
|
||||||
filterInputID: "subjectFilterId" },
|
|
||||||
{ label: "Job", fieldName: "project", type: "link", sortable: true,
|
{ label: "Job", fieldName: "project", type: "link", sortable: true,
|
||||||
onLinkClick: (link, rowData) => handleProjectClick(link, rowData)
|
onLinkClick: (link, rowData) => handleProjectClick(link, rowData)
|
||||||
},
|
},
|
||||||
|
|
@ -101,7 +92,7 @@ const tableActions = [
|
||||||
try {
|
try {
|
||||||
// Uncomment when API is ready
|
// Uncomment when API is ready
|
||||||
await Api.setTaskStatus(rowData.id, option);
|
await Api.setTaskStatus(rowData.id, option);
|
||||||
|
|
||||||
// Find and update the row in the table data
|
// Find and update the row in the table data
|
||||||
const rowIndex = tableData.value.findIndex(row => row.id === rowData.id);
|
const rowIndex = tableData.value.findIndex(row => row.id === rowData.id);
|
||||||
if (rowIndex >= 0) {
|
if (rowIndex >= 0) {
|
||||||
|
|
@ -220,10 +211,6 @@ watch(showCompleted, () => {
|
||||||
|
|
||||||
// Load initial data
|
// Load initial data
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
if (subject) {
|
|
||||||
const inputElement = document.getElementById(`filter-subject`);
|
|
||||||
inputElement.text = subject;
|
|
||||||
}
|
|
||||||
notifications.addWarning("Tasks page coming soon");
|
notifications.addWarning("Tasks page coming soon");
|
||||||
// Initialize pagination and filters
|
// Initialize pagination and filters
|
||||||
paginationStore.initializeTablePagination("tasks", { rows: 10 });
|
paginationStore.initializeTablePagination("tasks", { rows: 10 });
|
||||||
|
|
@ -235,14 +222,6 @@ onMounted(async () => {
|
||||||
const initialFilters = filtersStore.getTableFilters("tasks");
|
const initialFilters = filtersStore.getTableFilters("tasks");
|
||||||
const initialSorting = filtersStore.getTableSorting("tasks");
|
const initialSorting = filtersStore.getTableSorting("tasks");
|
||||||
|
|
||||||
if (subject) {
|
|
||||||
console.log(subject);
|
|
||||||
console.log(initialFilters);
|
|
||||||
console.log(initialFilters.subject);
|
|
||||||
initialFilters.subject.value = subject;
|
|
||||||
//initialFilters = {...initialFilters, subject: {value: subject, match_mode: "contains"}};
|
|
||||||
}
|
|
||||||
|
|
||||||
const optionsResult = await Api.getTaskStatusOptions();
|
const optionsResult = await Api.getTaskStatusOptions();
|
||||||
statusOptions.value = optionsResult;
|
statusOptions.value = optionsResult;
|
||||||
console.log("DEBUG: Loaded Status options: ", statusOptions.value)
|
console.log("DEBUG: Loaded Status options: ", statusOptions.value)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue