Skip to content

Commit a448b1f

Browse files
committed
fix: remove comments and 0x format
Signed-off-by: Manu Fernández <[email protected]>
1 parent d9c4c73 commit a448b1f

File tree

5 files changed

+24
-3
lines changed

5 files changed

+24
-3
lines changed

apps/ats/web/src/i18n/en/security/beneficiaries.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ export default {
227227
data: {
228228
label: 'Data',
229229
placeholder: '0x',
230+
invalidHexFormat: 'Invalid hex format',
230231
},
231232
},
232233
buttons: {
@@ -251,6 +252,7 @@ export default {
251252
data: {
252253
label: 'Data',
253254
placeholder: '0x',
255+
invalidHexFormat: 'Invalid hex format',
254256
},
255257
},
256258
buttons: {

apps/ats/web/src/views/DigitalSecurityDetails/Components/Beneficiaries/AddBeneficiaryModal.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { Button, InputController } from 'io-bricks-ui';
1414
import { useForm } from 'react-hook-form';
1515
import { useTranslation } from 'react-i18next';
1616
import { useParams } from 'react-router-dom';
17-
import { isValidHederaId, required } from '../../../../utils/rules';
17+
import { isValidHederaId, isValidHex, required } from '../../../../utils/rules';
1818
import { useAddBeneficiary } from '../../../../hooks/mutations/useBeneficiaries';
1919
import { AddBeneficiaryRequest } from '@hashgraph/asset-tokenization-sdk';
2020

@@ -95,6 +95,12 @@ export const AddBeneficiaryModal = ({
9595
id="data"
9696
label={tCreate('form.data.label')}
9797
placeholder={tCreate('form.data.placeholder')}
98+
rules={{
99+
validate: (value: string) =>
100+
!value ||
101+
isValidHex(value) ||
102+
tCreate('form.data.invalidHexFormat'),
103+
}}
98104
/>
99105
</VStack>
100106
</ModalBody>

apps/ats/web/src/views/DigitalSecurityDetails/Components/Beneficiaries/Beneficiaries.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ export const Beneficiaries = () => {
7878
columnsHelper.accessor('data', {
7979
header: tTable('fields.data'),
8080
enableSorting: false,
81+
cell({
82+
row: {
83+
original: { data },
84+
},
85+
}) {
86+
return data === '0x' ? '-' : data;
87+
},
8188
}),
8289
...(hasBeneficiaryManagerRole
8390
? [

apps/ats/web/src/views/DigitalSecurityDetails/Components/Beneficiaries/UpdateBeneficiaryModal.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { useTranslation } from 'react-i18next';
1616
import { useParams } from 'react-router-dom';
1717
import { useUpdateBeneficiary } from '../../../../hooks/mutations/useBeneficiaries';
1818
import { UpdateBeneficiaryDataRequest } from '@hashgraph/asset-tokenization-sdk';
19+
import { isValidHex } from '../../../../utils/rules';
1920

2021
interface FormValues {
2122
address: string;
@@ -98,6 +99,12 @@ export const UpdateBeneficiaryModal = ({
9899
label={tUpdate('form.data.label')}
99100
placeholder={tUpdate('form.data.placeholder')}
100101
isRequired={false}
102+
rules={{
103+
validate: (value: string) =>
104+
!value ||
105+
isValidHex(value) ||
106+
tUpdate('form.data.invalidHexFormat'),
107+
}}
101108
/>
102109
</VStack>
103110
</ModalBody>

apps/ats/web/vite.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,10 @@ export default {
222222
{
223223
name: 'selectiveHMR',
224224
handleHotUpdate({ file, modules }) {
225-
// Solo forzar reload para archivos específicos problemáticos
226225
if (file.includes('problematic-file.ts')) {
227226
return [];
228227
}
229-
// Permitir HMR normal para el resto
228+
230229
return modules;
231230
},
232231
},

0 commit comments

Comments
 (0)