Skip to content

Commit

Permalink
fix: Options fields operator comparison. (#867)
Browse files Browse the repository at this point in the history
* fix: Options fields operator comparison.

* delete unused code.

* remove consoles.

* fix comment.

* add send client request to search.

* rename to FieldOptions

* separate options fields and component.

* remove unused code.

* remove field/popover dir

* change e-mail

* remane components.

Co-authored-by: EdwinBetanc0urt <[email protected]>
  • Loading branch information
EdwinBetanc0urt and EdwinBetanc0urt authored May 28, 2021
1 parent 72fb23a commit 0f4fedb
Show file tree
Hide file tree
Showing 11 changed files with 805 additions and 642 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A.
Contributor(s): Edwin Betancourt edwinBetanc0urt@hotmail.com www.erpya.com
Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com www.erpya.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
Expand All @@ -17,7 +17,7 @@
-->
<template>
<el-popover
v-if="(field.columnName === 'DocStatus') && (!isEmptyValue(processOrderUuid))"
v-if="(fieldAttributes.columnName === 'DocStatus') && (!isEmptyValue(processOrderUuid))"
placement="right"
width="400"
trigger="click"
Expand All @@ -37,17 +37,17 @@
</el-select>
<el-tag
v-if="isEmptyValue(valueActionDocument)"
:type="tagStatus(field.value)"
:type="tagStatus(fieldAttributes.value)"
>
{{ field.displayColumn }}
{{ fieldAttributes.displayColumn }}
</el-tag>
<el-tag
v-else
:type="tagStatus(valueActionDocument)"
>
{{ labelDocumentActions }}
</el-tag>
<p v-if="isEmptyValue(valueActionDocument)"> {{ field.description }} </p>
<p v-if="isEmptyValue(valueActionDocument)"> {{ fieldAttributes.description }} </p>
<p v-else> {{ descriptionDocumentActions }} </p>
<el-button
slot="reference"
Expand All @@ -60,12 +60,14 @@
<script>
export default {
name: 'FieldDocumentStatus',

props: {
field: {
fieldAttributes: {
type: Object,
required: true
}
},

data() {
return {
valueActionDocument: ''
Expand Down Expand Up @@ -126,8 +128,8 @@ export default {
},
documentActionChange(value) {
// this.$store.dispatch('notifyFieldChange', {
// parentUuid: this.field.parentUuid,
// containerUuid: this.field.containerUuid,
// parentUuid: this.fieldAttributes.parentUuid,
// containerUuid: this.fieldAttributes.containerUuid,
// columnName: 'DocAction',
// isSendToServer: true,
// newValue: value
Expand All @@ -144,13 +146,13 @@ export default {
recordId: this.$route.params.recordId,
recordUuid: this.$route.query.action,
parametersList: [{
columnName: this.field.columnName,
columnName: this.fieldAttributes.columnName,
value: this.valueActionDocument
}],
isActionDocument: true,
parentUuid: this.field.parentUuid,
panelType: this.field.panelType,
containerUuid: this.field.containerUuid // determinate if get table name and record id (window) or selection (browser)
parentUuid: this.fieldAttributes.parentUuid,
panelType: this.fieldAttributes.panelType,
containerUuid: this.fieldAttributes.containerUuid // determinate if get table name and record id (window) or selection (browser)
})
this.valueActionDocument = ''
}
Expand Down
107 changes: 107 additions & 0 deletions src/components/ADempiere/Field/FieldOptions/fieldOptionsList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
// ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
// Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A.
// Contributor(s): Edwin Betancourt [email protected] www.erpya.com
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// 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 language from '@/lang'

export const infoOptionItem = {
name: language.t('field.info'),
enabled: true,
svg: false,
icon: 'el-icon-info',
componentRender: () => import('@/components/ADempiere/Field/contextMenuField/contextInfo')
}

/**
* For operators in advanced query
*/
export const operatorOptionItem = {
name: language.t('operators.operator'),
enabled: true,
svg: false,
icon: 'el-icon-rank',
componentRender: () => import('@/components/ADempiere/Field/FieldOptions/operatorComparison')
}

/**
* For lookup fields with context info
*/
export const zoomInOptionItem = {
name: language.t('table.ProcessActivity.zoomIn'),
enabled: true,
svg: false,
icon: 'el-icon-files',
componentRender: () => import('@/components/ADempiere/Field/contextMenuField/contextInfo')
}

/**
* Only when is translate option
*/
export const translateOptionItem = {
name: language.t('language'),
enabled: true,
svg: true,
icon: 'language',
componentRender: () => import('@/components/ADempiere/Field/contextMenuField/translated')
}

/**
* Displayed calculator option in numeric field
*/
export const calculatorOptionItem = {
name: language.t('field.calculator'),
enabled: true,
svg: false,
icon: 'el-icon-s-operation',
componentRender: () => import('@/components/ADempiere/Field/contextMenuField/calculator')
}

export const preferenceOptionItem = {
name: language.t('field.preference'),
enabled: true,
svg: false,
icon: 'el-icon-notebook-2',
componentRender: () => import('@/components/ADempiere/Field/FieldOptions/preference')
}

export const logsOptionItem = {
name: language.t('field.logsField'),
enabled: true,
svg: true,
icon: 'tree-table',
componentRender: () => import('@/components/ADempiere/Field/contextMenuField/changeLogs')
}

/**
* For document status field to workflow
*/
export const documentStatusOptionItem = {
name: language.t('window.documentStatus'),
enabled: true,
svg: false,
icon: 'el-icon-set-up',
componentRender: () => import('@/components/ADempiere/Field/FieldOptions/documentStatus')
}

export const optionsListStandad = [
infoOptionItem,
preferenceOptionItem,
logsOptionItem
]

export const optionsListAdvancedQuery = [
infoOptionItem,
operatorOptionItem
]
Loading

0 comments on commit 0f4fedb

Please sign in to comment.