Skip to content

Commit

Permalink
fix(ui): #1589 dataset must not allow agent group editing (#2103)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpazuch authored Dec 20, 2022
1 parent ad2bd42 commit dd601ef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@
<form [formGroup]="form" [hidden]="isLoading()">
<!-- GROUP-->
<div [hidden]="!!group">
<nb-form-field>
<nb-form-field *ngIf="isEdit">
<div>
<label class="font-weight-bold">Agent Group</label>
<span class="required">*</span>
</div>
<input nbInput fullWidth="true" disabled [value]="groupName"/>
</nb-form-field>
<nb-form-field *ngIf="!isEdit">
<div>
<label class="font-weight-bold">Agent Group</label>
<span class="required">*</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class DatasetFromComponent implements OnInit {
isEdit: boolean;

selectedGroup: string;

groupName: string;
selectedPolicy: string;
fetchedData: boolean;
sinkIDs: string[];
Expand All @@ -78,6 +78,7 @@ export class DatasetFromComponent implements OnInit {
private cdr: ChangeDetectorRef,
) {
this.isEdit = false;
this.groupName = '';
this.availableAgentGroups = [];
this.fetchedData = false;
this.filteredAgentGroups$ = of(this.availableAgentGroups);
Expand Down Expand Up @@ -165,11 +166,10 @@ export class DatasetFromComponent implements OnInit {
const group = this.availableAgentGroups.filter(
(agent) => agent.id === groupId,
);
let name;
if (group.length > 0) {
name = group[0].name;
this.groupName = group[0].name;
}
this.form.patchValue({ agent_group_name: name });
this.form.patchValue({ agent_group_name: this.groupName });
this.cdr.markForCheck();
}

Expand Down

0 comments on commit dd601ef

Please sign in to comment.