-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat(stark-ui): add footer to table component #1601
feat(stark-ui): add footer to table component #1601
Conversation
db6a58f
to
c75ab4c
Compare
packages/stark-ui/src/modules/table/components/column.component.html
Outdated
Show resolved
Hide resolved
packages/stark-ui/src/modules/table/components/table.component.ts
Outdated
Show resolved
Hide resolved
packages/stark-ui/src/modules/table/entities/column-properties.intf.ts
Outdated
Show resolved
Hide resolved
c75ab4c
to
e0a9af9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some remarks... let me know what you think?
packages/stark-ui/src/modules/table/entities/column-properties.intf.ts
Outdated
Show resolved
Hide resolved
packages/stark-ui/src/modules/table/components/table.component.ts
Outdated
Show resolved
Hide resolved
packages/stark-ui/src/modules/table/components/column.component.ts
Outdated
Show resolved
Hide resolved
e0a9af9
to
cdc967f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small remarks
packages/stark-ui/src/modules/table/components/column.component.html
Outdated
Show resolved
Hide resolved
packages/stark-ui/src/modules/table/components/table.component.ts
Outdated
Show resolved
Hide resolved
packages/stark-ui/src/modules/table/components/table.component.ts
Outdated
Show resolved
Hide resolved
cdc967f
to
35c7c7a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comments...
packages/stark-ui/src/modules/table/components/column.component.html
Outdated
Show resolved
Hide resolved
packages/stark-ui/src/modules/table/components/table.component.ts
Outdated
Show resolved
Hide resolved
35c7c7a
to
ffe4e64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! It is working now! Just small remarks and also... don't forget to write unit tests for this new feature 😉
selector: "showcase-table-with-footer", | ||
templateUrl: "./table-with-footer.component.html", | ||
styleUrls: ["./table-with-footer.component.scss"], | ||
/* tslint:disable-next-line:use-view-encapsulation */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this line as it is not relevant for the example code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! It is working now! Just small remarks and also... don't forget to write unit tests for this new feature 😉
Yes sure, I'll create an issue for this purpose : #1613
ffe4e64
to
1debba9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -39,4 +39,9 @@ | |||
*ngTemplateOutlet="columnTemplate; context: { $implicit: { rowData: rowItem, displayedValue: getDisplayedValue(rowItem) } }" | |||
></ng-container> | |||
</td> | |||
<ng-container *ngIf="footerValue !== 'undefined'"> | |||
<td mat-footer-cell *matFooterCellDef> | |||
{{ footerValue }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@christophercr @nicanac What do you think of adding the pipe | translate
here ?
Like this, it's easy for the developer to provide a translation key.
Otherwise, the dev will have to play with translateService.instant("TRANSLATION_KEY")
in the component using the Stark Table...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SuperITMan , @christophercr ,mhhh why not, but if we pass a number, isn't it an issue ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmm... You're right! I thought the pipe was able to get a string but it's not the case.
What we could do to make this working is:
<td mat-footer-cell *matFooterCellDef>
{{ footerValue!.toString() | translate }}
</td>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oki ok it's implemented.
}; | ||
|
||
public columns: StarkTableColumnProperties[] = [ | ||
{ name: "id", label: "Id", footerValue: "Total" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we implement the pipe | translate
, we should provide the translation key instead of Total
😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
1debba9
to
dede4d4
Compare
dede4d4
to
159b245
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
ISSUES CLOSED: #1540
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
Implement a footer for the table component
What is the current behavior?
Issue Number: #1540
What is the new behavior?
Does this PR introduce a breaking change?
Other information