Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: improve data view variable naming #317

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,16 @@
></ng-template>
<ng-template #dateCell let-rowObject="rowObject" let-column="column">
<ng-container
*ngIf="_tableDateCell"
[ngTemplateOutlet]="_tableDateCell"
*ngIf="_dateTableCell"
[ngTemplateOutlet]="_dateTableCell"
[ngTemplateOutletContext]="{rowObject:rowObject, column:column}"
>
</ng-container
></ng-template>
<ng-template #relativeDateCell let-rowObject="rowObject" let-column="column">
<ng-container
*ngIf="_tableRelativeDateCell"
[ngTemplateOutlet]="_tableRelativeDateCell"
*ngIf="_relativeDateTableCell"
[ngTemplateOutlet]="_relativeDateTableCell"
[ngTemplateOutletContext]="{rowObject:rowObject, column:column}"
>
</ng-container
Expand All @@ -158,8 +158,8 @@
></ng-template>
<ng-template #translationKeyCell let-rowObject="rowObject" let-column="column">
<ng-container
*ngIf="_tableTranslationKeyCell"
[ngTemplateOutlet]="_tableTranslationKeyCell"
*ngIf="_translationKeyTableCell"
[ngTemplateOutlet]="_translationKeyTableCell"
[ngTemplateOutletContext]="{rowObject:rowObject, column:column}"
>
</ng-container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,24 @@ export class DataViewComponent implements DoCheck, OnInit {
return this.customTableCellTemplate || this.customTableCellChildTemplate
}

