Skip to content
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

feat: [APPSMTH-29] make step up/down arrows in input Number and Currency widgets optional #18764

Merged
merged 9 commits into from
Dec 21, 2022

Conversation

ghost
Copy link

@ghost ghost commented Dec 7, 2022

Description

This PR makes step up/down arrows optional in

  • CurrencyInput
  • Input

NB: This would require updating the Appsmith Documentation

Fixes #18041

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

  • Cypress Tests

Checklist:

  • My code follows the style guidelines of this project
  • 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
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@ghost ghost self-assigned this Dec 7, 2022
@vercel
Copy link

vercel bot commented Dec 7, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
appsmith ✅ Ready (Inspect) Visit Preview Dec 21, 2022 at 0:40AM (UTC)

@ghost ghost changed the title [APPSMTH-29] [Feature]: make step up/down arrows in input Number and Currency widgets optional feat: [APPSMTH-29] make step up/down arrows in input Number and Currency widgets optional Dec 7, 2022
@github-actions github-actions bot added Enhancement New feature or request Widgets Product This label groups issues related to widgets Community Reported issues reported by community members Currency Input Widget Issues related to currency input widget Date Picker Widget High This issue blocks a user from building or impacts a lot of users Input Widget MultiSelect Widget Issues related to MultiSelect Widget MultiTree Select Widget Issues related to MultiTree Select Widget Needs PRD Issue which are awaiting PRD Phone Input Widget Issues related to the Phone Input widget Rich Text Editor Widget Select Widget Select or dropdown widget Table Widget V2 Issues related to Table Widget V2 TreeSelect Issues related to TreeSelect Widget labels Dec 7, 2022
@ghost ghost requested a review from sbalaji1192 December 7, 2022 18:19
@ghost ghost marked this pull request as ready for review December 7, 2022 18:19
): DSLWidget => {
return traverseDSLAndMigrate(currentDSL, (widget: WidgetProps) => {
if (
widget.showStepArrows === undefined &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's swap the operand positions of and condition

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move this function to the CurrencyInputWidgetMigrations.test.ts file?

@@ -6,3 +6,9 @@ export enum InputTypes {
PASSWORD = "PASSWORD",
CURRENCY = "CURRENCY",
}

export enum ButtonPosition {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please rename this to NumberInputStepButtonPosition. ButtonPosition seems to be misleading.

@@ -430,6 +431,12 @@ class CurrencyInputWidget extends BaseInputWidget<
conditionalProps.errorMessage = createMessage(FIELD_REQUIRED_ERROR);
}

if (Boolean(this.props.showStepArrows)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for boolean call.


if (
this.props.inputType === InputTypes.NUMBER &&
Boolean(this.props.showStepArrows)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for boolean call.

cy.get(widgetsPage.toggleShowStepArrows).click({ force: true });

// Add showStepArrows action and value as false
cy.testJsontext("showsteparrows", false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it should be cy.testJsontext("showsteparrows", {{false}});


it("4. Toggle test case to validate that currency input widget, stepArrows should be visible when toggle value is true", () => {
// Add showStepArrows action and value as true
cy.testJsontext("showsteparrows", true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it should be cy.testJsontext("showsteparrows", {{true}});

cy.get(widgetsPage.toggleShowStepArrows).click({ force: true });

// Add showStepArrows action and value as false
cy.testJsontext("showsteparrows", false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here too


it("4. Toggle test case to validate that dataType - NUMBER, stepArrows should be visible when toggle value is true", () => {
// Add showStepArrows action and add value as true
cy.testJsontext("showsteparrows", true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here too

@ghost
Copy link
Author

ghost commented Dec 15, 2022

Apologies for delay in responding, we wanted to QA the code and avoid regression on our end.

Copy link
Contributor

@sbalaji1192 sbalaji1192 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good! Could you rebase the branch as there are some conflicts

@laveena-en
Copy link
Contributor

laveena-en commented Dec 20, 2022

Tested and verified this PR for step up/down arrows being optional for input widget (number) and currency input widget:

  • Migration
  • JS toggle for the property
  • Helper text
  • functionality in edit and deployed version
    @dilippitchika This would require documentation changes

@sbalaji1192
Copy link
Contributor

/ok-to-test sha=d1477ef

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3738088942.
Workflow: Appsmith External Integration Test Workflow.
Commit: d1477ef.
PR: 18764.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=18764&runId=3738088942_1

@dilippitchika
Copy link
Contributor

Thanks @laveena-en i will take a look at it

@sbalaji1192
Copy link
Contributor

/ok-to-test sha=3b3f709

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3746941550.
Workflow: Appsmith External Integration Test Workflow.
Commit: 3b3f709.
PR: 18764.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=18764&runId=3746941550_1

@github-actions
Copy link

The following are new failures, please fix them before merging the PR cypress/integration/Smoke_TestSuite/ClientSideTests/IDE/MaintainContext&Focus_spec.js

1 similar comment
@github-actions
Copy link

The following are new failures, please fix them before merging the PR cypress/integration/Smoke_TestSuite/ClientSideTests/IDE/MaintainContext&Focus_spec.js

@Aishwarya-U-R
Copy link
Contributor

/ok-to-test sha=2de3c10

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3749291777.
Workflow: Appsmith External Integration Test Workflow.
Commit: 2de3c10.
PR: 18764.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=18764&runId=3749291777_1

@github-actions
Copy link

The following are new failures, please fix them before merging the PR cypress/integration/Smoke_TestSuite/ClientSideTests/Binding/ButtonGroup_binding_spec.js
cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Scrolling_Spec.ts
cypress/integration/Smoke_TestSuite/ClientSideTests/Git/GitImport/ImportEmptyRepo_spec.js
cypress/integration/Smoke_TestSuite/ClientSideTests/Git/GitSync/Deploy_spec.ts
cypress/integration/Smoke_TestSuite/ClientSideTests/Git/GitSync/DisconnectGit_spec.js
cypress/integration/Smoke_TestSuite/ClientSideTests/IDE/MaintainContext&Focus_spec.js

@sbalaji1192 sbalaji1192 merged commit 585a194 into release Dec 21, 2022
@sbalaji1192 sbalaji1192 deleted the APPSMTH-29 branch December 21, 2022 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community Reported issues reported by community members Currency Input Widget Issues related to currency input widget Date Picker Widget Enhancement New feature or request High This issue blocks a user from building or impacts a lot of users Input Widget MultiSelect Widget Issues related to MultiSelect Widget MultiTree Select Widget Issues related to MultiTree Select Widget Needs PRD Issue which are awaiting PRD Phone Input Widget Issues related to the Phone Input widget Rich Text Editor Widget Select Widget Select or dropdown widget Table Widget V2 Issues related to Table Widget V2 TreeSelect Issues related to TreeSelect Widget Widgets Product This label groups issues related to widgets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: make step up/down arrows in input Number and Currency widgets optional
4 participants