Skip to content

Commit

Permalink
feat(CompanyForm): add lock to prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanvanherwijnen committed Oct 9, 2024
1 parent ad04262 commit 95a1e36
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@modular-api/quasar-components": "^0.3.0",
"@quasar/extras": "1.16.12",
"@quasar/quasar-ui-qcalendar": "4.0.0-beta.16",
"@simsustech/quasar-components": "^0.10.4",
"@simsustech/quasar-components": "^0.10.5",
"@slimfact/api": "^0.1.0",
"@trpc/client": "^10.45.2",
"@trpc/server": "^10.45.2",
Expand Down
14 changes: 13 additions & 1 deletion packages/app/src/components/company/CompanyForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,22 @@
v-bind="input"
v-model="modelValue.prefix"
:label="lang.company.fields.prefix"
:readonly="prefixLocked"
class="col-md-3 col-12"
required
bottom-slots
lazy-rules
name="prefix"
:hint="lang.company.helpers.prefix"
/>
>
<template #append>
<q-icon
class="clickable"
:name="prefixLocked ? 'lock_open' : 'lock'"
@click="prefixLocked = !prefixLocked"
/>
</template>
</form-input>
<form-input
v-bind="input"
v-model="modelValue.email"
Expand Down Expand Up @@ -256,6 +265,7 @@ const formRef = ref<QForm>()
const setValue = (newValue: Company) => {
modelValue.value = extend({}, initialValue, newValue)
if (newValue.prefix) prefixLocked.value = true
}
const submit: InstanceType<typeof ResponsiveDialog>['$props']['onSubmit'] = ({
Expand All @@ -272,6 +282,8 @@ const submit: InstanceType<typeof ResponsiveDialog>['$props']['onSubmit'] = ({
done(false)
}
const prefixLocked = ref(false)
const functions = ref({
submit,
setValue
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/lang/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const lang: Language = {
},
helpers: {
emailBcc: 'All invoices will be sent as BCC to this address.',
prefix: 'The company prefix used in the invoice number prefix.'
prefix: 'The company prefix used in e.g. the invoice number prefix.'
}
},
client: {
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/lang/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const lang: Language = {
helpers: {
emailBcc: 'Alle facturen worden BCC verstuurd naar dit adres.',
prefix:
'Het bedrijfsvoorvoegsel gebruikt in het nummervoorvoegsel van een factuur.'
'Het bedrijfsvoorvoegsel gebruikt in o.a. het nummervoorvoegsel van een factuur. '
}
},
client: {
Expand Down
14 changes: 12 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 95a1e36

Please sign in to comment.