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

fix(ui): properly position help icon for tooltips next to form fields #1511

Merged
merged 3 commits into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 2 additions & 1 deletion src/app/core/config/config-fix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,8 @@ export const defaultJsonConfig = {
"name": "motherTongue",
"schema": {
dataType: "string",
label: $localize`:Label for the mother tongue of a child:Mother Tongue`
label: $localize`:Label for the mother tongue of a child:Mother Tongue`,
description: $localize`:Tooltip description for the mother tongue of a child:The primary language spoken at home`,
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,25 @@
<form class="columns-wrapper">
<div *ngFor="let col of _columns; let i=index" class="column-group">
<h2 *ngIf="columnHeaders && columnHeaders[i]">{{columnHeaders[i]}}</h2>
<div
*ngFor="let row of col"
[appDynamicComponent]="{
component: row.edit,
config: {
formFieldConfig: row,
propertySchema: entity.getSchema().get(row.id),
formControl: form.get(row.id)
}
}"
>
<div *ngFor="let row of col">
<div [class.field-with-tooltip-suffix]="row.tooltip">
<ng-container [appDynamicComponent]="{
component: row.edit,
config: {
formFieldConfig: row,
propertySchema: entity.getSchema().get(row.id),
formControl: form.get(row.id)
}
}"></ng-container>
</div>
<fa-icon
(click)="tooltipElement.show()"
#tooltipElement="matTooltip"
*ngIf="row.tooltip"
matSuffix
icon="question-circle"
[matTooltip]="row.tooltip"
class="tooltip-suffix"
></fa-icon>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,12 @@ $max-screen-width: $min-block-width + $margin-main-view-right + $margin-main-vie
margin-bottom: 20px !important;
font-family: sans-serif;
}

.field-with-tooltip-suffix {
width: calc(100% - 24px);
display: inline-block;
}

.tooltip-suffix {
margin: 4px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const cols = [
{
id: "projectNumber",
edit: "EditNumber",
tooltip: "some extra explanation",
},
{
edit: "EditLongText",
Expand Down