refacto: refs #4466 replace composable name
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2024-02-07 15:59:25 +01:00
parent e2facf3330
commit 75b527207f
5 changed files with 16 additions and 16 deletions

View File

@ -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();
>
<QItem class="origin-info items-center q-my-md" v-if="logTree.length > 1">
<h6 class="origin-id text-grey">
{{ useFirstUpper(validations[props.model].locale.name) }}
{{ useCapitalize(validations[props.model].locale.name) }}
#{{ originLog.originFk }}
</h6>
<div class="line bg-grey"></div>

View File

@ -1,3 +1,3 @@
export function useFirstUpper(str) {
export function useCapitalize(str) {
return str && str.charAt(0).toUpperCase() + str.substr(1);
}

View File

@ -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',

View File

@ -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
/>
<VnSelectFilter
:label="`${useFirstUpper(t('globals.class'))}*`"
:label="`${useCapitalize(t('globals.class'))}*`"
v-model="correctionFormData.invoiceClass"
:options="siiTypeInvoiceOuts"
option-value="id"
@ -491,7 +491,7 @@ const createInvoiceInCorrection = async () => {
</QItemSection>
<QItemSection>
<VnSelectFilter
:label="`${useFirstUpper(t('globals.type'))}*`"
:label="`${useCapitalize(t('globals.type'))}*`"
v-model="correctionFormData.invoiceType"
:options="cplusRectificationTypes"
option-value="id"
@ -499,7 +499,7 @@ const createInvoiceInCorrection = async () => {
:rules="[requiredFieldRule]"
/>
<VnSelectFilter
:label="`${useFirstUpper(t('globals.reason'))}*`"
:label="`${useCapitalize(t('globals.reason'))}*`"
v-model="correctionFormData.invoiceReason"
:options="invoiceCorrectionTypes"
option-value="id"

View File

@ -7,7 +7,7 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import FetchData from 'components/FetchData.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import { useFirstUpper } from 'src/composables/useFirstUpper';
import { useCapitalize } from 'src/composables/useCapitalize';
const { t } = useI18n();
const props = defineProps({
@ -53,7 +53,7 @@ const suppliersRef = ref();
<QItem>
<QItemSection>
<VnInput
:label="useFirstUpper(t('params.correctedFk'))"
:label="useCapitalize(t('params.correctedFk'))"
v-model="params.correctedFk"
is-outlined
>