Skip to content

Commit

Permalink
feat: (transcoding) Mail template (adempiere#1535)
Browse files Browse the repository at this point in the history
* feat: (Transcoding) Mail Template

* fix import file.
  • Loading branch information
EdwinBetanc0urt authored Oct 17, 2023
1 parent 6bfd453 commit b4928e7
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
* Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com
* Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com
* Contributor(s): Elsio Sanchez Elsiosanches@gmail.com https://github.com/elsiosanchez
* 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
Expand Down Expand Up @@ -29,18 +29,11 @@ export function requestMailTemplates({
}) {
return request({
url: '/user-interface/mail-templates',
method: 'post',
method: 'get',
data: {
search_value: searchValue,
page_size: pageSize,
page_token: pageToken
}
})
.then(response => {
return {
recordCount: response.record_count,
records: response.records,
nextPageToken: response.next_page_token
}
})
}
14 changes: 4 additions & 10 deletions src/api/ADempiere/user-interface/component/issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,30 +46,24 @@ export function requestExistsIssues({

/**
* Issues List from Window
* @param {string} tableName
* @param {number} recordId
* @param {string} recordUuid
* @param {string} searchValue
* @param {string} tableName
* @param {number} recordId
* @param {string} searchValue
*/
export function requestListIssues({
tableName,
recordId,
recordUuid,
searchValue
}) {
return request({
url: '/user-interface/component/issue/list-issues',
url: '/issue-management/issues',
method: 'get',
params: {
record_id: recordId,
record_uuid: recordUuid,
table_name: tableName,
search_value: searchValue
}
})
.then(listExists => {
return listExists
})
}

/**
Expand Down
19 changes: 12 additions & 7 deletions src/store/modules/ADempiere/form/issues.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
* Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com
* Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com
* Contributor(s): Elsio Sanchez elsiosanchez@gmail.com https://github.com/elsiosanchez
* 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
Expand All @@ -21,7 +21,7 @@ import lang from '@/lang'
// API Request Methods
import {
requestMailTemplates
} from '@/api/ADempiere/user-interface/component/index.js'
} from '@/api/ADempiere/user-interface/component/index.ts'

const issues = {
listMail: {
Expand All @@ -33,24 +33,27 @@ const issues = {

export default {
state: issues,

mutations: {
setListMailTemplates(state, list) {
state.listMail = list
}
},

actions: {
findListMailTemplates({ commit }) {
requestMailTemplates({})
.then(response => {
const { records } = response
const listOptions = records.map(listMail => {
const { name } = listMail
const listOptions = records.map(mailTemplate => {
const { name, subject, mail_text } = mailTemplate

return {
name,
text: listMail.subject,
text: subject,
action(editor) {
editor.insert((selected) => {
const placeholder = listMail.mail_text
editor.insert(selected => {
const placeholder = mail_text
const content = selected || placeholder
return {
text: `${content}`,
Expand All @@ -60,6 +63,7 @@ export default {
}
}
})

commit('setListMailTemplates', {
listMailTemplates: {
title: lang.t('issues.emailTemplate'),
Expand All @@ -73,6 +77,7 @@ export default {
})
}
},

getters: {
getListMailTemplates(state) {
return state.listMail
Expand Down
14 changes: 13 additions & 1 deletion src/views/ADempiere/Form/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ import store from '@/store'
// Components and Mixins
import FormPanel from '@/components/ADempiere/Form'
import LoadingView from '@/components/ADempiere/LoadingView/index.vue'
import TitleAndHelp from '@/components/ADempiere/TitleAndHelp'

// Utils and Helper Methods
import { isEmptyValue, getValidInteger } from '@/utils/ADempiere'
Expand All @@ -90,7 +91,8 @@ export default defineComponent({

components: {
FormPanel,
LoadingView
LoadingView,
TitleAndHelp
},

setup() {
Expand Down Expand Up @@ -184,3 +186,13 @@ export default defineComponent({
}
})
</script>

<style>
.el-card__body {
padding-top: 0px !important;
padding-right: 0px !important;
padding-bottom: 2px !important;
padding-left: 0px !important;
/* height: 100%!important; */
}
</style>

0 comments on commit b4928e7

Please sign in to comment.