Skip to content

Commit e5083e1

Browse files
committed
upgrade ngx-bootstrap, typescript, @angular/cli
* Closes inveniosoftware-contrib#348 * Closes inveniosoftware-contrib#398
1 parent 8ce2c7d commit e5083e1

File tree

2 files changed

+52
-51
lines changed

2 files changed

+52
-51
lines changed

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@
5151
"lodash": "4.17.2",
5252
"mousetrap": "^1.6.0",
5353
"ng2-slide-toggle": "^1.0.0",
54-
"ngx-bootstrap": "2.0.0-beta.1"
54+
"ngx-bootstrap": "2.0.0-beta.7"
5555
},
5656
"devDependencies": {
57-
"@angular/cli": "1.0.0",
57+
"@angular/cli": "1.4.5",
5858
"@angular/common": "^4.0.0",
5959
"@angular/compiler": "^4.0.0",
6060
"@angular/compiler-cli": "^4.0.0",
@@ -100,7 +100,7 @@
100100
"ts-node": "1.2.1",
101101
"tslint": "^4.3.0",
102102
"typedoc": "^0.5.5",
103-
"typescript": "~2.2.0",
103+
"typescript": "~2.3.0",
104104
"util-deprecate": "^1.0.2",
105105
"zone.js": "^0.8.4"
106106
},
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,63 @@
11
<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)">
4343
<i class="fa fa-link" aria-hidden="true"></i>
4444
</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">
4646
<i class="fa fa-link" aria-hidden="true"></i>
4747
</a>
48-
</td>
49-
</tr>
50-
</table>
48+
</td>
49+
</tr>
50+
</table>
5151
</div>
5252

5353
<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">
5556
{{value}} <i class="fa fa-bolt"></i>
5657
</button>
5758
</ng-template>
5859

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>
6162
<patch-actions [patch]="jsonPatches[0]" [addActionEnabled]="isPathToAnIndex"></patch-actions>
6263
</ng-template>

0 commit comments

Comments
 (0)