diff --git a/src/views/SimproV2/CreatedProyek/DialogGantt.js b/src/views/SimproV2/CreatedProyek/DialogGantt.js index fdce115..439f084 100644 --- a/src/views/SimproV2/CreatedProyek/DialogGantt.js +++ b/src/views/SimproV2/CreatedProyek/DialogGantt.js @@ -74,14 +74,16 @@ const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName "select": ["id", "name_version", "calculation_type", "description", "created_at", "progress"], "columns": [ { "name": "hierarchy_ftth_id", "logic_operator": "=", "value": hierarchyId, "operator": "AND" } - ] + ], + "orders": { "columns": ["name_version"], "ascending": true } } } else { payload = { "select": ["id", "name_version", "calculation_type", "description", "created_at", "progress"], "columns": [ { "name": "proyek_id", "logic_operator": "=", "value": idTask, "operator": "AND" } - ] + ], + "orders": { "columns": ["name_version"], "ascending": true }, } } const result = await axios diff --git a/src/views/SimproV2/CreatedProyek/DialogHierarchy.js b/src/views/SimproV2/CreatedProyek/DialogHierarchy.js index 7c1f99a..a6ac1b1 100644 --- a/src/views/SimproV2/CreatedProyek/DialogHierarchy.js +++ b/src/views/SimproV2/CreatedProyek/DialogHierarchy.js @@ -16,6 +16,7 @@ import { useTranslation } from 'react-i18next'; import { async } from '@dabeng/react-orgchart'; import { Link } from 'react-router-dom'; import { use } from 'i18next'; +import _ from 'lodash'; const DialogHierarchy = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName }) => { const token = localStorage.getItem("token") const HEADER = { @@ -154,7 +155,8 @@ const DialogHierarchy = ({ openDialog, closeDialog, toggleDialog, idTask, proyek .catch((error) => error.response); if (result && result.status == 200) { - setDataHierarchy(result.data.data); + const sortedData = _.orderBy(result.data.data, ['name'], ['asc']); + setDataHierarchy(sortedData); } else { NotificationManager.error(`Data gantt project gagal terload silahkan coba lagi!`, 'Failed!!'); } @@ -340,4 +342,4 @@ const DialogHierarchy = ({ openDialog, closeDialog, toggleDialog, idTask, proyek } -export default DialogHierarchy; +export default DialogHierarchy; diff --git a/src/views/SimproV2/CreatedProyek/index.js b/src/views/SimproV2/CreatedProyek/index.js index a82aebd..2f021aa 100644 --- a/src/views/SimproV2/CreatedProyek/index.js +++ b/src/views/SimproV2/CreatedProyek/index.js @@ -325,7 +325,7 @@ const CreatedProyek = ({ params, ...props }) => { }, // { "name": "subproyeks.m_subproyek", "column_join": "parent_id", "column_results": ["nama", "biaya", "color_progress", "jumlah_pekerja", "pic", "mulai_proyek", "akhir_proyek", "biaya_actual", "persentase_progress_plan", "persentase_progress_actual"] } ], - orders: { columns: ["id"], ascending: false }, + orders: { columns: ["nama"], ascending: true }, paging: { start: start, length: rowsPerPage }, }; @@ -1356,7 +1356,7 @@ const CreatedProyek = ({ params, ...props }) => { }, // { "name": "subproyeks.m_subproyek", "column_join": "parent_id", "column_results": ["nama", "biaya", "color_progress", "jumlah_pekerja", "pic", "mulai_proyek", "akhir_proyek", "biaya_actual", "persentase_progress_plan", "persentase_progress_actual"] } ], - orders: { columns: ["id"], ascending: false }, + orders: { columns: ["nama"], ascending: true }, }; const result = await axios