Skip to content

Commit 62bb973

Browse files
committed
KNOX-3224: Refactor token generation UI, upgrade node ,angular, bootstrap, jquery and other dependencies
1 parent d877a05 commit 62bb973

26 files changed

+475
-6772
lines changed

knox-token-generation-ui/.eslintrc.json

Lines changed: 0 additions & 98 deletions
This file was deleted.

knox-token-generation-ui/angular.json

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,30 @@
3636
"prefix": "app",
3737
"architect": {
3838
"build": {
39-
"builder": "@angular-devkit/build-angular:browser",
39+
"builder": "@angular/build:application",
4040
"options": {
41-
"outputPath": "target/classes/token-generation/app",
41+
"outputPath": {
42+
"base": "target/classes/token-generation/app",
43+
"browser": ""
44+
},
4245
"index": "token-generation/index.html",
43-
"main": "token-generation/main.ts",
44-
"polyfills": "token-generation/polyfills.ts",
46+
"polyfills": ["token-generation/polyfills.ts"],
4547
"tsConfig": "token-generation/tsconfig.json",
4648
"assets": [
4749
"token-generation/favicon.ico",
4850
"token-generation/assets"
4951
],
5052
"styles": [
51-
"token-generation/assets/styles/bootstrap.min.css",
53+
"node_modules/bootstrap/dist/css/bootstrap.min.css",
5254
"token-generation/assets/styles/app-font.css",
5355
"token-generation/assets/styles/knox.css",
5456
"token-generation/styles.css"
5557
],
5658
"scripts": [
57-
"node_modules/jquery/dist/jquery.min.js"
58-
]
59+
"node_modules/jquery/dist/jquery.min.js",
60+
"node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"
61+
],
62+
"browser": "token-generation/main.ts"
5963
},
6064
"configurations": {
6165
"production": {
@@ -68,9 +72,8 @@
6872
"outputHashing": "all"
6973
},
7074
"development": {
71-
"buildOptimizer": false,
75+
"aot": false,
7276
"optimization": false,
73-
"vendorChunk": true,
7477
"extractLicenses": false,
7578
"sourceMap": true,
7679
"namedChunks": true
@@ -79,21 +82,21 @@
7982
"defaultConfiguration": "production"
8083
},
8184
"serve": {
82-
"builder": "@angular-devkit/build-angular:dev-server",
85+
"builder": "@angular/build:dev-server",
8386
"configurations": {
8487
"production": {
85-
"browserTarget": "token-generation:build:production"
88+
"buildTarget": "token-generation:build:production"
8689
},
8790
"development": {
88-
"browserTarget": "token-generation:build:development"
91+
"buildTarget": "token-generation:build:development"
8992
}
9093
},
9194
"defaultConfiguration": "development"
9295
},
9396
"extract-i18n": {
94-
"builder": "@angular-devkit/build-angular:extract-i18n",
97+
"builder": "@angular/build:extract-i18n",
9598
"options": {
96-
"browserTarget": "token-generation:build"
99+
"buildTarget": "token-generation:build"
97100
}
98101
},
99102
"lint": {
@@ -107,11 +110,5 @@
107110
}
108111
}
109112
}
110-
},
111-
"defaultProject": "token-generation",
112-
"cli": {
113-
"schematicCollections": [
114-
"@angular-eslint/schematics"
115-
]
116113
}
117114
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import js from "@eslint/js";
2+
import tseslint from "typescript-eslint";
3+
import angular from "@angular-eslint/eslint-plugin";
4+
import angularTemplate from "@angular-eslint/eslint-plugin-template";
5+
import tsParser from "@typescript-eslint/parser";
6+
7+
export default [
8+
{
9+
ignores: ["**/dist/**", "**/node_modules/**"],
10+
},
11+
12+
js.configs.recommended,
13+
14+
{
15+
files: ["**/*.ts"],
16+
languageOptions: {
17+
parser: tsParser,
18+
parserOptions: {
19+
project: ["./token-generation/tsconfig.json"],
20+
tsconfigRootDir: import.meta.dirname,
21+
},
22+
globals: {
23+
console: "readonly",
24+
window: "readonly",
25+
document: "readonly",
26+
setTimeout: "readonly",
27+
atob: "readonly"
28+
},
29+
},
30+
plugins: {
31+
"@typescript-eslint": tseslint.plugin,
32+
"@angular-eslint": angular,
33+
},
34+
rules: {
35+
"@typescript-eslint/naming-convention": [
36+
"error",
37+
{selector: "class", format: ["PascalCase"]},
38+
],
39+
40+
curly: "error",
41+
eqeqeq: ["error", "always", {null: "ignore"}],
42+
"guard-for-in": "error",
43+
"max-len": ["error", {code: 140}],
44+
"no-bitwise": "error",
45+
"no-caller": "error",
46+
"no-console": "off",
47+
"no-debugger": "error",
48+
"no-empty": "error",
49+
"no-eval": "error",
50+
"no-fallthrough": "error",
51+
"no-trailing-spaces": "error",
52+
"no-unused-expressions": "error",
53+
"no-unused-labels": "error",
54+
"no-var": "error",
55+
quotes: ["error", "single"],
56+
radix: "error",
57+
semi: ["error", "always"],
58+
"spaced-comment": "error",
59+
"brace-style": ["error", "1tbs", {allowSingleLine: true}],
60+
61+
"@angular-eslint/directive-selector": [
62+
"error",
63+
{type: "attribute", prefix: "app", style: "camelCase"},
64+
],
65+
"@angular-eslint/component-selector": [
66+
"error",
67+
{type: "element", prefix: "app", style: "kebab-case"},
68+
],
69+
"@angular-eslint/no-output-rename": "error",
70+
"@angular-eslint/use-pipe-transform-interface": "error",
71+
"@angular-eslint/component-class-suffix": "error",
72+
"@angular-eslint/directive-class-suffix": "error",
73+
},
74+
},
75+
];

