diff --git a/src/components/common/VnLog.vue b/src/components/common/VnLog.vue index 4265d02e9..6368a3e52 100644 --- a/src/components/common/VnLog.vue +++ b/src/components/common/VnLog.vue @@ -7,7 +7,7 @@ import { date } from 'quasar'; import { useStateStore } from 'stores/useStateStore'; import { toRelativeDate } from 'src/filters'; import { useColor } from 'src/composables/useColor'; -import { useFirstUpper } from 'src/composables/useFirstUpper'; +import { useCapitalize } from 'src/composables/useCapitalize'; import { useValidator } from 'src/composables/useValidator'; import VnAvatar from '../ui/VnAvatar.vue'; import VnJsonValue from '../common/VnJsonValue.vue'; @@ -140,7 +140,7 @@ function parseProps(propNames, locale, vals, olds) { if (prop.endsWith('$')) continue; props.push({ name: prop, - nameI18n: useFirstUpper(locale.columns?.[prop]) || prop, + nameI18n: useCapitalize(locale.columns?.[prop]) || prop, val: getVal(vals, prop), old: olds && getVal(olds, prop), }); @@ -202,7 +202,7 @@ function getLogTree(data) { userLog.logs.push( (modelLog = { model: log.changedModel, - modelI18n: useFirstUpper(locale.name) || log.changedModel, + modelI18n: useCapitalize(locale.name) || log.changedModel, id: log.changedModelId, showValue: log.changedModelValue, logs: [], @@ -395,7 +395,7 @@ setLogTree(); (data) => (actions = data.map((item) => { return { - locale: useFirstUpper(validations[item.changedModel].locale.name), + locale: useCapitalize(validations[item.changedModel].locale.name), value: item.changedModel, }; })) @@ -409,7 +409,7 @@ setLogTree(); >
- {{ useFirstUpper(validations[props.model].locale.name) }} + {{ useCapitalize(validations[props.model].locale.name) }} #{{ originLog.originFk }}
diff --git a/src/composables/useFirstUpper.js b/src/composables/useCapitalize.js similarity index 63% rename from src/composables/useFirstUpper.js rename to src/composables/useCapitalize.js index 36378c05f..0a7d6e386 100644 --- a/src/composables/useFirstUpper.js +++ b/src/composables/useCapitalize.js @@ -1,3 +1,3 @@ -export function useFirstUpper(str) { +export function useCapitalize(str) { return str && str.charAt(0).toUpperCase() + str.substr(1); } diff --git a/src/pages/InvoiceIn/Card/InvoiceInCorrective.vue b/src/pages/InvoiceIn/Card/InvoiceInCorrective.vue index f0e555a84..6c05171e7 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInCorrective.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInCorrective.vue @@ -3,7 +3,7 @@ import { ref, computed } from 'vue'; import { useRoute, useRouter } from 'vue-router'; import { useI18n } from 'vue-i18n'; import { useArrayData } from 'src/composables/useArrayData'; -import { useFirstUpper } from 'src/composables/useFirstUpper'; +import { useCapitalize } from 'src/composables/useCapitalize'; import CrudModel from 'src/components/CrudModel.vue'; import FetchData from 'src/components/FetchData.vue'; import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; @@ -32,7 +32,7 @@ const columns = computed(() => [ }, { name: 'type', - label: useFirstUpper(t('globals.type')), + label: useCapitalize(t('globals.type')), field: (row) => row.cplusRectificationTypeFk, options: cplusRectificationTypes.value, model: 'cplusRectificationTypeFk', @@ -44,7 +44,7 @@ const columns = computed(() => [ }, { name: 'class', - label: useFirstUpper(t('globals.class')), + label: useCapitalize(t('globals.class')), field: (row) => row.siiTypeInvoiceOutFk, options: siiTypeInvoiceOuts.value, model: 'siiTypeInvoiceOutFk', @@ -56,7 +56,7 @@ const columns = computed(() => [ }, { name: 'reason', - label: useFirstUpper(t('globals.reason')), + label: useCapitalize(t('globals.reason')), field: (row) => row.invoiceCorrectionTypeFk, options: invoiceCorrectionTypes.value, model: 'invoiceCorrectionTypeFk', diff --git a/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue b/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue index 950f72777..5adaeca94 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue @@ -16,7 +16,7 @@ import FetchData from 'src/components/FetchData.vue'; import SendEmailDialog from 'components/common/SendEmailDialog.vue'; import VnConfirm from 'src/components/ui/VnConfirm.vue'; import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; -import { useFirstUpper } from 'src/composables/useFirstUpper'; +import { useCapitalize } from 'src/composables/useCapitalize'; const $props = defineProps({ id: { @@ -481,7 +481,7 @@ const createInvoiceInCorrection = async () => { readonly /> { { :rules="[requiredFieldRule]" />