1
1
< div [id] ="pathString ">
2
- < table class ="primitive-field-container " [ngSwitch] ="schema.componentType ">
3
- < tr [ngClass] ="errorClass ">
4
- < ng-template #errorsTooltipTemplate >
5
- < ul class ="tooltip-left-align ">
6
- < li *ngFor ="let error of internalErrors ">
7
- {{error.message}}
8
- </ li >
9
- < li *ngFor ="let error of externalErrors ">
10
- {{error.message}}
11
- </ li >
12
- </ ul >
13
- </ ng-template >
14
- < td *ngIf ="!jsonPatches[0]; else patchTemplate " class ="value-container " [ngClass] ="disabledClass " [tooltip] ="errorsTooltipTemplate "
15
- [isDisabled] ="!hasErrors() " placement ="{{tooltipPosition}} " container ="body ">
16
- < div *ngSwitchCase ="'string' ">
17
- < string-input [pathString] ="pathString " [value] ="value " (valueChange) ="onValueChange($event) " [disabled] ="disabled " [tabIndex] ="tabIndex "
18
- [latexPreviewEnabled] ="schema.latexPreviewEnabled " [placeholder] ="schema.title " (blur) ="onBlur() " (onKeypress) ="onKeypress($event) ">
19
- </ string-input >
20
- </ div >
21
- < div *ngSwitchCase ="'enum' ">
22
- < searchable-dropdown [pathString] ="pathString " [value] ="value " [placeholder] ="schema.title " [items] ="schema.enum " [shortcutMap] ="schema.enumShorcutMap "
23
- (onSelect) ="onSearchableDropdownSelect($event) " [tabIndex] ="tabIndex " (onBlur) ="onBlur() "> </ searchable-dropdown >
24
- </ div >
25
- < div *ngSwitchCase ="'autocomplete' ">
26
- < autocomplete-input [pathString] ="pathString " [value] ="value " [path] ="path " [autocompletionConfig] ="schema.autocompletionConfig "
27
- (onBlur) ="onBlur() " (onKeypress) ="onKeypress($event) " (onValueChange) ="onValueChange($event) " [placeholder] ="schema.title "
28
- [tabIndex] ="tabIndex "> </ autocomplete-input >
29
- </ div >
30
- < div *ngSwitchCase ="'integer' ">
31
- < input type ="number " [(ngModel)] ="value " [tabindex] ="tabIndex " [attr.data-path] ="pathString " (blur) ="onBlur() " (keypress) ="onKeypress($event) "
32
- [placeholder] ="schema.title ">
33
- </ div >
34
- < div *ngSwitchCase ="'boolean' ">
35
- < input type ="checkbox " [(ngModel)] ="value " (ngModelChange) ="onBlur() " [placeholder] ="schema.title ">
36
- </ div >
37
- < div *ngSwitchDefault >
38
- ## Not recognized type: {{valueType}}
39
- </ div >
40
- </ td >
41
- < td class ="link-button-container ">
42
- < a *ngIf ="schema.linkBuilder " class ="no-decoration " target ="_blank " [href] ="schema.linkBuilder(value) ">
2
+ < table class ="primitive-field-container " [ngSwitch] ="schema.componentType ">
3
+ < tr [ngClass] ="errorClass ">
4
+ < ng-template #errorsTooltipTemplate >
5
+ < ul class ="tooltip-left-align ">
6
+ < li *ngFor ="let error of internalErrors ">
7
+ {{error.message}}
8
+ </ li >
9
+ < li *ngFor ="let error of externalErrors ">
10
+ {{error.message}}
11
+ </ li >
12
+ </ ul >
13
+ </ ng-template >
14
+ < td *ngIf ="!jsonPatches[0]; else patchTemplate " class ="value-container " [ngClass] ="disabledClass " [tooltip] ="errorsTooltipTemplate "
15
+ [isDisabled] ="!hasErrors() " placement ="{{tooltipPosition}} " container ="body ">
16
+ < div *ngSwitchCase ="'string' ">
17
+ < string-input [pathString] ="pathString " [value] ="value " (valueChange) ="onValueChange($event) " [disabled] ="disabled " [tabIndex] ="tabIndex "
18
+ [latexPreviewEnabled] ="schema.latexPreviewEnabled " [placeholder] ="schema.title " (blur) ="onBlur() " (onKeypress) ="onKeypress($event) ">
19
+ </ string-input >
20
+ </ div >
21
+ < div *ngSwitchCase ="'enum' ">
22
+ < searchable-dropdown [pathString] ="pathString " [value] ="value " [placeholder] ="schema.title " [items] ="schema.enum " [shortcutMap] ="schema.enumShorcutMap "
23
+ (onSelect) ="onSearchableDropdownSelect($event) " [tabIndex] ="tabIndex " (onBlur) ="onBlur() "> </ searchable-dropdown >
24
+ </ div >
25
+ < div *ngSwitchCase ="'autocomplete' ">
26
+ < autocomplete-input [pathString] ="pathString " [value] ="value " [path] ="path " [autocompletionConfig] ="schema.autocompletionConfig "
27
+ (onBlur) ="onBlur() " (onKeypress) ="onKeypress($event) " (onValueChange) ="onValueChange($event) " [placeholder] ="schema.title "
28
+ [tabIndex] ="tabIndex "> </ autocomplete-input >
29
+ </ div >
30
+ < div *ngSwitchCase ="'integer' ">
31
+ < input type ="number " [(ngModel)] ="value " [tabindex] ="tabIndex " [attr.data-path] ="pathString " (blur) ="onBlur() " (keypress) ="onKeypress($event) "
32
+ [placeholder] ="schema.title ">
33
+ </ div >
34
+ < div *ngSwitchCase ="'boolean' ">
35
+ < input type ="checkbox " [(ngModel)] ="value " (ngModelChange) ="onBlur() " [placeholder] ="schema.title ">
36
+ </ div >
37
+ < div *ngSwitchDefault >
38
+ ## Not recognized type: {{valueType}}
39
+ </ div >
40
+ </ td >
41
+ < td class ="link-button-container ">
42
+ < a *ngIf ="schema.linkBuilder " class ="no-decoration " target ="_blank " [href] ="schema.linkBuilder(value) ">
43
43
< i class ="fa fa-link " aria-hidden ="true "> </ i >
44
44
</ a >
45
- < a *ngIf ="!schema.linkBuilder && schema.format === 'url' " class ="no-decoration " target ="_blank " [href] ="value ">
45
+ < a *ngIf ="!schema.linkBuilder && schema.format === 'url' " class ="no-decoration " target ="_blank " [href] ="value ">
46
46
< i class ="fa fa-link " aria-hidden ="true "> </ i >
47
47
</ a >
48
- </ td >
49
- </ tr >
50
- </ table >
48
+ </ td >
49
+ </ tr >
50
+ </ table >
51
51
</ div >
52
52
53
53
< ng-template #patchTemplate >
54
- < button class ="btn btn-default btn-merge orange-left-border " type ="button " [popover] ="mergePopover " popoverTitle ="Merge " container ="body ">
54
+ < button class ="btn btn-default btn-merge orange-left-border " type ="button " [popover] ="mergePopover " [popoverContext] ="{currentValue: value, patchValue: jsonPatches[0].value} "
55
+ popoverTitle ="Merge " container ="body ">
55
56
{{value}} < i class ="fa fa-bolt "> </ i >
56
57
</ button >
57
58
</ ng-template >
58
59
59
- < ng-template #mergePopover >
60
- < text-diff [currentText] ="value " [newText] ="jsonPatches[0].value "> </ text-diff >
60
+ < ng-template let-currentValue =" currentValue " let-patchValue =" patchValue " #mergePopover >
61
+ < text-diff [currentText] ="currentValue " [newText] ="patchValue "> </ text-diff >
61
62
< patch-actions [patch] ="jsonPatches[0] " [addActionEnabled] ="isPathToAnIndex "> </ patch-actions >
62
63
</ ng-template >
0 commit comments