diff --git a/src/api/ADempiere/data.js b/src/api/ADempiere/data.js index ab395ed9..b3d9efac 100644 --- a/src/api/ADempiere/data.js +++ b/src/api/ADempiere/data.js @@ -347,6 +347,10 @@ export function requestPrintFormats({ tableName, reportViewUuid, processUuid }) return Instance.call(this).requestPrintFormats({ tableName: tableName, reportViewUuid: reportViewUuid, processUuid: processUuid }) } +export function requestLisDashboards(roleUuid) { + return Instance.call(this).requestDashboards(roleUuid) +} + export function requestLanguages() { return Instance.call(this).requestLanguages() } diff --git a/src/components/ADempiere/PendingDocuments/index.vue b/src/components/ADempiere/Dashboard/docstatus/index.vue similarity index 100% rename from src/components/ADempiere/PendingDocuments/index.vue rename to src/components/ADempiere/Dashboard/docstatus/index.vue diff --git a/src/components/ADempiere/Favorites/index.vue b/src/components/ADempiere/Dashboard/favourites/index.vue similarity index 100% rename from src/components/ADempiere/Favorites/index.vue rename to src/components/ADempiere/Dashboard/favourites/index.vue diff --git a/src/components/ADempiere/Dashboard/index.vue b/src/components/ADempiere/Dashboard/index.vue new file mode 100644 index 00000000..24722f88 --- /dev/null +++ b/src/components/ADempiere/Dashboard/index.vue @@ -0,0 +1,55 @@ + + + + + diff --git a/src/components/ADempiere/Dashboard/recentItems/index.vue b/src/components/ADempiere/Dashboard/recentItems/index.vue new file mode 100644 index 00000000..0eea3480 --- /dev/null +++ b/src/components/ADempiere/Dashboard/recentItems/index.vue @@ -0,0 +1,156 @@ + + + + + diff --git a/src/store/modules/ADempiere/dashboard.js b/src/store/modules/ADempiere/dashboard.js index e86a6259..9803b9a4 100644 --- a/src/store/modules/ADempiere/dashboard.js +++ b/src/store/modules/ADempiere/dashboard.js @@ -1,4 +1,5 @@ // Default store for handle dashboard refresh and other functionalities +import { requestLisDashboards } from '@/api/ADempiere/data' const dashboard = { state: { dashboard: [] @@ -14,6 +15,39 @@ const dashboard = { actions: { refreshDashboard({ commit, getters }, parameters) { commit('notifyDashboardRefresh', parameters) + }, + listDashboard({ commit }, roleUuid) { + return new Promise((resolve, reject) => { + requestLisDashboards(roleUuid) + .then(response => { + const dashboards = response.getDashboardsList().map(item => { + return { + windowUuid: item.getWindowuuid(), + browserUuid: item.getBrowseruuid(), + dashboardName: item.getDashboardname(), + dashboardDescription: item.getDashboarddescription(), + dashboardHtml: item.getDashboardhtml(), + columnNo: item.getColumnno(), + lineNo: item.getLineno(), + isCollapsible: item.getIscollapsible(), + isOpenByDefault: item.getIsopenbydefault(), + isEventRequired: item.getIseventrequired(), + fileName: item.getFilename() + } + }) + const roleDashboards = { + roleUuid: roleUuid, + recordCount: response.getRecordcount(), + dashboardList: dashboards, + nextPageToken: response.getNextPageToken() + } + commit('addDashboard', roleDashboards) + resolve(roleDashboards) + }) + .catch(error => { + reject(error) + }) + }) } }, getters: { @@ -21,6 +55,11 @@ const dashboard = { return state.dashboard.find( item => item.uuid === dashboardUuid ) + }, + getDashboardByRole: (state) => (roleUuid) => { + return state.dashboard.find( + item => item.roleUuid === roleUuid + ) } } } diff --git a/src/views/dashboard/admin/index.vue b/src/views/dashboard/admin/index.vue index 3b70f99d..cfb0b79f 100644 --- a/src/views/dashboard/admin/index.vue +++ b/src/views/dashboard/admin/index.vue @@ -1,108 +1,48 @@