-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(redmine 1291405): fix types errors
- Loading branch information
Showing
8 changed files
with
144 additions
and
107 deletions.
There are no files selected for viewing
24 changes: 9 additions & 15 deletions
24
...ages/react-front-kit/src/Form/AddressAutocompleteFields/AddressAutocompleteFields.mock.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,16 @@ | ||
import type { IAdressFields } from './AddressAutocompleteFields'; | ||
import type { IAddressGouvData } from '../FetchAutocompleteField/FetchAutoCompleteField.mock'; | ||
import type { IValue } from '../FetchAutocompleteField/FetchAutocompleteField'; | ||
|
||
export function onOptionSubmitMock(value: { | ||
value: { | ||
properties?: { | ||
city?: string; | ||
housenumber?: string; | ||
number?: string; | ||
postcode?: string; | ||
street?: string; | ||
}; | ||
}; | ||
}): IAdressFields { | ||
export function onOptionSubmitMock( | ||
value: IValue<IAddressGouvData>, | ||
): IAdressFields { | ||
const address = value.value.properties; | ||
return { | ||
city: address?.city, | ||
city: address.city, | ||
country: 'France', | ||
number: address?.housenumber, | ||
postCode: address?.postcode, | ||
street: address?.street, | ||
number: address.housenumber, | ||
postCode: address.postcode, | ||
street: address.street, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/react-front-kit/src/Form/FetchAutocompleteField/AddressGouvApi.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import type { IAddressGouvData } from './FetchAutoCompleteField.mock'; | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { action } from '@storybook/addon-actions'; | ||
|
||
import { getDataAddressGouvMock } from './FetchAutoCompleteField.mock'; | ||
import { FetchAutocompleteField as Cmp } from './FetchAutocompleteField'; | ||
|
||
const meta = { | ||
component: Cmp<IAddressGouvData>, | ||
tags: ['autodocs'], | ||
title: '3-custom/Form/FetchAutocompleteField', | ||
} satisfies Meta<typeof Cmp<IAddressGouvData>>; | ||
|
||
export default meta; | ||
type IStory = StoryObj<typeof meta>; | ||
|
||
export const FieldWithAddressGouvApi: IStory = { | ||
args: { | ||
onFetchData: getDataAddressGouvMock, | ||
onOptionSubmit: action('location'), | ||
}, | ||
}; |
19 changes: 15 additions & 4 deletions
19
packages/react-front-kit/src/Form/FetchAutocompleteField/FetchAutoCompleteField.mock.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.