Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renewal dashboard frontend #83

Merged
merged 94 commits into from
Apr 25, 2019
Merged
Show file tree
Hide file tree
Changes from 77 commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
6d2efd2
Use `formik` instead `redux-form`
keigohtr Mar 14, 2019
e1bcbc8
Update constants
keigohtr Mar 14, 2019
649a164
Update `/apis`
keigohtr Mar 14, 2019
afb817d
Update `/actions`
keigohtr Mar 14, 2019
58ee1b7
Update `/reducers`
keigohtr Mar 15, 2019
40a061c
Update `/app.tsx`
keigohtr Mar 15, 2019
3549232
Add yup
keigohtr Mar 18, 2019
de0047a
Fix variable `id` to an appropriate variable name
keigohtr Mar 18, 2019
87d57ef
Fix Admin
keigohtr Mar 18, 2019
5432345
Fix minor
keigohtr Apr 8, 2019
5f7bf68
Add Field template
keigohtr Apr 8, 2019
7b00be9
Renew `Admin`
keigohtr Apr 8, 2019
fd75f57
Renew `Login`
keigohtr Apr 8, 2019
7c2dfd8
Renew `Kubernetes`
keigohtr Apr 8, 2019
d7c32f3
Add `SaveProject`
keigohtr Apr 8, 2019
57f3056
Add `DataServer`
keigohtr Apr 8, 2019
c8e7c34
Remove `Deploy` Add `Dashboard`
keigohtr Apr 8, 2019
0f847e1
Renew `Application`
keigohtr Apr 8, 2019
db836f6
Refactor
keigohtr Apr 8, 2019
688ea9a
Renew `Model`
keigohtr Apr 8, 2019
3649c35
Renew `Models`
keigohtr Apr 8, 2019
a2e0d91
Renew `Service`
keigohtr Apr 8, 2019
822beeb
Renew `Services`
keigohtr Apr 8, 2019
61dcf67
Add dummy `ServiceRouting`
keigohtr Apr 8, 2019
d8e0c7b
Renew `App`
keigohtr Apr 8, 2019
4464488
Fix bug `oneof` to `oneOf`
keigohtr Apr 8, 2019
7e1db75
Add Kubernetes mode endpoint
keigohtr Apr 10, 2019
b66dbfc
Fix bug
keigohtr Apr 10, 2019
417b707
Add Formik Field component
keigohtr Apr 10, 2019
b43583f
Fix bug
keigohtr Apr 10, 2019
056942e
Fix bugs of `Project`
keigohtr Apr 10, 2019
f59c7d7
Fix bugs of `DataServer`
keigohtr Apr 10, 2019
af5a137
Fix bugs of `Kubernetes`
keigohtr Apr 10, 2019
1d8aa0d
Fix bugs of `react-router-dom` route
keigohtr Apr 10, 2019
7f6a0d9
Change endpoint
keigohtr Apr 10, 2019
0b1298c
Fix bug
keigohtr Apr 10, 2019
7e66946
Fix bugs of `Applications`
keigohtr Apr 10, 2019
bed5f8e
Update fontawesome
keigohtr Apr 11, 2019
17fc07d
Remove `;`
keigohtr Apr 11, 2019
5aaa161
Fix bugs
keigohtr Apr 11, 2019
ff0aa78
Fix minor
keigohtr Apr 11, 2019
dd70ecb
Fix bugs of `Model`
keigohtr Apr 11, 2019
4309c45
Minor fix
keigohtr Apr 12, 2019
629e802
Fix backend
keigohtr Apr 12, 2019
6f8f039
Fix bugs of `Service`
keigohtr Apr 12, 2019
9fc2d29
Fix test
keigohtr Apr 14, 2019
f2a7a98
Update `Services`
keigohtr Apr 15, 2019
f0e7e0c
Minor fix
keigohtr Apr 15, 2019
7ed46ea
Fix bugs
keigohtr Apr 16, 2019
834dc1c
Add `ServiceRouting`
keigohtr Apr 16, 2019
03b47b6
Add Validator to `ServiceRouting`
keigohtr Apr 16, 2019
b10b48c
Fix bugs
keigohtr Apr 16, 2019
946c2e3
Fix bugs of `switch models`
keigohtr Apr 16, 2019
1557e81
Fix bugs
keigohtr Apr 16, 2019
ab3d480
Fix bugs of `Login`
keigohtr Apr 16, 2019
b725b9f
Fix bugs of `ProjectAdmin`
keigohtr Apr 16, 2019
af18f39
Fix bugs of `ApplicationAdmin`
keigohtr Apr 16, 2019
3cebc6a
Fix minor
keigohtr Apr 17, 2019
658039b
Fix behavior of `Kubernetes` when authenticated
keigohtr Apr 17, 2019
3ffd2d6
Fix minor
keigohtr Apr 17, 2019
57984b3
Fix behavior of `DataServer` when authenticated
keigohtr Apr 17, 2019
9a965c0
Fix behavior of `ProjectAdmin` when authenticated
keigohtr Apr 17, 2019
d598a15
Fix bugs
keigohtr Apr 17, 2019
0434bf3
Fix bugs
keigohtr Apr 17, 2019
15e591a
Fix behavior of `ApplicationAdmin` when authenticated
keigohtr Apr 17, 2019
beb507c
Fix behavior of `Services` when authenticated
keigohtr Apr 17, 2019
86f7300
Fix bugs
keigohtr Apr 17, 2019
783e0fc
Change behavior of `api_admin`
keigohtr Apr 17, 2019
8f44984
Remove unnecessary import
keigohtr Apr 18, 2019
1f18ff0
Fix minor
keigohtr Apr 18, 2019
cdf2525
Fix bugs of `Login`
keigohtr Apr 18, 2019
210690c
Add `id` specified notification
keigohtr Apr 18, 2019
3b02b3f
Fix minor bug
keigohtr Apr 18, 2019
7442046
Add ProjectAdmin checker
keigohtr Apr 18, 2019
a8b47e8
Fix bugs of `ServiceRouting`
keigohtr Apr 18, 2019
3f87dbb
Remove unnecessary API call
keigohtr Apr 18, 2019
545c6a0
Fix bugs of parsing `boolean` value
keigohtr Apr 22, 2019
e8c17a4
Remove `is_kubernetes_mode` endpoint
keigohtr Apr 22, 2019
fbea39b
Add `use_kubernetes` field to `Project` table
keigohtr Apr 22, 2019
1e1eccd
Replace `kubernetes_mode` to `use_kubernetes`
keigohtr Apr 22, 2019
eb96ba1
Update test
keigohtr Apr 22, 2019
acda3df
Merge pull request #85 from rekcurd/feature/add-kubernetes-mode-flag-…
keigohtr Apr 24, 2019
2c38cb0
Fix typo `failue` -> `failure`
keigohtr Apr 24, 2019
1a1853d
Add `fetchProjectByIdStatus` to restrict invalid access
keigohtr Apr 24, 2019
6725f62
Fix typo `unauhorized` -> `unauthorized`
keigohtr Apr 24, 2019
88b93ce
Fix typo `failue` -> `failure`
keigohtr Apr 24, 2019
b607bc6
Remove unnecessary `snakenize`
keigohtr Apr 25, 2019
91b19ce
Delete unnecessary code (`config.json`)
keigohtr Apr 25, 2019
61be661
Use `reactstrap.CustomInput`
keigohtr Apr 25, 2019
053a405
Set default value to set `initialValues` to non-null values
keigohtr Apr 25, 2019
df5f048
Use `setSubmitting(false)` after submission
keigohtr Apr 25, 2019
ed85815
Use `setSubmitting(false)` after request
keigohtr Apr 25, 2019
eef6b53
remove redux-thunk
yuki-mt Apr 25, 2019
aa57b23
Merge pull request #89 from rekcurd/fix/remove-redux-thunk
keigohtr Apr 25, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e_test/apis/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_post(self):
with open(POSITIVE_MODEL_PATH, 'rb') as f:
response = self.client.post(
f'/api/projects/{TEST_PROJECT_ID}/applications/{TEST_APPLICATION_ID}/models',
data={'file': (f, model_name), 'description': 'A model always return positive labels.'})
data={'filepath': (f, model_name), 'description': 'A model always return positive labels.'})
self.assertEqual(200, response.status_code)

