Closed rossbulat closed 3 weeks ago
The changes involve updating the metadata version used across various components in the application from MetadataV14
to MetadataV15
. This includes modifications to the MetadataController
, type definitions, and the Api
class to reflect the new version. Additionally, the Textbox
component has been enhanced with an initial
prop and an onBlur
event handler that utilizes a default input value. The ArgBuilder
class has seen improvements in the argument processing logic, while the useInput
hook has had its handling of the Textbox
value prop adjusted to eliminate fallback to a default value.
File Path | Change Summary |
---|---|
packages/app/src/controllers/Metadata/index.ts |
Updated import and instantiation of MetadataV15 in MetadataController . |
packages/app/src/controllers/Metadata/types.ts |
Changed import and export type from MetadataV14 to MetadataV15 . |
packages/app/src/library/Inputs/Textbox/index.tsx |
Added defaultInputValue import and implemented an onBlur event handler in the Textbox component. |
packages/app/src/model/Api/index.ts |
Modified fetchChainSpec method to access metadata using asV15 instead of asV14 . |
packages/app/src/model/Metadata/MetadataV15.ts |
Renamed class from MetadataV14 to MetadataV15 , retaining properties and methods. |
packages/app/src/model/Scraper/ArgBuilder.ts |
Adjusted logic in build method for argument processing and refined comments for clarity. |
packages/app/src/routes/Chain/Inputs/useInput.tsx |
Changed Textbox value handling to directly use inputValue without a fallback to defaultInputValue . |
packages/app/src/library/Inputs/Textbox/types.ts |
Added initial: string property to TextboxProps type. |
packages/app/src/modals/Transfer/index.tsx |
Updated Textbox usage to include initial prop for amount input handling. |
packages/app/src/routes/ParachainSetup/SetupForm/ReserveParaId/index.tsx |
Introduced initial prop in Textbox for existing Para ID input. |
sequenceDiagram
participant User
participant Textbox
participant MetadataController
participant Api
User->>Textbox: Input value
Textbox->>Textbox: onBlur event
Textbox->>Textbox: Check if empty
Textbox-->>User: Call onChange with defaultInputValue if empty
User->>MetadataController: Request metadata
MetadataController->>Api: fetchChainSpec
Api->>Api: Use metadataPJs.asV15.toJSON()
Api-->>MetadataController: Return metadata
MetadataController-->>User: Provide metadata
🐇 "In the meadow, changes bloom,
Metadata's new life finds room.
Textboxes now with defaults bright,
Arguments formatted just right.
With each hop, we celebrate,
Upgraded paths we navigate!" 🐇
ArgBuilder
class, which formats input keys and values, and may relate to how metadata is processed in the main PR, particularly in the context of handling input arguments and types.Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Fixes some input bugs and updates metadata version from 14 to 15. The metadata update currently has no effect on UI and functions.
Summary by CodeRabbit
Release Notes
New Features
initial
prop in theTextbox
component for better handling of initial values.ReserveParaId
component to pre-fill the textbox with existing Para IDs, improving user experience.Bug Fixes
MetadataV15
.Chores
ArgBuilder
class for improved clarity and functionality.