Add a new helpText field option to supply text for help popovers
that display next to the field label.
Example usage:
<eg-string #hostHelpStr text="EDI FTP or SCP server, including protocol. For example, ftp://ftp.example.org." i18n-text></eg-string>
<eg-fm-record-editor #editDialog
idlClass="acqedi"
[fieldOptions]="{
host: {helpText: hostHelpStr},
}"
</eg-fm-record-editor>
Sponsored-by: Evergreen Community Development Initiative
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Ruth Frasur <rfrasur@library.in.gov>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jason Etheridge <jason@EquinoxInitiative.org>
<div class="form-group row" *ngFor="let field of fields">
<div class="col-lg-3">
<label for="{{idPrefix}}-{{field.name}}">{{field.label}}</label>
+ <eg-help-popover [placement]="'right'" *ngIf="field.helpText" helpText="{{field.helpTextValue}}"></eg-help-popover>
</div>
<div class="col-lg-9">
// Render the field using this custom template instead of chosing
// from the default set of form inputs.
customTemplate?: CustomFieldTemplate;
+
+ // help text to display via a popover
+ helpText?: StringComponent;
}
@Component({
field.context = fieldOptions.customTemplate.context;
}
+ if (fieldOptions.helpText) {
+ field.helpText = fieldOptions.helpText;
+ field.helpText.current().then(help => field.helpTextValue = help);
+ }
+
return promise || Promise.resolve();
}
import {NgModule} from '@angular/core';
import {EgCommonModule} from '@eg/common.module';
+import {StaffCommonModule} from '@eg/staff/common.module';
import {CommonWidgetsModule} from '@eg/share/common-widgets.module';
import {StringModule} from '@eg/share/string/string.module';
import {TranslateModule} from '@eg/share/translate/translate.module';
],
imports: [
EgCommonModule,
+ StaffCommonModule,
StringModule,
TranslateModule,
CommonWidgetsModule