@genesislcap/blank-app-seed 1.5.2
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/.genx/.genxrc.js +9 -0
- package/.genx/configure.js +15 -0
- package/.genx/details.js +23 -0
- package/.genx/package.json +48 -0
- package/.genx/prompts/api.js +48 -0
- package/.genx/prompts/server.js +28 -0
- package/.genx/prompts/validators.js +10 -0
- package/.genx/prompts.js +22 -0
- package/.genx/scripts/health-check.sh +23 -0
- package/.genx/scripts/init-gradle.sh +21 -0
- package/.genx/scripts/update-versions.js +36 -0
- package/.genx/tests/fixtures/testapp/client/src/routes/home/home.template.ts +6 -0
- package/.genx/tests/fixtures/testapp/docker-compose.yml +20 -0
- package/.genx/tests/fixtures/testapp/server/jvm/testapp-config/src/main/resources/cfg/testapp-fields-dictionary.kts +20 -0
- package/.genx/tests/fixtures/testapp/server/jvm/testapp-config/src/main/resources/cfg/testapp-processes.xml +36 -0
- package/.genx/tests/fixtures/testapp/server/jvm/testapp-config/src/main/resources/cfg/testapp-service-definitions.xml +16 -0
- package/.genx/tests/fixtures/testapp/server/jvm/testapp-config/src/main/resources/cfg/testapp-tables-dictionary.kts +26 -0
- package/.genx/tests/fixtures/testapp/server/jvm/testapp-script-config/src/main/resources/scripts/testapp-dataserver.kts +13 -0
- package/.genx/tests/fixtures/testapp/server/jvm/testapp-script-config/src/main/resources/scripts/testapp-eventhandler.kts +21 -0
- package/.genx/versions.json +5 -0
- package/.vscode/settings.json +1 -0
- package/CHANGELOG.md +42 -0
- package/LICENSE +54 -0
- package/README.md +67 -0
- package/build.gradle.kts +15 -0
- package/client/.prettierignore +14 -0
- package/client/Dockerfile +12 -0
- package/client/README.md +88 -0
- package/client/build.gradle.kts +100 -0
- package/client/docs/images/lsp_jetbrains_one.png +0 -0
- package/client/docs/images/lsp_jetbrains_two.png +0 -0
- package/client/docs/images/lsp_vscode_one.png +0 -0
- package/client/docs/images/lsp_vscode_two.png +0 -0
- package/client/index.html +24 -0
- package/client/package.json +106 -0
- package/client/playwright.config.ts +1 -0
- package/client/public/favicon.ico +0 -0
- package/client/public/initSSO.js +49 -0
- package/client/settings.gradle.kts +1 -0
- package/client/src/components/components.ts +57 -0
- package/client/src/components/index.ts +1 -0
- package/client/src/index.federated.ts +1 -0
- package/client/src/index.ts +1 -0
- package/client/src/layouts/default.ts +135 -0
- package/client/src/layouts/index.ts +1 -0
- package/client/src/main/index.ts +2 -0
- package/client/src/main/main.css +17 -0
- package/client/src/main/main.styles.ts +21 -0
- package/client/src/main/main.template.ts +21 -0
- package/client/src/main/main.ts +95 -0
- package/client/src/routes/config.ts +142 -0
- package/client/src/routes/home/home.styles.ts +7 -0
- package/client/src/routes/home/home.template.ts +6 -0
- package/client/src/routes/home/home.ts +14 -0
- package/client/src/routes/index.ts +1 -0
- package/client/src/routes/not-found/not-found.styles.ts +11 -0
- package/client/src/routes/not-found/not-found.template.ts +6 -0
- package/client/src/routes/not-found/not-found.ts +16 -0
- package/client/src/styles/design-tokens.json +56 -0
- package/client/src/styles/index.ts +2 -0
- package/client/src/styles/styles.ts +30 -0
- package/client/src/styles/typography.ts +25 -0
- package/client/src/types.ts +5 -0
- package/client/src/utils/index.ts +1 -0
- package/client/src/utils/logger.ts +3 -0
- package/client/test/README.md +3 -0
- package/client/test/e2e/fixture.ts +25 -0
- package/client/test/e2e/flows/001-protected.e2e.ts +6 -0
- package/client/test/e2e/index.ts +2 -0
- package/client/test/e2e/pages/index.ts +1 -0
- package/client/test/e2e/pages/protected.ts +16 -0
- package/docker-compose.yml +42 -0
- package/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/gradle.properties +3 -0
- package/gradlew +249 -0
- package/gradlew.bat +92 -0
- package/package.json +23 -0
- package/server/jvm/README.md +27 -0
- package/server/jvm/build.gradle.kts +100 -0
- package/server/jvm/docker-scripts/configureDB.sh +12 -0
- package/server/jvm/docker-scripts/docker-entrypoint.sh +7 -0
- package/server/jvm/docker-scripts/genesisInstall.sh +5 -0
- package/server/jvm/docker-scripts/remap.sh +23 -0
- package/server/jvm/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/server/jvm/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/server/jvm/gradle.properties +10 -0
- package/server/jvm/gradlew +249 -0
- package/server/jvm/gradlew.bat +92 -0
- package/server/jvm/settings.gradle.kts +60 -0
- package/server/jvm/{{appName}}-config/build.gradle.kts +8 -0
- package/server/jvm/{{appName}}-config/src/main/kotlin/donotdelete.txt +1 -0
- package/server/jvm/{{appName}}-config/src/main/resources/cfg/{{appName}}-fields-dictionary.kts +14 -0
- package/server/jvm/{{appName}}-config/src/main/resources/cfg/{{appName}}-processes.xml +15 -0
- package/server/jvm/{{appName}}-config/src/main/resources/cfg/{{appName}}-service-definitions.xml +15 -0
- package/server/jvm/{{appName}}-config/src/main/resources/cfg/{{appName}}-system-definition.kts +20 -0
- package/server/jvm/{{appName}}-config/src/main/resources/cfg/{{appName}}-tables-dictionary.kts +14 -0
- package/server/jvm/{{appName}}-config/src/main/resources/cfg/{{appName}}-view-dictionary.kts +13 -0
- package/server/jvm/{{appName}}-deploy/build.gradle.kts +35 -0
- package/server/jvm/{{appName}}-dictionary-cache/build.gradle.kts +13 -0
- package/server/jvm/{{appName}}-dictionary-cache/{{appName}}-generated-dao/build.gradle.kts +1 -0
- package/server/jvm/{{appName}}-dictionary-cache/{{appName}}-generated-fields/build.gradle.kts +1 -0
- package/server/jvm/{{appName}}-dictionary-cache/{{appName}}-generated-hft/build.gradle.kts +1 -0
- package/server/jvm/{{appName}}-dictionary-cache/{{appName}}-generated-sysdef/build.gradle.kts +1 -0
- package/server/jvm/{{appName}}-dictionary-cache/{{appName}}-generated-view/build.gradle.kts +1 -0
- package/server/jvm/{{appName}}-distribution/build.gradle.kts +97 -0
- package/server/jvm/{{appName}}-eventhandler/build.gradle.kts +13 -0
- package/server/jvm/{{appName}}-eventhandler/src/test/resources/GenesisHome/donotdelete.txt +0 -0
- package/server/jvm/{{appName}}-messages/build.gradle.kts +6 -0
- package/server/jvm/{{appName}}-messages/src/main/kotlin/global/genesis/message/common/readme.md +1 -0
- package/server/jvm/{{appName}}-messages/src/main/kotlin/global/genesis/message/event/readme.md +1 -0
- package/server/jvm/{{appName}}-messages/src/main/kotlin/global/genesis/message/request/readme.md +1 -0
- package/server/jvm/{{appName}}-messages/src/main/resources/META-INF/global/genesis/message/product-info +1 -0
- package/server/jvm/{{appName}}-script-config/build.gradle.kts +16 -0
- package/server/jvm/{{appName}}-script-config/src/main/kotlin/donotdelete.txt +1 -0
- package/server/jvm/{{appName}}-script-config/src/main/resources/scripts/{{appName}}-dataserver.kts +13 -0
- package/server/jvm/{{appName}}-script-config/src/main/resources/scripts/{{appName}}-eventhandler.kts +13 -0
- package/server/jvm/{{appName}}-script-config/src/main/resources/scripts/{{appName}}-reqrep.kts +13 -0
- package/server/jvm/{{appName}}-script-config/src/test/kotlin/GenesisTestSupportTest.kt +23 -0
- package/server/jvm/{{appName}}-script-config/src/test/resources/GenesisHome/donotdelete.txt +0 -0
- package/server/jvm/{{appName}}-site-specific/README.md +3 -0
- package/server/jvm/{{appName}}-site-specific/build.gradle.kts +114 -0
- package/server/jvm/{{appName}}-site-specific/src/main/kotlin/donotdelete.txt +1 -0
- package/server/jvm/{{appName}}-site-specific/src/main/resources/cfg/genesis-system-definition.kts +52 -0
- package/server/jvm/{{appName}}-site-specific/src/main/resources/data/user.csv +2 -0
- package/server/nginx/Dockerfile +5 -0
- package/server/nginx/cert.crt +20 -0
- package/server/nginx/cert.key +27 -0
- package/server/nginx/default.conf +40 -0
- package/settings.gradle.kts +35 -0
package/build.gradle.kts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Use base plugin to access base tasks (clean, assemble, check, and build).
|
|
2
|
+
plugins {
|
|
3
|
+
base
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
tasks {
|
|
7
|
+
val tasks = listOf("clean", "assemble", "check", "build")
|
|
8
|
+
for(taskName in tasks){
|
|
9
|
+
named(taskName){
|
|
10
|
+
gradle.includedBuilds.forEach {
|
|
11
|
+
dependsOn(it.task(":$taskName"))
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
package/client/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Web Client
|
|
2
|
+
|
|
3
|
+
## Frontend stack
|
|
4
|
+
|
|
5
|
+
Genesis components are standards-based Web Components, making them compatible with almost any modern web framework.
|
|
6
|
+
Our state-of-the-art design system and component set is built on top of
|
|
7
|
+
[Microsoft FAST](https://www.fast.design/docs/introduction/).
|
|
8
|
+
|
|
9
|
+
# Development
|
|
10
|
+
|
|
11
|
+
1. Install dependencies:
|
|
12
|
+
|
|
13
|
+
```shell
|
|
14
|
+
npm run bootstrap
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
2. Start Web development server in watch mode:
|
|
18
|
+
|
|
19
|
+
```shell
|
|
20
|
+
npm run dev
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
3. Build for production:
|
|
24
|
+
|
|
25
|
+
```shell
|
|
26
|
+
npm run build
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Preview production build:
|
|
30
|
+
|
|
31
|
+
```shell
|
|
32
|
+
npm run serve
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Clean
|
|
36
|
+
|
|
37
|
+
Remove distribution and node_modules directories:
|
|
38
|
+
|
|
39
|
+
```shell
|
|
40
|
+
npm run clean
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Baseline task combines `clean` and `bootstrap` tasks into a single command:
|
|
44
|
+
|
|
45
|
+
```shell
|
|
46
|
+
npm run baseline
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Custom Elements IntelliSense
|
|
50
|
+
|
|
51
|
+
Using any modern editor, you'll receive IntelliSense help while writing TypeScript code while working in the repo. However, you'll also likely be writing a lot of html markup inside of "html\`\`" blocks.
|
|
52
|
+
By default you'll not get any IntelliSense provided in that scenario, but you can enable this while working in the monorepo by leveraging the open source [custom elements lsp](https://www.npmjs.com/package/@genesiscommunitysuccess/custom-elements-lsp) that Genesis provides. This comes pre-configured when you create a seed with `genx`.
|
|
53
|
+
|
|
54
|
+
### VSCode
|
|
55
|
+
|
|
56
|
+
VSCode has full support for the plugin, and is the recommended IDE to use if you're new working with the web code. To enable the LSP you'll need to follow the following steps.
|
|
57
|
+
|
|
58
|
+
1. You need a `.vscode/settings.json` file from the place that you launch your IDE. This has been added to the root of your project automatically, but you'll need to create it in a different place if you want to launch your editor from a different directory. The contents should contain a `typescript.tsdk` key which points to your local typescript install.
|
|
59
|
+
> This is the same file you'll edit if you want to set a specific workspace config. In that case you can have the `typescript.tsdk` key defined, as well as any other config you would like.
|
|
60
|
+
|
|
61
|
+
2. Launch VSCode on the root directory of the project (so in the folder structure you'll have `.vscode` directory from step 1 at the root). You can do this via the GUI or if you've installed VSCode on your path you can navigate to the root and run `code .`.
|
|
62
|
+
|
|
63
|
+
3. Ensuring you have a typescript file open, open the command palette (Ctrl/Cmd + Shift + P) and search for `TypeScript: Select Typescript Version...`
|
|
64
|
+

|
|
65
|
+
> If you don't see this option then ensure you have a `.ts` file open.
|
|
66
|
+
> If you don't see this option, it may be because you need to set VSCode to trust the workspace (so it picks up the config from step 1) when asked.
|
|
67
|
+
|
|
68
|
+
4. Select the workspace version, which should have the path matching the path set in the value of step 1.
|
|
69
|
+

|
|
70
|
+
> If you don't see this option then ensure that you've opened the project in VSCode that has the `.vscode` directory from step 1 at the root.
|
|
71
|
+
|
|
72
|
+
5. That should be it! Please note that you'll not see any diagnostics information after the LSP had loaded until you interact and change the file.
|
|
73
|
+
|
|
74
|
+
### JetBrains
|
|
75
|
+
|
|
76
|
+
This section applies to JetBrains IDEs such as IntelliJ and Webstorm, though the location of the settings menus might slightly differ between versions.
|
|
77
|
+
|
|
78
|
+
**IMPORTANT**: Currently JetBrains does not leverage the TypeScript server for full IntelliSense in their IDEs so our plugin can only offer limited functionality. You should receive full diagnostics support from the plugin, but only limited definition coverage, and no help with autocompletion. Currently we are in discussion with JetBrains to come to a solution about this.
|
|
79
|
+
|
|
80
|
+
1. Launch the IDE.
|
|
81
|
+
|
|
82
|
+
2. Open the preferences menu option from the settings.
|
|
83
|
+

|
|
84
|
+
|
|
85
|
+
3. Navigate to the `Typescript` settings in the `Languages & Frameworks` settings, and ensure that the typescript option is set to the `node_modules/typescript` of your _local_ project, as shown in the image. This may be the default already, in which case you don't need to do anything. You'll also want to enable at least the three options which are enabled in the image below.
|
|
86
|
+

|
|
87
|
+
|
|
88
|
+
4. That should be it! Please note that you'll not see any diagnostics information after the LSP had loaded until you interact and change the file.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import com.github.gradle.node.npm.task.NpmTask
|
|
2
|
+
|
|
3
|
+
plugins {
|
|
4
|
+
base
|
|
5
|
+
id("com.github.node-gradle.node") version "3.1.1"
|
|
6
|
+
distribution
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
distributions {
|
|
10
|
+
main {
|
|
11
|
+
distributionBaseName.set("web-distribution")
|
|
12
|
+
contents {
|
|
13
|
+
into ("/") {
|
|
14
|
+
from("dist")
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
artifacts {
|
|
21
|
+
val distzip = tasks.distZip.get()
|
|
22
|
+
add("default", distzip.archiveFile) {
|
|
23
|
+
builtBy(distzip)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
allprojects {
|
|
28
|
+
apply(plugin = "com.github.node-gradle.node")
|
|
29
|
+
apply(plugin = "base")
|
|
30
|
+
|
|
31
|
+
node {
|
|
32
|
+
// Version of Node to use.
|
|
33
|
+
version.set("20.8.1")
|
|
34
|
+
|
|
35
|
+
// Version of NPM to use.
|
|
36
|
+
npmVersion.set("10.1.0")
|
|
37
|
+
|
|
38
|
+
// If true, it will download node using above parameters.
|
|
39
|
+
// If false, it will try to use globally installed node.
|
|
40
|
+
download.set(false)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
tasks {
|
|
44
|
+
// Setup custom clean task to be run when "clean" task runs.
|
|
45
|
+
val npmClean = register("npmClean", NpmTask::class) {
|
|
46
|
+
args.set(listOf("run", "clean"))
|
|
47
|
+
delete(".bootstrapDone")
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
clean {
|
|
51
|
+
// Depend on the custom npmClean task, the default gradle one deletes the "build" folder by default
|
|
52
|
+
// and the project build won't work without it.
|
|
53
|
+
dependsOn(npmClean)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
tasks {
|
|
59
|
+
val npmBootstrap = register("npmBootstrap", NpmTask::class) {
|
|
60
|
+
val workingDir = layout.projectDirectory.asFile
|
|
61
|
+
args.set(listOf("run", "bootstrap"))
|
|
62
|
+
outputs.upToDateWhen { File(workingDir, ".bootstrapDone").exists() }
|
|
63
|
+
doLast { File(workingDir, ".bootstrapDone").createNewFile() }
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
val npmBuild = register("npmBuild", NpmTask::class) {
|
|
67
|
+
args.set(listOf("run", "build"))
|
|
68
|
+
inputs.dir("src")
|
|
69
|
+
outputs.dir("dist")
|
|
70
|
+
dependsOn(npmBootstrap)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
val test = register("test", NpmTask::class) {
|
|
74
|
+
dependsOn(build)
|
|
75
|
+
args.set(listOf("run", "test"))
|
|
76
|
+
inputs.files(fileTree("src"))
|
|
77
|
+
inputs.file("package.json")
|
|
78
|
+
|
|
79
|
+
val testsExecutedMarkerName: String = "${projectDir}/.tests.executed"
|
|
80
|
+
// Below some potentially useful config snippets if we want to be efficient with test executions.
|
|
81
|
+
|
|
82
|
+
// allows easy triggering re-tests
|
|
83
|
+
doLast {
|
|
84
|
+
File(testsExecutedMarkerName).appendText("delete this file to force re-execution JavaScript tests")
|
|
85
|
+
}
|
|
86
|
+
outputs.file(testsExecutedMarkerName)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
distZip {
|
|
90
|
+
dependsOn(npmBuild)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
distTar {
|
|
94
|
+
dependsOn(npmBuild)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
assemble {
|
|
98
|
+
dependsOn(npmBuild)
|
|
99
|
+
}
|
|
100
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
{{!
|
|
4
|
+
|
|
5
|
+
Standard Handlebars variables are evaluated once during app generation
|
|
6
|
+
Escaped Handlebars variables (prefixed with \) are evaluated during each run of app build/dev cycle
|
|
7
|
+
|
|
8
|
+
https://handlebarsjs.com/
|
|
9
|
+
}}
|
|
10
|
+
<head>
|
|
11
|
+
<meta charset="utf-8"/>
|
|
12
|
+
<title>\{{htmlWebpackPlugin.options.title}}</title>
|
|
13
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
14
|
+
{{#if enableSSO}}
|
|
15
|
+
<script src="/initSSO.js"></script>
|
|
16
|
+
{{/if}}
|
|
17
|
+
</head>
|
|
18
|
+
<body {{#if enableSSO}}onload="appendApp()"{{/if}}>
|
|
19
|
+
{{#unless enableSSO}}<{{rootElement}}></{{rootElement}}>{{/unless}}
|
|
20
|
+
\{{#if insertEntryPoint}}
|
|
21
|
+
<script type="module" src="/src/index.ts"></script>
|
|
22
|
+
\{{/if}}
|
|
23
|
+
</body>
|
|
24
|
+
</html>
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{pkgName}}",
|
|
3
|
+
"description": "",
|
|
4
|
+
"version": "{{applicationVersionWeb}}",
|
|
5
|
+
"private": true,
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"config": {
|
|
8
|
+
"API_HOST": "{{apiHost}}",
|
|
9
|
+
"PORT": 6060,
|
|
10
|
+
"ENABLE_SSO": {{enableSSO}}
|
|
11
|
+
},
|
|
12
|
+
"genx": {
|
|
13
|
+
"app": {
|
|
14
|
+
"rootElement": "{{rootElement}}"
|
|
15
|
+
},
|
|
16
|
+
"federation": {
|
|
17
|
+
"remotes": [
|
|
18
|
+
"@genesislcap/foundation-zero"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"baseline": "npm run clean && npm run bootstrap",
|
|
24
|
+
"bootstrap": "npm install --no-fund --no-audit",
|
|
25
|
+
"bootstrap:ci": "npm ci --no-fund --no-audit",
|
|
26
|
+
"build": "genx build -e ENABLE_SSO",
|
|
27
|
+
"build:stats": "genx analyze",
|
|
28
|
+
"clean": "genx clean dist node_modules",
|
|
29
|
+
"dev": "genx dev -e API_HOST,ENABLE_SSO",
|
|
30
|
+
"dev:docker": "npm run dev -- --host 0.0.0.0",
|
|
31
|
+
"dev:intellij": "genx dev -e ENABLE_SSO",
|
|
32
|
+
"dev:no-open": "npm run dev -- --no-open",
|
|
33
|
+
"dev:https": "npm run dev -- --https",
|
|
34
|
+
"dev:webpack": "npm run dev -- -b webpack",
|
|
35
|
+
"dsconfig": "dsconfig --path src/styles/design-tokens.json",
|
|
36
|
+
"git:setup": "cd .. && npx --yes husky install",
|
|
37
|
+
"lint": "genx lint --profile",
|
|
38
|
+
"lint:fix": "genx lint --fix",
|
|
39
|
+
"lint:eslint": "genx lint -l eslint --profile",
|
|
40
|
+
"lint:stylelint": "genx lint -l stylelint",
|
|
41
|
+
"serve": "genx serve",
|
|
42
|
+
"test": "genx test",
|
|
43
|
+
"test:e2e": "genx test --e2e",
|
|
44
|
+
"test:e2e:debug": "genx test --e2e --debug",
|
|
45
|
+
"test:e2e:ui": "genx test --e2e --interactive",
|
|
46
|
+
"test:coverage": "genx test --coverage",
|
|
47
|
+
"test:unit:watch": "genx test --watch"
|
|
48
|
+
},
|
|
49
|
+
"husky": {
|
|
50
|
+
"hooks": {
|
|
51
|
+
"pre-commit": "lint-staged"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"lint-staged": {
|
|
55
|
+
"*.{ts,js}": [
|
|
56
|
+
"eslint"
|
|
57
|
+
],
|
|
58
|
+
"*.styles.ts": [
|
|
59
|
+
"stylelint"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
"eslintConfig": {
|
|
63
|
+
"extends": "@genesislcap/eslint-config",
|
|
64
|
+
"ignorePatterns": ["**/dist/**", "**/public/**", "**/coverage/**", "**/test/**", "playwright.config.ts"]
|
|
65
|
+
},
|
|
66
|
+
"stylelint": {
|
|
67
|
+
"extends": "@genesislcap/stylelint-config"
|
|
68
|
+
},
|
|
69
|
+
"prettier": "@genesislcap/prettier-config",
|
|
70
|
+
"devDependencies": {
|
|
71
|
+
"@genesiscommunitysuccess/cep-fast-plugin": "4.1.1",
|
|
72
|
+
"@genesiscommunitysuccess/custom-elements-lsp": "4.1.1",
|
|
73
|
+
"@genesislcap/design-system-configurator": "{{versions.UI}}",
|
|
74
|
+
"@genesislcap/eslint-config": "{{versions.UI}}",
|
|
75
|
+
"@genesislcap/foundation-testing": "{{versions.UI}}",
|
|
76
|
+
"@genesislcap/genx": "{{versions.UI}}",
|
|
77
|
+
"@genesislcap/prettier-config": "{{versions.UI}}",
|
|
78
|
+
"@genesislcap/stylelint-config": "{{versions.UI}}",
|
|
79
|
+
"@types/node": "20.11.5",
|
|
80
|
+
"husky": "^7.0.4",
|
|
81
|
+
"lint-prepush": "^2.2.1",
|
|
82
|
+
"lint-staged": "^12.4.1"
|
|
83
|
+
},
|
|
84
|
+
"dependencies": {
|
|
85
|
+
"@genesislcap/foundation-comms": "{{versions.UI}}",
|
|
86
|
+
"@genesislcap/foundation-entity-management": "{{versions.UI}}",
|
|
87
|
+
"@genesislcap/foundation-forms": "{{versions.UI}}",
|
|
88
|
+
"@genesislcap/foundation-header": "{{versions.UI}}",
|
|
89
|
+
"@genesislcap/foundation-inbox": "{{versions.UI}}",
|
|
90
|
+
"@genesislcap/foundation-layout": "{{versions.UI}}",
|
|
91
|
+
"@genesislcap/foundation-logger": "{{versions.UI}}",
|
|
92
|
+
"@genesislcap/foundation-login": "{{versions.UI}}",
|
|
93
|
+
"@genesislcap/foundation-ui": "{{versions.UI}}",
|
|
94
|
+
"@genesislcap/foundation-utils": "{{versions.UI}}",
|
|
95
|
+
"@genesislcap/foundation-zero": "{{versions.UI}}",
|
|
96
|
+
"@genesislcap/foundation-zero-grid-pro": "{{versions.UI}}",
|
|
97
|
+
"@genesislcap/g2plot-chart": "{{versions.UI}}",
|
|
98
|
+
"@microsoft/fast-components": "^2.21.6",
|
|
99
|
+
"@microsoft/fast-element": "^1.7.0",
|
|
100
|
+
"@microsoft/fast-foundation": "^2.33.4",
|
|
101
|
+
"@microsoft/fast-router": "^0.4.2",
|
|
102
|
+
"@microsoft/fast-web-utilities": "^5.1.0",
|
|
103
|
+
"rxjs": "^7.5.4",
|
|
104
|
+
"tslib": "^2.3.1"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { configDefaults as default } from '@genesislcap/foundation-testing/e2e';
|
|
Binary file
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Set the appHostURL from which the providers are to be fetched.
|
|
2
|
+
const appHostURL = `${location.protocol}//${location.host}/gwf/`;
|
|
3
|
+
|
|
4
|
+
const fetchIDPs = async () => {
|
|
5
|
+
const ipdsEndpoint = `${appHostURL}sso/list`;
|
|
6
|
+
console.log('IPD endpoint', ipdsEndpoint);
|
|
7
|
+
return fetch(ipdsEndpoint)
|
|
8
|
+
.then((res) => {
|
|
9
|
+
if (res.ok) return res;
|
|
10
|
+
throw new Error(res.statusText);
|
|
11
|
+
})
|
|
12
|
+
.then((res) => res.json())
|
|
13
|
+
.then((json) => json.IDPS)
|
|
14
|
+
.catch(() => {
|
|
15
|
+
console.error('Failed to fetch identity providers.');
|
|
16
|
+
return [{ ID: 'error', DESCRIPTION: 'Failed to fetch providers.' }];
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// If we do not have initSSO token in our sessionStorage,
|
|
21
|
+
// then we check the list of providers and get ssoToken
|
|
22
|
+
if (!sessionStorage.getItem('initSSO')) {
|
|
23
|
+
fetchIDPs().then((allIdps) => {
|
|
24
|
+
console.log('Fetched IDPs', allIdps);
|
|
25
|
+
idps = allIdps.map((idp) => ({
|
|
26
|
+
id: idp.ID,
|
|
27
|
+
type: idp.TYPE,
|
|
28
|
+
}));
|
|
29
|
+
|
|
30
|
+
// Set initSSO token in sessionStorage after the first fetch of providers
|
|
31
|
+
sessionStorage.setItem('initSSO', 'true');
|
|
32
|
+
|
|
33
|
+
// If your environment has more providers and you want to test it - set a number corresponding to the number of your providers
|
|
34
|
+
if (idps.length === 1 && idps[0].type) {
|
|
35
|
+
const ssoLoginRoute = `/gwf/${idps[0].type}/login`;
|
|
36
|
+
const ssoLoginUrl = `${location.protocol}//${new URL(appHostURL).host}${ssoLoginRoute}?idp=${idps[0].id}`;
|
|
37
|
+
|
|
38
|
+
window.open(ssoLoginUrl, '_self');
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// If we have initSSO in our sessionStorage, then we load the entire application
|
|
44
|
+
function appendApp() {
|
|
45
|
+
if (sessionStorage.getItem('initSSO')) {
|
|
46
|
+
const node = document.createElement('{{rootElement}}');
|
|
47
|
+
document.body.appendChild(node);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
rootProject.name = "client"
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { EntityManagement } from '@genesislcap/foundation-entity-management';
|
|
2
|
+
import { Form } from '@genesislcap/foundation-forms';
|
|
3
|
+
import { foundationLayoutComponents } from '@genesislcap/foundation-layout';
|
|
4
|
+
import { zeroGridComponents } from '@genesislcap/foundation-zero-grid-pro';
|
|
5
|
+
import { g2plotChartsComponents } from '@genesislcap/g2plot-chart';
|
|
6
|
+
import { FASTRouter } from '@microsoft/fast-router';
|
|
7
|
+
import { logger } from '../utils';
|
|
8
|
+
|
|
9
|
+
EntityManagement;
|
|
10
|
+
Form;
|
|
11
|
+
|
|
12
|
+
enum ResourceType {
|
|
13
|
+
LOCAL = 'LOCAL',
|
|
14
|
+
REMOTE = 'REMOTE',
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* TODO: Think about sharing import functions across micro frontends.
|
|
19
|
+
*/
|
|
20
|
+
function loadZeroFallback() {
|
|
21
|
+
return import(
|
|
22
|
+
/* webpackMode: "lazy" */
|
|
23
|
+
'@genesislcap/foundation-zero'
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Granular
|
|
29
|
+
*/
|
|
30
|
+
async function loadZeroDesignSystem() {
|
|
31
|
+
let type = ResourceType.REMOTE;
|
|
32
|
+
try {
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
return await import('foundationZero/ZeroDesignSystem');
|
|
35
|
+
} catch (e) {
|
|
36
|
+
type = ResourceType.LOCAL;
|
|
37
|
+
return await loadZeroFallback();
|
|
38
|
+
} finally {
|
|
39
|
+
logger.debug(`Using '${type}' version of foundationZero/ZeroDesignSystem`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type LoadRemotesOptions = {};
|
|
44
|
+
|
|
45
|
+
export async function loadRemotes() {
|
|
46
|
+
const { provideDesignSystem, baseComponents } = await loadZeroDesignSystem();
|
|
47
|
+
return {
|
|
48
|
+
ZeroDesignSystem: provideDesignSystem().register(
|
|
49
|
+
baseComponents,
|
|
50
|
+
zeroGridComponents,
|
|
51
|
+
g2plotChartsComponents,
|
|
52
|
+
foundationLayoutComponents,
|
|
53
|
+
),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
FASTRouter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import('./index');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './main/index';
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { css, html, repeat } from '@microsoft/fast-element';
|
|
2
|
+
import { FASTElementLayout } from '@microsoft/fast-router';
|
|
3
|
+
|
|
4
|
+
const baseLayoutCss = css`
|
|
5
|
+
.container {
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
display: block;
|
|
9
|
+
position: relative;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.content {
|
|
13
|
+
position: absolute;
|
|
14
|
+
top: 0;
|
|
15
|
+
bottom: 0;
|
|
16
|
+
left: 0;
|
|
17
|
+
right: 0;
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
export const loginLayout = new FASTElementLayout(
|
|
22
|
+
html`
|
|
23
|
+
<div class="container">
|
|
24
|
+
<div class="content">
|
|
25
|
+
<slot></slot>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
`,
|
|
29
|
+
baseLayoutCss,
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
export const defaultLayout = new FASTElementLayout(
|
|
33
|
+
html`
|
|
34
|
+
<div class="container">
|
|
35
|
+
<foundation-header
|
|
36
|
+
show-luminance-toggle-button
|
|
37
|
+
show-misc-toggle-button
|
|
38
|
+
show-notification-button
|
|
39
|
+
>
|
|
40
|
+
${repeat(
|
|
41
|
+
(x) => x.config.allRoutes,
|
|
42
|
+
html`
|
|
43
|
+
<zero-button
|
|
44
|
+
appearance="neutral-grey"
|
|
45
|
+
slot="routes"
|
|
46
|
+
value="${(x) => x.index}"
|
|
47
|
+
@click=${(x, c) => c.parent.navigation.navigateTo(x.path)}
|
|
48
|
+
>
|
|
49
|
+
<zero-icon variant="${(x) => x.variant}" name="${(x) => x.icon}"></zero-icon>
|
|
50
|
+
${(x) => x.title}
|
|
51
|
+
</zero-button>
|
|
52
|
+
`,
|
|
53
|
+
)}
|
|
54
|
+
<span slot="group-title-1">GROUP SLOT</span>
|
|
55
|
+
<zero-tree-view slot="nav-items-1">
|
|
56
|
+
<zero-tree-item>
|
|
57
|
+
<zero-icon variant="solid" name="location-arrow"></zero-icon>
|
|
58
|
+
Slot Tree Item
|
|
59
|
+
</zero-tree-item>
|
|
60
|
+
<zero-tree-item>
|
|
61
|
+
<zero-icon variant="solid" name="location-arrow"></zero-icon>
|
|
62
|
+
Slot Tree Item
|
|
63
|
+
</zero-tree-item>
|
|
64
|
+
<zero-tree-item>
|
|
65
|
+
<zero-icon variant="solid" name="location-arrow"></zero-icon>
|
|
66
|
+
Slot Tree Item
|
|
67
|
+
</zero-tree-item>
|
|
68
|
+
<zero-tree-item>
|
|
69
|
+
<zero-icon variant="solid" name="location-arrow"></zero-icon>
|
|
70
|
+
Slot Tree Item
|
|
71
|
+
</zero-tree-item>
|
|
72
|
+
</zero-tree-view>
|
|
73
|
+
<span slot="group-title-2">GROUP SLOT 2</span>
|
|
74
|
+
<zero-tree-view slot="nav-items-2">
|
|
75
|
+
<zero-tree-item>
|
|
76
|
+
<zero-icon variant="solid" name="location-arrow"></zero-icon>
|
|
77
|
+
Slot Tree Item 2
|
|
78
|
+
</zero-tree-item>
|
|
79
|
+
<zero-tree-item>
|
|
80
|
+
<zero-icon variant="solid" name="location-arrow"></zero-icon>
|
|
81
|
+
Slot Tree Item 2
|
|
82
|
+
</zero-tree-item>
|
|
83
|
+
<zero-tree-item>
|
|
84
|
+
<zero-icon variant="solid" name="location-arrow"></zero-icon>
|
|
85
|
+
Slot Tree Item 2
|
|
86
|
+
</zero-tree-item>
|
|
87
|
+
<zero-tree-item>
|
|
88
|
+
<zero-icon variant="solid" name="location-arrow"></zero-icon>
|
|
89
|
+
Slot Tree Item 2
|
|
90
|
+
</zero-tree-item>
|
|
91
|
+
</zero-tree-view>
|
|
92
|
+
<span slot="group-title-3">GROUP SLOT 3</span>
|
|
93
|
+
<zero-tree-view slot="nav-items-3">
|
|
94
|
+
<zero-tree-item>
|
|
95
|
+
<zero-icon variant="solid" name="location-arrow"></zero-icon>
|
|
96
|
+
User Slot
|
|
97
|
+
</zero-tree-item>
|
|
98
|
+
<zero-tree-item>
|
|
99
|
+
<zero-icon variant="solid" name="location-arrow"></zero-icon>
|
|
100
|
+
Reporting Slot
|
|
101
|
+
</zero-tree-item>
|
|
102
|
+
<zero-tree-item>
|
|
103
|
+
<zero-icon variant="solid" name="location-arrow"></zero-icon>
|
|
104
|
+
Settings Slot
|
|
105
|
+
</zero-tree-item>
|
|
106
|
+
</zero-tree-view>
|
|
107
|
+
</foundation-header>
|
|
108
|
+
<div class="content">
|
|
109
|
+
<slot></slot>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
`,
|
|
113
|
+
css`
|
|
114
|
+
${baseLayoutCss}
|
|
115
|
+
|
|
116
|
+
.content {
|
|
117
|
+
padding-top: 60px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
foundation-header {
|
|
121
|
+
z-index: 999;
|
|
122
|
+
position: absolute;
|
|
123
|
+
top: 0;
|
|
124
|
+
left: 0;
|
|
125
|
+
width: 100%;
|
|
126
|
+
align-items: center;
|
|
127
|
+
border: none;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
zero-tree-item zero-icon {
|
|
131
|
+
color: #879ba6;
|
|
132
|
+
padding-right: 10px;
|
|
133
|
+
}
|
|
134
|
+
`,
|
|
135
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './default';
|