diff --git a/package-lock.json b/package-lock.json index 54b3b385ea..0ec900ed8d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9710,6 +9710,12 @@ "integrity": "sha512-4yvfe5Qil9Bz7OTSnVNVkQV5Mru0wSAgfAhBE/myo9aPLT7yjs3sn963Shg4MCDPlVCganS0spJ384fsyYB6lA==", "dev": true }, + "cordova-plugin-badge-fix": { + "version": "0.8.10", + "resolved": "https://registry.npmjs.org/cordova-plugin-badge-fix/-/cordova-plugin-badge-fix-0.8.10.tgz", + "integrity": "sha512-4yvfe5Qil9Bz7OTSnVNVkQV5Mru0wSAgfAhBE/myo9aPLT7yjs3sn963Shg4MCDPlVCganS0spJ384fsyYB6lA==", + "dev": true + }, "cordova-plugin-camera": { "version": "git+ssh://git@github.com/shikshalokam/cordova-plugin-camera.git#4a48d1a5d13de17ac7f522a848526fe9c4024e42", "from": "cordova-plugin-camera@git+https://github.com/shikshalokam/cordova-plugin-camera.git", @@ -11366,6 +11372,11 @@ "path-webpack": "0.0.3" }, "dependencies": { + "@xmldom/xmldom": { + "version": "0.7.13", + "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.7.13.tgz", + "integrity": "sha512-lm2GW5PkosIzccsaZIz7tp8cPADSIlIHWDFTR1N0SzfinhhYgeIQjFMz4rYzanCScr3DqQLeomUDArp6MWKm+g==" + }, "core-js": { "version": "3.30.1", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.30.1.tgz", diff --git a/src/app/components/popups/download-transcript-popup/download-transcript-popup.component.spec.ts b/src/app/components/popups/download-transcript-popup/download-transcript-popup.component.spec.ts index 582bfa1a5e..409133a775 100644 --- a/src/app/components/popups/download-transcript-popup/download-transcript-popup.component.spec.ts +++ b/src/app/components/popups/download-transcript-popup/download-transcript-popup.component.spec.ts @@ -88,14 +88,13 @@ describe('DownloadTranscriptPopupComponent', () => { }, 0); }); - it('should not download transcript file if api failed and hasPermission', (done) => { + it('should not download transcript file if api failed', (done) => { const dismissFn = jest.fn(() => Promise.resolve()); const presentFn = jest.fn(() => Promise.resolve()); mockCommonUtilService.getLoader = jest.fn(() => ({ present: presentFn, dismiss: dismissFn, })); - mockPlatform.is = jest.fn(platform => platform === 'android') mockPopOverCtrl.dismiss = jest.fn(() => Promise.resolve(true)); mockCommonUtilService.getGivenPermissionStatus = jest.fn(() => Promise.resolve({hasPermission: true})); mockCommonUtilService.isAndroidVer13 = jest.fn(() => false); @@ -126,310 +125,6 @@ describe('DownloadTranscriptPopupComponent', () => { }, 0); }); - it('should not download transcript file if api failed and isPermissionAlwaysDenied', (done) => { - const dismissFn = jest.fn(() => Promise.resolve()); - const presentFn = jest.fn(() => Promise.resolve()); - mockCommonUtilService.getLoader = jest.fn(() => ({ - present: presentFn, - dismiss: dismissFn, - })); - mockPlatform.is = jest.fn(platform => platform === 'android') - mockPopOverCtrl.dismiss = jest.fn(() => Promise.resolve(true)); - mockCommonUtilService.getGivenPermissionStatus = jest.fn(() => Promise.resolve({isPermissionAlwaysDenied: true})); - mockCommonUtilService.showSettingsPageToast = jest.fn(() => {}) - downloadTranscriptPopupComponent.contentData = { - transcripts: JSON.stringify([{ - identifier: 'sample-do_id', - artifactUrl: 'http//:sample-url/do_id', - language: 'english' - }, { - identifier: 'sample-do_id', - artifactUrl: 'http//:sample-url/do_id', - language: 'hindi' - }]), - name: 'transcript-content' - }; - downloadTranscriptPopupComponent.transcriptLanguage = 'english'; - mockContentService.downloadTranscriptFile = jest.fn(() => Promise.reject({error: 'api-failed'})); - // act - downloadTranscriptPopupComponent.download(); - // assert - setTimeout(() => { - expect(mockCommonUtilService.getLoader).toHaveBeenCalled(); - expect(presentFn).toHaveBeenCalled(); - expect(mockPopOverCtrl.dismiss).toHaveBeenCalled(); - done(); - }, 0); - }); - - it('should not download transcript file if api failed and isPermissionAlwaysDenied and hasPermission has false', (done) => { - const dismissFn = jest.fn(() => Promise.resolve()); - const presentFn = jest.fn(() => Promise.resolve()); - const presentPopover = jest.fn(() => Promise.resolve()); - mockCommonUtilService.getLoader = jest.fn(() => ({ - present: presentFn, - dismiss: dismissFn, - })); - mockPlatform.is = jest.fn(platform => platform === 'android') - mockPopOverCtrl.dismiss = jest.fn(() => Promise.resolve(true)); - mockCommonUtilService.getGivenPermissionStatus = jest.fn(() => Promise.resolve({hasPermission: false, isPermissionAlwaysDenied: false})); - mockCommonUtilService.translateMessage = jest.fn(); - mockCommonUtilService.buildPermissionPopover = jest.fn(() => Promise.resolve({ - present: presentPopover - })); - downloadTranscriptPopupComponent.contentData = { - transcripts: JSON.stringify([{ - identifier: 'sample-do_id', - artifactUrl: 'http//:sample-url/do_id', - language: 'english' - }, { - identifier: 'sample-do_id', - artifactUrl: 'http//:sample-url/do_id', - language: 'hindi' - }]), - name: 'transcript-content' - }; - downloadTranscriptPopupComponent.transcriptLanguage = 'english'; - mockContentService.downloadTranscriptFile = jest.fn(() => Promise.reject({error: 'api-failed'})); - // act - downloadTranscriptPopupComponent.download(); - // assert - setTimeout(() => { - expect(mockCommonUtilService.getLoader).toHaveBeenCalled(); - expect(presentFn).toHaveBeenCalled(); - expect(mockPopOverCtrl.dismiss).toHaveBeenCalled(); - done(); - }, 0); - }); - - it('should not download transcript file if api failed and isPermissionAlwaysDenied and hasPermission has false and not now is selected', (done) => { - const dismissFn = jest.fn(() => Promise.resolve()); - const presentFn = jest.fn(() => Promise.resolve()); - mockCommonUtilService.getLoader = jest.fn(() => ({ - present: presentFn, - dismiss: dismissFn, - })); - mockPlatform.is = jest.fn(platform => platform === 'android') - mockPopOverCtrl.dismiss = jest.fn(() => Promise.resolve(true)); - mockCommonUtilService.getGivenPermissionStatus = jest.fn(() => Promise.resolve({hasPermission: false, isPermissionAlwaysDenied: false})); - mockCommonUtilService.translateMessage = jest.fn(v => v); - mockCommonUtilService.buildPermissionPopover = jest.fn(async (callback) => { - await callback(mockCommonUtilService.translateMessage('NOT_NOW')); - mockTelemetryGeneratorService.generateInteractTelemetry = jest.fn(); - mockCommonUtilService.showSettingsPageToast = jest.fn() - return { - present: jest.fn(() => Promise.resolve()) - }; - }); - downloadTranscriptPopupComponent.contentData = { - transcripts: JSON.stringify([{ - identifier: 'sample-do_id', - artifactUrl: 'http//:sample-url/do_id', - language: 'english' - }, { - identifier: 'sample-do_id', - artifactUrl: 'http//:sample-url/do_id', - language: 'hindi' - }]), - name: 'transcript-content' - }; - downloadTranscriptPopupComponent.transcriptLanguage = 'english'; - mockContentService.downloadTranscriptFile = jest.fn(() => Promise.reject({error: 'api-failed'})); - // act - downloadTranscriptPopupComponent.download(); - // assert - setTimeout(() => { - expect(mockCommonUtilService.getLoader).toHaveBeenCalled(); - expect(presentFn).toHaveBeenCalled(); - expect(mockPopOverCtrl.dismiss).toHaveBeenCalled(); - done(); - }, 0); - }); - - it('should not download transcript file if api failed and isPermissionAlwaysDenied and hasPermission has false and allow is selected', (done) => { - const dismissFn = jest.fn(() => Promise.resolve()); - const presentFn = jest.fn(() => Promise.resolve()); - mockCommonUtilService.getLoader = jest.fn(() => ({ - present: presentFn, - dismiss: dismissFn, - })); - mockPlatform.is = jest.fn(platform => platform === 'android') - mockPopOverCtrl.dismiss = jest.fn(() => Promise.resolve(true)); - mockCommonUtilService.getGivenPermissionStatus = jest.fn(() => Promise.resolve({hasPermission: false, isPermissionAlwaysDenied: false})); - mockCommonUtilService.translateMessage = jest.fn(v => v); - mockCommonUtilService.buildPermissionPopover = jest.fn(async (callback) => { - await callback(mockCommonUtilService.translateMessage('ALLOW')); - mockTelemetryGeneratorService.generateInteractTelemetry = jest.fn(); - mockAppGlobalService.isNativePopupVisible = true; - mockPermissionService.requestPermission = jest.fn(() => of({hasPermission: true})) - mockAppGlobalService.setNativePopupVisible = jest.fn(); - return { - present: jest.fn(() => Promise.resolve()) - }; - }); - downloadTranscriptPopupComponent.contentData = { - transcripts: JSON.stringify([{ - identifier: 'sample-do_id', - artifactUrl: 'http//:sample-url/do_id', - language: 'english' - }, { - identifier: 'sample-do_id', - artifactUrl: 'http//:sample-url/do_id', - language: 'hindi' - }]), - name: 'transcript-content' - }; - downloadTranscriptPopupComponent.transcriptLanguage = 'english'; - mockContentService.downloadTranscriptFile = jest.fn(() => Promise.reject({error: 'api-failed'})); - // act - downloadTranscriptPopupComponent.download(); - // assert - setTimeout(() => { - expect(mockCommonUtilService.getLoader).toHaveBeenCalled(); - expect(presentFn).toHaveBeenCalled(); - expect(mockPopOverCtrl.dismiss).toHaveBeenCalled(); - expect(mockCommonUtilService.translateMessage).toHaveBeenCalled(); - expect(mockCommonUtilService.buildPermissionPopover).toHaveBeenCalled(); - expect(mockCommonUtilService.getGivenPermissionStatus).toHaveBeenCalled(); - expect(dismissFn).toHaveBeenCalled(); - done(); - }, 0); - }); - - it('should not download transcript file if api failed and isPermissionAlwaysDenied and hasPermission has false and allow is selected and request isPermissionAlwaysDenied', (done) => { - const dismissFn = jest.fn(() => Promise.resolve()); - const presentFn = jest.fn(() => Promise.resolve()); - mockCommonUtilService.getLoader = jest.fn(() => ({ - present: presentFn, - dismiss: dismissFn, - })); - mockPlatform.is = jest.fn(platform => platform === 'android') - mockPopOverCtrl.dismiss = jest.fn(() => Promise.resolve(true)); - mockCommonUtilService.getGivenPermissionStatus = jest.fn(() => Promise.resolve({hasPermission: false, isPermissionAlwaysDenied: false})); - mockCommonUtilService.translateMessage = jest.fn(v => v); - mockCommonUtilService.buildPermissionPopover = jest.fn(async (callback) => { - await callback(mockCommonUtilService.translateMessage('ALLOW')); - mockTelemetryGeneratorService.generateInteractTelemetry = jest.fn(); - mockAppGlobalService.isNativePopupVisible = true; - mockPermissionService.requestPermission = jest.fn(() => of({isPermissionAlwaysDenied: true})) - mockAppGlobalService.setNativePopupVisible = jest.fn(); - return { - present: jest.fn(() => Promise.resolve()) - }; - }); - downloadTranscriptPopupComponent.contentData = { - transcripts: JSON.stringify([]), - name: 'transcript-content' - }; - downloadTranscriptPopupComponent.transcriptLanguage = 'english'; - mockContentService.downloadTranscriptFile = jest.fn(() => Promise.reject({error: 'api-failed'})); - // act - downloadTranscriptPopupComponent.download(); - // assert - setTimeout(() => { - expect(mockCommonUtilService.getLoader).toHaveBeenCalled(); - expect(presentFn).toHaveBeenCalled(); - expect(mockPopOverCtrl.dismiss).toHaveBeenCalled(); - expect(mockCommonUtilService.translateMessage).toHaveBeenCalled(); - expect(mockCommonUtilService.buildPermissionPopover).toHaveBeenCalled(); - expect(mockCommonUtilService.getGivenPermissionStatus).toHaveBeenCalled(); - expect(dismissFn).toHaveBeenCalled(); - done(); - }, 0); - }); - - it('should not download transcript file if api failed and isPermissionAlwaysDenied and hasPermission has false and allow is selected and no request with hasPermission and isPermissionAlwaysDenied', (done) => { - const dismissFn = jest.fn(() => Promise.resolve()); - const presentFn = jest.fn(() => Promise.resolve()); - mockCommonUtilService.getLoader = jest.fn(() => ({ - present: presentFn, - dismiss: dismissFn, - })); - mockPlatform.is = jest.fn(platform => platform === 'android') - mockPopOverCtrl.dismiss = jest.fn(() => Promise.resolve(true)); - mockCommonUtilService.getGivenPermissionStatus = jest.fn(() => Promise.resolve({hasPermission: false, isPermissionAlwaysDenied: false})); - mockCommonUtilService.translateMessage = jest.fn(v => v); - mockCommonUtilService.buildPermissionPopover = jest.fn(async (callback) => { - await callback(mockCommonUtilService.translateMessage('ALLOW')); - mockTelemetryGeneratorService.generateInteractTelemetry = jest.fn(); - mockAppGlobalService.isNativePopupVisible = true; - mockPermissionService.requestPermission = jest.fn(() => of({hasPermission: false, isPermissionAlwaysDenied: false})) - mockAppGlobalService.setNativePopupVisible = jest.fn(); - mockCommonUtilService.showSettingsPageToast = jest.fn(); - return { - present: jest.fn(() => Promise.resolve()) - }; - }); - downloadTranscriptPopupComponent.contentData = { - transcripts: JSON.stringify([{ - identifier: 'sample-do_id', - artifactUrl: 'http//:sample-url/do_id', - language: 'english' - }, { - identifier: 'sample-do_id', - artifactUrl: 'http//:sample-url/do_id', - language: 'hindi' - }]), - name: 'transcript-content' - }; - downloadTranscriptPopupComponent.transcriptLanguage = 'english'; - mockContentService.downloadTranscriptFile = jest.fn(() => Promise.reject({error: 'api-failed'})); - // act - downloadTranscriptPopupComponent.download(); - // assert - setTimeout(() => { - expect(mockCommonUtilService.getLoader).toHaveBeenCalled(); - expect(presentFn).toHaveBeenCalled(); - expect(mockPopOverCtrl.dismiss).toHaveBeenCalled(); - expect(mockCommonUtilService.translateMessage).toHaveBeenCalled(); - expect(mockCommonUtilService.buildPermissionPopover).toHaveBeenCalled(); - expect(mockCommonUtilService.getGivenPermissionStatus).toHaveBeenCalled(); - done(); - }, 0); - }); - - it('should not download transcript file and allow is selected and no request with hasPermission and isPermissionAlwaysDenied', (done) => { - const dismissFn = jest.fn(() => Promise.resolve()); - const presentFn = jest.fn(() => Promise.resolve()); - mockCommonUtilService.getLoader = jest.fn(() => ({ - present: presentFn, - dismiss: dismissFn, - })); - mockPlatform.is = jest.fn(platform => platform === 'android') - mockPopOverCtrl.dismiss = jest.fn(() => Promise.resolve(true)); - mockCommonUtilService.getGivenPermissionStatus = jest.fn(() => Promise.resolve({hasPermission: false, isPermissionAlwaysDenied: false})); - mockCommonUtilService.translateMessage = jest.fn(v => v); - mockCommonUtilService.buildPermissionPopover = jest.fn(async (callback) => { - await callback(mockCommonUtilService.translateMessage('Sample')); - mockTelemetryGeneratorService.generateInteractTelemetry = jest.fn(); - mockAppGlobalService.isNativePopupVisible = true; - mockPermissionService.requestPermission = jest.fn(() => of({hasPermission: false, isPermissionAlwaysDenied: false})) - mockAppGlobalService.setNativePopupVisible = jest.fn(); - mockCommonUtilService.showSettingsPageToast = jest.fn(); - return { - present: jest.fn(() => Promise.resolve()) - }; - }); - downloadTranscriptPopupComponent.contentData = { - transcripts: JSON.stringify([]), - name: 'transcript-content' - }; - downloadTranscriptPopupComponent.transcriptLanguage = 'english'; - mockContentService.downloadTranscriptFile = jest.fn(() => Promise.reject({error: 'api-failed'})); - // act - downloadTranscriptPopupComponent.download(); - // assert - setTimeout(() => { - expect(mockCommonUtilService.getLoader).toHaveBeenCalled(); - expect(presentFn).toHaveBeenCalled(); - expect(mockPopOverCtrl.dismiss).toHaveBeenCalled(); - expect(mockCommonUtilService.translateMessage).toHaveBeenCalled(); - expect(mockCommonUtilService.buildPermissionPopover).toHaveBeenCalled(); - expect(mockCommonUtilService.getGivenPermissionStatus).toHaveBeenCalled(); - done(); - }, 0); - }); - it('should not download transcript file if transcript is not available', (done) => { const dismissFn = jest.fn(() => Promise.resolve()); const presentFn = jest.fn(() => Promise.resolve()); @@ -670,4 +365,4 @@ describe('DownloadTranscriptPopupComponent', () => { it('ngOnInit', () => { downloadTranscriptPopupComponent.ngOnInit(); }); -}); +}); \ No newline at end of file diff --git a/src/app/manage-learn/project/add-file/add-file.page.ts b/src/app/manage-learn/project/add-file/add-file.page.ts index f9ccd8e30b..271b8fe0e8 100644 --- a/src/app/manage-learn/project/add-file/add-file.page.ts +++ b/src/app/manage-learn/project/add-file/add-file.page.ts @@ -65,7 +65,7 @@ export class AddFilePage implements OnInit { this.description = params.taskId ? actions.TASK_FILE_DESCRIPTION.label : actions.PROJECT_FILE_DESCRIPTION.label; this.taskId = params.taskId; }) - this.updateRemarks = _.debounce(this.updateRemarks,1500) + this.updateRemarks = _.debounce(this.updateRemarks,1500); } ngOnInit() { } @@ -76,7 +76,14 @@ export class AddFilePage implements OnInit { } handleHeaderEvents($event) { - this.location.back() + if ($event.name == 'back') { + if (JSON.stringify(this.projectCopy) !== JSON.stringify(this.project) || + JSON.stringify(this.projectCopy.tasks[this.taskIndex]) !== JSON.stringify(this.task)) { + this.pageExitConfirm(); + } else { + this.location.back() + } + } } getProject() { this.db.query({ _id: this.projectId }).then( @@ -104,7 +111,6 @@ export class AddFilePage implements OnInit { } else { this.project.remarks = this.remarks } - this.update('save') } setHeaderConfig() { @@ -159,24 +165,20 @@ export class AddFilePage implements OnInit { delete(index) { this.attachments.splice(index, 1); - this.update('save'); - this.taskId ? this.task.isEdit = true :''; + this.task.isEdit = true; + this.update('delete'); } - async onAction(event) { + onAction(event) { if(!this.taskId){ - this.popupService.showPPPForProjectPopUp('FRMELEMNTS_LBL_EVIDENCES_CONTENT_POLICY', 'FRMELEMNTS_LBL_EVIDENCES_CONTENT_POLICY_TEXT', 'FRMELEMNTS_LBL_EVIDENCES_CONTENT_POLICY_LABEL', 'FRMELEMNTS_LBL_UPLOAD_EVIDENCES', 'https://diksha.gov.in/term-of-use.html', 'contentPolicy').then(async(data: any) => { + this.popupService.showPPPForProjectPopUp('FRMELEMNTS_LBL_EVIDENCES_CONTENT_POLICY', 'FRMELEMNTS_LBL_EVIDENCES_CONTENT_POLICY_TEXT', 'FRMELEMNTS_LBL_EVIDENCES_CONTENT_POLICY_LABEL', 'FRMELEMNTS_LBL_UPLOAD_EVIDENCES', 'https://diksha.gov.in/term-of-use.html', 'contentPolicy').then((data: any) => { if (data.isClicked) { if(data.isChecked){ if (event == 'openLink') { this.toggleLinkModal(); return; } - await this.attachmentService.openAttachmentSource(event, this.attachments); - setTimeout(() => { - this.update('save') - }, 1000); - + this.attachmentService.openAttachmentSource(event, this.attachments); }else{ this.toast.showMessage('FRMELEMNTS_MSG_EVIDENCES_CONTENT_POLICY_REJECT', 'danger'); } @@ -187,10 +189,7 @@ export class AddFilePage implements OnInit { this.toggleLinkModal(); return; } - await this.attachmentService.openAttachmentSource(event, this.attachments); - setTimeout(() => { - this.update('save') - }, 1000); + this.attachmentService.openAttachmentSource(event, this.attachments); } } @@ -199,11 +198,13 @@ export class AddFilePage implements OnInit { if (this.taskId) { this.task.attachments = this.attachments; this.task.remarks = this.remarks; - this.location.back(); if (JSON.stringify(this.projectCopy.tasks[this.taskIndex]) !== JSON.stringify(this.task)) { this.task.isEdit = true; this.project.isEdit = true; + this.taskId ? this.update(): this.update('submit'); this.toast.showMessage('FRMELEMNTS_LBL_FILES_ATTACHED', 'success') + } else { + this.location.back(); } } else { if (this.network.isNetworkAvailable) { @@ -218,14 +219,11 @@ export class AddFilePage implements OnInit { if (event) { this.attachments = this.attachments.concat(this.projectService.getLinks(event)); if (this.taskId) { - this.task.isEdit = true; this.task.attachments = this.task?.attachments.concat(this.projectService.getLinks(event)); } else { - this.project.isEdit = true; this.project.attachments = this.project?.attachments.concat(this.projectService.getLinks(event)); } this.toast.showMessage('FRMELEMNTS_MSG_SUCCESSFULLY_ATTACHED', 'success'); - this.update('save')   } this.toggleLinkModal(); } @@ -235,21 +233,18 @@ export class AddFilePage implements OnInit { } update(type?) { - if (this.taskId) { - this.task.attachments = this.attachments; - this.task.remarks = this.remarks; - if (JSON.stringify(this.projectCopy.tasks[this.taskIndex]) !== JSON.stringify(this.task)) { - this.task.isEdit = true; - this.project.isEdit = true; - this.toast.showMessage('FRMELEMNTS_LBL_FILES_ATTACHED', 'success') - } - } this.project.isEdit = true; this.db .update(this.project) .then((success) => { this.project._rev = success.rev; this.projectCopy = JSON.parse(JSON.stringify(this.project)); + if (type == 'submit') { + this.attachments = []; + this.doSyncAction(type === 'submit'); + }else{ + this.location.back(); + } }) } doSyncAction(isSubmission:boolean = false) { @@ -262,6 +257,35 @@ export class AddFilePage implements OnInit { } } + async pageExitConfirm() { + let data; + this.translate.get(["FRMELEMNTS_MSG_ATTACHMENT_PAGE_EXIT_CONFIRM", "FRMELEMNTS_BTN_EXIT_PAGE", "FRMELEMNTS_BTN_YES_PAGE", "FRMELEMNTS_LBL_YES", "NO"]).subscribe((text) => { + data = text; + }); + const alert = await this.alert.create({ + cssClass: 'central-alert', + header: data['FRMELEMNTS_BTN_EXIT_PAGE'], + message: data['FRMELEMNTS_MSG_ATTACHMENT_PAGE_EXIT_CONFIRM'], + buttons: [ + { + text: this.taskId ? data["FRMELEMNTS_BTN_YES_PAGE"] : data["FRMELEMNTS_LBL_YES"], + handler: () => { }, + }, { + text: data["NO"], + role: "cancel", + cssClass: "secondary", + handler: (blah) => { + }, + }, + ], + }); + await alert.present(); + let resp = await alert.onDidDismiss(); + if (resp.role !== 'cancel') { + this.location.back(); + } + } + async submitProjectConfirmation() { let data; this.translate.get(["FRMELEMNTS_MSG_SUBMIT_PROJECT", "FRMELEMNTS_LBL_SUBMIT_IMPROVEMENT", "CANCEL", "FRMELEMNTS_BTN_SUBMIT"]).subscribe((text) => { @@ -294,8 +318,10 @@ export class AddFilePage implements OnInit { this.project.attachments = this.attachments; this.project.remarks = this.remarks; this.attachments = []; - this.update(); + this.update('submit'); this.doSyncAction(true); + // this.project.status = statusType.submitted; }, 0) + this.location.back() } }