Skip to content

Commit 1c995f4

Browse files
authored
NIFI-14319: Create initial project structure for new NiFi Registry UI (#9855)
* NIFI-14319: init new registry app * NIFI-14319: add unit test coverage * NIFI-14319: update redirect value * Remove commented code in droplet filter * NIFI-14319: remove commented code from current user effects * NIFI-14319: remove commented code from bucket reducer * NIFI-14319: remove commented code from index.ts * NIFI-14319: address initial feedback * check if window.matchMedia has value before calling method * add empty states to explorer table * destroy direct store subscriptions * add filtered count to droplet table filter * NIFI-14319: add wrongly removed favicon back to old project * NIFI-14319: fix CI build failures * Linux solution: https://github.com/evanw/esbuild/issues/1819\#issuecomment-2426254293 * Windows solution: nrwl/nx#29551 * NIFI-14319: fix alt value used for registry logo * NIFI-14319: review feedback * fix error service * NIFI-14319: address naming and formatting feedback * NIFI-14319: address review feedback * fix multiple namings * template cleanup * configuration changes to align better with NiFi * style fixes * NIFI-14319: refactor droplet table into standalone component * NIFI-14319: align banner error handling with NiFi UX * NIFI-14319: align file upload UX with NiFi UI * NIFI-14319: additional dialog header and button style tweaks * NIFI-14319: update logo styling * NIFI-14319: error handling improvements * NIFI-14319: use NiFi file pick UX in import new flow dialog * NIFI-14319: remove unused directory * NIFI-14319: cleanup action types and fix missing import description * NIFI-14319: address feedback * use px units instead of calc for logo container * use unique contexts for dialog errors * update explorer page title * margin and sizing class updates * run prettier to fix formatting issues * NIFI-14319: move context error into shared lib * NIFI-14319: remove current user code * NIFI-14319: remove old context error code from registry * NIFI-14319: update explorer naming to resources * NIFI-14319: remove circular dependency * NIFI-14319: remove error abstractions from shared folder * NIFI-14319: update out-of-sync lock file * NIFI-14319: a few minor changes * remove rej file * remove unused deps * add standalone to components missing that configuration * hadle legacy routes * NIFI-14319: restore ignore path for favicon in old ui gitignore * NIFI-14319: update lock file * NIFI-14319: fix build issues
1 parent 97115f2 commit 1c995f4

File tree

98 files changed

+5255
-21
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+5255
-21
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": ["!**/*"],
4+
"parserOptions": {
5+
"ecmaVersion": "latest"
6+
},
7+
"overrides": [
8+
{
9+
"files": ["*.ts"],
10+
"extends": [
11+
"plugin:@nx/angular",
12+
"eslint:recommended",
13+
"plugin:@typescript-eslint/recommended",
14+
"plugin:@angular-eslint/recommended",
15+
"plugin:@angular-eslint/template/process-inline-templates",
16+
"plugin:prettier/recommended"
17+
],
18+
"rules": {
19+
"@angular-eslint/directive-selector": [
20+
"error",
21+
{
22+
"type": "attribute",
23+
"prefix": "",
24+
"style": "camelCase"
25+
}
26+
],
27+
"@angular-eslint/component-selector": [
28+
"error",
29+
{
30+
"type": "element",
31+
"prefix": "",
32+
"style": "kebab-case"
33+
}
34+
],
35+
"@angular-eslint/component-class-suffix": "off",
36+
"@typescript-eslint/no-explicit-any": "off",
37+
"@typescript-eslint/ban-ts-comment": "off",
38+
"@typescript-eslint/no-non-null-assertion": "off",
39+
"@typescript-eslint/no-this-alias": "warn",
40+
"@typescript-eslint/no-unused-vars": "warn",
41+
"no-useless-escape": "off",
42+
"@angular-eslint/prefer-standalone": "off"
43+
}
44+
}
45+
]
46+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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 default {
19+
displayName: 'NiFi Registry',
20+
preset: '../../jest.preset.js',
21+
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
22+
coverageDirectory: '../../coverage/apps/nifi-registry',
23+
transform: {
24+
'^.+\\.(ts|mjs|js|html)$': [
25+
'jest-preset-angular',
26+
{
27+
tsconfig: '<rootDir>/tsconfig.spec.json',
28+
stringifyContentPathRegex: '\\.(html|svg)$'
29+
}
30+
]
31+
},
32+
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
33+
snapshotSerializers: [
34+
'jest-preset-angular/build/serializers/no-ng-attributes',
35+
'jest-preset-angular/build/serializers/ng-snapshot',
36+
'jest-preset-angular/build/serializers/html-comment'
37+
]
38+
};
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
{
2+
"name": "nifi-registry",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"projectType": "application",
5+
"generators": {
6+
"@schematics/angular:component": {
7+
"style": "scss"
8+
}
9+
},
10+
"prefix": "app",
11+
"sourceRoot": "apps/nifi-registry/src",
12+
"targets": {
13+
"build": {
14+
"executor": "@nx/angular:application",
15+
"outputs": ["{options.outputPath}"],
16+
"options": {
17+
"outputPath": "dist/nifi-registry",
18+
"index": "apps/nifi-registry/src/index.html",
19+
"browser": "apps/nifi-registry/src/main.ts",
20+
"polyfills": ["zone.js"],
21+
"tsConfig": "apps/nifi-registry/tsconfig.app.json",
22+
"inlineStyleLanguage": "scss",
23+
"assets": [
24+
{
25+
"glob": "**/*.svg",
26+
"input": "libs/shared/src/assets/",
27+
"output": "./assets"
28+
}
29+
],
30+
"styles": ["apps/nifi-registry/src/styles.scss"],
31+
"stylePreprocessorOptions": {
32+
"includePaths": [""]
33+
},
34+
"scripts": [],
35+
"preserveSymlinks": true
36+
},
37+
"configurations": {
38+
"production": {
39+
"budgets": [
40+
{
41+
"type": "initial",
42+
"maximumWarning": "500kb",
43+
"maximumError": "1mb"
44+
},
45+
{
46+
"type": "anyComponentStyle",
47+
"maximumWarning": "2kb",
48+
"maximumError": "4kb"
49+
}
50+
],
51+
"outputHashing": "all",
52+
"optimization": true
53+
},
54+
"development": {
55+
"optimization": false,
56+
"extractLicenses": false,
57+
"sourceMap": true,
58+
"preserveSymlinks": true,
59+
"namedChunks": true,
60+
"outputHashing": "none",
61+
"assets": [
62+
{
63+
"glob": "**/*.svg",
64+
"input": "libs/shared/src/assets/",
65+
"output": "./assets"
66+
}
67+
],
68+
"fileReplacements": [
69+
{
70+
"replace": "apps/nifi-registry/src/environments/environment.ts",
71+
"with": "apps/nifi-registry/src/environments/environment.development.ts"
72+
}
73+
]
74+
}
75+
},
76+
"defaultConfiguration": "production"
77+
},
78+
"serve": {
79+
"executor": "@nx/angular:dev-server",
80+
"configurations": {
81+
"production": {
82+
"buildTarget": "nifi-registry:build:production"
83+
},
84+
"development": {
85+
"buildTarget": "nifi-registry:build:development",
86+
"servePath": "/nifi-registry"
87+
}
88+
},
89+
"defaultConfiguration": "development",
90+
"options": {
91+
"proxyConfig": "apps/nifi-registry/proxy.config.mjs",
92+
"buildTarget": "nifi-registry:build",
93+
"port": 4204
94+
},
95+
"continuous": true
96+
},
97+
"extract-i18n": {
98+
"executor": "@angular-devkit/build-angular:extract-i18n",
99+
"options": {
100+
"buildTarget": "nifi-registry:build"
101+
}
102+
},
103+
"lint": {
104+
"executor": "@nx/eslint:lint",
105+
"outputs": ["{options.outputFile}"]
106+
},
107+
"lint:fix": {
108+
"executor": "@nx/eslint:lint",
109+
"options": {
110+
"fix": true
111+
},
112+
"outputs": ["{options.outputFile}"]
113+
},
114+
"prettier": {
115+
"executor": "nx:run-commands",
116+
"options": {
117+
"command": "npm run prettier"
118+
}
119+
},
120+
"prettier:format": {
121+
"executor": "nx:run-commands",
122+
"options": {
123+
"command": "npm run prettier-format"
124+
}
125+
},
126+
"test": {
127+
"executor": "@nx/jest:jest",
128+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
129+
"options": {
130+
"jestConfig": "apps/nifi-registry/jest.config.ts"
131+
}
132+
}
133+
}
134+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
const target = {
19+
target: 'http://localhost:18080',
20+
secure: false,
21+
logLevel: 'debug',
22+
changeOrigin: true,
23+
headers: {
24+
'X-ProxyScheme': 'http',
25+
'X-ProxyPort': 4204
26+
},
27+
configure: (proxy, _options) => {
28+
proxy.on('error', (err, _req, _res) => {
29+
console.log('proxy error', err);
30+
});
31+
proxy.on('proxyReq', (proxyReq, req, _res) => {
32+
console.log('Sending Request to the Target:', req.method, req.url);
33+
});
34+
proxy.on('proxyRes', (proxyRes, req, _res) => {
35+
console.log('Received Response from the Target:', proxyRes.statusCode, req.url);
36+
});
37+
},
38+
bypass: function (req) {
39+
if (req.url.startsWith('/nifi-registry/')) {
40+
return req.url;
41+
}
42+
}
43+
};
44+
45+
export default {
46+
'/**': target
47+
};
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
import { NgModule } from '@angular/core';
19+
import { RouterModule, Routes } from '@angular/router';
20+
21+
const routes: Routes = [
22+
{
23+
path: '',
24+
redirectTo: 'explorer',
25+
pathMatch: 'full'
26+
},
27+
{
28+
path: 'explorer',
29+
loadChildren: () => import('./pages/resources/feature/resources.module').then((m) => m.ResourcesModule)
30+
},
31+
// Backward compatibility: old app's default route
32+
{
33+
path: 'nifi-registry',
34+
redirectTo: 'explorer',
35+
pathMatch: 'full'
36+
}
37+
// TODO: buckets
38+
// TODO: Users/groups
39+
// TODO: Page not found
40+
];
41+
42+
@NgModule({
43+
imports: [
44+
RouterModule.forRoot(routes, {
45+
paramsInheritanceStrategy: 'always',
46+
useHash: true
47+
})
48+
],
49+
exports: [RouterModule]
50+
})
51+
export class AppRoutingModule {}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
<div class="flex flex-col h-screen">
19+
<header class="mb-5 nifi-registry-header">
20+
<app-header></app-header>
21+
</header>
22+
<router-outlet></router-outlet>
23+
</div>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
*/

0 commit comments

Comments
 (0)