Remove the create link from doc details

This commit is contained in:
shamoon committed 2026-10-20 08:11:40 -07:00
1 parent 7055f7a745
commit 3ed9586347
4 files changed
+1 -28

No files matched your search

@@ -70,14 +70,6 @@
<i-bs width="1em" height="1em" name="file-earmark-ruled" class="me-1"></i-bs><span i18n>Run Zone OCR</span>
</button>
<button
ngbDropdownItem
(click)="createOcrTemplate()"
*pngxIfPermissions="{ action: PermissionAction.Add, type: PermissionType.OcrTemplate }"
>
<i-bs width="1em" height="1em" name="file-earmark-medical" class="me-1"></i-bs><span i18n>Create OCR Template</span>
</button>
@if (userIsOwner && (requiresPassword || password)) {
<button ngbDropdownItem (click)="removePassword()" [disabled]="!password">
<i-bs name="unlock" class="me-1"></i-bs><ng-container i18n>Remove Password</ng-container>
@@ -1587,15 +1587,6 @@ export class DocumentDetailComponent
})
}
createOcrTemplate() {
this.router.navigate(['/ocr-templates', 'new'], {
queryParams: {
document_type: this.document().document_type,
sample_document: this.document().id,
},
})
}
private getSelectedNonLatestVersionId(): number | null {
const versions = this.document()?.versions ?? []
if (!versions.length || !this.selectedVersionId()) {
@@ -53,7 +53,7 @@ describe('OcrTemplateEditorComponent', () => {
providers: [
{
provide: ActivatedRoute,
useValue: { snapshot: { paramMap: new Map(), queryParams: {} } },
useValue: { snapshot: { paramMap: new Map() } },
},
{ provide: DocumentService, useValue: documents },
{ provide: OcrTemplateService, useValue: templates },
@@ -345,16 +345,6 @@ export class OcrTemplateEditorComponent
this.markSaved()
})
} else {
const qp = this.route.snapshot.queryParams
if (qp['document_type']) {
this.template.document_type = parseInt(qp['document_type'])
}
if (qp['sample_document']) {
const docId = parseInt(qp['sample_document'])
this.template.sample_document = docId
this.previewDocId = docId
this.loadPreview()
}
this.markSaved()
}
}