Skip to content

Commit

Permalink
Merge pull request #322 from shikshalokam/SB-30812
Browse files Browse the repository at this point in the history
Issue SB-30812 fix: Add button changes in entity page
  • Loading branch information
vishwanath1004 authored Sep 2, 2022
2 parents c9ffe07 + 8c1c8a2 commit 4c22f1e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ion-button
size="small"
class="button custom-btn-txt-transform-none button-small button-solid hydrated ion-activatable ion-focusable m-12 md button-clr ion-text-capitalize"
(click)="addEntity()"
(click)="addEntity()" [disabled]="disableAddEntity"
>{{ 'ADD' | translate }} {{entityType}}</ion-button
>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export class ObservationDetailComponent implements OnInit {
actionButtons: []
};
observationId: any;
disableAddEntity : boolean = true;
solutionId: any;
programId: any;
submissionCount: any;
Expand Down Expand Up @@ -65,6 +66,7 @@ export class ObservationDetailComponent implements OnInit {
this.solutionId = params.solutionId;
this.programId = params.programId;
this.solutionName = params.solutionName;
this.entityType =params.entityType;
let parameters = {
solutionId: this.solutionId,
programId: this.programId,
Expand Down Expand Up @@ -116,15 +118,16 @@ export class ObservationDetailComponent implements OnInit {
success => {
this.loader.stopLoader();
if (success && success.result && success.result.entities) {
this.disableAddEntity = false;
this.solutionData = success.result;
this.entities = success.result.entities;
this.entityType = success.result.entityType;
if (!this.observationId) {
this.observationId = success.result._id; // for autotargeted if get observationId
}
this.localStorage.setLocalStorage(this.generatedKey,success.result);

} else {
this.disableAddEntity = true;
this.entities = [];
if (!this.observationId) {
this.observationId = success.result._id; // for autotargeted if get observationId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ export class ObservationHomeComponent implements OnInit {
programId: programId,
solutionId: solutionId,
observationId: observationId,
solutionName: solutionName
solutionName: solutionName,
entityType : solution.entityType
}
}
)
Expand Down

0 comments on commit 4c22f1e

Please # to comment.