-
Notifications
You must be signed in to change notification settings - Fork 59
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
Added the support for the Item Control grid extension. #117
base: master
Are you sure you want to change the base?
Conversation
package.json
Outdated
@@ -104,6 +104,7 @@ | |||
"ts-node": "~10.9.1", | |||
"tslint": "~6.1.3", | |||
"typescript": "~4.8.4", | |||
"webpack-cli": "^4.10.0" | |||
"webpack-cli": "^4.10.0", | |||
"lodash": "^4.17.21" |
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.
We don't want to add another 70KB unless it's absolutely necessary. forEach and includes could be done without lodash.
src/app/app.module.ts
Outdated
@@ -54,6 +54,7 @@ import { SafeHtmlPipe } from './safe-html.pipe'; | |||
import { LhcButtonPopoverComponent } from './lhc-button-popover/lhc-button-popover.component'; | |||
import { LhcItemAttachmentComponent } from './lhc-item-attachment/lhc-item-attachment.component'; | |||
import { LhcItemMessagesComponent } from './lhc-item-messages/lhc-item-messages.component'; | |||
import { LhcItemGirdComponent } from './lhc-item-gird/lhc-item-gird.component'; |
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.
Please rename it to lhc-group-grid as it is similar to lhc-group-matrix.
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.
and LhcGroupGridComponent
@@ -0,0 +1,51 @@ | |||
<div *ngIf="item" class="lhc-layout-grid lf-table-item {{lhcDataService.getSiblingStatus(item)}}"> | |||
<div class="lf-form-grid-table-title" *ngIf="!formLevel"> |
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.
The CSS class names starting with 'lf-' are legacy names used in the previous versions of lforms, and will be cleaned up eventually. Please use 'lhc-' when adding new CSS class names.
<table class="lf-form-grid-table lf-form-table"> | ||
<colgroup> | ||
<col class="lf-question"> | ||
<col *ngFor="let answer of item.items[0].answers"> |
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.
The number of columns should be from item.items, right? The "other-answer" is not needed. Your implementation looks similar to the "matrix" ("table in fhir itemControl). If that's what you need, "matrix" has been implemented in lforms.
There was discussion on chat.fhir.org (https://chat.fhir.org/#narrow/stream/179255-questionnaire/topic/Grid.20Question) that the items under each group are not necessary same. The grid could be sparse.
Please add a small test Questionnaire and some tests. (But first see Ye's comment about about whether "grid" is what you need or not. Grid columns should not be from item answer lists. See https://build.fhir.org/valueset-questionnaire-item-control.html .) |
Added the support for the Item Control grid extension.