-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Phone number with ISD codes support in Input widget #5256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 21 commits
Commits
Show all changes
87 commits
Select commit
Hold shift + click to select a range
9d2bb31
Added properties for currency type input in Input widget
vicky-primathon 796829c
Added search to dropdown
vicky-primathon cd3fdeb
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon 622bc70
Currency type dropdown alignment fixed
vicky-primathon e6a28c5
Changes to handle formatting
vicky-primathon 414218f
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon 1354a8c
Handle decimal points for current type input widget
vicky-primathon ac8dd2d
Added cypress test to validate currency type input
vicky-primathon 768be59
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon 1013b64
Changed property pane currency type dropdown to be searchable
vicky-primathon 61207e7
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon d3c3e41
Fix currency type input widget
vicky-primathon ad4e0a8
Fix currencType property to be updated in canvas mode only since its …
vicky-primathon a38ba7e
Merge branch 'currency-type-input' of https://github.com/appsmithorg/…
vicky-primathon 13cab87
Added changes to handle phone number code selection for input widget
vicky-primathon 114639e
Added dialing code options, made selected country code as meta prop
vicky-primathon 6ab06ce
Added test case to validate phone number and country flag is visible
vicky-primathon 1ee6752
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon 513c41b
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon 6fc61c7
Rename PhoneNumberCodeDropdown to ISDCodeDropdown
vicky-primathon 9988579
Merge branch 'currency-type-input' of https://github.com/appsmithorg/…
vicky-primathon 7417828
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon 2796dc9
useMemo, calling function once for optimizations
vicky-primathon f4bc511
useMemo, calling function once for optimizations
vicky-primathon 6983006
remove incorrect usage of useMemo from component
vicky-primathon 6ee0f0b
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon 31eed21
Merge branch 'currency-type-input' of https://github.com/appsmithorg/…
vicky-primathon 5a0e9b2
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon 4ee46b0
Fix unit test
vicky-primathon 7bc0190
Fix currency selection not displayed after initial selection
vicky-primathon 15a3770
Merge branch 'currency-type-input' of https://github.com/appsmithorg/…
vicky-primathon 4fb326d
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon 4f91044
Fixes for unit test
vicky-primathon 0c221a8
Merge branch 'currency-type-input' of https://github.com/appsmithorg/…
vicky-primathon 5e5d5cf
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon c217057
Fix default curerncy selection and removed 0 decimal counts option
vicky-primathon cb455f8
Fix NaN issue on clearing the currency input
vicky-primathon 5544251
Merge branch 'currency-type-input' of https://github.com/appsmithorg/…
vicky-primathon fed0fa6
Add selected countryCode as widget api property
vicky-primathon 2e5ce92
Add selected currency countryCode as widget api property
vicky-primathon 2510b49
Merge branch 'currency-type-input' of https://github.com/appsmithorg/…
vicky-primathon 09563f1
Fix test case
vicky-primathon d2fa0ce
Fix phonenumber value
vicky-primathon a5c56ed
Convert default text to default number for number type inputs
vicky-primathon 0e87198
Fix overflow issue for property actions component
vicky-primathon ef5f193
Fix no of digits after decimal issue
vicky-primathon 62a2fbd
Merge branch 'currency-type-input' of https://github.com/appsmithorg/…
vicky-primathon 2dc471e
Fix decimal point rounding off
vicky-primathon 58e1eeb
Merge branch 'currency-type-input' of https://github.com/appsmithorg/…
vicky-primathon 39e214f
Fix cypress test for Input spec
vicky-primathon 25164ed
Fix disable input with phone number type
vicky-primathon d5a004f
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon b487cef
Merge branch 'currency-type-input' of https://github.com/appsmithorg/…
vicky-primathon 0a3f2d6
Fix default value validation
vicky-primathon ee161b4
Fix build issue and default value validations
vicky-primathon 56180d9
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon 42505a6
Issue during merge fixed
vicky-primathon c250ecb
Use overflow elipsis for selected dropdown label
vicky-primathon 314eadd
Show dropdown flag and icon when disabled
vicky-primathon e45ad0b
Fix line-height css property
vicky-primathon 8f7877d
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon 0359dd7
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon f08f562
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon 5a4e4cd
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon 85d1d1f
Merge remote-tracking branch 'origin/release' into phone-number-type-…
techbhavin 8ff126a
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon d357079
Merge branch 'phone-number-type-input' of https://github.com/appsmith…
vicky-primathon eef80f5
Fix input widget default value validation
vicky-primathon 7bc57a5
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon fb4351a
Fix default value validation
vicky-primathon 2a0900f
fix input text validation
vicky-primathon 7397cd1
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon d47cb8f
Add inputType to dependecies
vicky-primathon 2066f53
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon 164a65d
Hide icon configurations for currency and phone number type inputs
vicky-primathon 8e1fdfd
Fix phone number type widget validation in form widget
vicky-primathon 5b792c5
valid regex property fix
vicky-primathon 270ef22
Fix input widget isValid
vicky-primathon 159260e
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon 7f087d6
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon 17461ef
Fix invalid input error for currency widget
vicky-primathon 4625bdd
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon cd85a24
Fix height prop missing
vicky-primathon 5f354de
Fix height prop missing
vicky-primathon fb85799
Fix cypress test case
vicky-primathon 2b22a88
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
vicky-primathon 73ef75e
Fix cypress test case
vicky-primathon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,98 @@ | ||
| import React from "react"; | ||
| import styled from "styled-components"; | ||
| import Dropdown, { DropdownOption } from "components/ads/Dropdown"; | ||
| import { CurrencyTypeOptions, CurrencyOptionProps } from "constants/Currency"; | ||
| import Icon, { IconSize } from "components/ads/Icon"; | ||
| import { countryToFlag } from "components/designSystems/blueprint/InputComponent/utilties"; | ||
|
|
||
| const DropdownTriggerIconWrapper = styled.div` | ||
| height: 19px; | ||
| padding: 9px 5px 9px 12px; | ||
| width: 40px; | ||
| height: 19px; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: space-between; | ||
| font-size: 14px; | ||
| line-height: 19px; | ||
| letter-spacing: -0.24px; | ||
| color: #090707; | ||
| `; | ||
|
|
||
| const CurrencyIconWrapper = styled.span` | ||
| height: 100%; | ||
| padding: 6px 4px 6px 12px; | ||
| width: 28px; | ||
| position: absolute; | ||
| left: 0; | ||
| z-index: 16; | ||
| font-size: 14px; | ||
| line-height: 19px; | ||
| letter-spacing: -0.24px; | ||
| color: #090707; | ||
| `; | ||
|
|
||
| export const getCurrencyOptions = (): Array<DropdownOption> => { | ||
| return CurrencyTypeOptions.map((item: CurrencyOptionProps) => { | ||
| return { | ||
| leftElement: countryToFlag(item.code), | ||
| searchText: item.label, | ||
| label: `${item.currency} - ${item.currency_name}`, | ||
| value: item.currency, | ||
| }; | ||
| }); | ||
| }; | ||
|
|
||
| export const getSelectedCurrency = (currencyType?: string): DropdownOption => { | ||
| const selectedCurrency: CurrencyOptionProps | undefined = currencyType | ||
| ? CurrencyTypeOptions.find((item: CurrencyOptionProps) => { | ||
| return item.currency === currencyType; | ||
| }) | ||
| : undefined; | ||
| if (selectedCurrency) { | ||
| return { | ||
| label: `${selectedCurrency.currency} - ${selectedCurrency.currency_name}`, | ||
| searchText: selectedCurrency.label, | ||
| value: selectedCurrency.currency, | ||
| id: selectedCurrency.symbol_native, | ||
| }; | ||
| } | ||
| return CurrencyTypeOptions[0]; | ||
| }; | ||
|
|
||
| interface CurrencyDropdownProps { | ||
| onCurrencyTypeChange: (code?: string) => void; | ||
| options: Array<DropdownOption>; | ||
| selected: DropdownOption; | ||
| allowCurrencyChange?: boolean; | ||
| } | ||
|
|
||
| export default function CurrencyTypeDropdown(props: CurrencyDropdownProps) { | ||
| if (!props.allowCurrencyChange) { | ||
| return ( | ||
| <CurrencyIconWrapper> | ||
| {getSelectedCurrency(props.selected.value).id} | ||
| </CurrencyIconWrapper> | ||
| ); | ||
| } | ||
| const dropdownTriggerIcon = ( | ||
| <DropdownTriggerIconWrapper className="t--input-currency-change"> | ||
| {getSelectedCurrency(props.selected.value).id} | ||
| <Icon name="downArrow" size={IconSize.XXS} /> | ||
| </DropdownTriggerIconWrapper> | ||
| ); | ||
| return ( | ||
| <Dropdown | ||
| containerClassName="currency-type-filter" | ||
| dropdownHeight="195px" | ||
| dropdownTriggerIcon={dropdownTriggerIcon} | ||
| enableSearch | ||
| onSelect={props.onCurrencyTypeChange} | ||
| optionWidth="260px" | ||
| options={props.options} | ||
| searchPlaceholder="Search by currency or country" | ||
| selected={props.selected} | ||
| showLabelOnly | ||
| /> | ||
| ); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.