Skip to content

Commit 6a2dba8

Browse files
committed
Merge branch 'feature/dashboard' into feature/dashboard-storage
2 parents f5caa22 + c38bb71 commit 6a2dba8

File tree

4 files changed

+14
-18
lines changed

4 files changed

+14
-18
lines changed

dashboard/src/api/api.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
class Api {
2-
token = '';
1+
export default {
2+
token: '',
33

44
async decodeResults(result) {
55
const decoded = await result.json();
@@ -10,7 +10,7 @@ class Api {
1010
throw Error(`Unexpected status ${result.status}`);
1111
}
1212
return decoded;
13-
}
13+
},
1414

1515
// apiGet performs a GET request on the API with given local URL.
1616
// The result is decoded from JSON and returned.
@@ -23,7 +23,7 @@ class Api {
2323
}
2424
const result = await fetch(localURL, {headers});
2525
return this.decodeResults(result);
26-
}
26+
},
2727

2828
// apiPost performs a POST request on the API with given local URL and given data.
2929
// The result is decoded from JSON and returned.
@@ -42,8 +42,4 @@ class Api {
4242
});
4343
return this.decodeResults(result);
4444
}
45-
}
46-
47-
var api = new Api();
48-
49-
export default api;
45+
};

dashboard/src/auth/Login.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ import React, { Component } from 'react';
22
import { Button, Container, Form, Icon, Message, Modal } from 'semantic-ui-react';
33
import { css } from 'react-emotion';
44

5-
const LoginView = ({username, password, usernameChanged, passwordChanged, doLogin, error}) => (
5+
const LoginView = ({username, password, onUsernameChanged, onPasswordChanged, doLogin, error}) => (
66
<Container>
77
<Form onSubmit={doLogin}>
88
<Form.Field>
99
<label>Name</label>
10-
<input focus="true" value={username} onChange={(e) => usernameChanged(e.target.value)}/>
10+
<input focus="true" value={username} onChange={(e) => onUsernameChanged(e.target.value)}/>
1111
</Form.Field>
1212
<Form.Field>
1313
<label>Password</label>
14-
<input type="password" value={password} onChange={(e) => passwordChanged(e.target.value)}/>
14+
<input type="password" value={password} onChange={(e) => onPasswordChanged(e.target.value)}/>
1515
</Form.Field>
1616
<Form.Button className={css`display:none`} type="submit" />
1717
</Form>
@@ -38,8 +38,8 @@ class Login extends Component {
3838
error={this.props.error}
3939
username={this.state.username}
4040
password={this.state.password}
41-
usernameChanged={(v) => this.setState({username:v})}
42-
passwordChanged={(v) => this.setState({password:v})}
41+
onUsernameChanged={(v) => this.setState({username:v})}
42+
onPasswordChanged={(v) => this.setState({password:v})}
4343
doLogin={this.handleLogin}
4444
/>
4545
</Modal.Content>

dashboard/src/deployment/DeploymentDetails.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const LoaderBox = styled('span')`
1919
const MemberGroupsView = ({memberGroups, namespace}) => (
2020
<div>
2121
{memberGroups.map((item) => <MemberList
22-
key={`server-group-${item.group}`}
22+
key={item.group}
2323
group={item.group}
2424
members={item.members}
2525
namespace={namespace}

dashboard/src/deployment/DeploymentList.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ function getStateColorDescription(stateColor) {
152152

153153
class DeploymentList extends Component {
154154
state = {
155-
items: undefined,
156-
error: undefined,
155+
items: null,
156+
error: null,
157157
loading: true
158158
};
159159

@@ -168,7 +168,7 @@ class DeploymentList extends Component {
168168
this.setState({
169169
items: result.deployments,
170170
loading: false,
171-
error: undefined
171+
error: null
172172
});
173173
} catch (e) {
174174
this.setState({error: e.message, loading: false});

0 commit comments

Comments
 (0)