Fix merge conflicts

This commit is contained in:
shamoon
2024-01-13 13:34:18 -08:00
parent be3d1128eb
commit fd60b2aa6f
3 changed files with 29 additions and 32 deletions

View File

@@ -972,6 +972,9 @@ describe('DocumentDetailComponent', () => {
const openDoc = Object.assign({}, doc)
// simulate a document being modified elsewhere and db updated
doc.modified = new Date()
jest
.spyOn(activatedRoute, 'paramMap', 'get')
.mockReturnValue(of(convertToParamMap({ id: 3, section: 'details' })))
jest.spyOn(documentService, 'get').mockReturnValueOnce(of(doc))
jest.spyOn(openDocumentsService, 'getOpenDocument').mockReturnValue(openDoc)
jest.spyOn(customFieldsService, 'listAll').mockReturnValue(
@@ -982,9 +985,7 @@ describe('DocumentDetailComponent', () => {
})
)
fixture.detectChanges() // calls ngOnInit
expect(modalSpy).toHaveBeenCalledWith(ConfirmDialogComponent, {
backdrop: 'static',
})
expect(modalSpy).toHaveBeenCalledWith(ConfirmDialogComponent)
})
function initNormally() {

View File

@@ -303,15 +303,12 @@ export class DocumentDetailComponent
new Date(doc.modified) > new Date(openDocument.modified) &&
!this.modalService.hasOpenModals()
) {
let modal = this.modalService.open(ConfirmDialogComponent, {
backdrop: 'static',
})
let modal = this.modalService.open(ConfirmDialogComponent)
modal.componentInstance.title = $localize`Document changes detected`
modal.componentInstance.messageBold = $localize`The version of this document in your browser session appears older than the existing version.`
modal.componentInstance.message = $localize`Saving the document here may overwrite other changes that were made. To restore the existing version, discard your changes or close the document.`
modal.componentInstance.cancelBtnCaption = $localize`Ok`
modal.componentInstance.cancelBtnClass = 'btn-primary'
modal.componentInstance.btnClass = 'visually-hidden'
modal.componentInstance.cancelBtnClass = 'visually-hidden'
modal.componentInstance.btnCaption = $localize`Ok`
}
if (this.documentForm.dirty) {
@@ -433,7 +430,6 @@ export class DocumentDetailComponent
updateComponent(doc: Document) {
this.document = doc
this.requiresPassword = false
// this.customFields = doc.custom_fields.concat([])
this.updateFormForCustomFields()
this.documentsService
.getMetadata(doc.id)