@duetds/cli 4.0.21 → 4.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -3
- package/templates/angular/16.2.0/.browserlistrc +16 -0
- package/templates/angular/16.2.0/.depcheckrc +2 -0
- package/templates/angular/16.2.0/.editorconfig +16 -0
- package/templates/angular/16.2.0/.eslintrc.json +51 -0
- package/templates/angular/16.2.0/.prettierignore +3 -0
- package/templates/angular/16.2.0/.prettierrc +14 -0
- package/templates/angular/16.2.0/LICENSE.md +29 -0
- package/templates/angular/16.2.0/README.md +32 -0
- package/templates/angular/16.2.0/angular.json +133 -0
- package/templates/angular/16.2.0/config/jest.base.ts +17 -0
- package/templates/angular/16.2.0/config/jest.setup.ts +24 -0
- package/templates/angular/16.2.0/package.file +59 -0
- package/templates/angular/16.2.0/playwright.config.ts +26 -0
- package/templates/angular/16.2.0/src/app/agreement.model.ts +3 -0
- package/templates/angular/16.2.0/src/app/app-routing.module.ts +11 -0
- package/templates/angular/16.2.0/src/app/app.component.html +5 -0
- package/templates/angular/16.2.0/src/app/app.component.scss +0 -0
- package/templates/angular/16.2.0/src/app/app.component.ts +10 -0
- package/templates/angular/16.2.0/src/app/app.module.ts +21 -0
- package/templates/angular/16.2.0/src/app/currency-formatter.service.ts +12 -0
- package/templates/angular/16.2.0/src/app/footer/footer.component.html +22 -0
- package/templates/angular/16.2.0/src/app/footer/footer.component.scss +0 -0
- package/templates/angular/16.2.0/src/app/footer/footer.component.ts +10 -0
- package/templates/angular/16.2.0/src/app/header/header.component.html +1 -0
- package/templates/angular/16.2.0/src/app/header/header.component.scss +0 -0
- package/templates/angular/16.2.0/src/app/header/header.component.ts +10 -0
- package/templates/angular/16.2.0/src/app/index-page/index-page.component.html +49 -0
- package/templates/angular/16.2.0/src/app/index-page/index-page.component.scss +0 -0
- package/templates/angular/16.2.0/src/app/index-page/index-page.component.ts +61 -0
- package/templates/angular/16.2.0/src/app/investment-amount/investment-amount.component.html +85 -0
- package/templates/angular/16.2.0/src/app/investment-amount/investment-amount.component.scss +0 -0
- package/templates/angular/16.2.0/src/app/investment-amount/investment-amount.component.ts +41 -0
- package/templates/angular/16.2.0/src/app/investment-origin/investment-origin.component.html +12 -0
- package/templates/angular/16.2.0/src/app/investment-origin/investment-origin.component.scss +0 -0
- package/templates/angular/16.2.0/src/app/investment-origin/investment-origin.component.ts +44 -0
- package/templates/angular/16.2.0/src/app/summary/summary.component.html +74 -0
- package/templates/angular/16.2.0/src/app/summary/summary.component.scss +0 -0
- package/templates/angular/16.2.0/src/app/summary/summary.component.ts +16 -0
- package/templates/angular/16.2.0/src/assets/.gitkeep +0 -0
- package/templates/angular/16.2.0/src/assets/img/android-chrome-192x192.png +0 -0
- package/templates/angular/16.2.0/src/assets/img/apple-touch-icon-180x180.png +0 -0
- package/templates/angular/16.2.0/src/assets/img/splash-screen-icon-512x512.png +0 -0
- package/templates/angular/16.2.0/src/environments/environment.prod.ts +3 -0
- package/templates/angular/16.2.0/src/environments/environment.ts +16 -0
- package/templates/angular/16.2.0/src/favicon.ico +0 -0
- package/templates/angular/16.2.0/src/index.html +24 -0
- package/templates/angular/16.2.0/src/main.ts +19 -0
- package/templates/angular/16.2.0/src/manifest.json +19 -0
- package/templates/angular/16.2.0/src/polyfills.ts +62 -0
- package/templates/angular/16.2.0/src/styles.scss +3 -0
- package/templates/angular/16.2.0/src/tests/app.test.ts +13 -0
- package/templates/angular/16.2.0/src/tests/playwright/playwright.test.ts +54 -0
- package/templates/angular/16.2.0/src/tests/playwright/playwright.test.ts-snapshots/angular-1-chromium-darwin.png +0 -0
- package/templates/angular/16.2.0/src/tests/playwright/playwright.test.ts-snapshots/angular-2-chromium-darwin.png +0 -0
- package/templates/angular/16.2.0/src/tests/playwright/playwright.test.ts-snapshots/angular-3-chromium-darwin.png +0 -0
- package/templates/angular/16.2.0/src/tests/playwright/playwright.test.ts-snapshots/angular-4-chromium-darwin.png +0 -0
- package/templates/angular/16.2.0/src/tests/playwright/playwright.test.ts-snapshots/angular-5-chromium-darwin.png +0 -0
- package/templates/angular/16.2.0/src/tests/playwright/playwright.test.ts-snapshots/code-chromium-darwin.json +16 -0
- package/templates/angular/16.2.0/src/utils/string.utils.ts +1 -0
- package/templates/angular/16.2.0/tsconfig.app.json +9 -0
- package/templates/angular/16.2.0/tsconfig.base.json +17 -0
- package/templates/angular/16.2.0/tsconfig.json +8 -0
- package/templates/angular/16.2.0/tsconfig.spec.json +15 -0
- package/templates/angular/17.0.0/.browserlistrc +16 -0
- package/templates/angular/17.0.0/.depcheckrc +2 -0
- package/templates/angular/17.0.0/.editorconfig +16 -0
- package/templates/angular/17.0.0/.eslintrc.json +52 -0
- package/templates/angular/17.0.0/.prettierignore +3 -0
- package/templates/angular/17.0.0/.prettierrc +14 -0
- package/templates/angular/17.0.0/LICENSE.md +29 -0
- package/templates/angular/17.0.0/README.md +32 -0
- package/templates/angular/17.0.0/angular.json +138 -0
- package/templates/angular/17.0.0/config/jest.base.ts +17 -0
- package/templates/angular/17.0.0/config/jest.setup.ts +24 -0
- package/templates/angular/17.0.0/package.file +59 -0
- package/templates/angular/17.0.0/playwright.config.ts +26 -0
- package/templates/angular/17.0.0/src/app/agreement.model.ts +3 -0
- package/templates/angular/17.0.0/src/app/app-routing.module.ts +11 -0
- package/templates/angular/17.0.0/src/app/app.component.html +5 -0
- package/templates/angular/17.0.0/src/app/app.component.scss +0 -0
- package/templates/angular/17.0.0/src/app/app.component.ts +10 -0
- package/templates/angular/17.0.0/src/app/app.module.ts +21 -0
- package/templates/angular/17.0.0/src/app/currency-formatter.service.ts +12 -0
- package/templates/angular/17.0.0/src/app/footer/footer.component.html +22 -0
- package/templates/angular/17.0.0/src/app/footer/footer.component.scss +0 -0
- package/templates/angular/17.0.0/src/app/footer/footer.component.ts +10 -0
- package/templates/angular/17.0.0/src/app/header/header.component.html +1 -0
- package/templates/angular/17.0.0/src/app/header/header.component.scss +0 -0
- package/templates/angular/17.0.0/src/app/header/header.component.ts +10 -0
- package/templates/angular/17.0.0/src/app/index-page/index-page.component.html +49 -0
- package/templates/angular/17.0.0/src/app/index-page/index-page.component.scss +0 -0
- package/templates/angular/17.0.0/src/app/index-page/index-page.component.ts +61 -0
- package/templates/angular/17.0.0/src/app/investment-amount/investment-amount.component.html +85 -0
- package/templates/angular/17.0.0/src/app/investment-amount/investment-amount.component.scss +0 -0
- package/templates/angular/17.0.0/src/app/investment-amount/investment-amount.component.ts +41 -0
- package/templates/angular/17.0.0/src/app/investment-origin/investment-origin.component.html +12 -0
- package/templates/angular/17.0.0/src/app/investment-origin/investment-origin.component.scss +0 -0
- package/templates/angular/17.0.0/src/app/investment-origin/investment-origin.component.ts +44 -0
- package/templates/angular/17.0.0/src/app/summary/summary.component.html +74 -0
- package/templates/angular/17.0.0/src/app/summary/summary.component.scss +0 -0
- package/templates/angular/17.0.0/src/app/summary/summary.component.ts +16 -0
- package/templates/angular/17.0.0/src/assets/.gitkeep +0 -0
- package/templates/angular/17.0.0/src/assets/img/android-chrome-192x192.png +0 -0
- package/templates/angular/17.0.0/src/assets/img/apple-touch-icon-180x180.png +0 -0
- package/templates/angular/17.0.0/src/assets/img/splash-screen-icon-512x512.png +0 -0
- package/templates/angular/17.0.0/src/environments/environment.prod.ts +3 -0
- package/templates/angular/17.0.0/src/environments/environment.ts +16 -0
- package/templates/angular/17.0.0/src/favicon.ico +0 -0
- package/templates/angular/17.0.0/src/index.html +24 -0
- package/templates/angular/17.0.0/src/main.ts +19 -0
- package/templates/angular/17.0.0/src/manifest.json +19 -0
- package/templates/angular/17.0.0/src/polyfills.ts +62 -0
- package/templates/angular/17.0.0/src/styles.scss +3 -0
- package/templates/angular/17.0.0/src/tests/app.test.ts +13 -0
- package/templates/angular/17.0.0/src/tests/playwright/playwright.test.ts +54 -0
- package/templates/angular/17.0.0/src/tests/playwright/playwright.test.ts-snapshots/angular-1-chromium-darwin.png +0 -0
- package/templates/angular/17.0.0/src/tests/playwright/playwright.test.ts-snapshots/angular-2-chromium-darwin.png +0 -0
- package/templates/angular/17.0.0/src/tests/playwright/playwright.test.ts-snapshots/angular-3-chromium-darwin.png +0 -0
- package/templates/angular/17.0.0/src/tests/playwright/playwright.test.ts-snapshots/angular-4-chromium-darwin.png +0 -0
- package/templates/angular/17.0.0/src/tests/playwright/playwright.test.ts-snapshots/angular-5-chromium-darwin.png +0 -0
- package/templates/angular/17.0.0/src/tests/playwright/playwright.test.ts-snapshots/code-chromium-darwin.json +16 -0
- package/templates/angular/17.0.0/src/utils/string.utils.ts +1 -0
- package/templates/angular/17.0.0/tsconfig.app.json +9 -0
- package/templates/angular/17.0.0/tsconfig.base.json +17 -0
- package/templates/angular/17.0.0/tsconfig.json +9 -0
- package/templates/angular/17.0.0/tsconfig.spec.json +15 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Component } from "@angular/core"
|
|
2
|
+
import { FormBuilder, Validators } from "@angular/forms"
|
|
3
|
+
import { Agreement } from "../agreement.model"
|
|
4
|
+
|
|
5
|
+
import { currencyFormatFI } from "../../utils/string.utils"
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: "app-index-page",
|
|
9
|
+
templateUrl: "./index-page.component.html",
|
|
10
|
+
styleUrls: ["./index-page.component.scss"]
|
|
11
|
+
})
|
|
12
|
+
export class IndexPageComponent {
|
|
13
|
+
constructor(private formBuilder: FormBuilder) {}
|
|
14
|
+
|
|
15
|
+
currentStep = 0
|
|
16
|
+
completed = false
|
|
17
|
+
|
|
18
|
+
form = this.formBuilder.group({
|
|
19
|
+
investmentAmount: this.formBuilder.group({
|
|
20
|
+
agreement: [null, [Validators.required]],
|
|
21
|
+
additionalInvestment: 50
|
|
22
|
+
}),
|
|
23
|
+
investmentOrigin: this.formBuilder.group({
|
|
24
|
+
salary: false,
|
|
25
|
+
gift: false,
|
|
26
|
+
heritage: false,
|
|
27
|
+
entrepreneurialIncome: false,
|
|
28
|
+
assets: false,
|
|
29
|
+
otherIncome: false,
|
|
30
|
+
investment: false,
|
|
31
|
+
extras: null
|
|
32
|
+
})
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
agreements: Record<number, Agreement> = {
|
|
36
|
+
1: new Agreement("Vakuutus 1", 2500),
|
|
37
|
+
2: new Agreement("Vakuutus 2", 1000)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
get selectedAgreement() {
|
|
41
|
+
return this.agreements[this.form.value.investmentAmount.agreement ?? 1]
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
formatNumber(value: number) {
|
|
45
|
+
return currencyFormatFI.format(value)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
handleStepChange(event: CustomEvent) {
|
|
49
|
+
this.currentStep = event.detail.toStep
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
handleNextClick(event: Event) {
|
|
53
|
+
event.preventDefault()
|
|
54
|
+
this.currentStep++
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
handleSubmit(event: Event) {
|
|
58
|
+
event.preventDefault()
|
|
59
|
+
this.completed = true
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<ng-container [formGroup]="form">
|
|
2
|
+
<duet-select
|
|
3
|
+
expand
|
|
4
|
+
label="Valitse sopimus"
|
|
5
|
+
placeholder="Valitse…"
|
|
6
|
+
[items]="agreementOptions"
|
|
7
|
+
>
|
|
8
|
+
</duet-select>
|
|
9
|
+
<duet-table variation="plain" *ngIf="selectedAgreement">
|
|
10
|
+
<table>
|
|
11
|
+
<thead>
|
|
12
|
+
<tr>
|
|
13
|
+
<th>Sijoituskohde</th>
|
|
14
|
+
<th class="duet-text-right">Osuus</th>
|
|
15
|
+
</tr>
|
|
16
|
+
</thead>
|
|
17
|
+
<tbody>
|
|
18
|
+
<tr>
|
|
19
|
+
<td>
|
|
20
|
+
<duet-button
|
|
21
|
+
variation="plain"
|
|
22
|
+
margin="none"
|
|
23
|
+
padding="none"
|
|
24
|
+
url="https://www.duetds.com/assets/downloads/localtapiola-brand-guidelines.pdf"
|
|
25
|
+
external
|
|
26
|
+
>
|
|
27
|
+
Kohde 1<duet-spacer size="xx-small" direction="horizontal"></duet-spacer>
|
|
28
|
+
<duet-visually-hidden>, avautuu uuteen ikkunaan</duet-visually-hidden>
|
|
29
|
+
</duet-button>
|
|
30
|
+
</td>
|
|
31
|
+
<td class="duet-text-right">25%</td>
|
|
32
|
+
</tr>
|
|
33
|
+
<tr>
|
|
34
|
+
<td>
|
|
35
|
+
<duet-button
|
|
36
|
+
variation="plain"
|
|
37
|
+
margin="none"
|
|
38
|
+
padding="none"
|
|
39
|
+
url="https://www.duetds.com/assets/downloads/localtapiola-brand-guidelines.pdf"
|
|
40
|
+
external
|
|
41
|
+
>
|
|
42
|
+
Kohde 2<duet-spacer size="xx-small" direction="horizontal"></duet-spacer>
|
|
43
|
+
<duet-visually-hidden>, avautuu uuteen ikkunaan</duet-visually-hidden>
|
|
44
|
+
</duet-button>
|
|
45
|
+
</td>
|
|
46
|
+
<td class="duet-text-right">25%</td>
|
|
47
|
+
</tr>
|
|
48
|
+
<tr>
|
|
49
|
+
<td>
|
|
50
|
+
<duet-button
|
|
51
|
+
variation="plain"
|
|
52
|
+
margin="none"
|
|
53
|
+
padding="none"
|
|
54
|
+
url="https://www.duetds.com/assets/downloads/localtapiola-brand-guidelines.pdf"
|
|
55
|
+
external
|
|
56
|
+
>
|
|
57
|
+
Kohde 3<duet-spacer size="xx-small" direction="horizontal"></duet-spacer>
|
|
58
|
+
<duet-visually-hidden>, avautuu uuteen ikkunaan</duet-visually-hidden>
|
|
59
|
+
</duet-button>
|
|
60
|
+
</td>
|
|
61
|
+
<td class="duet-text-right">50%</td>
|
|
62
|
+
</tr>
|
|
63
|
+
</tbody>
|
|
64
|
+
<tfoot>
|
|
65
|
+
<tr>
|
|
66
|
+
<td class="duet-font-weight-semi-bold">Yhteisarvo</td>
|
|
67
|
+
<td class="duet-text-right duet-font-weight-semi-bold duet-font-size-large">
|
|
68
|
+
{{ formatter.format(selectedAgreement.price) }}
|
|
69
|
+
</td>
|
|
70
|
+
</tr>
|
|
71
|
+
</tfoot>
|
|
72
|
+
</table>
|
|
73
|
+
</duet-table>
|
|
74
|
+
<duet-spacer></duet-spacer>
|
|
75
|
+
<duet-card variation="plain" background="gray-lighter">
|
|
76
|
+
<duet-input
|
|
77
|
+
numeric-keyboard
|
|
78
|
+
expand
|
|
79
|
+
label="Syötä summa"
|
|
80
|
+
placeholder="50"
|
|
81
|
+
icon="form-money"
|
|
82
|
+
type="number"
|
|
83
|
+
></duet-input>
|
|
84
|
+
</duet-card>
|
|
85
|
+
</ng-container>
|
|
File without changes
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Component, OnInit, Input, ElementRef } from "@angular/core"
|
|
2
|
+
import { FormGroup } from "@angular/forms"
|
|
3
|
+
import { Agreement } from "../agreement.model"
|
|
4
|
+
import { CurrencyFormatterService } from "../currency-formatter.service"
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: "app-investment-amount",
|
|
8
|
+
templateUrl: "./investment-amount.component.html",
|
|
9
|
+
styleUrls: ["./investment-amount.component.scss"]
|
|
10
|
+
})
|
|
11
|
+
export class InvestmentAmountComponent implements OnInit {
|
|
12
|
+
@Input() agreements: Record<number, Agreement>
|
|
13
|
+
@Input() form: FormGroup
|
|
14
|
+
|
|
15
|
+
constructor(public formatter: CurrencyFormatterService, private myElement: ElementRef) {}
|
|
16
|
+
|
|
17
|
+
ngOnInit(): void {
|
|
18
|
+
const element = this.myElement.nativeElement as Element
|
|
19
|
+
const select = element.querySelector("duet-select") as HTMLDuetSelectElement
|
|
20
|
+
const input = element.querySelector("duet-input") as HTMLDuetInputElement
|
|
21
|
+
select.addEventListener("duetChange", (e: CustomEvent<{value: number}>) => {
|
|
22
|
+
this.form.controls['agreement'].setValue(e.detail.value)
|
|
23
|
+
})
|
|
24
|
+
input.addEventListener("duetChange", (e: CustomEvent<{value: string}>) => {
|
|
25
|
+
this.form.controls['additionalInvestment'].setValue(Number(e.detail.value))
|
|
26
|
+
})
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
get selectedAgreement() {
|
|
30
|
+
return this.agreements[this.form.value.agreement]
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
get agreementOptions() {
|
|
34
|
+
return Object.entries(this.agreements).map(([value, { label, price }]) => {
|
|
35
|
+
return {
|
|
36
|
+
value,
|
|
37
|
+
label: `${label} - ${this.formatter.format(price)}`
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<ng-container [formGroup]="form">
|
|
2
|
+
<duet-checkbox label="Valinta 1"></duet-checkbox>
|
|
3
|
+
<duet-checkbox label="Valinta 2"></duet-checkbox>
|
|
4
|
+
<duet-checkbox label="Valinta 3"></duet-checkbox>
|
|
5
|
+
<duet-checkbox label="Valinta 4"></duet-checkbox>
|
|
6
|
+
<duet-checkbox label="Valinta 5"></duet-checkbox>
|
|
7
|
+
<duet-checkbox label="Valinta 6"></duet-checkbox>
|
|
8
|
+
<duet-checkbox label="Muu, mikä?" (duetChange)="handleExtrasChange($event)"></duet-checkbox>
|
|
9
|
+
<div *ngIf="hasExtras">
|
|
10
|
+
<duet-input label="Kerro sijoitettavien varojen muu alkuperä" label-hidden (duetChange)="handleExtrasValueChange($event)"></duet-input>
|
|
11
|
+
</div>
|
|
12
|
+
</ng-container>
|
|
File without changes
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Component, OnInit, Input, ElementRef } from "@angular/core"
|
|
2
|
+
import { FormGroup } from "@angular/forms"
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: "app-investment-origin",
|
|
6
|
+
templateUrl: "./investment-origin.component.html",
|
|
7
|
+
styleUrls: ["./investment-origin.component.scss"]
|
|
8
|
+
})
|
|
9
|
+
export class InvestmentOriginComponent implements OnInit {
|
|
10
|
+
@Input() form: FormGroup
|
|
11
|
+
hasExtras = false
|
|
12
|
+
extrasValue = ""
|
|
13
|
+
|
|
14
|
+
constructor(private myElement: ElementRef) {}
|
|
15
|
+
|
|
16
|
+
ngOnInit(): void {
|
|
17
|
+
const element = this.myElement.nativeElement as Element
|
|
18
|
+
function listenCheckboxEvents(form: FormGroup, selector: string, control: string) {
|
|
19
|
+
const checkbox = element.querySelector(`duet-checkbox[label='${selector}']`) as HTMLDuetSelectElement
|
|
20
|
+
checkbox.addEventListener("duetChange", (e: CustomEvent<{checked: boolean}>) => {
|
|
21
|
+
form.controls[control].setValue(e.detail.checked)
|
|
22
|
+
})
|
|
23
|
+
}
|
|
24
|
+
listenCheckboxEvents(this.form, 'Valinta 1', 'salary')
|
|
25
|
+
listenCheckboxEvents(this.form, 'Valinta 2', 'gift')
|
|
26
|
+
listenCheckboxEvents(this.form, 'Valinta 3', 'heritage')
|
|
27
|
+
listenCheckboxEvents(this.form, 'Valinta 4', 'entrepreneurialIncome')
|
|
28
|
+
listenCheckboxEvents(this.form, 'Valinta 5', 'assets')
|
|
29
|
+
listenCheckboxEvents(this.form, 'Valinta 6', 'otherIncome')
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
handleExtrasChange(event: CustomEvent) {
|
|
33
|
+
this.hasExtras = event.detail.checked
|
|
34
|
+
|
|
35
|
+
if (!event.detail.checked) {
|
|
36
|
+
this.form.get("extras").setValue(null)
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
handleExtrasValueChange(event: CustomEvent) {
|
|
41
|
+
this.extrasValue = event.detail.value
|
|
42
|
+
this.form.get("extras").setValue(this.extrasValue)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<ng-container *ngIf="agreement">
|
|
2
|
+
<duet-input expand disabled label="Sopimus" [value]="agreement.label"></duet-input>
|
|
3
|
+
<duet-spacer></duet-spacer>
|
|
4
|
+
<duet-paragraph>Valitsemasi vaihtoehto jakautuu seuraavasti:</duet-paragraph>
|
|
5
|
+
<duet-table variation="plain">
|
|
6
|
+
<table>
|
|
7
|
+
<thead>
|
|
8
|
+
<tr>
|
|
9
|
+
<th>Sijoituskohde</th>
|
|
10
|
+
<th>Osuus</th>
|
|
11
|
+
<th class="duet-text-right">Summa</th>
|
|
12
|
+
</tr>
|
|
13
|
+
</thead>
|
|
14
|
+
<tbody>
|
|
15
|
+
<tr>
|
|
16
|
+
<td>
|
|
17
|
+
<duet-button
|
|
18
|
+
variation="plain"
|
|
19
|
+
margin="none"
|
|
20
|
+
padding="none"
|
|
21
|
+
url="https://www.duetds.com/assets/downloads/localtapiola-brand-guidelines.pdf"
|
|
22
|
+
external
|
|
23
|
+
>
|
|
24
|
+
Kohde 1<duet-spacer size="xx-small" direction="horizontal"></duet-spacer>
|
|
25
|
+
<duet-visually-hidden>, avautuu uuteen ikkunaan</duet-visually-hidden>
|
|
26
|
+
</duet-button>
|
|
27
|
+
</td>
|
|
28
|
+
<td>25%</td>
|
|
29
|
+
<td class="duet-text-right">{{ formatter.format(agreement.price * 0.25) }}</td>
|
|
30
|
+
</tr>
|
|
31
|
+
<tr>
|
|
32
|
+
<td>
|
|
33
|
+
<duet-button
|
|
34
|
+
variation="plain"
|
|
35
|
+
margin="none"
|
|
36
|
+
padding="none"
|
|
37
|
+
url="https://www.duetds.com/assets/downloads/localtapiola-brand-guidelines.pdf"
|
|
38
|
+
external
|
|
39
|
+
>
|
|
40
|
+
Kohde 2<duet-spacer size="xx-small" direction="horizontal"></duet-spacer>
|
|
41
|
+
<duet-visually-hidden>, avautuu uuteen ikkunaan</duet-visually-hidden>
|
|
42
|
+
</duet-button>
|
|
43
|
+
</td>
|
|
44
|
+
<td>25%</td>
|
|
45
|
+
<td class="duet-text-right">{{ formatter.format(agreement.price * 0.25) }}</td>
|
|
46
|
+
</tr>
|
|
47
|
+
<tr>
|
|
48
|
+
<td>
|
|
49
|
+
<duet-button
|
|
50
|
+
variation="plain"
|
|
51
|
+
margin="none"
|
|
52
|
+
padding="none"
|
|
53
|
+
url="https://www.duetds.com/assets/downloads/localtapiola-brand-guidelines.pdf"
|
|
54
|
+
external
|
|
55
|
+
>
|
|
56
|
+
Kohde 3<duet-spacer size="xx-small" direction="horizontal"></duet-spacer>
|
|
57
|
+
<duet-visually-hidden>, avautuu uuteen ikkunaan</duet-visually-hidden>
|
|
58
|
+
</duet-button>
|
|
59
|
+
</td>
|
|
60
|
+
<td>50%</td>
|
|
61
|
+
<td class="duet-text-right">{{ formatter.format(agreement.price * 0.5) }}</td>
|
|
62
|
+
</tr>
|
|
63
|
+
</tbody>
|
|
64
|
+
<tfoot>
|
|
65
|
+
<tr>
|
|
66
|
+
<td colspan="2" class="duet-font-weight-semi-bold">Sijoitettava summa</td>
|
|
67
|
+
<td class="duet-text-right duet-font-weight-semi-bold duet-font-size-large">
|
|
68
|
+
{{ formatter.format(agreement.price) }}
|
|
69
|
+
</td>
|
|
70
|
+
</tr>
|
|
71
|
+
</tfoot>
|
|
72
|
+
</table>
|
|
73
|
+
</duet-table>
|
|
74
|
+
</ng-container>
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Component, OnInit, Input } from "@angular/core"
|
|
2
|
+
import { Agreement } from "../agreement.model"
|
|
3
|
+
import { CurrencyFormatterService } from "../currency-formatter.service"
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: "app-summary",
|
|
7
|
+
templateUrl: "./summary.component.html",
|
|
8
|
+
styleUrls: ["./summary.component.scss"]
|
|
9
|
+
})
|
|
10
|
+
export class SummaryComponent implements OnInit {
|
|
11
|
+
@Input() agreement: Agreement
|
|
12
|
+
|
|
13
|
+
constructor(public formatter: CurrencyFormatterService) {}
|
|
14
|
+
|
|
15
|
+
ngOnInit(): void {}
|
|
16
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// This file can be replaced during build by using the `fileReplacements` array.
|
|
2
|
+
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
|
|
3
|
+
// The list of file replacements can be found in `angular.json`.
|
|
4
|
+
|
|
5
|
+
export const environment = {
|
|
6
|
+
production: false
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* For easier debugging in development mode, you can import the following file
|
|
11
|
+
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
|
|
12
|
+
*
|
|
13
|
+
* This import should be commented out in production mode because it will have a negative impact
|
|
14
|
+
* on performance if an error is thrown.
|
|
15
|
+
*/
|
|
16
|
+
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
|
|
Binary file
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="fi" class="duet-sticky-footer duet-bg-gradient">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<base href="/" />
|
|
6
|
+
<title>LähiTapiola</title>
|
|
7
|
+
<meta name="author" content="LähiTapiola" />
|
|
8
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
|
9
|
+
<meta name="format-detection" content="telephone=no" />
|
|
10
|
+
<meta name="robots" content="noindex,nofollow" />
|
|
11
|
+
<link rel="apple-touch-icon" href="assets/img/apple-touch-icon-180x180.png" />
|
|
12
|
+
<link rel="manifest" href="manifest.json" />
|
|
13
|
+
<link
|
|
14
|
+
rel="stylesheet"
|
|
15
|
+
href="https://cdn.duetds.com/api/fonts/1.3.12/lib/localtapiola.css"
|
|
16
|
+
integrity="sha384-5JYmtSD7nykpUvSmTW1CHMoBDkBZUpUmG0vuh+NUVtZag3F75Kr7+/JU3J7JV6Wq"
|
|
17
|
+
crossorigin="anonymous"
|
|
18
|
+
/>
|
|
19
|
+
<link rel="icon" type="image/x-icon" href="favicon.ico" />
|
|
20
|
+
</head>
|
|
21
|
+
<body>
|
|
22
|
+
<app-root class="duet-sticky-body"></app-root>
|
|
23
|
+
</body>
|
|
24
|
+
</html>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { enableProdMode } from "@angular/core"
|
|
2
|
+
import { platformBrowserDynamic } from "@angular/platform-browser-dynamic"
|
|
3
|
+
import { applyPolyfills, defineCustomElements } from '@duetds/components/lib/loader'
|
|
4
|
+
|
|
5
|
+
import { AppModule } from "./app/app.module"
|
|
6
|
+
import { environment } from "./environments/environment"
|
|
7
|
+
|
|
8
|
+
if (environment.production) {
|
|
9
|
+
enableProdMode()
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Register Duet’s custom elements
|
|
13
|
+
applyPolyfills().then(() => {
|
|
14
|
+
defineCustomElements(window)
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
platformBrowserDynamic()
|
|
18
|
+
.bootstrapModule(AppModule)
|
|
19
|
+
.catch(err => console.error(err))
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"icons": [
|
|
3
|
+
{
|
|
4
|
+
"src": "assets/img/apple-touch-icon-180x180.png",
|
|
5
|
+
"sizes": "180x180",
|
|
6
|
+
"type": "image/png"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"src": "assets/img/android-chrome-192x192.png",
|
|
10
|
+
"sizes": "192x192",
|
|
11
|
+
"type": "image/png"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"src": "assets/img/splash-screen-icon-512x512.png",
|
|
15
|
+
"sizes": "512x512",
|
|
16
|
+
"type": "image/png"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file includes polyfills needed by Angular and is loaded before the app.
|
|
3
|
+
* You can add your own extra polyfills to this file.
|
|
4
|
+
*
|
|
5
|
+
* This file is divided into 2 sections:
|
|
6
|
+
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
|
|
7
|
+
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
|
|
8
|
+
* file.
|
|
9
|
+
*
|
|
10
|
+
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
|
|
11
|
+
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
|
|
12
|
+
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
|
|
13
|
+
*
|
|
14
|
+
* Learn more in https://angular.io/guide/browser-support
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/***************************************************************************************************
|
|
18
|
+
* BROWSER POLYFILLS
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
|
|
22
|
+
// import 'classlist.js'; // Run `npm install --save classlist.js`.
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Web Animations `@angular/platform-browser/animations`
|
|
26
|
+
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
|
|
27
|
+
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
|
|
28
|
+
*/
|
|
29
|
+
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* By default, zone.js will patch all possible macroTask and DomEvents
|
|
33
|
+
* user can disable parts of macroTask/DomEvents patch by setting following flags
|
|
34
|
+
* because those flags need to be set before `zone.js` being loaded, and webpack
|
|
35
|
+
* will put import in the top of bundle, so user need to create a separate file
|
|
36
|
+
* in this directory (for example: zone-flags.ts), and put the following flags
|
|
37
|
+
* into that file, and then add the following code before importing zone.js.
|
|
38
|
+
* import './zone-flags';
|
|
39
|
+
*
|
|
40
|
+
* The flags allowed in zone-flags.ts are listed here.
|
|
41
|
+
*
|
|
42
|
+
* The following flags will work for all browsers.
|
|
43
|
+
*
|
|
44
|
+
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
|
|
45
|
+
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
|
|
46
|
+
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
|
|
47
|
+
*
|
|
48
|
+
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
|
|
49
|
+
* with the following flag, it will bypass `zone.js` patch for IE/Edge
|
|
50
|
+
*
|
|
51
|
+
* (window as any).__Zone_enable_cross_context_check = true;
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
/***************************************************************************************************
|
|
56
|
+
* Zone JS is required by default for Angular itself.
|
|
57
|
+
*/
|
|
58
|
+
import "zone.js" // Included with Angular CLI.
|
|
59
|
+
|
|
60
|
+
/***************************************************************************************************
|
|
61
|
+
* APPLICATION IMPORTS
|
|
62
|
+
*/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {currencyFormatFI} from "../utils/string.utils"
|
|
2
|
+
|
|
3
|
+
describe('Example test of the jest setup running', () => {
|
|
4
|
+
test('formatter should format correctly', () => {
|
|
5
|
+
console.log(currencyFormatFI)
|
|
6
|
+
const formatStub = currencyFormatFI.format(12.90)
|
|
7
|
+
expect(formatStub).toBe("12,90 €")
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test('Should do another thing', () => {
|
|
11
|
+
// do something...
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { test, expect } from '@playwright/test';
|
|
2
|
+
|
|
3
|
+
test.use({
|
|
4
|
+
viewport: { width: 1800, height: 2500 },
|
|
5
|
+
bypassCSP: true,
|
|
6
|
+
deviceScaleFactor: 1,
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
test('angular test', async ({ page }, testInfo) => {
|
|
11
|
+
await page.waitForLoadState("networkidle") // This resolves after 'networkidle'
|
|
12
|
+
await page.waitForTimeout(1000 * testInfo.retry + 1)
|
|
13
|
+
await page.setViewportSize({ width: 1600, height: 1200 })
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
// initial loading
|
|
17
|
+
await page.goto("http://localhost:4200/");
|
|
18
|
+
await page.goto("http://localhost:4200/#/");
|
|
19
|
+
await page.locator('select');
|
|
20
|
+
expect(await page.screenshot()).toMatchSnapshot("angular_1.png", {maxDiffPixelRatio: 0.01});
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
// Select 2
|
|
24
|
+
await page.locator('select').selectOption('2');
|
|
25
|
+
await page.waitForLoadState("networkidle")
|
|
26
|
+
expect(await page.screenshot()).toMatchSnapshot("angular_2.png", {maxDiffPixelRatio: 0.01});
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
// Click input[type="number"]
|
|
30
|
+
await page.locator('input[type="number"]').click();
|
|
31
|
+
await page.locator('input[type="number"]').fill('500');
|
|
32
|
+
await page.locator('#step1').click();
|
|
33
|
+
await page.waitForLoadState("networkidle")
|
|
34
|
+
expect(await page.screenshot()).toMatchSnapshot("angular_3.png", {maxDiffPixelRatio: 0.01});
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
// summary loading
|
|
38
|
+
await page.locator('#step2').click();
|
|
39
|
+
await page.waitForLoadState("networkidle")
|
|
40
|
+
expect(await page.screenshot()).toMatchSnapshot("angular_4.png", {maxDiffPixelRatio: 0.01});
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
// summary displaying
|
|
44
|
+
await page.locator('#step3').click();
|
|
45
|
+
await page.waitForLoadState("networkidle") // This resolves after 'networkidle'
|
|
46
|
+
expect(await page.screenshot()).toMatchSnapshot("angular_5.png", {maxDiffPixelRatio: 0.01});
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
// Click code, store json
|
|
51
|
+
await page.locator('code').click();
|
|
52
|
+
expect(await page.textContent('code')).toMatchSnapshot('code.json');
|
|
53
|
+
|
|
54
|
+
});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"investmentAmount": {
|
|
3
|
+
"agreement": "2",
|
|
4
|
+
"additionalInvestment": 500
|
|
5
|
+
},
|
|
6
|
+
"investmentOrigin": {
|
|
7
|
+
"salary": false,
|
|
8
|
+
"gift": false,
|
|
9
|
+
"heritage": false,
|
|
10
|
+
"entrepreneurialIncome": false,
|
|
11
|
+
"assets": false,
|
|
12
|
+
"otherIncome": false,
|
|
13
|
+
"investment": false,
|
|
14
|
+
"extras": null
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const currencyFormatFI = new Intl.NumberFormat("fi-FI", { style: "currency", currency: "EUR" })
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compileOnSave": false,
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"esModuleInterop":true,
|
|
5
|
+
"baseUrl": "./",
|
|
6
|
+
"outDir": "./dist/out-tsc",
|
|
7
|
+
"sourceMap": true,
|
|
8
|
+
"declaration": false,
|
|
9
|
+
"downlevelIteration": true,
|
|
10
|
+
"experimentalDecorators": true,
|
|
11
|
+
"moduleResolution": "node",
|
|
12
|
+
"importHelpers": true,
|
|
13
|
+
"target": "es2015",
|
|
14
|
+
"module": "es2020",
|
|
15
|
+
"lib": ["es2018", "dom"]
|
|
16
|
+
}
|
|
17
|
+
}
|