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

Feature/#source code improve reorder implementation #466

Merged
merged 2 commits into from
Apr 28, 2020
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
41 changes: 41 additions & 0 deletions src/api/ADempiere/browser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { getLanguage } from '@/lang/index'
import BusinessData from '@adempiere/grpc-data-client'
import { BUSINESS_DATA_ADDRESS } from '@/api/ADempiere/constants'
import { getToken, getCurrentOrganization, getCurrentWarehouse } from '@/utils/auth'

// Get Instance for connection
function Instance() {
return new BusinessData({
host: BUSINESS_DATA_ADDRESS,
sessionUuid: getToken(),
organizationUuid: getCurrentOrganization(),
warehouseUuid: getCurrentWarehouse(),
language: getLanguage() || 'en_US'
})
}

/**
* Request a browser search
* @param {string} uuid
* @param {string} query
* @param {string} whereClause
* @param {string} orderByClause
* @param {string} nextPageToken
* @param {array} parametersList, This allows follow structure:
* [{
* columnName,
* value
* }]
*/
export function getBrowserSearch({ uuid, parametersList = [], query, whereClause, orderByClause, nextPageToken: pageToken, pageSize }) {
// Run browser
return Instance.call(this).requestListBrowserSearch({
uuid,
parametersList,
query,
whereClause,
orderByClause,
pageToken,
pageSize
})
}
77 changes: 77 additions & 0 deletions src/api/ADempiere/dashboard/dashboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// This file is for get all information for dashboard of ADempiere client,
// please if you want to implement a custom dashboard create a new fielwith api definition
import { getLanguage } from '@/lang/index'
import BusinessData from '@adempiere/grpc-data-client'
import { BUSINESS_DATA_ADDRESS } from '@/api/ADempiere/constants'
import { getToken, getCurrentOrganization, getCurrentWarehouse } from '@/utils/auth'

// Get Instance for connection
function Instance() {
return new BusinessData({
host: BUSINESS_DATA_ADDRESS,
sessionUuid: getToken(),
organizationUuid: getCurrentOrganization(),
warehouseUuid: getCurrentWarehouse(),
language: getLanguage() || 'en_US'
})
}

// Request a Process Activity list
export function requestListProcessesLogs({ pageToken, pageSize }) {
// Get Process Activity
return Instance.call(this).requestListProcessesLogs({ pageToken, pageSize })
}

// Get Recent Items based on selection option
export function getRecentItems({ pageToken, pageSize }) {
return Instance.call(this).requestListRecentItems({ pageToken, pageSize })
}

/**
* Request Favorites List
* @param {string} userUuid
*/
export function getFavoritesFromServer({ userUuid, pageToken, pageSize }) {
return Instance.call(this).requestListFavorites({ userUuid, pageToken, pageSize })
}

// Get pending documents
export function getPendingDocumentsFromServer({ userUuid, roleUuid, pageToken, pageSize }) {
return Instance.call(this).requestListPendingDocuments({
userUuid,
roleUuid,
pageToken,
pageSize
})
}

// List all dashboard for role
export function requestLisDashboards({ roleUuid, pageToken, pageSize }) {
return Instance.call(this).requestListDashboards({
roleUuid,
pageToken,
pageSize
})
}

/**
* Request Document Status List
* @param {string} tableName
* @param {number} recordId
* @param {string} recordUuid
* @param {string} documentStatus
* @param {string} documentAction
* @param {number} pageSize
* @param {string} pageToken
*/
export function requestListDocumentStatuses({ tableName, recordId, recordUuid, documentStatus, documentAction, pageSize, pageToken }) {
return Instance.call(this).requestListDocumentStatuses({
tableName,
recordId,
recordUuid,
documentStatus,
documentAction,
pageSize,
pageToken
})
}
Loading