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

Feature: Combine WfsSearch and WfsSearchInput to WfsSearchField using useWfs hook #3771

Merged
merged 5 commits into from
Mar 11, 2024

Conversation

ahennr
Copy link
Member

@ahennr ahennr commented Mar 1, 2024

This PR refactors the WfsSearch and WfsSearchInput components to a WfsSearchField component that

  • uses the useWfs hoom introduced in Feature: introduce useWfs hook react-util#612
  • rendered component (either AutoComplete or Input of antd) an be changes by setting asInput prop (default: false => AutoComplete will be rendered.)
  • onChange and value are overwritten such that they can now be used more easily in antd forms

BREAKING CHANGES:

  • use new useWfs hook
  • combine WfsSearch and WfsSearchInput (both removed)) to WfsSearchField

Description

Related issues or pull requests

Pull request type

  • Bugfix
  • Feature
  • Dependency updates
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe)

Do you introduce a breaking change?

  • Yes
  • No

Checklist

  • I understand and agree that the changes in this PR will be licensed under the
    BSD-2-Clause.
  • I have followed the guidelines for contributing.
  • The proposed change fits to the content of the Code of Conduct.
  • I have added or updated tests and documentation, and the test suite passes (run npm test locally).
  • I have added a screenshot/screencast to illustrate the visual output of my update.

BREAKING CHANGE: make use of new useWfs hook in react-util

Co-authored-by: Amanda Sefu-Beierl <[email protected]>
BREAKGING CHANGE: WfsSearch and WfsSearchInput are replaced by
WfsSearchField
@ahennr ahennr changed the title feat: use wfs hook Feature: Combine WfsSearch and WfsSearchInput to WfsSearchField using useWfs hook Mar 5, 2024
@ahennr ahennr marked this pull request as ready for review March 5, 2024 14:51
Comment on lines 50 to 51
* @class WfsSearchField
* @extends React.Component
Copy link
Member

Choose a reason for hiding this comment

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

(very minor) I think these annotations are meant for class components. I would just remove them since we use typescript anyway

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @class WfsSearchField
* @extends React.Component

Comment on lines +220 to +229
loading ?
<FontAwesomeIcon
spin={true}
icon={faCircleNotch}
onClick={resetSearch}
/> :
<FontAwesomeIcon
icon={faClose}
onClick={resetSearch}
/>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
loading ?
<FontAwesomeIcon
spin={true}
icon={faCircleNotch}
onClick={resetSearch}
/> :
<FontAwesomeIcon
icon={faClose}
onClick={resetSearch}
/>
<FontAwesomeIcon
spin={loading}
icon={loading ? faCircleNotch : faClose}
onClick={resetSearch}
/>

@ahennr ahennr merged commit bdaef7f into terrestris:rg-future Mar 11, 2024
2 checks passed
@ahennr ahennr deleted the wfs-hook branch March 11, 2024 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants