Skip to content

Commit

Permalink
Merge pull request #3952 from LibreSign/chore/replace-value-sync-by-v…
Browse files Browse the repository at this point in the history
…-model

chore: replace :value.sync by v-model
  • Loading branch information
vitormattos authored Nov 15, 2024
2 parents 7232e88 + a00bb83 commit 1ae8e40
Show file tree
Hide file tree
Showing 18 changed files with 40 additions and 41 deletions.
1 change: 0 additions & 1 deletion src/Components/Draw/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<div class="actions">
<NcColorPicker ref="colorPicker"
v-model="color"
:value.sync="color"
:palette="customPalette"
:palette-only="true"
@input="refresh">
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Draw/TextInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
:height="canvasHeight + 'px'" />
<NcTextField id="text"
ref="input"
:label="t('libresign', 'Enter your Full Name or Initials to create Signature')"
:value.sync="value" />
v-model="value"
:label="t('libresign', 'Enter your Full Name or Initials to create Signature')" />
</div>
<div class="action-buttons">
<NcButton :disabled="!isValid" type="primary" @click="confirmSignature">
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Request/IdentifySigner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
@update:email="updateEmail"
@update:display-name="updateDisplayName" />
<label for="name-input">{{ t('libresign', 'Signer name') }}</label>
<NcTextField aria-describedby="name-input"
<NcTextField v-model="displayName"
aria-describedby="name-input"
autocapitalize="none"
:value.sync="displayName"
:label="t('libresign', 'Signer name')"
:required="true"
:error="nameHaveError"
Expand Down
8 changes: 4 additions & 4 deletions src/views/CreateAccount.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
{{ errorMessage }}
</NcNoteCard>
<fieldset class="create-account__fieldset">
<NcTextField :label="t('libresign', 'Email')"
:value.sync="email"
<NcTextField v-model="email"
:label="t('libresign', 'Email')"
autocapitalize="none"
:spellchecking="false"
autocomplete="off"
Expand All @@ -30,7 +30,7 @@
required>
<EmailIcon :size="20" />
</NcTextField>
<NcPasswordField :value.sync="password"
<NcPasswordField v-model="password"
:label="t('libresign', 'Password')"
:spellchecking="false"
autocapitalize="none"
Expand All @@ -39,7 +39,7 @@
:helper-text="passwordError"
:error="passwordError.length > 0"
required />
<NcPasswordField :value.sync="passwordConfirm"
<NcPasswordField v-model="passwordConfirm"
:label="t('libresign', 'Confirm password')"
:spellchecking="false"
autocapitalize="none"
Expand Down
6 changes: 3 additions & 3 deletions src/views/CreatePassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
:name="t('libresign', 'Password Creation')"
@closing="signMethodsStore.closeModal('createPassword')">
<p>{{ t('libresign', 'For security reasons, you must create a password to sign the documents. Enter your new password in the field below.') }}</p>
<NcPasswordField :disabled="hasLoading"
<NcPasswordField v-model="password"
:disabled="hasLoading"
:label="t('libresign', 'Enter a password')"
:placeholder="t('libresign', 'Enter a password')"
:value.sync="password" />
:placeholder="t('libresign', 'Enter a password')" />
<template #actions>
<NcButton :disabled="hasLoading" @click="send">
<template #icon>
Expand Down
4 changes: 2 additions & 2 deletions src/views/FilesList/FilesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@
type="error">
{{ message }}
</NcNoteCard>
<NcTextField :label="t('libresign', 'URL of a PDF file')"
:value.sync="pdfUrl">
<NcTextField v-model="pdfUrl"
:label="t('libresign', 'URL of a PDF file')">
<LinkIcon :size="20" />
</NcTextField>
<template #actions>
Expand Down
6 changes: 3 additions & 3 deletions src/views/ReadCertificate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@
</table>
<div v-else class="container">
<div class="input-group">
<NcPasswordField :disabled="hasLoading"
<NcPasswordField v-model="password"
:disabled="hasLoading"
:label="t('libresign', 'Certificate password')"
:placeholder="t('libresign', 'Certificate password')"
:value.sync="password" />
:placeholder="t('libresign', 'Certificate password')" />
</div>
</div>
<template v-if="Object.keys(certificateData).length === 0" #actions>
Expand Down
4 changes: 2 additions & 2 deletions src/views/Request.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
type="error">
{{ message }}
</NcNoteCard>
<NcTextField :label="t('libresign', 'URL of a PDF file')"
:value.sync="pdfUrl">
<NcTextField v-model="pdfUrl"
:label="t('libresign', 'URL of a PDF file')">
<LinkIcon :size="20" />
</NcTextField>
<template #actions>
Expand Down
6 changes: 3 additions & 3 deletions src/views/ResetPassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
<div class="container">
<div class="input-group">
<label for="new-password">{{ t('libresign', 'Current password') }}</label>
<NcPasswordField :value.sync="currentPassword" type="password" />
<NcPasswordField v-model="currentPassword" type="password" />
</div>
<div class="input-group">
<label for="new-password">{{ t('libresign', 'New password') }}</label>
<NcPasswordField :value.sync="newPassword" type="password" />
<NcPasswordField v-model="newPassword" type="password" />
</div>
<div class="input-group">
<label for="repeat-password">{{ t('libresign', 'Repeat password') }}</label>
<NcPasswordField :value.sync="rPassword" :has-error="!validNewPassord" type="password" />
<NcPasswordField v-model="rPassword" :has-error="!validNewPassord" type="password" />
</div>
</div>
<template #actions>
Expand Down
2 changes: 1 addition & 1 deletion src/views/Settings/CertificateCustonOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<div class="item">
<NcTextField v-if="certificate"
:id="certificate.id"
:value.sync="certificate.value"
v-model="certificate.value"
:success="typeof certificate.error === 'boolean' && !certificate.error"
:error="certificate.error"
:maxlength="certificate.max ? certificate.max : undefined"
Expand Down
4 changes: 2 additions & 2 deletions src/views/Settings/DefaultUserFolder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
{{ t('libresign', 'Customize default user folder') }}
</NcCheckboxRadioSwitch>
<div v-if="customUserFolder">
<NcTextField :placeholder="t('libresign', 'Customize default user folder')"
:value.sync="value"
<NcTextField v-model="value"
:placeholder="t('libresign', 'Customize default user folder')"
@update:value="saveDefaultUserFolder" />
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/views/Settings/ExpirationRules.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
</NcCheckboxRadioSwitch>
<fieldset v-show="enableMaximumValidity" id="settings-sharing-remote-api-expiration" class="sharing__sub-section">
{{ t('libresign', 'Maximum validity in seconds of a request to sign.') }}
<NcTextField type="number"
<NcTextField v-model="maximumValidity"
type="number"
class="sharing__input"
:label="t('libresign', 'Maximum validity')"
:placeholder="t('libresign', 'Maximum validity')"
:value.sync="maximumValidity"
@update:value="saveMaximumValidity" />
</fieldset>
<NcCheckboxRadioSwitch type="switch"
Expand All @@ -28,11 +28,11 @@
</NcCheckboxRadioSwitch>
<fieldset v-show="enableRenewalInterval" id="settings-sharing-remote-api-expiration" class="sharing__sub-section">
{{ t('libresign', 'Renewal interval in seconds of a subscription request. When accessing the link, you will be asked to renew the link.') }}
<NcTextField type="number"
<NcTextField v-model="renewalInterval"
type="number"
class="sharing__input"
:label="t('libresign', 'Renewal interval')"
:placeholder="t('libresign', 'Renewal interval')"
:value.sync="renewalInterval"
@update:value="saveRenewalInterval" />
</fieldset>
</NcSettingsSection>
Expand Down
6 changes: 3 additions & 3 deletions src/views/Settings/RootCertificateCfssl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<label for="commonName" class="form-heading--required">{{ t('libresign', 'Name (CN)') }}</label>
<NcTextField id="commonName"
ref="commonName"
:value.sync="certificate.rootCert.commonName"
v-model="certificate.rootCert.commonName"
:helper-text="t('libresign', 'Full name of the main company or main user of this instance')"
:minlength="1"
:success="certificate.rootCert.commonName !== ''"
Expand All @@ -70,15 +70,15 @@
<div v-if="customData" class="form-group">
<label for="cfsslUri">{{ t('libresign', 'CFSSL API URI') }}</label>
<NcTextField id="cfsslUri"
:value.sync="certificate.cfsslUri"
v-model="certificate.cfsslUri"
:label-outside="true"
:placeholder="t('libresign', 'Not mandatory, don\'t fill to use default value.')"
:disabled="formDisabled" />
</div>
<div v-if="customData" class="form-group">
<label for="configPath">{{ t('libresign', 'Config path') }}</label>
<NcTextField id="configPath"
:value.sync="certificate.configPath"
v-model="certificate.configPath"
:label-outside="true"
:placeholder="t('libresign', 'Not mandatory, don\'t fill to use default value.')"
:disabled="formDisabled" />
Expand Down
4 changes: 2 additions & 2 deletions src/views/Settings/RootCertificateOpenSsl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<label for="commonName" class="form-heading--required">{{ t('libresign', 'Name (CN)') }}</label>
<NcTextField id="commonName"
ref="commonName"
:value.sync="certificate.rootCert.commonName"
v-model="certificate.rootCert.commonName"
:helper-text="t('libresign', 'Full name of the main company or main user of this instance')"
:minlength="1"
:success="certificate.rootCert.commonName !== ''"
Expand All @@ -66,7 +66,7 @@
<div v-if="customData" class="form-group">
<label for="configPath">{{ t('libresign', 'Config path') }}</label>
<NcTextField id="configPath"
:value.sync="certificate.configPath"
v-model="certificate.configPath"
:label-outside="true"
:placeholder="t('libresign', 'Not mandatory, don\'t fill to use default value.')"
:disabled="formDisabled" />
Expand Down
4 changes: 2 additions & 2 deletions src/views/Settings/Validation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
@keypress.enter="validationUrlEnter()">
</p>
<p v-if="addFooter && isExtraSettingsEnabled">
<NcTextArea label="Footer template"
<NcTextArea v-model="footerTemplate"
label="Footer template"
placeholder="A twig template to be used at footer of PDF. Will be rendered by mPDF."
:value.sync="footerTemplate"
@update:value="saveFooterTemplate" />
</p>
</NcSettingsSection>
Expand Down
6 changes: 3 additions & 3 deletions src/views/SignPDF/_partials/ModalEmailManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
</div>
<div v-if="signMethodsStore.settings.emailToken.hasConfirmCode">
{{ t('libresign', 'Enter the code you received') }}
<NcTextField maxlength="6"
:value.sync="token"
<NcTextField v-model="token"
maxlength="6"
:disabled="loading"
:label="t('libresign', 'Enter your code')"
:placeholder="t('libresign', 'Enter your code')"
Expand All @@ -23,12 +23,12 @@
</NcTextField>
</div>
<NcTextField v-else
v-model="sendTo"
:disabled="loading"
:label="t('libresign', 'Email')"
:placeholder="t('libresign', 'Email')"
:helper-text="errorMessage"
:error="errorMessage.length > 0"
:value.sync="sendTo"
@input="onChangeEmail">
<EmailIcon :size="20" />
</NcTextField>
Expand Down
2 changes: 1 addition & 1 deletion src/views/SignPDF/_partials/Sign.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
:name="t('libresign', 'Confirm your signature')"
@closing="onCloseConfirmPassword">
{{ t('libresign', 'Subscription password.') }}
<NcPasswordField :value.sync="signPassword" type="password" />
<NcPasswordField v-model="signPassword" type="password" />
<a id="lost-password" @click="toggleManagePassword">{{ t('libresign', 'Forgot password?') }}</a>
<ManagePassword v-if="showManagePassword" />
<template #actions>
Expand Down
2 changes: 1 addition & 1 deletion src/views/Validation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div id="dataUUID">
<form v-show="!hasInfo" @submit="(e) => e.preventDefault()">
<h1>{{ title }}</h1>
<NcTextField :value.sync="myUuid" :label="legend" />
<NcTextField v-model="myUuid" :label="legend" />
<NcButton type="primary"
@click.prevent="validate(myUuid)">
<template #icon>
Expand Down

0 comments on commit 1ae8e40

Please sign in to comment.