Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bartoval committed Feb 6, 2024
1 parent bd41b0a commit b8633b4
Show file tree
Hide file tree
Showing 70 changed files with 11,069 additions and 5 deletions.
20 changes: 20 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Javascript builds
.DS_Store
dist
node_modules
src/local
# package managers
npm-debug.log*
yarn-error.log*
package-lock.json
.eslintcache
# IDEs and editors
.idea
.project
.classpath
.c9
*.launch
.settings
*.sublime-workspace
.history
.vscode
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 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

[*.md]
max_line_length = off
trim_trailing_whitespace = false
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
**/*.js
175 changes: 175 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
{
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"typescript": {},
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
},
"import/extensions": [".ts", ".tsx"],
"react": {
"version": "detect"
}
},
"env": {
"browser": true,
"es2021": true,
"node": true,
"jest": true
},
"globals": {
"JSX": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"comment": true,
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"extraFileExtensions": [".json"],
"sourceType": "module",
"project": ["tsconfig.json"],
"tsconfigRootDir": "./"
},
"plugins": ["react", "react-hooks", "@typescript-eslint"],
"rules": {
"arrow-body-style": ["error", "as-needed"],
"padding-line-between-statements": "off",
"import/prefer-default-export": "off",
"import/no-cycle": [
"error",
{
"maxDepth": 10,
"ignoreExternal": true
}
],
"no-console": 1,
"semi": [1, "always"],
"eol-last": 2,
"consistent-return": 0,
"consistent-this": [1, "that"],
"curly": [2, "all"],
"default-case": [2],
"dot-notation": [2],
"no-multiple-empty-lines": [
2,
{
"max": 2,
"maxEOF": 0
}
],
"eqeqeq": [2, "allow-null"],
"guard-for-in": 2,
"import/no-unresolved": ["error"],
"import/no-duplicates": ["error"],
"max-nested-callbacks": [1, 4],
"newline-before-return": "error",
"no-alert": 2,
"no-caller": 2,
"no-constant-condition": 2,
"no-debugger": 2,
"no-else-return": ["error"],
"no-global-strict": 0,
"no-irregular-whitespace": ["error"],
"no-param-reassign": ["warn", { "props": true, "ignorePropertyModificationsFor": ["acc", "node"] }],
"no-shadow": "off",
"no-underscore-dangle": 0,
"no-var": 2,
"no-unused-vars": "off",
"object-shorthand": ["error", "properties"],
"prefer-const": [
"error",
{
"destructuring": "all"
}
],
"prefer-template": 2,
"radix": 2,
"import/newline-after-import": [
"error",
{
"count": 1
}
],
"import/order": [
"warn",
{
"newlines-between": "always",
"alphabetize": {
"caseInsensitive": true,
"order": "asc"
},
"groups": ["builtin", "external", "internal", ["parent", "sibling"]],
"pathGroupsExcludedImportTypes": ["react"],
"pathGroups": [
{
"pattern": "react",
"group": "external",
"position": "before"
}
]
}
],
"react/jsx-filename-extension": [1, { "extensions": [".ts", ".tsx"] }],
"react/jsx-fragments": "error",
"react/react-in-jsx-scope": "off",
"react/jsx-no-duplicate-props": 2,
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"react/function-component-definition": [
"error",
{
"namedComponents": "function-expression",
"unnamedComponents": "function-expression"
}
],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"react/no-string-refs": 1,
"react/no-unknown-property": "error",
"react/jsx-no-useless-fragment": "error",
"react/no-unescaped-entities": 0,
"react/prop-types": 0,
"react/self-closing-comp": [
"error",
{
"component": true,
"html": false
}
],
"react/display-name": 0,
"require-atomic-updates": 0,
"@typescript-eslint/no-shadow": ["error", { "ignoreTypeValueShadow": true }],
"@typescript-eslint/padding-line-between-statements": [
"error",
{
"blankLine": "always",
"next": "*",
"prev": ["interface", "type", "function"]
}
],
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": ["enum", "enumMember"],
"format": ["PascalCase"]
}
],
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-use-before-define": 0,
"@typescript-eslint/no-unused-vars": ["error"]
}
}
16 changes: 16 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.ts text eol=lf
*.tsx text eol=lf
*.js text eol=lf
*.jsx text eol=lf
*.json text eol=lf
*.md text eol=lf

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.ico binary
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

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

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

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

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

**browser (please complete the following information):**

- Browser [e.g. firefox, chrome]

**Additional context**
Add any other context about the problem here.
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Javascript builds
.DS_Store
dist
node_modules
coverage

# package managers
npm-debug.log*
yarn-error.log*
package-lock.json

.eslintcache
# IDEs and editors
.idea
.project
.classpath
.c9
*.launch
.settings
*.sublime-workspace
.history
.vscode
# For vim
*.swp
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": true,
"printWidth": 120,
"singleQuote": true,
"trailingComma": "none",
"useTabs": false,
"tabWidth": 2
}
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM registry.access.redhat.com/ubi9/nodejs-18 AS build

USER root
RUN command -v yarn || npm i -g yarn

ADD . /usr/src/app/skupper_console
WORKDIR /usr/src/app/skupper_console
RUN yarn install --network-timeout 7200000 && yarn build

FROM registry.access.redhat.com/ubi9/nginx-122:1-45

# Add application sources to a directory that the assemble script expects them
# and set permissions so that the container runs without root access
USER 0

COPY --from=build /usr/src/app//skupper_console/dist /usr/share/nginx/html/
# add locales
ADD ./locales /usr/share/nginx/html/locales
RUN chown -R 1001:0 /usr/share/nginx/html/
RUN rm -rf ./*

ARG VERSION_PLUGIN
ARG COMMIT_HASH
RUN printf "\necho 'OpenShift Service Interconnect Console: Version=[${VERSION_PLUGIN}], Commit=[${COMMIT_HASH}]' >> /proc/1/fd/1" >> ${NGINX_CONTAINER_SCRIPTS_PATH}/common.sh

USER 1001
LABEL com.redhat.component="openshift-service-interconnect-console" \
name="openshift-service-interconnect-console" \
summary="OpenShift Service interconnect Console" \
description="The OpenShift Service interconnect Console adds configuration and validation into the OpenShift Console." \
version=$VERSION_PLUGIN \
commit=$COMMIT_HASH

# Run script uses standard ways to run the application
CMD /usr/libexec/s2i/run
7 changes: 4 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Apache License
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

Expand Down Expand Up @@ -178,15 +178,15 @@
APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2018 Red Hat, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -199,3 +199,4 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Loading

0 comments on commit b8633b4

Please sign in to comment.