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

Refactor app details #25

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e89cf3e
First pass at refactoring the app details page
solomon23 Sep 15, 2019
5a9ffe8
fix some some crashes and add the loader
solomon23 Sep 15, 2019
fa60465
don't requests logs after stopped
solomon23 Sep 15, 2019
e6b0f78
Add some interfaces for logs
solomon23 Sep 15, 2019
f25edc4
cleanup some typescript
solomon23 Sep 15, 2019
1c1d3bf
remove container status reference
solomon23 Sep 15, 2019
eda6d3a
add in linting support for just my changes
solomon23 Sep 15, 2019
bb7c654
add an unsafe getter to the current app without force an unwrap
solomon23 Sep 15, 2019
434aa1f
copy the object in a safer way before saving it
solomon23 Sep 15, 2019
27b46f1
remove unused utils
solomon23 Sep 15, 2019
c3497d9
fix repo name
solomon23 Sep 16, 2019
89bfb05
remove a bunch of anys
solomon23 Sep 16, 2019
30f4d67
Pull out the header and action bar into new components
solomon23 Sep 16, 2019
169cd5b
remove switch for object destructering
solomon23 Sep 16, 2019
1445827
use some higher order components to change contenxt into props
solomon23 Sep 16, 2019
51af307
Create a scrolling log view component that takes care of scrolling it…
solomon23 Sep 17, 2019
38df3ea
ifx unused var warning
solomon23 Sep 17, 2019
fb9e060
remove timeout hack
solomon23 Sep 17, 2019
695305c
use a constant
solomon23 Sep 17, 2019
12929c8
set loading state when uploading a file
solomon23 Sep 17, 2019
f355ab5
remove another any
solomon23 Sep 17, 2019
8c3ce03
fix up linting path
solomon23 Sep 18, 2019
d4d1500
add some more rules that cover how code already is
solomon23 Sep 18, 2019
22e35b4
react file ordering
solomon23 Sep 18, 2019
5deda5d
tabs now navigate
solomon23 Sep 18, 2019
db44fd8
destructure activeTabKey
solomon23 Sep 18, 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
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.tsx
*.js
*.ts
!/src/containers/apps/appDetails/**/*.tsx
49 changes: 49 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"extends": ["plugin:@typescript-eslint/recommended", "plugin:react/recommended"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "prettier"],
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"typescript": {}
},
"react": {
"createClass": "createReactClass",
"pragma": "React",
"version": "detect"
}
},
"rules": {
"react/jsx-filename-extension": [2, { "extensions": [".js", ".jsx", ".ts", ".tsx"] }],
"@typescript-eslint/indent": [2, 2],
"@typescript-eslint/explicit-function-return-type": 0,
"semi": [2, "always"],
"quotes": [2, "double"],
"function-call-argument-newline": [2, "consistent"],
"eol-last": [2, "always"],
"curly": [2, "all"],
"object-curly-spacing": ["error", "always"],
"space-before-blocks": ["error", "always"],
"block-spacing": ["error", "always"],
"comma-dangle": ["error", {
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "never"
}],
"react/sort-comp": ["error", {
"order": [
"static-methods",
"instance-variables",
"lifecycle",
"everything-else",
"/^on.+$/",
"/^render.+$/",
"render"
]
}]
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
/.project
.vscode/settings.json
1 change: 0 additions & 1 deletion config-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ module.exports = override(
javascriptEnabled: true,
modifyVars: {
"@primary-color": "#1b8ad3",
'@font-family': '"Google Sans", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif',
},
})
);
3,654 changes: 2,277 additions & 1,377 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
"@types/react-router": "^5.0.3",
"@types/react-router-dom": "^4.3.4",
"@types/utf8": "^2.1.6",
"antd": "~3.21.2",
"antd": "^3.23.2",
"axios": "^0.19.0",
"babel-plugin-import": "^1.12.0",
"bcryptjs": "^2.4.3",
"classnames": "^2.2.6",
"customize-cra": "^0.5.0",
"moment": "^2.24.0",
"query-string": "^6.8.2",
Expand All @@ -35,7 +36,8 @@
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"lint": "eslint \"**/*.tsx\""
},
"eslintConfig": {
"extends": "react-app"
Expand All @@ -45,5 +47,13 @@
"not dead",
"not ie <= 11",
"not op_mini all"
]
],
"devDependencies": {
"@types/classnames": "^2.2.9",
"@typescript-eslint/eslint-plugin": "^2.2.0",
"@typescript-eslint/parser": "^2.2.0",
"babel-eslint": "^10.0.2",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "^7.14.3"
}
}
8 changes: 7 additions & 1 deletion src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,10 @@ hr {
border-radius: 5px;
padding: 10px;
font-size: 90%;
}
}

.disabled {
opacity: .4;
cursor: hand;
pointer-events: none;
}
2 changes: 1 addition & 1 deletion src/containers/PageRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ class PageRoot extends ApiComponent<
<Switch>
<Route path="/dashboard/" component={Dashboard} />
<Route
path="/apps/details/:appName"
path="/apps/details/:appName/:tab?"
render={props => (
<AppDetails {...props} mainContainer={self.mainContainer} />
)}
Expand Down
27 changes: 19 additions & 8 deletions src/containers/apps/AppDefinition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ export interface IAppEnvVar {
value: string;
}

interface IAppVolume {
export interface IAppVolume {
containerPath: string;
volumeName?: string;
hostPath?: string;
}

interface IAppPort {
export interface IAppPort {
containerPort: number;
hostPort: number;
protocol?: "udp" | "tcp";
Expand Down Expand Up @@ -47,23 +47,34 @@ export interface IAppVersion {
gitHash: string | undefined;
}

interface IAppCustomDomain {
export interface IBuildLogs {
isAppBuilding: boolean;
isBuildFailed: boolean;
logs: {
firstLineNumber: number;
lines: string[];
}
}

export interface IAppCustomDomain {
publicDomain: string;
hasSsl: boolean;
}

export interface IHttpAuth {
user: string;
password?: string;
passwordHashed?: string;
}

interface IAppDefinitionBase {
description?: string;
deployedVersion: number;
notExposeAsWebApp: boolean;
hasPersistentData: boolean;
hasDefaultSubDomainSsl: boolean;
containerHttpPort: number;
httpAuth?: {
user: string
password?: string
passwordHashed?: string
}
httpAuth?: IHttpAuth;
captainDefinitionRelativeFilePath: string;

forceSsl: boolean;
Expand Down
3 changes: 1 addition & 2 deletions src/containers/apps/AppsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ function mapStateToProps(state: any) {
};
}

export default connect(
export default connect<{ isMobile: boolean }>(
mapStateToProps,
undefined
)(AppsTable);
7 changes: 3 additions & 4 deletions src/containers/apps/CreateNewApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class CreateNewApp extends Component<
}
>
<Row>
{self.props.isMobile ?
{self.props.isMobile ?
<Fragment>
<Input placeholder="my-amazing-app" onChange={e => self.setState({ appName: e.target.value })} />
<Button style={{marginTop: 8}} block onClick={() => self.onCreateNewAppClicked()} type="primary">Create New App</Button>
Expand Down Expand Up @@ -107,8 +107,7 @@ function mapStateToProps(state: any) {
};
}

export default connect(
mapStateToProps,
undefined
export default connect<{ isMobile: boolean }>(
mapStateToProps
)(CreateNewApp);

Loading