Skip to content

Commit 59e5ac6

Browse files
committed
SVY-20864 Web Components "Group Buttons" doesn't react on
controller.readOnly
1 parent b372ea7 commit 59e5ac6

9 files changed

Lines changed: 13 additions & 13 deletions

File tree

bootstrapextracomponents/buttonsGroup/buttonsGroup.spec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"size": { "type": "dimension", "default" : {"width":180, "height":32}, "pushToServer": "deep"},
2121
"format": { "type": "format", "for": "dataProviderID", "tags": { "scope" :"private" }},
2222
"tabSeq": { "type": "tabseq", "tags": { "scope" :"design" }},
23-
"showAs": { "type": "string", "values": [{"text":null}, {"html":"html"}, {"trusted_html":"trusted_html"}]}
23+
"showAs": { "type": "string", "values": [{"text":null}, {"html":"html"}, {"trusted_html":"trusted_html"}]},
24+
"readOnly": { "type": "protected", "blockingOn": true, "default": false, "for": ["dataProviderID","onDataChangeMethodID"], "tags": {"scope":"private"} }
2425
},
2526
"handlers": {
2627
"onDataChangeMethodID" : {

bootstrapextracomponents/projects/bootstrapextracomponents/src/buttonsgroup/buttonsgroup.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
class= "btn {{styleClass()}}"
88
[sabloTabseq]="tabSeq()"
99
[ngClass]="selectedValues[item.realValue] ? 'active' : ''"
10+
[disabled]="!enabled() || readOnly()"
1011
(click)="onClick(item)">
1112
@if (showAs() != "html" && showAs() != "trusted_html") {
1213
<span [textContent]='item.displayValue'></span>

bootstrapextracomponents/projects/bootstrapextracomponents/src/buttonsgroup/buttonsgroup.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export class ServoyBootstrapExtraButtonsGroup extends ServoyBaseComponent<HTMLEl
1313
readonly valuelistID = input<IValuelist>(undefined);
1414
readonly showAs = input<string>(undefined);
1515
readonly enabled = input<boolean>(undefined);
16+
readonly readOnly = input<boolean>(undefined);
1617
readonly tabSeq = input<number>(undefined);
1718
readonly inputType = input<string>(undefined);
1819
readonly toolTipText = input<string>(undefined);
@@ -34,13 +35,6 @@ export class ServoyBootstrapExtraButtonsGroup extends ServoyBaseComponent<HTMLEl
3435
for (const property of Object.keys(changes)) {
3536
const change = changes[property];
3637
switch (property) {
37-
case 'enabled':
38-
if (change.currentValue)
39-
this.renderer.removeAttribute(this.getNativeElement(), 'disabled');
40-
else
41-
this.renderer.setAttribute(this.getNativeElement(), 'disabled', 'disabled');
42-
break;
43-
4438
case 'dataProviderID':
4539
this._dataProviderID.set(this.dataProviderID());
4640
this.updateSelectedValues(this.dataProviderID());

bootstrapextracomponents/projects/bootstrapextracomponents/src/rating/rating.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[id]="servoyApi.getMarkupId()"
44
[(rate)]="_dataProviderID"
55
[max]="max()"
6-
[readonly]="!enabled()"
6+
[readonly]="!enabled() || readOnly()"
77
(leave)="onLeaveEvent()"
88
(hover)="onHoverEvent($event)"
99
(rateChange)="onChange()">

bootstrapextracomponents/projects/bootstrapextracomponents/src/rating/rating.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export class ServoyBootstrapExtraRating extends ServoyBaseComponent<HTMLDivEleme
1313
readonly onDataChangeMethodID = input<(oldValue: any, newValue: any, e: Event) => boolean>(undefined);
1414

1515
readonly enabled = input<boolean>(undefined);
16+
readonly readOnly = input<boolean>(undefined);
1617
readonly dataProviderID = input<number>(undefined);
1718
readonly dataProviderIDChange = output<number>();
1819
readonly max = input<number>(undefined);

bootstrapextracomponents/projects/bootstrapextracomponents/src/switch/switch.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="bts-extra-switch" [ngClass]="styleClass()" [sabloTabseq]="tabSeq()" [sabloTabseqConfig]="{container: false, tabSeqSetter: this}" [id]="servoyApi.getMarkupId()" #element>
22
<bSwitch
3-
[disabled]="!enabled()"
4-
[switch-disabled]="!enabled()"
3+
[disabled]="!enabled() || readOnly()"
4+
[switch-disabled]="!enabled() || readOnly()"
55
[switch-size]="componentSize()"
66
[switch-animate]="animate()"
77
[switch-label-text]="label()"

bootstrapextracomponents/projects/bootstrapextracomponents/src/switch/switch.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export class ServoyBootstrapExtraSwitch extends ServoyBaseComponent<HTMLDivEleme
1515
readonly styleClass = input<string>(undefined);
1616
readonly tabSeq = input<number>(undefined);
1717
readonly enabled = input<boolean>(undefined);
18+
readonly readOnly = input<boolean>(undefined);
1819
readonly componentSize = input<string>(undefined);
1920
readonly animate = input<boolean>(undefined);
2021
readonly label = input<string>(undefined);

bootstrapextracomponents/rating/rating.spec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"visible" : { "type": "boolean", "default": true},
2121
"location" : { "type": "point", "pushToServer": "deep"},
2222
"showPercentageOnHover" : { "type": "boolean" },
23-
"size" : { "type": "dimension", "default" : {"width":200, "height":32}, "pushToServer": "deep"}
23+
"size" : { "type": "dimension", "default" : {"width":200, "height":32}, "pushToServer": "deep"},
24+
"readOnly" : { "type": "protected", "blockingOn": true, "default": false, "for": ["dataProviderID","onDataChangeMethodID"], "tags": {"scope":"private"} }
2425
},
2526
"handlers":
2627
{

bootstrapextracomponents/switch/switch.spec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"componentSize" : { "type" : "tagstring" ,"default": "Normal", "values":[{"Mini":"mini"},{"Small":"small"},{"Normal":"normal"},{"Large":"large"}] },
3030
"tabSeq" : {"type" :"tabseq", "tags": { "scope" :"design" }},
3131
"size" : {"type" :"dimension", "default" : {"width":300, "height":40}},
32-
"visible" : "visible"
32+
"visible" : "visible",
33+
"readOnly" : { "type": "protected", "blockingOn": true, "default": false, "for": ["dataProviderID","onDataChangeMethodID"], "tags": {"scope":"private"} }
3334
},
3435
"handlers":
3536
{

0 commit comments

Comments
 (0)