Toggle for source document handling
This commit is contained in:
1 parent
7df9e1f532
commit
cf5747f0bd
4 files changed
+29
-11
No files matched your search
@@ -18,12 +18,24 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="btn-toolbar" role="toolbar">
|
||||
<button class="btn btn-sm btn-outline-primary w-100" i18n-title title="Add Documents" (click)="chooseDocuments()">
|
||||
<svg width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor">
|
||||
<use xlink:href="assets/bootstrap-icons.svg#plus-circle" />
|
||||
</svg> <ng-container i18n>Add Documents</ng-container>
|
||||
</button>
|
||||
<div class="btn-toolbar justify-content-between" role="toolbar">
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-sm btn-outline-primary" i18n-title title="Add Documents" (click)="chooseDocuments()">
|
||||
<svg width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor">
|
||||
<use xlink:href="assets/bootstrap-icons.svg#plus-circle" />
|
||||
</svg> <ng-container i18n>Add Documents</ng-container>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<label class="text-muted ml-auto mr-2" i18n>Source documents:</label>
|
||||
<div class="btn-group btn-group-sm btn-group-toggle" ngbRadioGroup name="radioBasic" [(ngModel)]="delete_source_documents">
|
||||
<label ngbButtonLabel class="btn-outline-primary">
|
||||
<input ngbButton type="radio" [value]="false"><ng-container i18n>Copy</ng-container>
|
||||
</label>
|
||||
<label ngbButtonLabel class="btn-outline-danger">
|
||||
<input ngbButton type="radio" [value]="true"><ng-container i18n>Delete</ng-container>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="py-4" dndDropzone (dndDrop)="onDrop($event, documents)">
|
||||
<div class="spacer bg-primary" dndPlaceholderRef>
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.split-document-preview ::ng-deep .ng2-pdf-viewer-container {
|
||||
width: 1px !important;
|
||||
height: 1px !important;
|
||||
@@ -69,7 +68,7 @@ app-input-debounce {
|
||||
height: 20px;
|
||||
opacity: 0.5;
|
||||
background-color: transparent !important;
|
||||
background-image: url('data:image/svg+xml;utf8, <svg viewBox="0 0 200 110" xmlns="http://www.w3.org/2000/svg"><path d="M -15 110 L100 10 L215 110" fill="none" stroke="%23000000" stroke-width="1" vector-effect="non-scaling-stroke"/></svg>');
|
||||
background-image: url("data:image/svg+xml;utf8, <svg viewBox='0 0 200 110' xmlns='http://www.w3.org/2000/svg'><path d='M -15 110 L100 10 L215 110' fill='none' stroke='%23000000' stroke-width='1' vector-effect='non-scaling-stroke'/></svg>");
|
||||
background-position: bottom left;
|
||||
background-size: 2% auto;
|
||||
background-repeat: repeat-x;
|
||||
@@ -78,7 +77,7 @@ app-input-debounce {
|
||||
h6 {
|
||||
text-transform: uppercase;
|
||||
text-align: center;
|
||||
letter-spacing: .1em;
|
||||
letter-spacing: 0.1em;
|
||||
margin-top: -20px !important;
|
||||
z-index: 10;
|
||||
}
|
||||
@@ -97,3 +96,8 @@ app-input-debounce {
|
||||
pointer-events: all;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-toolbar > label {
|
||||
line-height: 2rem;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
@@ -20,8 +20,11 @@ import { PageChooserComponent } from 'src/app/components/common/page-chooser/pag
|
||||
export class SplitMergeComponent implements OnInit, OnDestroy {
|
||||
|
||||
public loading: boolean = false
|
||||
|
||||
public previewUrls: string[] = []
|
||||
|
||||
public delete_source_documents: boolean = false
|
||||
|
||||
private previewDebounce$ = new Subject()
|
||||
|
||||
private previewSub: Subscription
|
||||
@@ -92,7 +95,7 @@ export class SplitMergeComponent implements OnInit, OnDestroy {
|
||||
save(preview: boolean = false) {
|
||||
this.loading = true
|
||||
this.previewUrls = []
|
||||
this.splitMergeService.executeSplitMerge(preview, false, SplitMergeMetadata.COPY_FIRST).subscribe(
|
||||
this.splitMergeService.executeSplitMerge(preview, this.delete_source_documents, SplitMergeMetadata.COPY_FIRST).subscribe(
|
||||
result => {
|
||||
console.log('API split_merge result:', result)
|
||||
this.loading = false
|
||||
|
||||
@@ -72,7 +72,6 @@ export class SplitMergeService {
|
||||
currentDocument.push({document: d.id, pages: (d as PaperlessDocumentPart).pages?.join(',')})
|
||||
}
|
||||
})
|
||||
console.log(split_merge_plan);
|
||||
|
||||
let request: SplitMergeRequest = {
|
||||
delete_source: delete_source,
|
||||
|
||||
Reference in new issue
Block a user