fix: Map widget zoom control suffix (#25031)

## Description

PR fixes the zoom level control suffix getting appended twice in the map
widget property pane. Also this PR has fixed the text getting selected
behaviour while clicking on add and subtract icon inside the number
input.

#### PR fixes following issue(s)
Fixes #24819

#### Media


https://github.com/appsmithorg/appsmith/assets/87797149/ec6f4a0b-b428-492b-b6c5-6dff97f4247a



#### Type of change

- Bug fix (non-breaking change which fixes an issue)


## Testing

#### How Has This Been Tested?
> Please describe the tests that you ran to verify your changes. Also
list any relevant details for your test configuration.
> Delete anything that is not relevant
- [ ] Manual
- [ ] Jest
- [ ] Cypress
>
>
#### Test Plan
> Add Testsmith test cases links that relate to this PR
>
>
#### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)
>
>
>
## Checklist:
#### Dev activity
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


#### QA activity:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
This commit is contained in:
albinAppsmith 2023-07-07 18:28:47 +05:30 committed by GitHub
parent 73305d940c
commit 7efe8cf09e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 17 deletions

View File

@ -93,7 +93,7 @@
"cypress-log-to-output": "^1.1.2",
"dayjs": "^1.10.6",
"deep-diff": "^1.0.2",
"design-system": "npm:@appsmithorg/design-system@2.1.14",
"design-system": "npm:@appsmithorg/design-system@2.1.15",
"design-system-old": "npm:@appsmithorg/design-system-old@1.1.10",
"downloadjs": "^1.4.7",
"fast-deep-equal": "^3.1.3",

View File

@ -56,7 +56,7 @@ class NumericInputControl extends BaseControl<NumericInputControlProps> {
this.inputElement = element;
}}
scale={stepSize}
value={parseInt(propertyValue)}
value={propertyValue}
/>
);
}
@ -65,11 +65,11 @@ class NumericInputControl extends BaseControl<NumericInputControlProps> {
return !isNaN(Number(value));
}
private handleValueChange = (value: number) => {
private handleValueChange = (value: string | undefined) => {
// Update the propertyValue
this.updateProperty(
this.props.propertyName,
value.toString(),
value?.toString(),
document.activeElement === this.inputElement,
);
};

View File

@ -13,7 +13,7 @@ const MIN = 0;
const MAX = 100;
class StepControl extends BaseControl<StepControlProps> {
componentRef = React.createRef<HTMLDivElement>();
componentRef = React.createRef<HTMLInputElement>();
componentDidMount() {
this.componentRef.current?.addEventListener(
@ -64,15 +64,13 @@ class StepControl extends BaseControl<StepControlProps> {
<NumberInput
max={max}
min={min}
onChange={(value: number, isUpdatedViaKeyboard: boolean) => {
this.updateProperty(
this.props.propertyName,
value,
isUpdatedViaKeyboard,
);
// TODO: UI builders -> confirm isUpdatedViaKeyboard is needed going forward
onChange={(value: string | undefined, isUpdatedViaKeyboard = false) => {
const v = value ? parseFloat(value.replace(/[^0-9.-]+/g, "")) : 0;
this.updateProperty(this.props.propertyName, v, isUpdatedViaKeyboard);
}}
ref={this.componentRef}
steps={steps}
scale={steps}
suffix={suffix}
value={this.props.propertyValue}
/>

View File

@ -7,6 +7,9 @@ const Label = styled.label`
color: var(--ads-v2-color-fg);
font-size: var(--ads-v2-font-size-4);
font-weight: var(--ads-v2-font-weight-normal);
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
`;
type Props = {

View File

@ -9669,7 +9669,7 @@ __metadata:
cypress-xpath: ^1.6.0
dayjs: ^1.10.6
deep-diff: ^1.0.2
design-system: "npm:@appsmithorg/design-system@2.1.14"
design-system: "npm:@appsmithorg/design-system@2.1.15"
design-system-old: "npm:@appsmithorg/design-system-old@1.1.10"
diff: ^5.0.0
dotenv: ^8.1.0
@ -13711,9 +13711,9 @@ __metadata:
languageName: node
linkType: hard
"design-system@npm:@appsmithorg/design-system@2.1.14":
version: 2.1.14
resolution: "@appsmithorg/design-system@npm:2.1.14"
"design-system@npm:@appsmithorg/design-system@2.1.15":
version: 2.1.15
resolution: "@appsmithorg/design-system@npm:2.1.15"
dependencies:
"@radix-ui/react-dialog": ^1.0.2
"@radix-ui/react-dropdown-menu": ^2.0.4
@ -13738,7 +13738,7 @@ __metadata:
react-dom: ^17.0.2
react-router-dom: ^5.0.0
styled-components: ^5.3.6
checksum: 7c762404027072d869ccfab00412addb65edcf3b96f091509849bf6a109fa4246b7551d0a9dab6625b3ad171b97735f55036a3391a0338071dcf3190f86e843b
checksum: 35641238fdf0bd7072beacc06b53aeefc6fbad499d5a8ad90955821387eed7c55c1396c01930177d4ef4c787f5b29768e5f410345eb06f3fde2e0c85217a1c73
languageName: node
linkType: hard