dididy commented on code in PR #5075:
URL: https://github.com/apache/zeppelin/pull/5075#discussion_r2355241998
##########
zeppelin-web-angular/src/app/pages/workspace/notebook/paragraph/paragraph.component.html:
##########
@@ -40,26 +40,27 @@
[colWidthOption]="colWidthOption"
[pid]="paragraph.id"
[isEntireNoteRunning]="isEntireNoteRunning"
- [(enabled)]="paragraph.config.enabled"
- [(tableHide)]="paragraph.config.tableHide"
- [(colWidth)]="paragraph.config.colWidth"
- [(title)]="paragraph.config.title"
- [(fontSize)]="paragraph.config.fontSize"
- [(lineNumbers)]="paragraph.config.lineNumbers"
- [(editorHide)]="paragraph.config.editorHide"
- [(runOnSelectionChange)]="paragraph.config.runOnSelectionChange"
- (tableHideChange)="commitParagraph()"
+ [enabled]="paragraph.config.enabled"
+ [tableHide]="paragraph.config.tableHide"
+ [colWidth]="paragraph.config.colWidth"
+ [titleShow]="paragraph.config.title"
+ [fontSize]="paragraph.config.fontSize"
+ [showLineNumbers]="paragraph.config.lineNumbers"
+ [editorHide]="paragraph.config.editorHide"
+ [runOnSelectionChange]="paragraph.config.runOnSelectionChange"
Review Comment:
```suggestion
*ngIf="paragraph.config?.title"
[value]="paragraph?.title || ''"
...
[something]="paragraph.config?.something"
...
[config]="configs[i] ?? {}"
...
```
How about revising it like this for the optional case?
##########
zeppelin-web-angular/src/app/share/page-header/page-header.component.ts:
##########
@@ -21,7 +21,7 @@ import { InputBoolean } from 'ng-zorro-antd/core/util';
})
export class PageHeaderComponent implements OnInit {
@Input() title!: string;
- @Input() description!: string | TemplateRef<void>;
+ @Input() description!: TemplateRef<void>;
Review Comment:
https://github.com/apache/zeppelin/pull/5075/files#diff-97564afdcc91a75edcc8c7cc380cee9de3ef14dd50ddb4e874becccb7423a15cR19
Wouldn’t this part in page-header.component.html need to ensure that the
value of the `ngTemplateOutlet` attribute (**extra**) converges to null?
##########
zeppelin-web-angular/src/app/visualizations/table/table-visualization.component.ts:
##########
@@ -96,11 +89,8 @@ export class TableVisualizationComponent implements OnInit {
this.filterRows();
}
- onSortChange(type: 'descend' | 'ascend' | string, key: string): void {
- const opt = this.colOptions.get(key);
- if (!opt) {
- throw new Error('opt is not found');
- }
+ onSortChange(type: 'descend' | 'ascend' | string | null, key: string): void {
Review Comment:
```suggestion
onSortChange(key: string, type?: 'descend' | 'ascend'): void {
```
Was the `null` added because of added tsconfig option? With the above
modification, and by adjusting the parameter order in `nzSortChange` within
**table-visualization.component.html** as
[this](https://github.com/apache/zeppelin/pull/5075/files#diff-da0b297d95609bb39dfce32ab16e7d6a9cb24adf5eb8897891bb5ab231f73309R77),
it seems cleaner — though it needs to be confirmed whether this actually
passes the type check.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]