Skip to content

Commit

Permalink
Patternfly
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas committed Nov 13, 2023
1 parent 6e8920c commit f82d4e0
Show file tree
Hide file tree
Showing 46 changed files with 40,206 additions and 0 deletions.
9 changes: 9 additions & 0 deletions java-components/management-console/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
</parent>
<artifactId>management-console</artifactId>
<dependencies>
<dependency>
<groupId>io.quarkiverse.quinoa</groupId>
<artifactId>quarkus-quinoa</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
Expand All @@ -29,6 +34,10 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-reactive-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-openapi</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-scheduler</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.redhat.hacbs.management.importer;

import jakarta.annotation.PostConstruct;
import jakarta.inject.Inject;
import jakarta.inject.Singleton;

Expand All @@ -11,12 +12,14 @@
import com.redhat.hacbs.resources.model.v1alpha1.DependencyBuild;

import io.quarkus.logging.Log;
import io.quarkus.runtime.Startup;
import software.amazon.awssdk.services.s3.S3Client;
import software.amazon.awssdk.services.s3.model.GetObjectRequest;
import software.amazon.awssdk.services.s3.model.ListObjectsRequest;
import software.amazon.awssdk.services.s3.model.ListObjectsResponse;

@Singleton
@Startup
public class S3Importer {

private static final ObjectMapper MAPPER = new ObjectMapper(new YAMLFactory());
Expand All @@ -34,6 +37,7 @@ public class S3Importer {
@ConfigProperty(name = "bucket.name")
String bucketName;

@PostConstruct
public void doImport() {
Log.infof("Attempting S3 import");
importArtifactBuilds();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ concurrent-builds=20
quarkus.s3.aws.region=us-east-1
quarkus.s3.aws.credentials.type=default
quarkus.s3.devservices.enabled=false
quarkus.quinoa.package-manager-install.node-version=18.18.2
quarkus.quinoa.package-manager-install.npm-version=9.8.1
quarkus.quinoa.dev-server.port=9000
quarkus.quinoa.build-dir=dist
17 changes: 17 additions & 0 deletions java-components/management-console/src/main/webui/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.snap]
max_line_length = off
trim_trailing_whitespace = false

[*.md]
max_line_length = off
trim_trailing_whitespace = false
76 changes: 76 additions & 0 deletions java-components/management-console/src/main/webui/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
module.exports = {
// tells eslint to use the TypeScript parser
"parser": "@typescript-eslint/parser",
// tell the TypeScript parser that we want to use JSX syntax
"parserOptions": {
"tsx": true,
"jsx": true,
"js": true,
"useJSXTextNode": true,
"project": "./tsconfig.json",
"tsconfigRootDir": "."
},
// we want to use the recommended rules provided from the typescript plugin
"extends": [
"@redhat-cloud-services/eslint-config-redhat-cloud-services",
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended"
],
"globals": {
"window": "readonly",
"describe": "readonly",
"test": "readonly",
"expect": "readonly",
"it": "readonly",
"process": "readonly",
"document": "readonly",
"insights": "readonly",
"shallow": "readonly",
"render": "readonly",
"mount": "readonly"
},
"overrides": [
{
"files": ["src/**/*.ts", "src/**/*.tsx"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": ["plugin:@typescript-eslint/recommended"],
"rules": {
"react/prop-types": "off",
"@typescript-eslint/no-unused-vars": "error"
},
},
],
"settings": {
"react": {
"version": "^16.11.0"
}
},
// includes the typescript specific rules found here: https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#supported-rules
"plugins": [
"@typescript-eslint",
"react-hooks",
"eslint-plugin-react-hooks"
],
"rules": {
"sort-imports": [
"error",
{
"ignoreDeclarationSort": true
}
],
"@typescript-eslint/explicit-function-return-type": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"@typescript-eslint/interface-name-prefix": "off",
"prettier/prettier": "off",
"import/no-unresolved": "off",
"import/extensions": "off",
"react/prop-types": "off"
},
"env": {
"browser": true,
"node": true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Bug report
about: Create a report to help us improve the react seed
title: ''
labels: needs triage
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI
on:
pull_request:
push:
branches:
- main
- release*

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Install dependencies
run: npm install
- name: Run eslint
run: npm run lint
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Install dependencies
run: npm install
- name: Run tests
run: npm run test
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Install dependencies
run: npm install
- name: Attempt a build
run: npm run build
10 changes: 10 additions & 0 deletions java-components/management-console/src/main/webui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
**/node_modules
dist
yarn-error.log
yarn.lock
stats.json
coverage
storybook-static
.DS_Store
.idea
.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package.json
4 changes: 4 additions & 0 deletions java-components/management-console/src/main/webui/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"printWidth": 120
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// https://storybook.js.org/blog/storybook-for-webpack-5/
module.exports = {
// https://gist.github.com/shilman/8856ea1786dcd247139b47b270912324#upgrade
core: {
builder: "webpack5",
},
stories: ['../stories/*.stories.tsx'],
addons: [
'@storybook/addon-knobs',
],
typescript: {
check: false,
checkOptions: {},
reactDocgen: 'react-docgen-typescript'
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@patternfly/react-core/dist/styles/base.css';
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../tsconfig.json"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const path = require('path');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const appConfig = require('../webpack.common');
const { stylePaths } = require("../stylePaths");

module.exports = ({ config, mode }) => {
config.module.rules = [];
config.module.rules.push(...appConfig(mode).module.rules);
config.module.rules.push({
test: /\.css$/,
include: [
path.resolve(__dirname, '../node_modules/@storybook'),
...stylePaths
],
use: ["style-loader", "css-loader"]
});
config.module.rules.push({
test: /\.tsx?$/,
include: path.resolve(__dirname, '../src'),
use: [
require.resolve('react-docgen-typescript-loader'),
],
})
config.resolve.plugins = [
new TsconfigPathsPlugin({
configFile: path.resolve(__dirname, "../tsconfig.json")
})
];
config.resolve.extensions.push('.ts', '.tsx');
return config;
};
21 changes: 21 additions & 0 deletions java-components/management-console/src/main/webui/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Red Hat

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit f82d4e0

Please sign in to comment.