-
Notifications
You must be signed in to change notification settings - Fork 552
Expand file tree
/
Copy pathdynamic-lookup-relation-modal.component.html
More file actions
105 lines (105 loc) · 4.66 KB
/
Copy pathdynamic-lookup-relation-modal.component.html
File metadata and controls
105 lines (105 loc) · 4.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<div class="modal-header">
<h4 class="modal-title" id="modal-title">{{ ('submission.sections.describe.relationship-lookup.title.' + relationshipOptions.relationshipType) | translate }}</h4>
<button type="button" [dsBtnDisabled]="isPending" class="btn-close" aria-label="Close button" aria-describedby="modal-title"
(click)="close()">
</button>
</div>
<div class="modal-body">
@if (!item || !collection || isSubmitting) {
<ds-loading></ds-loading>
}
@if (item && collection && !isSubmitting) {
<ul ngbNav #nav="ngbNav" class="nav-tabs">
<li ngbNavItem role="presentation">
<a ngbNavLink>{{'submission.sections.describe.relationship-lookup.search-tab.tab-title.' + relationshipOptions.relationshipType | translate : { count: (totalInternal$ | async)} }}</a>
<ng-template ngbNavContent>
<ds-dynamic-lookup-relation-search-tab
[selection$]="selection$"
[listId]="listId"
[relationship]="relationshipOptions"
[repeatable]="repeatable"
[context]="context"
[query]="query"
[hiddenQuery]="hiddenQuery"
[relationshipType]="relationshipType"
[isLeft]="isLeft"
[item]="item"
[isEditRelationship]="isEditRelationship"
[toRemove]="toRemove"
(selectObject)="select($event)"
(deselectObject)="deselect($event)"
(resultFound)="setTotalInternals($event.pageInfo.totalElements)"
class="d-block pt-3">
</ds-dynamic-lookup-relation-search-tab>
</ng-template>
</li>
@for (source of (externalSourcesRD$ | async); track source; let idx = $index) {
<li ngbNavItem role="presentation">
<a ngbNavLink>{{'submission.sections.describe.relationship-lookup.search-tab.tab-title.' + source.id | translate : { count: (totalExternal$ | async)?.[idx] } }}</a>
<ng-template ngbNavContent>
<ds-dynamic-lookup-relation-external-source-tab
[label]="label"
[listId]="listId"
[repeatable]="repeatable"
[item]="item"
[collection]="collection"
[relationship]="relationshipOptions"
[context]="context"
[query]="query"
[externalSource]="source"
(importedObject)="imported($event)"
class="d-block pt-3">
</ds-dynamic-lookup-relation-external-source-tab>
</ng-template>
</li>
}
@if (!isEditRelationship) {
<li ngbNavItem role="presentation">
<a ngbNavLink>{{'submission.sections.describe.relationship-lookup.selection-tab.tab-title' | translate : { count: (selection$ | async)?.length } }}</a>
<ng-template ngbNavContent>
<ds-dynamic-lookup-relation-selection-tab
[selection$]="selection$"
[listId]="listId"
[relationshipType]="relationshipOptions.relationshipType"
[repeatable]="repeatable"
[context]="context"
(selectObject)="select($event)"
(deselectObject)="deselect($event)"
class="d-block pt-3">
</ds-dynamic-lookup-relation-selection-tab>
</ng-template>
</li>
}
</ul>
<div [ngbNavOutlet]="nav"></div>
}
</div>
<div class="modal-footer">
<small>{{ ('submission.sections.describe.relationship-lookup.selected' | translate: {size: (selection$ | async)?.length || 0}) }}</small>
<div class="d-flex float-end space-children-mr">
<div class="close-button">
<button type="button" [dsBtnDisabled]="isPending || isSubmitting" class="btn btn-outline-secondary" (click)="close()">
{{ ('submission.sections.describe.relationship-lookup.close' | translate) }}</button>
</div>
@if (isEditRelationship) {
<button class="btn btn-danger discard"
[dsBtnDisabled]="(toAdd.length === 0 && toRemove.length === 0) || isPending || isSubmitting"
(click)="discardEv()">
<i class="fas fa-times"></i>
<span class="d-none d-sm-inline"> {{"item.edit.metadata.discard-button" | translate}}</span>
</button>
<button class="btn btn-primary submit"
[dsBtnDisabled]="(toAdd.length === 0 && toRemove.length === 0) || isPending || isSubmitting"
(click)="submitEv()">
@if (isPending) {
<span class="spinner-border spinner-border-sm me-1" role="status"
aria-hidden="true"></span>
}
@if (!isPending) {
<i class="fas fa-save"></i>
}
<span class="d-none d-sm-inline"> {{"item.edit.metadata.save-button" | translate}}</span>
</button>
}
</div>
</div>