-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/CH-95
- Loading branch information
Showing
243 changed files
with
5,661 additions
and
12,513 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module.exports = { | ||
root: true, | ||
env: { browser: true, es2020: true }, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:react-hooks/recommended', | ||
], | ||
ignorePatterns: ['dist', '.eslintrc.cjs', 'src/rest/*'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['react-refresh'], | ||
rules: { | ||
'react-refresh/only-export-components': [ | ||
'warn', | ||
{ allowConstantExport: true }, | ||
], | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/favicon.png" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>CloudHarness sample application</title> | ||
</head> | ||
|
||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,11 @@ | ||
{ | ||
"name": "__APP_NAME__", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"prebuild": "eslint . --color", | ||
"build": "webpack --config webpack.config.js", | ||
"build-dev": "webpack --config webpack.config.js --env mode=development", | ||
"prestart": "eslint . --color --fix", | ||
"start": "webpack serve --progress --env DOMAIN=http://localhost:5000 --config webpack.config.dev.js", | ||
"start:dev": "webpack serve --progress --env.DOMAIN=https://__APP_NAME__.cloudharness.metacell.us --config webpack.config.dev.js", | ||
"start:local": "webpack serve --progress --env DOMAIN=http://__APP_NAME__.ch.local --config webpack.config.dev.js" | ||
}, | ||
"author": "", | ||
"license": "MIT", | ||
"dependencies": { | ||
"axios": "^0.21.1", | ||
"react": "^16.12.0", | ||
"react-dom": "^16.12.0", | ||
"react-router": "^5.0.0", | ||
"react-router-dom": "^5.0.0", | ||
"use-clipboard-copy": "^0.1.2" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.8.3", | ||
"@babel/plugin-proposal-class-properties": "^7.8.3", | ||
"@babel/preset-env": "^7.8.3", | ||
"@babel/preset-react": "^7.8.3", | ||
"babel-eslint": "^10.1.0", | ||
"babel-loader": "^8.0.6", | ||
"babel-plugin-module-resolver": "^4.0.0", | ||
"babel-preset-minify": "^0.5.1", | ||
"clean-webpack-plugin": "^3.0.0", | ||
"compression-webpack-plugin": "^7.1.2", | ||
"copy-webpack-plugin": "^6.2.1", | ||
"css-loader": "^5.2.4", | ||
"dotenv": "^16.0.2", | ||
"eslint": "5.16.0", | ||
"eslint-plugin-jest": "^23.8.2", | ||
"eslint-plugin-react": "^7.19.0", | ||
"eslint-plugin-react-hooks": "^3.0.0", | ||
"file-loader": "^5.0.2", | ||
"html-loader": "^0.5.5", | ||
"html-webpack-plugin": "^5.5.0", | ||
"image-webpack-loader": "^8.1.0", | ||
"less": "^3.10.3", | ||
"less-loader": "^6.1.2", | ||
"less-vars-to-js": "^1.3.0", | ||
"raw-loader": "^4.0.2", | ||
"style-loader": "^1.1.3", | ||
"ts-loader": "^9.0.0", | ||
"typescript": "^4.8.3", | ||
"webpack": "^5.61.0", | ||
"webpack-cli": "^4.6.0", | ||
"webpack-dev-server": "^4.5.0", | ||
"webpack-merge": "^5.7.0" | ||
"dev": "vite", | ||
"start": "DOMAIN=http://localhost:5000 vite", | ||
"start:dev": "DOMAIN=https://test.ch.metacell.us vite", | ||
"start:local": "DOMAIN=http://samples.ch vite", | ||
"prebuild": "eslint .", | ||
"build": "vite build" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import React from 'react'; | ||
import './styles/style.less'; | ||
|
||
import RestTest from './components/RestTest'; | ||
import Version from './components/Version'; | ||
|
||
|
||
const Main = () => ( | ||
<> | ||
<img src="/assets/icon.png" /> | ||
<h1>Sample React application is working!</h1> | ||
<img src="/logo.png" width="800" /> | ||
<h1>__APP_NAME__ React application is working!</h1> | ||
<Version /> | ||
<RestTest /> | ||
<p>See api documentation <a href="/api/ui">here</a></p> | ||
<p>See api documentation <a href="/api/ui/">here</a></p> | ||
</> | ||
); | ||
) | ||
|
||
|
||
export default Main; | ||
export default Main; |
12 changes: 7 additions & 5 deletions
12
application-templates/webapp/frontend/src/components/RestTest.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
import React, { useState, useEffect } from 'react'; | ||
import { useState, useEffect } from 'react'; | ||
|
||
|
||
import { TestApi } from '../rest/api' | ||
import { TestApi } from '../rest/apis/TestApi' | ||
const test = new TestApi(); | ||
|
||
|
||
|
||
const RestTest = () => { | ||
const [result, setResult] = useState(null); | ||
const [result, setResult] = useState<any>(null); | ||
useEffect(() => { | ||
test.ping().then(r => setResult(r), () => setResult({ data: "API error"})); | ||
test.ping().then((r) => setResult(r), () => setResult( "API error")); | ||
}, []); | ||
|
||
|
||
return result ? <p>Backend answered: { result.data } </p> : <p>Backend did not answer</p> | ||
return result ? <p>Backend answered: { result } </p> : <p>Backend did not answer</p> | ||
} | ||
|
||
export default RestTest; |
19 changes: 19 additions & 0 deletions
19
application-templates/webapp/frontend/src/components/Version.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { useState, useEffect } from 'react'; | ||
|
||
|
||
|
||
const Version = () => { | ||
const [result, setResult] = useState<any>(null); | ||
useEffect(() => { | ||
fetch("/proxy/common/api/version", { | ||
headers: { | ||
'Accept': 'application/json' | ||
} | ||
}).then(r => r.json().then(j => setResult(j)), () => setResult("API error")); | ||
}, []); | ||
|
||
|
||
return result ? <p>Tag: { result?.tag } - Build: {result?.build} </p> : <p>Backend did not answer</p> | ||
} | ||
|
||
export default Version; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
body { | ||
text-align: center; | ||
background-color: '#eeeeee'; | ||
font-family: Roboto, Helvetica, sans-serif; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.