@duetds/cli 3.0.18 → 3.0.19
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 +2 -2
- package/templates/angular/15.0.4/.browserlistrc +16 -0
- package/templates/angular/15.0.4/.depcheckrc +2 -0
- package/templates/angular/15.0.4/.editorconfig +16 -0
- package/templates/angular/15.0.4/.eslintrc.json +51 -0
- package/templates/angular/15.0.4/.github/workflows/deploy.yml +23 -0
- package/templates/angular/15.0.4/.github/workflows/encrypt.js +60 -0
- package/templates/angular/15.0.4/.github/workflows/login.template +150 -0
- package/templates/angular/15.0.4/.prettierignore +3 -0
- package/templates/angular/15.0.4/.prettierrc +14 -0
- package/templates/angular/15.0.4/LICENSE.md +29 -0
- package/templates/angular/15.0.4/README.md +32 -0
- package/templates/angular/15.0.4/angular.json +133 -0
- package/templates/angular/15.0.4/config/jest.base.ts +17 -0
- package/templates/angular/15.0.4/config/jest.setup.ts +24 -0
- package/templates/angular/15.0.4/package.file +59 -0
- package/templates/angular/15.0.4/playwright.config.ts +26 -0
- package/templates/angular/15.0.4/src/app/agreement.model.ts +3 -0
- package/templates/angular/15.0.4/src/app/app-routing.module.ts +11 -0
- package/templates/angular/15.0.4/src/app/app.component.html +5 -0
- package/templates/angular/15.0.4/src/app/app.component.scss +0 -0
- package/templates/angular/15.0.4/src/app/app.component.ts +10 -0
- package/templates/angular/15.0.4/src/app/app.module.ts +21 -0
- package/templates/angular/15.0.4/src/app/currency-formatter.service.ts +12 -0
- package/templates/angular/15.0.4/src/app/footer/footer.component.html +22 -0
- package/templates/angular/15.0.4/src/app/footer/footer.component.scss +0 -0
- package/templates/angular/15.0.4/src/app/footer/footer.component.ts +10 -0
- package/templates/angular/15.0.4/src/app/header/header.component.html +1 -0
- package/templates/angular/15.0.4/src/app/header/header.component.scss +0 -0
- package/templates/angular/15.0.4/src/app/header/header.component.ts +10 -0
- package/templates/angular/15.0.4/src/app/index-page/index-page.component.html +49 -0
- package/templates/angular/15.0.4/src/app/index-page/index-page.component.scss +0 -0
- package/templates/angular/15.0.4/src/app/index-page/index-page.component.ts +61 -0
- package/templates/angular/15.0.4/src/app/investment-amount/investment-amount.component.html +85 -0
- package/templates/angular/15.0.4/src/app/investment-amount/investment-amount.component.scss +0 -0
- package/templates/angular/15.0.4/src/app/investment-amount/investment-amount.component.ts +41 -0
- package/templates/angular/15.0.4/src/app/investment-origin/investment-origin.component.html +12 -0
- package/templates/angular/15.0.4/src/app/investment-origin/investment-origin.component.scss +0 -0
- package/templates/angular/15.0.4/src/app/investment-origin/investment-origin.component.ts +44 -0
- package/templates/angular/15.0.4/src/app/summary/summary.component.html +74 -0
- package/templates/angular/15.0.4/src/app/summary/summary.component.scss +0 -0
- package/templates/angular/15.0.4/src/app/summary/summary.component.ts +16 -0
- package/templates/angular/15.0.4/src/assets/.gitkeep +0 -0
- package/templates/angular/15.0.4/src/assets/img/android-chrome-192x192.png +0 -0
- package/templates/angular/15.0.4/src/assets/img/apple-touch-icon-180x180.png +0 -0
- package/templates/angular/15.0.4/src/assets/img/splash-screen-icon-512x512.png +0 -0
- package/templates/angular/15.0.4/src/environments/environment.prod.ts +3 -0
- package/templates/angular/15.0.4/src/environments/environment.ts +16 -0
- package/templates/angular/15.0.4/src/favicon.ico +0 -0
- package/templates/angular/15.0.4/src/index.html +24 -0
- package/templates/angular/15.0.4/src/main.ts +19 -0
- package/templates/angular/15.0.4/src/manifest.json +19 -0
- package/templates/angular/15.0.4/src/polyfills.ts +62 -0
- package/templates/angular/15.0.4/src/styles.scss +3 -0
- package/templates/angular/15.0.4/src/tests/app.test.ts +13 -0
- package/templates/angular/15.0.4/src/tests/playwright/playwright.test.ts +54 -0
- package/templates/angular/15.0.4/src/tests/playwright/playwright.test.ts-snapshots/angular-1-chromium-darwin.png +0 -0
- package/templates/angular/15.0.4/src/tests/playwright/playwright.test.ts-snapshots/angular-2-chromium-darwin.png +0 -0
- package/templates/angular/15.0.4/src/tests/playwright/playwright.test.ts-snapshots/angular-3-chromium-darwin.png +0 -0
- package/templates/angular/15.0.4/src/tests/playwright/playwright.test.ts-snapshots/angular-4-chromium-darwin.png +0 -0
- package/templates/angular/15.0.4/src/tests/playwright/playwright.test.ts-snapshots/angular-5-chromium-darwin.png +0 -0
- package/templates/angular/15.0.4/src/tests/playwright/playwright.test.ts-snapshots/code-chromium-darwin.json +16 -0
- package/templates/angular/15.0.4/src/utils/string.utils.ts +1 -0
- package/templates/angular/15.0.4/tsconfig.app.json +9 -0
- package/templates/angular/15.0.4/tsconfig.base.json +17 -0
- package/templates/angular/15.0.4/tsconfig.json +8 -0
- package/templates/angular/15.0.4/tsconfig.spec.json +15 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"newProjectRoot": "projects",
|
|
5
|
+
"projects": {
|
|
6
|
+
"duet-angular-template": {
|
|
7
|
+
"projectType": "application",
|
|
8
|
+
"schematics": {
|
|
9
|
+
"@schematics/angular:component": {
|
|
10
|
+
"style": "scss",
|
|
11
|
+
"skipTests": true
|
|
12
|
+
},
|
|
13
|
+
"@schematics/angular:class": {
|
|
14
|
+
"skipTests": true
|
|
15
|
+
},
|
|
16
|
+
"@schematics/angular:directive": {
|
|
17
|
+
"skipTests": true
|
|
18
|
+
},
|
|
19
|
+
"@schematics/angular:guard": {
|
|
20
|
+
"skipTests": true
|
|
21
|
+
},
|
|
22
|
+
"@schematics/angular:interceptor": {
|
|
23
|
+
"skipTests": true
|
|
24
|
+
},
|
|
25
|
+
"@schematics/angular:module": {
|
|
26
|
+
"skipTests": true
|
|
27
|
+
},
|
|
28
|
+
"@schematics/angular:pipe": {
|
|
29
|
+
"skipTests": true
|
|
30
|
+
},
|
|
31
|
+
"@schematics/angular:service": {
|
|
32
|
+
"skipTests": true
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"root": "",
|
|
36
|
+
"sourceRoot": "src",
|
|
37
|
+
"prefix": "app",
|
|
38
|
+
"architect": {
|
|
39
|
+
"build": {
|
|
40
|
+
"builder": "@angular-devkit/build-angular:browser",
|
|
41
|
+
"options": {
|
|
42
|
+
"outputPath": "dist/duet-angular-template",
|
|
43
|
+
"index": "src/index.html",
|
|
44
|
+
"main": "src/main.ts",
|
|
45
|
+
"polyfills": "src/polyfills.ts",
|
|
46
|
+
"tsConfig": "tsconfig.app.json",
|
|
47
|
+
"aot": true,
|
|
48
|
+
"assets": ["src/favicon.ico", "src/assets", "src/manifest.json"],
|
|
49
|
+
"styles": ["src/styles.scss"],
|
|
50
|
+
"scripts": []
|
|
51
|
+
},
|
|
52
|
+
"configurations": {
|
|
53
|
+
"production": {
|
|
54
|
+
"fileReplacements": [
|
|
55
|
+
{
|
|
56
|
+
"replace": "src/environments/environment.ts",
|
|
57
|
+
"with": "src/environments/environment.prod.ts"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"optimization": true,
|
|
61
|
+
"outputHashing": "all",
|
|
62
|
+
"sourceMap": false,
|
|
63
|
+
"extractCss": true,
|
|
64
|
+
"namedChunks": false,
|
|
65
|
+
"extractLicenses": true,
|
|
66
|
+
"vendorChunk": false,
|
|
67
|
+
"buildOptimizer": true,
|
|
68
|
+
"budgets": [
|
|
69
|
+
{
|
|
70
|
+
"type": "initial",
|
|
71
|
+
"maximumWarning": "2mb",
|
|
72
|
+
"maximumError": "5mb"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"type": "anyComponentStyle",
|
|
76
|
+
"maximumWarning": "6kb",
|
|
77
|
+
"maximumError": "10kb"
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
"development": {
|
|
82
|
+
"buildOptimizer": false,
|
|
83
|
+
"optimization": false,
|
|
84
|
+
"vendorChunk": true,
|
|
85
|
+
"extractLicenses": false,
|
|
86
|
+
"sourceMap": true,
|
|
87
|
+
"namedChunks": true
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"serve": {
|
|
92
|
+
"builder": "@angular-devkit/build-angular:dev-server",
|
|
93
|
+
"options": {
|
|
94
|
+
"browserTarget": "duet-angular-template:build",
|
|
95
|
+
"port": 4200
|
|
96
|
+
},
|
|
97
|
+
"configurations": {
|
|
98
|
+
"production": {
|
|
99
|
+
"browserTarget": "duet-angular-template:build:production"
|
|
100
|
+
},
|
|
101
|
+
"development": {
|
|
102
|
+
"browserTarget": "duet-angular-template:build:development"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"extract-i18n": {
|
|
107
|
+
"builder": "@angular-devkit/build-angular:extract-i18n",
|
|
108
|
+
"options": {
|
|
109
|
+
"browserTarget": "duet-angular-template:build"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"lint": {
|
|
113
|
+
"builder": "@angular-eslint/builder:lint",
|
|
114
|
+
"options": {
|
|
115
|
+
"lintFilePatterns": [
|
|
116
|
+
"src/**/*.ts",
|
|
117
|
+
"src/**/*.html"
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"test": {
|
|
122
|
+
"builder": "@angular-builders/jest:run",
|
|
123
|
+
"options": {
|
|
124
|
+
"tsConfig": "tsconfig.spec.json",
|
|
125
|
+
"configPath" : "config/jest.base.ts",
|
|
126
|
+
"globalMocks": ["getComputedStyle", "doctype", "styleTransform", "matchMedia"]
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"defaultProject": "duet-angular-template"
|
|
133
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const { pathsToModuleNameMapper } = require('ts-jest');
|
|
2
|
+
const { compilerOptions } = require('../tsconfig.spec.json');
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
preset: 'jest-preset-angular',
|
|
6
|
+
roots: ['<rootDir>/src/'],
|
|
7
|
+
setupFilesAfterEnv: ["<rootDir>/config/jest.setup.ts"],
|
|
8
|
+
collectCoverage: true,
|
|
9
|
+
coverageReporters: ['html'],
|
|
10
|
+
coverageDirectory: 'coverage/my-app',
|
|
11
|
+
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths || {}, {
|
|
12
|
+
prefix: '<rootDir>/'
|
|
13
|
+
}),
|
|
14
|
+
testPathIgnorePatterns : [
|
|
15
|
+
"<rootDir>/src/tests/playwright/"
|
|
16
|
+
]
|
|
17
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import 'jest-preset-angular/setup-jest';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(window, 'CSS', {value: null});
|
|
5
|
+
Object.defineProperty(window, 'getComputedStyle', {
|
|
6
|
+
value: () => {
|
|
7
|
+
return {
|
|
8
|
+
display: 'none',
|
|
9
|
+
appearance: ['-webkit-appearance']
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
Object.defineProperty(document, 'doctype', {
|
|
15
|
+
value: '<!DOCTYPE html>'
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(document.body.style, 'transform', {
|
|
18
|
+
value: () => {
|
|
19
|
+
return {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
configurable: true
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "duet-angular-template",
|
|
3
|
+
"version": "15.0.4",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"ng": "ng",
|
|
6
|
+
"start": "ng lint; npm run serve",
|
|
7
|
+
"serve": "ng serve --host=0.0.0.0 --poll 500 -c development",
|
|
8
|
+
"serve:daemon": "ng serve --host=0.0.0.0 --poll 500 &",
|
|
9
|
+
"build": "ng build",
|
|
10
|
+
"test": "ng test --watch=true",
|
|
11
|
+
"test:ci": "DEBUG=pw:webserver npx playwright test",
|
|
12
|
+
"lint": "ng lint"
|
|
13
|
+
},
|
|
14
|
+
"private": true,
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@angular/animations": "15.0.4",
|
|
17
|
+
"@angular/common": "15.0.4",
|
|
18
|
+
"@angular/compiler": "15.0.4",
|
|
19
|
+
"@angular/core": "15.0.4",
|
|
20
|
+
"@angular/forms": "15.0.4",
|
|
21
|
+
"@angular/platform-browser": "15.0.4",
|
|
22
|
+
"@angular/platform-browser-dynamic": "15.0.4",
|
|
23
|
+
"@angular/router": "15.0.4",
|
|
24
|
+
"@duetds/components": "latest",
|
|
25
|
+
"@duetds/css": "latest",
|
|
26
|
+
"@duetds/icons": "latest",
|
|
27
|
+
"@duetds/tokens": "latest",
|
|
28
|
+
"rxjs": "7.5.7",
|
|
29
|
+
"tslib": "2.4.1",
|
|
30
|
+
"zone.js": "0.12.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@angular-builders/jest": "15.0.0-beta.2",
|
|
34
|
+
"@angular-devkit/build-angular": "15.0.4",
|
|
35
|
+
"@angular-eslint/builder": "15.1.0",
|
|
36
|
+
"@angular-eslint/eslint-plugin": "15.1.0",
|
|
37
|
+
"@angular-eslint/eslint-plugin-template": "15.1.0",
|
|
38
|
+
"@angular-eslint/schematics": "15.1.0",
|
|
39
|
+
"@angular-eslint/template-parser": "15.1.0",
|
|
40
|
+
"@angular/cli": "15.0.4",
|
|
41
|
+
"@angular/compiler-cli": "15.0.4",
|
|
42
|
+
"@playwright/test": "1.28.0",
|
|
43
|
+
"@types/jest": "29.2.3",
|
|
44
|
+
"@types/node": "18.11.9",
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "5.44.0",
|
|
46
|
+
"@typescript-eslint/parser": "5.44.0",
|
|
47
|
+
"angular-eslint": "0.0.1-alpha.0",
|
|
48
|
+
"codelyzer": "6.0.2",
|
|
49
|
+
"eslint": "8.28.0",
|
|
50
|
+
"eslint-config-prettier": "8.5.0",
|
|
51
|
+
"eslint-plugin-import": "2.26.0",
|
|
52
|
+
"eslint-plugin-prefer-arrow": "1.2.3",
|
|
53
|
+
"eslint-plugin-prettier": "4.2.1",
|
|
54
|
+
"eslint-plugin-unused-imports": "2.0.0",
|
|
55
|
+
"jest": "29.3.1",
|
|
56
|
+
"ts-node": "10.9.0",
|
|
57
|
+
"typescript": "4.8.4"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// playwright.config.ts
|
|
2
|
+
import { PlaywrightTestConfig, devices } from '@playwright/test';
|
|
3
|
+
|
|
4
|
+
const config: PlaywrightTestConfig = {
|
|
5
|
+
testDir:"src/tests/playwright",
|
|
6
|
+
retries: process.env.CI ? 2 : 0,
|
|
7
|
+
use: {
|
|
8
|
+
trace: 'on-first-retry',
|
|
9
|
+
viewport: { width: 2080, height: 2020 },
|
|
10
|
+
ignoreHTTPSErrors: true,
|
|
11
|
+
video: 'on-first-retry'
|
|
12
|
+
},
|
|
13
|
+
webServer: {
|
|
14
|
+
command: 'npx ng serve',
|
|
15
|
+
url:"http://localhost:4200/#/",
|
|
16
|
+
timeout: 120 * 1000,
|
|
17
|
+
reuseExistingServer: false
|
|
18
|
+
},
|
|
19
|
+
projects: [
|
|
20
|
+
{
|
|
21
|
+
name: 'chromium',
|
|
22
|
+
use: { ...devices['Desktop Chrome'] },
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
export default config;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NgModule } from "@angular/core"
|
|
2
|
+
import { Routes, RouterModule } from "@angular/router"
|
|
3
|
+
import { IndexPageComponent } from "./index-page/index-page.component"
|
|
4
|
+
|
|
5
|
+
const routes: Routes = [{ path: "", component: IndexPageComponent }]
|
|
6
|
+
|
|
7
|
+
@NgModule({
|
|
8
|
+
imports: [RouterModule.forRoot(routes, { scrollPositionRestoration: "enabled", useHash: true })],
|
|
9
|
+
exports: [RouterModule]
|
|
10
|
+
})
|
|
11
|
+
export class AppRoutingModule {}
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BrowserModule } from "@angular/platform-browser"
|
|
2
|
+
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from "@angular/core"
|
|
3
|
+
|
|
4
|
+
import { AppRoutingModule } from "./app-routing.module"
|
|
5
|
+
import { AppComponent } from "./app.component"
|
|
6
|
+
import { FormsModule, ReactiveFormsModule } from "@angular/forms"
|
|
7
|
+
import { IndexPageComponent } from "./index-page/index-page.component"
|
|
8
|
+
import { HeaderComponent } from "./header/header.component"
|
|
9
|
+
import { FooterComponent } from "./footer/footer.component"
|
|
10
|
+
import { InvestmentAmountComponent } from './investment-amount/investment-amount.component';
|
|
11
|
+
import { InvestmentOriginComponent } from './investment-origin/investment-origin.component';
|
|
12
|
+
import { SummaryComponent } from './summary/summary.component'
|
|
13
|
+
|
|
14
|
+
@NgModule({
|
|
15
|
+
declarations: [AppComponent, IndexPageComponent, HeaderComponent, FooterComponent, InvestmentAmountComponent, InvestmentOriginComponent, SummaryComponent],
|
|
16
|
+
imports: [BrowserModule, FormsModule, ReactiveFormsModule, AppRoutingModule],
|
|
17
|
+
providers: [],
|
|
18
|
+
bootstrap: [AppComponent],
|
|
19
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
|
20
|
+
})
|
|
21
|
+
export class AppModule {}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Injectable } from "@angular/core"
|
|
2
|
+
import { currencyFormatFI } from "../utils/string.utils"
|
|
3
|
+
|
|
4
|
+
@Injectable({
|
|
5
|
+
providedIn: "root"
|
|
6
|
+
})
|
|
7
|
+
export class CurrencyFormatterService {
|
|
8
|
+
|
|
9
|
+
format(value: number) {
|
|
10
|
+
return currencyFormatFI.format(value)
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<duet-footer
|
|
2
|
+
variation="simple"
|
|
3
|
+
language="fi"
|
|
4
|
+
[menu]="[
|
|
5
|
+
{
|
|
6
|
+
label: 'Turvallisuus ja käyttöehdot',
|
|
7
|
+
href: '#',
|
|
8
|
+
external: 'true'
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
label: 'Evästeet',
|
|
12
|
+
href: '#',
|
|
13
|
+
external: 'true'
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
label: 'Henkilötietojen käsittely',
|
|
17
|
+
href: '#',
|
|
18
|
+
external: 'true'
|
|
19
|
+
}
|
|
20
|
+
]"
|
|
21
|
+
>
|
|
22
|
+
</duet-footer>
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<duet-header logo-href="" [back]="{ label: 'Takaisin', href: '/' }"></duet-header>
|
|
File without changes
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<duet-layout center>
|
|
2
|
+
<div slot="top" role="region">
|
|
3
|
+
<duet-spacer breakpoint="large" size="x-large"></duet-spacer>
|
|
4
|
+
<duet-heading level="h1" visual-level="h2">Pääotsikko</duet-heading>
|
|
5
|
+
<duet-spacer></duet-spacer>
|
|
6
|
+
</div>
|
|
7
|
+
<div slot="main">
|
|
8
|
+
<form [formGroup]="form" (ngSubmit)="handleSubmit($event)">
|
|
9
|
+
<duet-stepper [selected]="currentStep" (duetStepChange)="handleStepChange($event)">
|
|
10
|
+
<duet-step heading="Perustiedot" formGroupName="investmentAmount">
|
|
11
|
+
<duet-paragraph>
|
|
12
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore etdolore
|
|
13
|
+
magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip.
|
|
14
|
+
</duet-paragraph>
|
|
15
|
+
<app-investment-amount
|
|
16
|
+
[form]="form.get('investmentAmount')"
|
|
17
|
+
[agreements]="agreements"
|
|
18
|
+
></app-investment-amount>
|
|
19
|
+
<duet-spacer></duet-spacer>
|
|
20
|
+
<duet-button margin="none" variation="primary" (click)="handleNextClick($event)" [disabled]="form.invalid"
|
|
21
|
+
id="step1">Seuraava</duet-button
|
|
22
|
+
>
|
|
23
|
+
</duet-step>
|
|
24
|
+
|
|
25
|
+
<duet-step heading="Tarkemmat tiedot" formGroupName="investmentOrigin">
|
|
26
|
+
<duet-paragraph>
|
|
27
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore etdolore
|
|
28
|
+
magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip.
|
|
29
|
+
</duet-paragraph>
|
|
30
|
+
<app-investment-origin [form]="form.get('investmentOrigin')"></app-investment-origin>
|
|
31
|
+
<duet-spacer></duet-spacer>
|
|
32
|
+
<duet-button margin="none" variation="primary" (click)="handleNextClick($event)" [disabled]="form.invalid" id="step2">
|
|
33
|
+
Seuraava
|
|
34
|
+
</duet-button>
|
|
35
|
+
</duet-step>
|
|
36
|
+
|
|
37
|
+
<duet-step heading="Yhteenveto">
|
|
38
|
+
<duet-spacer></duet-spacer>
|
|
39
|
+
<app-summary [agreement]="selectedAgreement"></app-summary>
|
|
40
|
+
<duet-spacer></duet-spacer>
|
|
41
|
+
<duet-button submit margin="none" variation="primary" expand [disabled]="form.invalid" id="step3"> Lähetä </duet-button>
|
|
42
|
+
</duet-step>
|
|
43
|
+
</duet-stepper>
|
|
44
|
+
</form>
|
|
45
|
+
</div>
|
|
46
|
+
</duet-layout>
|
|
47
|
+
<duet-modal [active]="completed" heading="You entered the following data:">
|
|
48
|
+
<pre><code>{{ form.value | json }}</code></pre>
|
|
49
|
+
</duet-modal>
|
|
File without changes
|
|
@@ -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
|