Conversation
d2b541e to
364b395
Compare
541cfd5 to
43037ec
Compare
d7db79e to
86284ed
Compare
27bf1f6 to
400c6fa
Compare
… dxCardViewOptions (fails on topic generator without direct parent component)
| * @public | ||
| * @namespace DevExpress.ui.dxCardView | ||
| */ | ||
| export type CardHeaderToolbarItem = dxToolbarItem & { |
There was a problem hiding this comment.
| export type CardHeaderToolbarItem = dxToolbarItem & { | |
| export type CardHeaderItem = dxToolbarItem & { |
Since it is only used in CardHeader, the Toolbar part is unnecessary
There was a problem hiding this comment.
Fixed
But one thought worried me a bit
If we would like to have some items in the Card in future -> the CardHeaderItem name will be already reserved
| }; | ||
|
|
||
| /** @public */ | ||
| export type CardHeaderPredefinedToolbarItem = 'selectionCheckBox' | 'updateButton' | 'deleteButton'; |
There was a problem hiding this comment.
| export type CardHeaderPredefinedToolbarItem = 'selectionCheckBox' | 'updateButton' | 'deleteButton'; | |
| export type CardHeaderPredefinedItem = 'selectionCheckBox' | 'updateButton' | 'deleteButton'; |
Since it is only used in CardHeader, the Toolbar part is unnecessary
There was a problem hiding this comment.
Fixed
Same thoughts like about the CardHeaderToolbarItem fix
But the chance here is extremely low,I guess
| /** | ||
| * @docid | ||
| */ | ||
| type WithFieldValueInfo = { |
There was a problem hiding this comment.
Question
Just curious, why WithFieldValueInfo, not FieldValueInfo?
There was a problem hiding this comment.
Because this type is used to add sth to existing types, I guess :)
E.g:
export type FieldValuePreparedEvent = EventInfo<dxCardView> & WithFieldValueInfo;An event with field value info
There was a problem hiding this comment.
It sounds like a name of a HOC
| * @public | ||
| * @namespace DevExpress.ui.dxCardView | ||
| */ | ||
| export type FieldInfoType = { // TODO: rename to FieldInfo |
There was a problem hiding this comment.
| export type FieldInfoType = { // TODO: rename to FieldInfo | |
| export type FieldInfo = { |
I see the TODO, just to have a conversation entry for ir
There was a problem hiding this comment.
Fixed
But @pomahtri warned that the FieldInfo causes some error (I don't have more details)
So, if we will face complex issues with this name -> let's rollback my fix to the FieldInfoType with TODO
There was a problem hiding this comment.
Hi, @IlyaKhD, @wdevfx. FieldInfo causes a conflict with FieldInfo from FilterBuilder, which is also used in CardView and imported in generated components directly from 'filter_builder' module. This change will lead to re-generation in CardView and other grids with import { FieldInfo } from 'filter_builder' replaced to import { FieldInfo } from 'card_view' which is totally wrong. So we can revert renaming or use WA with prefixed internal type.
| * @docid | ||
| * @type object | ||
| */ | ||
| value: unknown; |
There was a problem hiding this comment.
Not 100% sure about that, but it seems that we shouldn't use unknown for values that can be passed to consuming code. It's generallly a good practise, but all the other components currently use any.
| value: unknown; | |
| value: any; |
There was a problem hiding this comment.
Agree with u here
Let's not risk and use any for now
Btw, @IlyaKhD, what do u think about unknown in generics?
I guess it should be alright, but at night it started worried me a bit because unknown !== any
There was a problem hiding this comment.
Well, I don't have a general idea for all generics, better investigate some samples. We have reasons to avoid giving unknown outside, and can leverage from marking as unknown for data going inside. Is there a gurantee that generics never given outside - hm... not sure about that, it will be hard to lint, I think. Not sure about possible covariance / contravariance issues, 2-way bindings in Angualr, etc
| * @public | ||
| * @type object | ||
| */ | ||
| dragging?: Pick<dxSortableOptions, 'dropFeedbackMode' | 'scrollSpeed' | 'scrollSensitivity' | 'onDragChange' | 'onDragEnd' | 'onDragMove' | 'onDragStart' | 'onRemove' | 'onReorder'>; |
There was a problem hiding this comment.
Suggestion
Maybe it would be useful to extract a public type for dragging:HeaderPanelDragging
There was a problem hiding this comment.
Agree -> fixed
@IlyaKhD, could u please re-check that I did it right (I may have missed some jsDoc comment or sth)?
But as far as I can see, everything should be alright :)
| * @docid | ||
| * @public | ||
| */ | ||
| filterBuilder?: dxFilterBuilderOptions; |
There was a problem hiding this comment.
You can create a local public alias, so that it get into card_view_types.d.ts and aggregated exports in framework packages:
/**
* @public
*/
type FilterBuilder = dxFilterBuilderOptions;
export {
FilterBuilder
}| filterBuilder?: dxFilterBuilderOptions; | |
| filterBuilder?: FilterBuilder; |
There was a problem hiding this comment.
This change leads to the following error:
System.Exception: "dxCardView.filterBuilder" has unknown type. Try adding @docid tag to the type.
at DevExtreme.NgSmdGenerator.StrongType.Builder.Build(String optionName, String optionFullName, DataType[] types, Boolean hasAcceptableValues, Boolean hasNestedOptions)
at DevExtreme.NgSmdGenerator.Program.BuildStrongType(Builder builder, HierarchicalMember member, String optionFullName)
at DevExtreme.NgSmdGenerator.Program.<>c__DisplayClass2_0.<ToSerializable>b__5(HierarchicalMember m)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector)
at DevExtreme.NgSmdGenerator.Program.ToSerializable(HierarchicalMember member, Builder typesBuilder, String name)
at DevExtreme.NgSmdGenerator.Program.<>c__DisplayClass1_0.<MainCore>b__3(HierarchicalMember m)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](TSource[] source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at DevExtreme.NgSmdGenerator.Program.MainCore(ProgramConfig programConfig)
at DevExtreme.NgSmdGenerator.Program.Main(String[] args)As logs adviced -> I added the docid:
/**
* @docid
* @public
*/
export type FilterBuilder = dxFilterBuilderOptions;But I'm not sure that it's ok (we already have docid on the dxFilterBuilderOptions)
And get the following error on the last Angular regenerate step:
[04:00:49] TypeError: Cannot set properties of undefined (setting 'baseClass')
at ComponentMetadataGenerator.generateComplexOptionByType (/Users/wdevfx/work/devextreme_prod/node_modules/.pnpm/devextreme-internal-tools@18.0.0-beta.1/node_modules/devextreme-internal-tools/ts/angular-components-generator/metadata-generator.js:444:43)
at ComponentMetadataGenerator.generate (/Users/wdevfx/work/devextreme_prod/node_modules/.pnpm/devextreme-internal-tools@18.0.0-beta.1/node_modules/devextreme-internal-tools/ts/angular-components-generator/metadata-generator.js:283:47)
at /Users/wdevfx/work/devextreme_prod/packages/devextreme-angular/gulpfile.js:38:13
at bound (node:domain:433:15)
at runBound (node:domain:444:12)
at asyncRunner (/Users/wdevfx/work/devextreme_prod/node_modules/.pnpm/async-done@1.3.2/node_modules/async-done/index.js:55:18)
at process.processTicksAndRejections (node:internal/process/task_queues:77:11)@IlyaKhD, may we temporarily leave it as is with direct dxFilterBuilderOptions type?
…s) without CardView
This reverts commit 7b74d23.
Co-authored-by: Mikhail Preyskurantov <5574159+mpreyskurantov@users.noreply.github.com> Co-authored-by: wdevfx <ilya.vinogradov@devexpress.com> Co-authored-by: alexlavrov <alex.s.lavrov@gmail.com>
Co-authored-by: Mikhail Preyskurantov <5574159+mpreyskurantov@users.noreply.github.com> Co-authored-by: wdevfx <ilya.vinogradov@devexpress.com> Co-authored-by: alexlavrov <alex.s.lavrov@gmail.com>
No description provided.