Skip to content

Commit 6837956

Browse files
committed
Fix deletion of cloned (local copies), Update validation messages after modbus value change
1 parent b3ae169 commit 6837956

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/app/specification/specification/specification.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ export class SpecificationComponent
244244
)
245245
.pipe(
246246
map((e) => {
247+
this.setValidationMessages()
247248
return {
248249
id: e.id,
249250
modbusValue: e.modbusValue,
@@ -267,7 +268,7 @@ export class SpecificationComponent
267268
this.slaveid,
268269
this.config.mqttdiscoverylanguage,
269270
value,
270-
);
271+
).pipe(map((v)=>{ this.setValidationMessages() ;return v}));
271272
},
272273
getNonVariableNumberEntities: () => {
273274
let rc: ImodbusEntity[] = [];

src/app/specifications/specifications.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
}}</mat-card-title>
3131
<div class="card-header-buttons">
3232
<button mat-icon-button class="material-icons app-toolbar-menu delete-button"
33-
matTooltip="Delete" color="warn" [disabled]="[0,1].includes(spec.status)"
33+
[matTooltip]="spec.status == 1?'Restore public version':'Delete'" color="warn" [disabled]="[0,4].includes(spec.status)"
3434
(click)="deleteSpecification(spec)">
35-
<mat-icon matTooltip="Delete">delete</mat-icon>
35+
<mat-icon>delete</mat-icon>
3636
</button>
3737
</div>
3838
</mat-card-header>

src/app/specifications/specifications.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export class SpecificationsComponent implements OnInit {
110110
}
111111
deleteSpecification(spec: ImodbusSpecification) {
112112
if (
113-
[SpecificationStatus.added, SpecificationStatus.cloned].includes(
113+
[SpecificationStatus.added, SpecificationStatus.new, SpecificationStatus.cloned].includes(
114114
spec.status,
115115
)
116116
) {

0 commit comments

Comments
 (0)