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

feat: Add window zoom in smart browser. #1300

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/lang/ADempiere/en/actionMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const actionMenu = {
createNewRecord: 'New Record',
shareLink: 'Share Link',
withoutActions: 'Without Actions',
zoomWindow: 'Zoom Window',
// relations
relations: 'Relations',
withoutRelations: 'Without Relations',
Expand Down
3 changes: 2 additions & 1 deletion src/lang/ADempiere/es/actionMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ const actionMenu = {
createNewRecord: 'Nuevo Registro',
shareLink: 'Compartir Enlace',
withoutActions: 'Sin Actiones',
zoomWindow: 'Acercar Ventana',
// relations
relations: 'Relaciones',
withoutRelations: 'Sin Relaciones',
// refeerences
// references
references: 'Referencias',
withoutReferences: 'Sin referencias para el registro'
}
Expand Down
20 changes: 19 additions & 1 deletion src/utils/ADempiere/constants/actionsMenuList.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import language from '@/lang'
import { showMessage } from '@/utils/ADempiere/notification.js'
import { copyToClipboard } from '@/utils/ADempiere/coreUtils'
import { copyToClipboard, zoomIn } from '@/utils/ADempiere/coreUtils.js'

/**
* Create new record
Expand Down Expand Up @@ -120,6 +120,24 @@ export const deleteRecord = {
}
}

/**
* Zoom in on the window associated with the smart browser
* @param {string} uuid of window
*/
export const zoomWindow = {
name: language.t('actionMenu.zoomWindow'),
enabled: true,
svg: false,
icon: 'el-icon-zoom-in',
type: 'zoom',
actionName: 'zoomWindow',
zoomWindow: ({ uuid }) => {
zoomIn({
uuid
})
}
}

export const refreshRecords = {
name: language.t('actionMenu.refreshRecords'),
enabled: true,
Expand Down
14 changes: 12 additions & 2 deletions src/utils/ADempiere/coreUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,27 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

import { isEmptyValue, recursiveTreeSearch } from '@/utils/ADempiere/valueUtils.js'
import { showMessage } from '@/utils/ADempiere/notification'
import router from '@/router'
import language from '@/lang'
import store from '@/store'

import { showMessage } from '@/utils/ADempiere/notification'
import { isEmptyValue, recursiveTreeSearch } from '@/utils/ADempiere/valueUtils.js'

export function zoomIn({
uuid,
params = {},
query = {}
}) {
if (isEmptyValue(uuid)) {
showMessage({
type: 'error',
showClose: true,
message: language.t('notifications.emptyValues')
})
return
}

const menuTree = store.getters.permission_routes

const viewSearch = recursiveTreeSearch({
Expand Down
20 changes: 15 additions & 5 deletions src/views/ADempiere/Browser/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,20 @@ import LoadingView from '@/components/ADempiere/LoadingView/index.vue'
import TitleAndHelp from '@/components/ADempiere/TitleAndHelp'
import PanelDefinition from '@/components/ADempiere/PanelDefinition/index.vue'

// utils and helpers methods
import {
refreshBrowserSearh,
sharedLink
} from '@/utils/ADempiere/constants/actionsMenuList'
// utils and helper methods
import {
isDisplayedField, isDisplayedColumn,
isMandatoryField, isMandatoryColumn,
isReadOnlyField, isReadOnlyColumn
} from '@/utils/ADempiere/dictionary/browser.js'

// constants
import {
refreshBrowserSearh,
sharedLink,
zoomWindow
} from '@/utils/ADempiere/constants/actionsMenuList'

export default defineComponent({
name: 'BrowserView',

Expand Down Expand Up @@ -268,6 +271,13 @@ export default defineComponent({

getActionList: () => [
refreshBrowserSearh,
{
...zoomWindow,
uuid: root.isEmptyValue(storedBrowser.value)
? null
: storedBrowser.value.window.uuid
},

sharedLink
]
})
Expand Down