Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

Add pagination to secrets list + fix case sensitivity #110

Merged
merged 6 commits into from
Apr 30, 2017
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# 2.2.0 (Unreleased)
## Features
- Add JSON diff view to compare updates
- Add backend mount description field - https://github.com/djenriquez/vault-ui/pull/105
- Add filtering to all lists - https://github.com/djenriquez/vault-ui/pull/106
- Add pagination to secrets list - https://github.com/djenriquez/vault-ui/pull/110
- Add JSON diff view to compare updates - https://github.com/djenriquez/vault-ui/pull/84
- Allow naming tokens generated from roles
- Support Cubbyhole secret backend
- Add ability to renew token

# 2.1.0
Expand Down
18 changes: 10 additions & 8 deletions app/components/Authentication/AwsEc2/AwsEc2.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,16 @@ export default class AwsEc2AuthBackend extends React.Component {
if (!tab) {
history.push(`${this.state.baseUrl}${this.state.selectedTab}/`);
} else {
this.setState({selectedTab: tab.includes('/') ? tab.split('/')[0] : tab});
this.setState({ selectedTab: tab.includes('/') ? tab.split('/')[0] : tab });
}
}

componentDidMount() {
this.listEc2Roles();
this.getEc2AuthConfig();
let uri = this.props.location.pathname.split(this.state.baseUrl)[1];
if(uri.includes('roles/') && uri.split('roles/')[1]) {
this.setState({selectedRoleId: uri.split('roles/')[1]});
if (uri.includes('roles/') && uri.split('roles/')[1]) {
this.setState({ selectedRoleId: uri.split('roles/')[1] });
this.displayRole();
}
}
Expand Down Expand Up @@ -659,11 +659,13 @@ export default class AwsEc2AuthBackend extends React.Component {
floatingLabelText="Filter"
hintText="Filter list items"
onChange={(e, v) => {
this.setState({
filteredEc2RoleList: _.filter(this.state.ec2Roles, (item) => {
return item.includes(v);
})
})
let filtered = _.filter(this.state.ec2Roles, (item) => {
return item.toLowerCase().includes(v.toLowerCase());
});
if (filtered.length > 0)
this.setState({
filteredEc2RoleList: filtered
});
}}
/>
</ToolbarGroup>
Expand Down
28 changes: 16 additions & 12 deletions app/components/Authentication/Github/Github.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export default class GithubAuthBackend extends React.Component {

let policies = _.get(item, 'value', undefined);
item.policies = policies ? policies.split(',') : [];

this.setState({ itemConfig: item, openItemDialog: true });
})
.catch(snackBarMessage)
Expand Down Expand Up @@ -207,7 +207,7 @@ export default class GithubAuthBackend extends React.Component {
if (!tab) {
history.push(`${this.state.baseUrl}${this.state.selectedTab}/`);
} else {
this.setState({selectedTab: tab.includes('/') ? tab.split('/')[0] : tab});
this.setState({ selectedTab: tab.includes('/') ? tab.split('/')[0] : tab });
}
}

Expand Down Expand Up @@ -446,11 +446,13 @@ export default class GithubAuthBackend extends React.Component {
floatingLabelText="Filter"
hintText="Filter list items"
onChange={(e, v) => {
this.setState({
filteredTeamList: _.filter(this.state.teams, (item) => {
return item.includes(v);
})
})
let filtered = _.filter(this.state.teams, (item) => {
return item.toLowerCase().includes(v.toLowerCase());
});
if (filtered.length > 0)
this.setState({
filteredTeamList: filtered
});
}}
/>
</ToolbarGroup>
Expand Down Expand Up @@ -492,11 +494,13 @@ export default class GithubAuthBackend extends React.Component {
floatingLabelText="Filter"
hintText="Filter list items"
onChange={(e, v) => {
this.setState({
filteredUserList: _.filter(this.state.users, (item) => {
return item.includes(v);
})
})
let filtered = _.filter(this.state.users, (item) => {
return item.toLowerCase().includes(v.toLowerCase());
});
if (filtered.length > 0)
this.setState({
filteredUserList: filtered
});
}}
/>
</ToolbarGroup>
Expand Down
16 changes: 9 additions & 7 deletions app/components/Authentication/Radius/Radius.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ class RadiusAuthBackend extends React.Component {
path={this.state.deleteUserPath}
onReceiveResponse={() => {
snackBarMessage(`Object '${this.state.deleteUserPath}' deleted`)
this.setState({deleteUserPath: ''})
this.setState({ deleteUserPath: '' })
this.loadUserList();
}}
onReceiveError={(err) => snackBarMessage(err)}
Expand Down Expand Up @@ -387,11 +387,13 @@ class RadiusAuthBackend extends React.Component {
floatingLabelText="Filter"
hintText="Filter list items"
onChange={(e, v) => {
this.setState({
filteredUserList: _.filter(this.state.userList, (item) => {
return item.id.includes(v);
})
})
let filtered = _.filter(this.state.userList, (item) => {
return item.id.toLowerCase().includes(v.toLowerCase());
});
if (filtered.length > 0)
this.setState({
filteredUserList: filtered
});
}}
/>
</ToolbarGroup>
Expand Down Expand Up @@ -482,7 +484,7 @@ class RadiusAuthBackend extends React.Component {
this.setState({ newConfigObj: update(this.state.newConfigObj, { unregistered_user_policies: { $set: policies } }) });
}}
/>
<div style={{paddingTop: '20px', textAlign: 'center'}}>
<div style={{ paddingTop: '20px', textAlign: 'center' }}>
<FlatButton
primary={true}
label="Save"
Expand Down
16 changes: 9 additions & 7 deletions app/components/Authentication/UserPass/UserPass.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default class UserPassAuthBackend extends React.Component {
tokenHasCapabilities(['create', 'update'], `${this.state.baseVaultPath}/users/${user}`)
.then(() => {
let updateObj = _.clone(this.state.config);
if(newUser) updateObj.password = this.state.newUserPassword;
if (newUser) updateObj.password = this.state.newUserPassword;
updateObj.policies = updateObj.policies.join(',');
callVaultApi('post', `${this.state.baseVaultPath}/users/${user}`, null, updateObj)
.then(() => {
Expand All @@ -125,7 +125,7 @@ export default class UserPassAuthBackend extends React.Component {
this.listUsers();
let user = this.props.location.pathname.split(this.state.baseUrl)[1];
if (user) {
this.setState({selectedUserId: user});
this.setState({ selectedUserId: user });
this.displayItem();
}
}
Expand Down Expand Up @@ -361,11 +361,13 @@ export default class UserPassAuthBackend extends React.Component {
floatingLabelText="Filter"
hintText="Filter list items"
onChange={(e, v) => {
this.setState({
filteredUserList: _.filter(this.state.users, (item) => {
return item.includes(v);
})
})
let filtered = _.filter(this.state.users, (item) => {
return item.toLowerCase().includes(v.toLowerCase());
});
if (filtered.length > 0)
this.setState({
filteredUserList: filtered
});
}}
/>
</ToolbarGroup>
Expand Down
12 changes: 7 additions & 5 deletions app/components/Policies/Manage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,13 @@ export default class PolicyManager extends React.Component {
floatingLabelText="Filter"
hintText="Filter list items"
onChange={(e, v) => {
this.setState({
filteredPolicyList: _.filter(this.state.policies, (item) => {
return item.includes(v);
})
})
let filtered = _.filter(this.state.policies, (item) => {
return item.toLowerCase().includes(v.toLowerCase());
});
if (filtered.length > 0)
this.setState({
filteredPolicyList: filtered
});
}}
/>
</ToolbarGroup>
Expand Down
Loading