@Input() tableDateCellTemplate: TemplateRef<any> | undefined
@Input() dateTableCellTemplate: TemplateRef<any> | undefined
/**
* @deprecated Will be replaced by dateTableCellTemplate
*/
@Input()
get tableDateCellTemplate(): TemplateRef<any> | undefined {
return this.dateTableCellTemplate
}
set tableDateCellTemplate(value: TemplateRef<any> | undefined) {
this.dateTableCellTemplate = value
}
/**
* @deprecated Will be replaced by dateTableCellChildTemplate
*/
@ContentChild('tableDateCell') tableDateCellChildTemplate: TemplateRef<any> | undefined
get _tableDateCell(): TemplateRef<any> | undefined {
return this.tableDateCellTemplate || this.tableDateCellChildTemplate
@ContentChild('dateTableCell') dateTableCellChildTemplate: TemplateRef<any> | undefined
get _dateTableCell(): TemplateRef<any> | undefined {
return this.dateTableCellTemplate || this.dateTableCellChildTemplate || this.tableDateCellChildTemplate
}

@Input() tableCellTemplate: TemplateRef<any> | undefined
Expand All @@ -116,10 +130,24 @@ export class DataViewComponent implements DoCheck, OnInit {
return this.tableCellTemplate || this.tableCellChildTemplate
}

@Input() tableTranslationKeyCellTemplate: TemplateRef<any> | undefined
@Input() translationKeyTableCellTemplate: TemplateRef<any> | undefined
/**
* @deprecated Will be replaced by translationKeyTableCellTemplate
*/
@Input()
get tableTranslationKeyCellTemplate(): TemplateRef<any> | undefined {
return this.translationKeyTableCellTemplate
}
set tableTranslationKeyCellTemplate(value: TemplateRef<any> | undefined) {
this.translationKeyTableCellTemplate = value
}
/**
* @deprecated Will be replaced by translationKeyTableCellChildTemplate
*/
@ContentChild('tableTranslationKeyCell') tableTranslationKeyCellChildTemplate: TemplateRef<any> | undefined
get _tableTranslationKeyCell(): TemplateRef<any> | undefined {
return this.tableTranslationKeyCellTemplate || this.tableTranslationKeyCellChildTemplate
@ContentChild('translationKeyTableCell') translationKeyTableCellChildTemplate: TemplateRef<any> | undefined
get _translationKeyTableCell(): TemplateRef<any> | undefined {
return this.translationKeyTableCellTemplate || this.translationKeyTableCellChildTemplate || this.tableTranslationKeyCellChildTemplate
}

@Input() gridItemSubtitleLinesTemplate: TemplateRef<any> | undefined
Expand All @@ -145,10 +173,24 @@ export class DataViewComponent implements DoCheck, OnInit {
return this.listItemTemplate || this.listItemChildTemplate
}

@Input() tableRelativeDateCellTemplate: TemplateRef<any> | undefined
@Input() relativeDateTableCellTemplate: TemplateRef<any> | undefined
/**
* @deprecated Will be replaced by relativeDateTableCellTemplate
*/
@Input()
get tableRelativeDateCellTemplate(): TemplateRef<any> | undefined {
return this.relativeDateTableCellTemplate
}
set tableRelativeDateCellTemplate(value: TemplateRef<any> | undefined) {
this.relativeDateTableCellTemplate = value
}
/**
* @deprecated Will be replace by relativeDateTableCellChildTemplate
*/
@ContentChild('tableRelativeDateCell') tableRelativeDateCellChildTemplate: TemplateRef<any> | undefined
@ContentChild('relativeDateTableCell') relativeDateTableCellChildTemplate: TemplateRef<any> | undefined
get _tableRelativeDateCell(): TemplateRef<any> | undefined {
return this.tableRelativeDateCellTemplate || this.tableRelativeDateCellChildTemplate
return this.relativeDateTableCellTemplate || this.relativeDateTableCellChildTemplate || this.tableRelativeDateCellChildTemplate
}

@Input() additionalActions: DataAction[] = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@
[stringTableCellTemplate]="_stringTableCell ? stringTableCell : undefined"
[numberTableCellTemplate]="_numberTableCell ? numberTableCell : undefined"
[customTableCellTemplate]="_customTableCell ? customTableCell : undefined"
[tableDateCellTemplate]="_tableDateCell ? tableDateCell : undefined"
[tableRelativeDateCellTemplate]="_tableRelativeDateCell ? tableRelativeDateCell : undefined"
[dateTableCellTemplate]="_dateTableCell ? dateTableCell : _tableDateCell ? tableDateCell : undefined"
[relativeDateTableCellTemplate]="_relativeDateTableCell ? relativeDateTableCell : _tableRelativeDateCell ? tableRelativeDateCell : undefined"
[tableCellTemplate]="_tableCell ? tableCell : undefined"
[tableTranslationKeyCellTemplate]="_tableTranslationKeyCell ? tableTranslationKeyCell : undefined"
[translationKeyTableCellTemplate]="_translationKeyTableCell ? translationKeyTableCell : _tableTranslationKeyCell ? tableTranslationKeyCell : undefined"
[gridItemSubtitleLinesTemplate]="_gridItemSubtitleLines ? gridItemSubtitleLines : undefined"
[listItemSubtitleLinesTemplate]="_listItemSubtitleLines ? listItemSubtitleLines : undefined"
[listItemTemplate]="_listItem? listItem : undefined"
Expand Down Expand Up @@ -111,6 +111,14 @@
>
</ng-container
></ng-template>
<ng-template #dateTableCell let-rowObject="rowObject" let-column="column">
<ng-container
*ngIf="_dateTableCell"
[ngTemplateOutlet]="_dateTableCell"
[ngTemplateOutletContext]="{rowObject:rowObject, column:column}"
>
</ng-container
></ng-template>
<ng-template #tableRelativeDateCell let-rowObject="rowObject" let-column="column">
<ng-container
*ngIf="_tableRelativeDateCell"
Expand All @@ -119,6 +127,14 @@
>
</ng-container
></ng-template>
<ng-template #relativeDateTableCell let-rowObject="rowObject" let-column="column">
<ng-container
*ngIf="_relativeDateTableCell"
[ngTemplateOutlet]="_relativeDateTableCell"
[ngTemplateOutletContext]="{rowObject:rowObject, column:column}"
>
</ng-container
></ng-template>
<ng-template #tableCell let-rowObject="rowObject" let-column="column">
<ng-container
*ngIf="_tableCell"
Expand All @@ -135,6 +151,14 @@
>
</ng-container
></ng-template>
<ng-template #translationKeyTableCell let-rowObject="rowObject" let-column="column">
<ng-container
*ngIf="_translationKeyTableCell"
[ngTemplateOutlet]="_translationKeyTableCell"
[ngTemplateOutletContext]="{rowObject:rowObject, column:column}"
>
</ng-container
></ng-template>
<ng-template #gridItemSubtitleLines let-item>
<ng-container
*ngIf="_gridItemSubtitleLines"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,24 @@ export class InteractiveDataViewComponent implements OnInit {
@Input() frozenActionColumn = false
@Input() actionColumnPosition: 'left' | 'right' = 'right'
@ContentChild('tableCell') tableCell: TemplateRef<any> | undefined
/**
* @deprecated Will be replaced by dateTableCell
*/
@ContentChild('tableDateCell') tableDateCell: TemplateRef<any> | undefined
@ContentChild('dateTableCell') dateTableCell: TemplateRef<any> | undefined

/**
* @deprecated Will be replaced by relativeDateTableCell
*/
@ContentChild('tableRelativeDateCell') tableRelativeDateCell: TemplateRef<any> | undefined
@ContentChild('relativeDateTableCell') relativeDateTableCell: TemplateRef<any> | undefined

/**
* @deprecated Will be replaced by translationKeyTableCell
*/
@ContentChild('tableTranslationKeyCell') tableTranslationKeyCell: TemplateRef<any> | undefined
@ContentChild('translationKeyTableCell') translationKeyTableCell: TemplateRef<any> | undefined

@ContentChild('gridItemSubtitleLines') gridItemSubtitleLines: TemplateRef<any> | undefined
@ContentChild('listItemSubtitleLines') listItemSubtitleLines: TemplateRef<any> | undefined
@ContentChild('stringTableCell') stringTableCell: TemplateRef<any> | undefined
Expand Down Expand Up @@ -126,13 +141,22 @@ export class InteractiveDataViewComponent implements OnInit {
return this.customTableCell
}
get _tableDateCell(): TemplateRef<any> | undefined {
return this.tableDateCell
return this.dateTableCell ?? this.tableDateCell
}
get _dateTableCell(): TemplateRef<any> | undefined {
return this.dateTableCell
}
get _tableRelativeDateCell(): TemplateRef<any> | undefined {
return this.tableRelativeDateCell
return this.relativeDateTableCell ?? this.tableRelativeDateCell
}
get _relativeDateTableCell(): TemplateRef<any> | undefined {
return this.relativeDateTableCell
}
get _tableTranslationKeyCell(): TemplateRef<any> | undefined {
return this.tableTranslationKeyCell
return this.translationKeyTableCell ?? this.tableTranslationKeyCell
}
get _translationKeyTableCell(): TemplateRef<any> | undefined {
return this.translationKeyTableCell
}
get _gridItem(): TemplateRef<any> | undefined {
return this.gridItem
Expand Down
Loading