-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
20656: MAJOR FeatureAttributes refactor to support InferFeatureAttrib…
…uteParams (#5) Highlights: - Removed SetFeatureAtom. Conflicted with synchronous SetParamsAtom - Introduced merged InferFeatureAttributesParams atom replacing both and extracted shared functionality to utilities - Renamed some component and functions based on "Infer". Should we renamed all? - Introduced FieldLabel tooltips for FieldRadio to simplify user discovery - Various style and bug fixes - FeatureAttributeSubtypeField changed to FieldSelect due to VSCode layout issues - Renamed the 'areDirty' atom related to inference requirement to "RunRequired" to avoid overlapping meaning with form's dirty handling. Known issues: - FieldLabel sizing does not match for FieldTextArea, because Flowbite does not support it. ☠️ - [Light mode tooltips use dark mode theme #1438](themesberg/flowbite-react#1438)
- Loading branch information
1 parent
23266bf
commit e9389e8
Showing
71 changed files
with
1,581 additions
and
792 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,82 @@ | ||
# Migration guide | ||
|
||
## 1.x Initial version | ||
## 1.x Feature Attributes updated to include Infer params | ||
|
||
This breaking change modifies the data structures for FeatureAttributes. | ||
All storage is now part of `InferFeatureAttributesParams` with attributes in `.features`. | ||
Integration with `.strict_bounds` is complete. | ||
|
||
Updates are based on the following signatures: | ||
|
||
### FeaturesAttributesRows | ||
|
||
```tsx | ||
const params: InferFeatureAttributesParams = { | ||
features: featuresAttributes, | ||
}; | ||
const features = Object.keys(featuresAttributes); | ||
|
||
const featuresDirtyAtom = getFeatureAttributesAreDirtyAtom(); | ||
const inferFeatureAttributesParamsAtom = | ||
getInferFeatureAttributesParamsAtom(params); | ||
const setFeatureAttributesAtom = | ||
getInferFeatureAttributesParamsSetFeatureAttributesAtom({ | ||
inferFeatureAttributesParamsAtom, | ||
featuresDirtyAtom, | ||
}); | ||
const setParamsAtom = getInferFeatureAttributesParamsSetParamAtom({ | ||
inferFeatureAttributesParamsAtom, | ||
}); | ||
|
||
const timeFeatureAtom = getInferFeatureAttributesParamsTimeFeatureAtom({ | ||
inferFeatureAttributesParamsAtom, | ||
featuresDirtyAtom, | ||
}); | ||
|
||
render( | ||
<FeaturesAttributesRows | ||
activeFeatureAtom={getFeatureAttributesActiveFeatureAtom()} | ||
inferFeatureAttributesParamsAtom={inferFeatureAttributesParamsAtom} | ||
optionsAtom={getFeatureAttributesOptionsAtom({})} | ||
setFeatureAttributesAtom={setFeatureAttributesAtom} | ||
setParamsAtom={setParamsAtom} | ||
timeFeatureAtom={timeFeatureAtom} | ||
/> | ||
); | ||
``` | ||
|
||
### FeaturesAttributesCompact | ||
|
||
```tsx | ||
const featuresDirtyAtom = getFeatureAttributesAreDirtyAtom(); | ||
const params: InferFeatureAttributesParams = { | ||
features: featuresAttributes, | ||
}; | ||
const inferFeatureAttributesParamsAtom = | ||
getInferFeatureAttributesParamsAtom(params); | ||
const setFeatureAttributesAtom = | ||
getInferFeatureAttributesParamsSetFeatureAttributesAtom({ | ||
inferFeatureAttributesParamsAtom, | ||
featuresDirtyAtom, | ||
}); | ||
const setParamsAtom = getInferFeatureAttributesParamsSetParamAtom({ | ||
inferFeatureAttributesParamsAtom, | ||
}); | ||
const timeFeatureAtom = getInferFeatureAttributesParamsTimeFeatureAtom({ | ||
inferFeatureAttributesParamsAtom, | ||
featuresDirtyAtom, | ||
}); | ||
|
||
render( | ||
<FeaturesAttributesCompact | ||
activeFeatureAtom={getFeatureAttributesActiveFeatureAtom()} | ||
inferFeatureAttributesParamsAtom={inferFeatureAttributesParamsAtom} | ||
optionsAtom={getFeatureAttributesOptionsAtom({})} | ||
setFeatureAttributesAtom={setFeatureAttributesAtom} | ||
setParamsAtom={setParamsAtom} | ||
timeFeatureAtom={timeFeatureAtom} | ||
/> | ||
); | ||
``` | ||
|
||
## 0.x Initial version |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.