# Use `ls` to see the model exists or not
Expand Down
4 changes: 3 additions & 1 deletion e2e_test/apis/test_service_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def test_post(self):
response = self.client.delete(self.__DELETE_URL)
self.assertEqual(200, response.status_code)

display_name = "test"
container = WorkerConfiguration.deployment['spec']['template']['spec']['containers'][0]
service_level = WorkerConfiguration.deployment['metadata']['namespace']
container_image = container['image']
Expand All @@ -65,7 +66,8 @@ def test_post(self):

response = self.client.post(
self.__URL,
data={'service_level': service_level, 'container_image': container_image,
data={'display_name': display_name,
'service_level': service_level, 'container_image': container_image,
'service_model_assignment': service_model_assignment,
'resource_request_cpu': resource_request_cpu, 'resource_request_memory': resource_request_memory,
'service_git_url': service_git_url, 'service_git_branch': service_git_branch,
Expand Down
7 changes: 4 additions & 3 deletions e2e_test/apis/test_service_routing.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import json
from e2e_test.base import (
BaseTestCase, TEST_PROJECT_ID, TEST_APPLICATION_ID, TEST_SERVICE_ID
)
Expand All @@ -12,9 +13,9 @@ def test_get(self):

def test_patch(self):
service_level = "development"
service_ids = [TEST_SERVICE_ID]
service_weights = [100]
service_weights = [{'service_id': TEST_SERVICE_ID, 'service_weight': 100}]
response = self.client.patch(
self.__URL,
data={'service_level': service_level, 'service_ids': service_ids, 'service_weights': service_weights})
data=json.dumps({'service_level': service_level, 'service_weights': service_weights}),
content_type='application/json')
self.assertEqual(200, response.status_code)
5 changes: 3 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"babel-preset-react": "^6.24.1",
"css-loader": "^0.28.11",
"express": "^4.16.3",
"formik": "^1.5.1",
"html-webpack-plugin": "3.0.7",
"node-sass": "^4.9.0",
"react": "^16.4.1",
Expand All @@ -34,7 +35,6 @@
"react-router-dom": "^4.3.1",
"reactstrap": "^6.1.0",
"redux": "^4.0.0",
"redux-form": "^7.4.2",
"redux-thunk": "^2.3.0",
"sass-loader": "^7.0.3",
"style-loader": "^0.21.0",
Expand All @@ -43,6 +43,7 @@
"webpack": "^4.12.1",
"webpack-cli": "^3.0.8",
"webpack-dev-server": "^3.1.4",
"webpack-merge": "^4.1.3"
"webpack-merge": "^4.1.3",
"yup": "^0.27.0"
}
}
320 changes: 209 additions & 111 deletions frontend/src/actions/index.tsx

