File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed
app/javascript/gobierto_plans/webapp Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 3636 <CustomFieldImage :attributes =" attributes" />
3737 </template >
3838
39+ <template v-else-if =" currencyType " >
40+ <div
41+ v-for =" value in values"
42+ :key =" value"
43+ >
44+ {{ value | money }}
45+ </div >
46+ </template >
47+
3948 <template v-else >
4049 <div
4150 v-for =" value in values"
5160</template >
5261
5362<script >
54- import { translate } from " lib/vue/filters" ;
63+ import { translate , money } from " lib/vue/filters" ;
5564import { FieldTypeMixin } from " ../lib/mixins/field-type" ;
5665import CustomFieldParagraph from " ./CustomFieldParagraph.vue" ;
5766import CustomFieldPluginRawIndicators from " ./CustomFieldPluginRawIndicators.vue" ;
@@ -69,7 +78,8 @@ export default {
6978 CustomFieldImage
7079 },
7180 filters: {
72- translate
81+ translate,
82+ money
7383 },
7484 mixins: [FieldTypeMixin],
7585 props: {
Original file line number Diff line number Diff line change @@ -2,7 +2,8 @@ export const FieldTypeMixin = {
22 data ( ) {
33 return {
44 fieldType : null ,
5- termDecorator : null
5+ termDecorator : null ,
6+ unitType : null ,
67 } ;
78 } ,
89 computed : {
@@ -28,18 +29,23 @@ export const FieldTypeMixin = {
2829 } ,
2930 rawIndicatorsType ( ) {
3031 return this . termDecorator === "raw_indicators" ;
31- }
32+ } ,
33+ currencyType ( ) {
34+ return this . fieldType === "numeric" && this . unitType === "currency" ;
35+ } ,
3236 } ,
3337 created ( ) {
3438 const {
3539 field_type,
3640 options : {
3741 configuration : {
38- plugin_configuration : { category_term_decorator } = { }
42+ plugin_configuration : { category_term_decorator } = { } ,
43+ unit_type
3944 } = { }
4045 } = { }
4146 } = this . attributes ;
4247 this . fieldType = field_type ;
4348 this . termDecorator = category_term_decorator ;
49+ this . unitType = unit_type ;
4450 }
4551} ;
You can’t perform that action at this time.
0 commit comments