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: create select dropdown patterns for form builders and form users tckt-360 #370

Merged
merged 9 commits into from
Nov 1, 2024

Conversation

kalasgarov
Copy link
Contributor

@kalasgarov kalasgarov commented Oct 30, 2024

Created Select Dropdown Pattern for Forms Users.
Created Select Dropdown Pattern Edit for Form Builders.
Added unit tests for Select Dropdown Pattern.

@kalasgarov kalasgarov self-assigned this Oct 30, 2024
Copy link

github-actions bot commented Oct 30, 2024

Terraform plan for tts-10x-atj-dev

Plan: 0 to add, 2 to change, 0 to destroy.
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
!~  update in-place

Terraform will perform the following actions:

  # cloudfoundry_app.tts-10x-atj-dev-server-doj_tts-10x-atj-dev-server-doj-app_380DB029 will be updated in-place
!~  resource "cloudfoundry_app" "tts-10x-atj-dev-server-doj_tts-10x-atj-dev-server-doj-app_380DB029" {
!~      docker_image                    = "ghcr.io/gsa-tts/atj-platform/server-doj:10bd08991e4b02e193b77b3dcdd6309f3b5ae622" -> "ghcr.io/gsa-tts/atj-platform/server-doj:2e2b423218335be6e00f4ed7faf7de2011380d59"
        id                              = "6246c063-6cf4-423d-812a-4bfdeb62bcae"
        name                            = "tts-10x-atj-dev-server-doj-app"
#        (17 unchanged attributes hidden)

#        (3 unchanged blocks hidden)
    }

  # cloudfoundry_app.tts-10x-atj-dev-server-kansas_tts-10x-atj-dev-server-kansas-app_337A9CF1 will be updated in-place
!~  resource "cloudfoundry_app" "tts-10x-atj-dev-server-kansas_tts-10x-atj-dev-server-kansas-app_337A9CF1" {
!~      docker_image                    = "ghcr.io/gsa-tts/atj-platform/server-kansas:10bd08991e4b02e193b77b3dcdd6309f3b5ae622" -> "ghcr.io/gsa-tts/atj-platform/server-kansas:2e2b423218335be6e00f4ed7faf7de2011380d59"
        id                              = "f7c60971-bffd-4a6e-a0bb-af1191079918"
        name                            = "tts-10x-atj-dev-server-kansas-app"
#        (17 unchanged attributes hidden)

#        (3 unchanged blocks hidden)
    }

Plan: 0 to add, 2 to change, 0 to destroy.

📝 Plan generated in Post Terraform plan to PR comment #378

Copy link
Contributor

@danielnaab danielnaab left a comment

Choose a reason for hiding this comment

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

This is a great start, especially as a first dive into the codebase! We need some validation on user input to be added, and I have a couple other questions/comments.

packages/forms/src/patterns/select-dropdown.ts Outdated Show resolved Hide resolved
packages/forms/src/patterns/select-dropdown.ts Outdated Show resolved Hide resolved
packages/forms/src/patterns/select-dropdown.ts Outdated Show resolved Hide resolved
packages/forms/src/patterns/select-dropdown.ts Outdated Show resolved Hide resolved
packages/forms/src/patterns/select-dropdown.ts Outdated Show resolved Hide resolved
@kalasgarov kalasgarov force-pushed the feature/360-select-field branch from 799fb6f to 1eab4be Compare October 30, 2024 21:50
@kalasgarov kalasgarov added WIP Work in progress and removed WIP Work in progress labels Oct 30, 2024
@kalasgarov kalasgarov force-pushed the feature/360-select-field branch from 019204d to d61938a Compare November 1, 2024 18:24
};

const inputValue = 'value1';
if (selectDropdownConfig.parseUserInput) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You could also do this here, to avoid skipping the test, in the event parseUserInput becomes undefined:

if (!selectDropdownConfig.parseUserInput) {
    expect.fail('selectDropdownConfig.parseUserInput is not undefined');
}

Then the test code, below, will be type-safe without the if condition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@danielnaab do you mean something like this?

      if (!selectDropdownConfig.parseUserInput) {
        expect.fail('selectDropdownConfig.parseUserInput is not undefined');
      }
      const result = selectDropdownConfig.parseUserInput(pattern, inputValue);
      console.log('Test parse result:', result);
      if (result.success) {
        expect(result.data).toBe('value1');
      } else {
        throw new Error('Unexpected validation failure');
      }

@kalasgarov kalasgarov force-pushed the feature/360-select-field branch 2 times, most recently from 1d5a8f3 to cbfe7ba Compare November 1, 2024 19:19
@kalasgarov kalasgarov force-pushed the feature/360-select-field branch from cbfe7ba to 3b06384 Compare November 1, 2024 19:33
Copy link
Contributor

@danielnaab danielnaab left a comment

Choose a reason for hiding this comment

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

💯

@kalasgarov kalasgarov merged commit 8a7f982 into main Nov 1, 2024
4 checks passed
@kalasgarov kalasgarov deleted the feature/360-select-field branch November 1, 2024 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants