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

fix: Action button name. #1540

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
13 changes: 12 additions & 1 deletion src/components/ADempiere/ActionMenu/Actions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@command="runAction"
@click="runDefaultAction"
>
{{ actionsManager.defaultActionName }}
{{ defaultActionName }}

<el-dropdown-menu slot="dropdown">
<el-dropdown-item
Expand Down Expand Up @@ -177,6 +177,16 @@ export default defineComponent({
return actionsList.value[0]
})

const defaultActionName = computed(() => {
if (!root.isEmptyValue(props.actionsManager.defaultActionName)) {
return props.actionsManager.defaultActionName
}
if (!root.isEmptyValue(actionsList.value)) {
return actionsList.value[0].name
}
return root.$t('actionMenu.runProcessOrReport')
})

/**
* Run default action with last parameters
*/
Expand All @@ -202,6 +212,7 @@ export default defineComponent({

return {
actionsList,
defaultActionName,
// methods
runAction,
runDefaultAction
Expand Down
6 changes: 3 additions & 3 deletions src/components/ADempiere/ActionMenu/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
<script>
import { defineComponent, computed } from '@vue/composition-api'

import MenuActions from './Actions'
import MenuRelations from './Relations'
import MenuReferences from './References'
import MenuActions from './Actions.vue'
import MenuRelations from './Relations.vue'
import MenuReferences from './References.vue'

export default defineComponent({
name: 'ActionMenu',
Expand Down
46 changes: 35 additions & 11 deletions src/views/ADempiere/Browser/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,28 @@ export default defineComponent({
}
}

const actionsManager = ref({
containerUuid: browserUuid,
const processName = computed(() => {
const browser = storedBrowser.value
if (!root.isEmptyValue(browser)) {
const process = storedBrowser.value.process
if (!root.isEmptyValue(process)) {
return process.name
}
}

defaultActionName: root.$t('actionMenu.runProcessOrReport'),
return root.$t('actionMenu.runProcessOrReport')
})

getActionList: () => root.$store.getters.getStoredActionsMenu({
containerUuid: browserUuid
})
const actionsManager = computed(() => {
return {
containerUuid: browserUuid,

defaultActionName: processName.value,

getActionList: () => root.$store.getters.getStoredActionsMenu({
containerUuid: browserUuid
})
}
})

const relationsManager = ref({
Expand Down Expand Up @@ -381,15 +395,25 @@ export default defineComponent({
</script>

<style lang="scss">
/* removes the title link effect on collapse */
.el-collapse-item__header:hover {
background-color: #fcfcfc;
}

.browser-view {
.browser-collapse {
margin-bottom: 10px;
}

/* removes the title link effect on collapse */
.el-collapse-item__header {
&:hover {
background-color: #fcfcfc;
color: #000;
}
&.focusing:focus:not(:hover) {
color: #000;
}

/* browser criteria title */
font-weight: bold;
font-size: 16px;
}
}
</style>
<style scoped>
Expand Down
2 changes: 2 additions & 0 deletions src/views/ADempiere/Process/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ export default defineComponent({
const actionsManager = ref({
containerUuid: processUuid,

defaultActionName: root.$t('actionMenu.runProcessOrReport'),

getActionList: () => [
runProcessOrReport,
sharedLink
Expand Down