Large diffs are not rendered by default.

36 changes: 26 additions & 10 deletions frontend/src/apis/Core/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Core implementations for handling external APIs
*/

export const JWT_TOKEN_KEY = 'jwt_token'
export const JWT_TOKEN_KEY = 'jwt_token';

export enum APIErrorType {
unknown,
Expand All @@ -14,7 +14,7 @@ export enum APIErrorType {
*
*/
export class APIError implements Error {
name = 'APIError'
name = 'APIError';

constructor(
public message: string,
Expand Down Expand Up @@ -86,7 +86,7 @@ export async function getRequest(
) {
const options = {
method: 'GET',
}
};
return rawRequest(entryPoint, convert, options)
}

Expand All @@ -101,7 +101,7 @@ export async function postJsonRequest(
headers: {
'Content-Type': 'application/json'
}
}
};
return rawRequest(entryPoint, convert, options)
}

Expand All @@ -116,7 +116,22 @@ export async function putJsonRequest(
headers: {
'Content-Type': 'application/json'
}
}
};
return rawRequest(entryPoint, convert, options)
}

export async function patchJsonRequest(
entryPoint: string,
data: any,
convert: (response) => any = (response) => response,
) {
const options = {
method: 'PATCH',
body: JSON.stringify(data),
headers: {
'Content-Type': 'application/json'
}
};
return rawRequest(entryPoint, convert, options)
}

Expand All @@ -126,7 +141,7 @@ export async function deleteRequest(
) {
const options = {
method: 'DELETE',
}
};
return rawRequest(entryPoint, convert, options)
}

Expand Down Expand Up @@ -199,7 +214,7 @@ export async function rawRequest<T = any>(
*
* @param entryPoints {string[]} Target API entrypoints
* @param convert
* @param paramsList {any[]}
* @param requestList {any[]}
*/
export async function rawMultiRequest<T = any>(
entryPoints: string[],
Expand All @@ -226,9 +241,10 @@ export async function rawMultiRequest<T = any>(
return Promise.all(
entryPoints.map(
(entryPoint, i) => {
return fetch(entryPoint, fullOptionsList[i]).then((response) => {
return _handleAPIResponse<T>(response, convert)
})
return fetch(entryPoint, fullOptionsList[i])
.then((response) => {
return _handleAPIResponse<T>(response, convert)
})
}
)
)
Expand Down
Loading