Attribute groups were positioned with CSS `column-count` values, which is normally used for getting columns in longform text. However, this caused errors in the past[1] and a new layouting error in Firefox now. This commit changes the layouting to use CSS Flexbox, which allows us to get rid of a lot of legacy stuff. Adresses https://community.openproject.org/projects/openproject/work_packages/44846/activity [1] https://community.openproject.org/projects/openproject/work_packages/31614/activityfix/44846-custom-field-multi-select
parent
aa973e5e13
commit
f703e4324e
@ -0,0 +1,25 @@ |
||||
@import "src/assets/sass/helpers" |
||||
|
||||
.wp-attribute-group |
||||
display: flex |
||||
flex-direction: row |
||||
flex-wrap: wrap |
||||
|
||||
// We want a margin between items, but don't know if any one item is on the right, |
||||
// the left, or spanning both columns. The easy way to get a gutter is to give |
||||
// *all* elements margins on both sides, and then negating this margin on the parent. |
||||
// This also explains all of the + and - xrem calc() values below. |
||||
margin: 0 -1 * $spot-spacing-1_5 |
||||
width: calc(100% + #{$spot-spacing-3}) |
||||
|
||||
&--attribute |
||||
flex-basis: calc(100% - #{$spot-spacing-3}) |
||||
flex-grow: 0 |
||||
flex-shrink: 0 |
||||
margin: 0 $spot-spacing-1_5 |
||||
|
||||
@media screen and (min-width: 92rem), print |
||||
flex-basis: calc(50% - #{$spot-spacing-3}) |
||||
|
||||
&_span-all |
||||
flex-basis: calc(100% - #{$spot-spacing-3}) |
@ -1,27 +1,32 @@ |
||||
<div class="-columns-2"> |
||||
<div class="attributes-key-value" |
||||
[ngClass]="{'-span-all-columns': descriptor.spanAll }" |
||||
*ngFor="let descriptor of group.members; trackBy:trackByName"> |
||||
<ng-template [ngIf]="!shouldHideField(descriptor)"> |
||||
<div |
||||
class="attributes-key-value--key" |
||||
*ngIf="!descriptor.multiple && descriptor.field"> |
||||
<wp-replacement-label [fieldName]="descriptor.name"> |
||||
{{ descriptor.label }} |
||||
<span class="required" |
||||
*ngIf="descriptor.field!.required && descriptor.field!.writable"> *</span> |
||||
</wp-replacement-label> |
||||
<attribute-help-text [attribute]="descriptor.name" [attributeScope]="'WorkPackage'"></attribute-help-text> |
||||
</div> |
||||
<div *ngIf="!descriptor.multiple && descriptor.field" |
||||
class="attributes-key-value--value-container"> |
||||
|
||||
<op-editable-attribute-field [ngClass]="{'wp-edit-formattable-field': descriptor.field!.isFormattable }" |
||||
[resource]="workPackage" |
||||
[isDropTarget]="descriptor.field!.isFormattable" |
||||
[fieldName]="fieldName(descriptor.name)"> |
||||
</op-editable-attribute-field> |
||||
</div> |
||||
</ng-template> |
||||
</div> |
||||
<div |
||||
class="wp-attribute-group--attribute attributes-key-value" |
||||
[ngClass]="{'wp-attribute-group--attribute_span-all': descriptor.spanAll }" |
||||
*ngFor="let descriptor of group.members; trackBy:trackByName" |
||||
> |
||||
<ng-template [ngIf]="!shouldHideField(descriptor)"> |
||||
<div |
||||
class="attributes-key-value--key" |
||||
*ngIf="!descriptor.multiple && descriptor.field" |
||||
> |
||||
<wp-replacement-label [fieldName]="descriptor.name"> |
||||
{{ descriptor.label }} |
||||
<span |
||||
class="required" |
||||
*ngIf="descriptor.field!.required && descriptor.field!.writable" |
||||
>*</span> |
||||
</wp-replacement-label> |
||||
<attribute-help-text [attribute]="descriptor.name" [attributeScope]="'WorkPackage'"></attribute-help-text> |
||||
</div> |
||||
<div |
||||
*ngIf="!descriptor.multiple && descriptor.field" |
||||
class="attributes-key-value--value-container" |
||||
> |
||||
<op-editable-attribute-field |
||||
[ngClass]="{'wp-edit-formattable-field': descriptor.field!.isFormattable }" |
||||
[resource]="workPackage" |
||||
[isDropTarget]="descriptor.field!.isFormattable" |
||||
[fieldName]="fieldName(descriptor.name)" |
||||
></op-editable-attribute-field> |
||||
</div> |
||||
</ng-template> |
||||
</div> |
||||
|
Loading…
Reference in new issue