Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #Portal : fix : profile modal on close loader removed #7461

Merged
merged 4 commits into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@project-sunbird/web-extensions": "^0.0.2",
"@samagra-x/uci-console": "1.2.1",
"@shikshalokam/sl-questionnaire": "0.0.11",
"@shikshalokam/sl-reports-library": "^1.0.5",
"@shikshalokam/sl-reports-library": "1.0.6",
"@swimlane/ngx-datatable": "16.1.1",
"@types/jquery": "3.3.31",
"@types/jquery.fancytree": "2.7.34",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<label class="mr-10"> {{ resourceService?.frmelmnts?.lbl?.solution }} </label>
<label class="sb-field">
<sui-select #solutionSelect labelField="name" [(ngModel)]="solutionSelected" valueField="_id" formControlName="solution"
[options]="solutions" class="selection pd-10" placeholder="Select Solution"
[options]="solutions" class="selection pd-10" placeholder="Select Resource"
(selectedOptionChange)="selectSolution($event)">
<sui-select-option *ngFor="let solutionInfo of solutionSelect.availableOptions" [value]="solutionInfo">
</sui-select-option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import { SbFormLocationSelectionDelegate } from '../delegate/sb-form-location-se
export class LocationSelectionComponent implements OnInit, OnDestroy, AfterViewInit {
@Input() isClosable = true;
@Input() deviceProfile: IDeviceProfile;
@Output() close = new EventEmitter<void>();
@Output() close = new EventEmitter<any>();
@ViewChild('onboardingModal', { static: true }) onboardingModal;

telemetryImpression: IImpressionEventInput;

sbFormLocationSelectionDelegate: SbFormLocationSelectionDelegate;

isSubmitted:boolean=false;
constructor(
public resourceService: ResourceService,
public toasterService: ToasterService,
Expand Down Expand Up @@ -81,7 +81,7 @@ export class LocationSelectionComponent implements OnInit, OnDestroy, AfterViewI
closeModal() {
this.onboardingModal.deny();
this.popupControlService.changePopupStatus(true);
this.close.emit();
this.close.emit({isSubmitted:this.isSubmitted});
}

async updateUserLocation() {
Expand All @@ -106,6 +106,7 @@ export class LocationSelectionComponent implements OnInit, OnDestroy, AfterViewI
} catch (e) {
this.toasterService.error(this.resourceService.messages.fmsg.m0049);
} finally {
this.isSubmitted=true;
this.closeModal();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ <h3 class="content-header-info font-weight-bold mb-16">{{resourceService.frmelmn
</app-modal-wrapper>

<app-location-selection
(close)="onLocationModalClose()"
(close)="onLocationModalClose($event)"
*ngIf="showEditUserDetailsPopup">

<div slot="popup-sub-header">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,4 +510,23 @@ describe('ProfilePageComponent', () => {
component.copyToClipboard('user');
expect(component.toasterService.success).toHaveBeenCalledWith(resourceBundle.messages.profile.smsg.m0041);
});

it('should close the profile popup on onLocationModalClose() called',()=>{
let event = {
isSubmitted : false
}
component.showEditUserDetailsPopup =!component.showEditUserDetailsPopup;
component.onLocationModalClose(event);
expect(component.showFullScreenLoader).toBe(false);
})

it('should close the profile popup on onLocationModalClose() called when submission is true',()=>{
let event = {
isSubmitted : true
}
component.showEditUserDetailsPopup =!component.showEditUserDetailsPopup;
component.onLocationModalClose(event);
expect(component.showFullScreenLoader).toBe(true);
})

});
Original file line number Diff line number Diff line change
Expand Up @@ -617,9 +617,9 @@ private async getSubPersonaConfig(subPersonaCode: string, persona: string, userL
return subPersonaFieldConfigOption ? subPersonaFieldConfigOption.label : undefined;
}

public onLocationModalClose() {
public onLocationModalClose(event) {
this.showEditUserDetailsPopup = !this.showEditUserDetailsPopup;
this.showFullScreenLoader = true;
this.showFullScreenLoader = !event?.isSubmitted ? false : true;
setTimeout(() => {
if (this.showFullScreenLoader) {
this.showFullScreenLoader = false;
Expand Down
2 changes: 1 addition & 1 deletion src/app/resourcebundles/data/consumption/en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2178,7 +2178,7 @@ frmelmnts.lbl.ariaContentPlayer = Content Player
#program-dashboard
frmelmnts.lbl.datasetRequestSuccess = Your report has been requested and will be available to download after 24 hours
frmelmnts.lbl.program = Select Program
frmelmnts.lbl.solution = Select Solution
frmelmnts.lbl.solution = Select Resource
frmelmnts.lbl.reportType = Report Type
frmelmnts.btn.requestReport = Request Report
frmelmnts.lbl.csvDataSets = CSV Datasets
Expand Down