knox-token-generation-ui/package.json

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "ng-knox-token-generation",
33
"version": "1.0.0",
44
"license": "Apache-2.0",
5+
"type": "module",
56
"scripts": {
67
"start": "ng serve --verbose=true",
78
"build": "ng build",
@@ -10,30 +11,33 @@
1011
},
1112
"private": true,
1213
"dependencies": {
13-
"@angular/common": "^14.3.0",
14-
"@angular/compiler": "^14.3.0",
15-
"@angular/core": "^14.3.0",
16-
"@angular/forms": "^14.3.0",
17-
"@angular/platform-browser": "^14.3.0",
18-
"@angular/platform-browser-dynamic": "^14.3.0",
19-
"jquery": "^3.5.1",
20-
"sweetalert2": "^11.6.5",
21-
"zone.js": "~0.11.4"
14+
"@angular/common": "^20.3.15",
15+
"@angular/compiler": "^20.3.15",
16+
"@angular/core": "^20.3.15",
17+
"@angular/forms": "^20.3.15",
18+
"@angular/platform-browser": "^20.3.15",
19+
"@angular/platform-browser-dynamic": "^20.3.15",
20+
"@angular/material": "^20.2.5",
21+
"@angular/router": "^20.3.2",
22+
"jquery": "^3.7.1",
23+
"sweetalert2": "^11.26.3",
24+
"zone.js": "~0.15.1",
25+
"bootstrap": "^5.3.8"
2226
},
2327
"devDependencies": {
24-
"@angular-devkit/build-angular": "^13.3.11",
25-
"@angular-eslint/builder": "14.1.2",
26-
"@angular-eslint/eslint-plugin": "14.1.2",
27-
"@angular-eslint/eslint-plugin-template": "14.1.2",
28-
"@angular-eslint/schematics": "14.1.2",
29-
"@angular-eslint/template-parser": "14.1.2",
30-
"@angular/cli": "^14.2.9",
31-
"@angular/compiler-cli": "^14.3.0",
32-
"@angular/language-service": "^14.3.0",
33-
"@types/node": "16.18.11",
34-
"@typescript-eslint/eslint-plugin": "5.37.0",
35-
"@typescript-eslint/parser": "5.37.0",
36-
"eslint": "^8.23.1",
37-
"typescript": "~4.8.4"
28+
"@angular-devkit/build-angular": "^20.3.13",
29+
"@angular-eslint/builder": "20.7.0",
30+
"@angular-eslint/eslint-plugin": "20.7.0",
31+
"@angular-eslint/eslint-plugin-template": "20.7.0",
32+
"@angular-eslint/schematics": "20.7.0",
33+
"@angular-eslint/template-parser": "20.7.0",
34+
"@angular/cli": "^20.3.13",
35+
"@angular/compiler-cli": "^20.3.15",
36+
"@angular/language-service": "^20.3.15",
37+
"@types/node": "^24.5.2",
38+
"eslint": "^9.39.0",
39+
"ts-node": "~10.9.0",
40+
"typescript": "~5.8.3",
41+
"typescript-eslint": "^8.46.2"
3842
}
39-
}
43+
}

knox-token-generation-ui/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
<goal>npm</goal>
6666
</goals>
6767
<configuration>
68-
<arguments>install --legacy-peer-deps</arguments>
68+
<arguments>install</arguments>
6969
</configuration>
7070
</execution>
7171
<execution>

knox-token-generation-ui/token-generation/app/app.module.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,12 @@
1616
*/
1717
import { NgModule } from '@angular/core';
1818
import { BrowserModule } from '@angular/platform-browser';
19-
import { HttpClientModule } from '@angular/common/http';
20-
import { TokenGenerationComponent } from './token-generation.component';
2119
import { ReactiveFormsModule } from '@angular/forms';
22-
import { TokenGenService } from './token-generation.service';
23-
import { SessionInformationComponent } from './session.information.component';
24-
import { SafeHtmlPipe } from './session.information.component';
20+
import { TokenGenService } from './service/token-generation.service';
2521

2622
@NgModule({
27-
imports: [BrowserModule,
28-
HttpClientModule,
29-
ReactiveFormsModule
30-
],
31-
declarations: [TokenGenerationComponent, SessionInformationComponent, SafeHtmlPipe],
32-
providers: [TokenGenService],
33-
bootstrap: [TokenGenerationComponent, SessionInformationComponent]
23+
imports: [BrowserModule, ReactiveFormsModule],
24+
providers: [TokenGenService]
3425
})
3526
export class AppModule {
3627
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
export class SessionInformation {
19+
user: string;
20+
logoutUrl: string;
21+
logoutPageUrl: string;
22+
globalLgoutPageUrl: string;
23+
canSeeAllTokens: boolean;
24+
currentKnoxSsoCookieTokenId: string;
25+
bannerText: string;
26+
}

0 commit comments

Comments
 (0)