Skip to content

Commit

Permalink
feat: Enable Export Dictionary Definition form only System role.
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt committed Jul 30, 2024
1 parent b756b5d commit d04f39f
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/components/ADempiere/Process/ExportDictionaryDefinition.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
</el-button>
</el-col>
</el-row>

<el-card
shadow="hover"
class="box-card"
Expand All @@ -73,6 +74,7 @@
/>
</el-form-item>
</el-col>

<el-col :span="spanColumn">
<el-form-item
:label="$t('page.exportDictionaryDefinition.windows')"
Expand All @@ -86,6 +88,7 @@
/>
</el-form-item>
</el-col>

<el-col :span="spanColumn">
<el-form-item
:label="$t('page.exportDictionaryDefinition.process')"
Expand All @@ -99,6 +102,7 @@
/>
</el-form-item>
</el-col>

<el-col :span="spanColumn">
<el-form-item
:label="$t('page.exportDictionaryDefinition.browsers')"
Expand All @@ -112,6 +116,7 @@
/>
</el-form-item>
</el-col>

<el-col :span="spanColumn">
<el-form-item
:label="$t('page.exportDictionaryDefinition.form')"
Expand All @@ -129,6 +134,7 @@
</el-form>
</el-card>
</el-main>

<el-footer>
<panel-footer
:container-uuid="UUID"
Expand Down Expand Up @@ -157,6 +163,11 @@ import router from '@/router'
import TitleAndHelp from '@/components/ADempiere/TitleAndHelp/index.vue'
import PanelFooter from '@/components/ADempiere/PanelFooter/index.vue'

// Constants
import {
EXPORT_DICTIONARY_DEFINITION_PROCESS_ID
} from '@/utils/ADempiere/dictionary/process/exportDictionaryDefinition.ts'

// API Request Methods
import {
requestRunBusinessProcess
Expand Down Expand Up @@ -215,8 +226,9 @@ export default defineComponent({
const procesingNotification = {
close: () => false
}

requestRunBusinessProcess({
id: 54692,
id: EXPORT_DICTIONARY_DEFINITION_PROCESS_ID,
parameters: {
ECA56_ExportMenu: isMenu.value,
ECA56_ExportForms: isForm.value,
Expand Down Expand Up @@ -279,15 +291,6 @@ export default defineComponent({
</script>

<style lang="scss" scoped>
.v-pos {
height: 90% !important;
.buttons-and-options {
text-align: left;
}
.order-info {
text-align: right;
}
}
.buttons-options {
position: absolute;
top: 45%;
Expand Down
7 changes: 7 additions & 0 deletions src/router/modules/ADempiere/staticRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,13 @@ const staticRoutes = [
path: '/export-dictionary',
component: Layout,
hidden: true,
validateToEnable: ({ role }) => {
if (!role) {
return false
}
// only for System role
return Boolean(role.id === 0)
},
children: [
{
path: '/export-dictionary',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
* Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com
* Contributor(s): Edwin Betancourt [email protected] https://github.com/EdwinBetanc0urt
* 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/>.
*/

export const EXPORT_DICTIONARY_DEFINITION_PROCESS_ID = 232

0 comments on commit d04f39f

Please sign in to comment.