Skip to content

Commit 4abdea5

Browse files
samuelalexandrevryghem
authored andcommitted
99221: Fix minor issues with Relationships in submission - hide disabled buttons
1 parent dff343f commit 4abdea5

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/app/shared/form/form.component.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,20 @@
1313
(ngbEvent)="onCustomEvent($event)">
1414
<ng-template modelType="ARRAY" let-group let-index="index" let-context="context">
1515
<!--Array with repeatable items-->
16-
<div *ngIf="(!context.notRepeatable) && !isVirtual(context, index)"
16+
<div *ngIf="(!context.notRepeatable) && !isVirtual(context, index) && group.context.groups.length !== 1 && !isItemReadOnly(context, index)"
1717
class="col-xs-2 d-flex flex-column justify-content-sm-start align-items-end">
1818
<button type="button" class="btn btn-secondary" role="button"
1919
title="{{'form.remove' | translate}}"
2020
attr.aria-label="{{'form.remove' | translate}}"
21-
(click)="removeItem($event, context, index)"
22-
[disabled]="group.context.groups.length === 1 || isItemReadOnly(context, index)">
21+
(click)="removeItem($event, context, index)">
2322
<span><i class="fas fa-trash" aria-hidden="true"></i></span>
2423
</button>
2524
</div>
26-
<div *ngIf="(!context.notRepeatable) && index === (group.context.groups.length - 1)" class="clearfix pl-4 w-100">
25+
<div *ngIf="(!context.notRepeatable) && index === (group.context.groups.length - 1) && !isItemReadOnly(context, index)" class="clearfix pl-4 w-100">
2726
<div class="btn-group" role="group">
2827
<button type="button" role="button" class="ds-form-add-more btn btn-link"
2928
title="{{'form.add' | translate}}"
3029
attr.aria-label="{{'form.add' | translate}}"
31-
[disabled]="isItemReadOnly(context, index)"
3230
(click)="insertItem($event, group.context, group.context.groups.length)">
3331
<span><i class="fas fa-plus"></i> {{'form.add' | translate}}</span>
3432
</button>

0 commit comments

Comments
 (0)