<?php bulkSaveEditorData( editorData: any, options?: { isAutoSave?: boolean; displayName?: string } ) { this._sectionsService.saveEditorData(this.reviewUId, editorData).subscribe({ next: res => { if (!(options?.isAutoSave && options.displayName)) { this.toastrService.success(ApiConstant.MSG_EDITOR_DATA_SAVE_SUCCESS); } }, error: err => { this.toastrService.error(ApiConstant.MSG_EDITOR_DATA_SAVE_FAIL); }, }); } bulkEditorBulkSequenceUpdate( editorData: any, message: string, options?: { isAutoSave?: boolean; displayName?: string } ) { this._sectionsService .editorBulkSequenceUpdate(this.reviewUId, editorData) .subscribe({ next: res => { if (!(options?.isAutoSave && options.displayName)) { this.toastrService.success(message); } }, error: err => { this.toastrService.error(ApiConstant.MSG_EDITOR_DATA_SAVE_FAIL); }, }); } onSaveAction(sectionObj) { sectionObj.data.updatedBy = this.userInfo && this.userInfo.UserName ? this.userInfo.UserName : this.currentUserName; sectionObj.data.updatedOn = this.currentTimestamp; this.cASectionService.onSaveAction(sectionObj); this.onPasteVisibitliy = false; this.SaveActionCallback.emit({ sectionObject: sectionObj, editorContent: sectionObj.data?.editorData, }); this.updateTimelineStatusForSection(sectionObj); } onEditAction(sectionObj) { this.editorData = this.cASectionService.onEditAction(sectionObj); this.EditActionCallback.emit({ sectionObject: sectionObj, editorContent: sectionObj.sectionDescription, }); } onCopyAction(sectionObj) { const selectedEditor = this.editorComponent.find( p => p.ID == sectionObj.parameterId ); let htmldata = ""; if (!sectionObj.isRTE) { htmldata = sectionObj.sectionDescription; } else { htmldata = selectedEditor?.getEditorSelectedContent(); if (!htmldata) { htmldata = selectedEditor?.getEditorData(); } } if (navigator && navigator.clipboard && navigator.clipboard.write) { const blob = new Blob([htmldata], { type: ApiConstant.TEXT_HTML }); const clipboardItem = new ClipboardItem({ "text/html": blob }); navigator.clipboard .write([clipboardItem]) .then(() => {}) .catch(err => { this.toastrService.error(ApiConstant.MSG_COPY_ERROR); }); } } onPasteAction(sectionObj) { const selectedEditor = this.editorComponent.find( p => p.ID == sectionObj.parameterId ); navigator.clipboard .read() .then(items => { let contentType: string = ""; for (const item of items) { if (item.types.includes(ApiConstant.TEXT_HTML)) { contentType = ApiConstant.TEXT_HTML; } else if (item.types.includes(ApiConstant.TEXT_PLAIN)) { contentType = ApiConstant.TEXT_PLAIN; } item.getType(contentType).then(blob => { blob.text().then(html => { selectedEditor.insertContentIntoEditor(html); }); }); break; } }) .catch(err => { this.toastrService.error(ApiConstant.MSG_Paste_ERROR); }); } editorContentChange(sectionObj, editorContent: any) { if (sectionObj && sectionObj.data) { sectionObj.data.editorData = editorContent; } else { sectionObj.data = { editorData: editorContent, parameterDisplayName: sectionObj.parameterDisplayName, parameterId: sectionObj.parameterId, reviewSectionId: this.reviewSectionId, sequence: sectionObj.sequence, reviewUId: this.reviewUId, }; } const upateParams: ParameterDataModel = new ParameterDataModel(); upateParams.reviewSectionId = WatchlistSections.CREDIT_ANALYSIS; upateParams.parameter = structuredClone(sectionObj); upateParams.parameter.data = editorContent; this.EditorContentChange.emit(upateParams); } onDeleteEditor(section) { this._sectionsService.NotifyDeleteEditor(section); } focusInRTE(event) { this.onPasteVisibitliy = event; } editorSaveTextIn(content: string, sectionObj) { sectionObj.data.updatedBy = this.userInfo && this.userInfo.UserName ? this.userInfo.UserName : this.currentUserName; sectionObj.data.updatedOn = this.currentTimestamp; sectionObj.data.editorData = content; sectionObj.sectionDescription = content; this.cASectionService.onSaveAction(sectionObj); } editorTextIn(editorContent: string, sectionObj) { if (sectionObj) { if (!sectionObj.data) { sectionObj.data = {}; } sectionObj.data.editorData = editorContent; sectionObj.sectionDescription = editorContent; if (this.cASectionService.enableSimultaneous) { this.cASectionService.onEditAction(sectionObj); } } } getEditorForSection(section): CustomizedEditorComponent { return this.editorComponent?.find(p => p.ID === section.parameterId); } onSimultaneous(event: MultiUserEditConfig) { this.simultaneous = event; } setAutoNotification(event: string) { this.autosaveNotification = event; setTimeout(() => (this.autosaveNotification = null), 8000); } resetSimultaneousNotification(event: any) { this.autoSimultaneousNotification = event; setTimeout(() => (this.autoSimultaneousNotification = null), 8000); } onHistory(section) { const sectionDetails = section.data; if (sectionDetails.editorData != null) { this.trackChangesComp.showTrackChangesModal( this.reviewUId === undefined ? sectionDetails.reviewUId : this.reviewUId, this.reviewSectionId, section.parameterId ); } this.trackChanges.showModal(); } onTrackChangesCancel() { if (this.trackChanges) { this.trackChanges.onCancelClick(); } } showTooltip() { return this.interimReviewConstants.CREDIT_PROFILE_MATERIAL_CHANGE; } materialChangeCheckboxUpdate( value: boolean, isInitialising: boolean = false ) { this.materialChangeSelectedValue = value ?? false; this.creditProfileSelectionUpdated.emit(this.materialChangeSelectedValue); const dataObject = this.sectionData.find( item => item.parameterId === InterimReviewCASections.MATERIAL_CHANGE ); const section = { data: null, }; if (dataObject) { section.data = { editorData: null, parameterDisplayName: dataObject.parameterDisplayName, parameterId: InterimReviewCASections.MATERIAL_CHANGE, reviewSectionId: this.reviewSectionId, reviewUId: this.reviewUId, sequence: dataObject.sequence, materialChange: this.materialChangeSelectedValue, }; const shouldSave = (isInitialising && value === null) || !isInitialising; if (shouldSave) { this.bulkSaveEditorData([section.data], { isAutoSave: true, displayName: section.data.parameterDisplayName, }); if (dataObject?.isDefaultView === true) { this.updateTimelineStatusForSection({ parameterName: dataObject.parameterName, parameterId: dataObject.parameterId, isDefaultView: dataObject.isDefaultView, data: section.data, }); } } } } }
You have javascript disabled. You will not be able to edit any code.