Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

[Form]: Add controlled field hook#47641

Merged
vovakulikov merged 3 commits intomainfrom
vk/add-controlled-field-hook
Feb 15, 2023
Merged

[Form]: Add controlled field hook#47641
vovakulikov merged 3 commits intomainfrom
vk/add-controlled-field-hook

Conversation

@vovakulikov
Copy link
Contributor

@vovakulikov vovakulikov commented Feb 14, 2023

Part of https://github.com/sourcegraph/sourcegraph/issues/47237
Preparation for https://github.com/sourcegraph/sourcegraph/pull/47572

This PR adds a new type of file hook - useControlledField. There are a few cases when we want to store the field's value, not in the form but somewhere else (like in another field store, or some external store) useControlledField doesn't bind with useForm it only adds a validation pipeline to the data; that consumer is supposed to provide.

Also, this PR fixes one small visual problem with insight creation UI (I didn't want to open yet another one-line PR for it)

Test plan

  • Check that code insight creation UI works properly

App preview:

Check out the client app preview documentation to learn more.

@vovakulikov vovakulikov self-assigned this Feb 14, 2023
@cla-bot cla-bot bot added the cla-signed label Feb 14, 2023
@vovakulikov vovakulikov changed the title Vk/add controlled field hook [Form]: Add controlled field hook Feb 14, 2023
@sg-e2e-regression-test-bob

Bundle size report 📦

Initial size Total size Async size Modules
0.00% (0.00 kb) 0.00% (+0.19 kb) 0.00% (+0.19 kb) 0.00% (0)

Look at the Statoscope report for a full comparison between the commits 01eea83 and 83746c1 or learn more.

Open explanation
  • Initial size is the size of the initial bundle (the one that is loaded when you open the page)
  • Total size is the size of the initial bundle + all the async loaded chunks
  • Async size is the size of all the async loaded chunks
  • Modules is the number of modules in the initial bundle

Copy link
Member

@valerybugakov valerybugakov left a comment

Choose a reason for hiding this comment

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

Tested creation UI ✅

@vovakulikov vovakulikov merged commit 27673bf into main Feb 15, 2023
@vovakulikov vovakulikov deleted the vk/add-controlled-field-hook branch February 15, 2023 15:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants