mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-12 12:33:02 +00:00
Make Groups functional
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
|||||||
import { compose, withProps } from "recompose";
|
import { compose, withProps } from "recompose";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { jhapiRequest } from "../../util/jhapiUtil";
|
import { jhapiRequest } from "../../util/jhapiUtil";
|
||||||
import { Groups } from "./Groups.pre";
|
import Groups from "./Groups.pre";
|
||||||
|
|
||||||
const withGroupsAPI = withProps((props) => ({
|
const withGroupsAPI = withProps((props) => ({
|
||||||
refreshGroupsData: () =>
|
refreshGroupsData: () =>
|
||||||
|
@@ -2,27 +2,14 @@ import React, { Component } from "react";
|
|||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
export class Groups extends Component {
|
const Groups = (props) => {
|
||||||
static get propTypes() {
|
|
||||||
return {
|
|
||||||
user_data: PropTypes.array,
|
|
||||||
groups_data: PropTypes.array,
|
|
||||||
refreshUserData: PropTypes.func,
|
|
||||||
refreshGroupsData: PropTypes.func,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(props) {
|
|
||||||
super(props);
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
var {
|
var {
|
||||||
user_data,
|
user_data,
|
||||||
groups_data,
|
groups_data,
|
||||||
refreshGroupsData,
|
refreshGroupsData,
|
||||||
refreshUserData,
|
refreshUserData,
|
||||||
} = this.props;
|
history
|
||||||
|
} = props;
|
||||||
|
|
||||||
if (!groups_data || !user_data) {
|
if (!groups_data || !user_data) {
|
||||||
return <div></div>;
|
return <div></div>;
|
||||||
@@ -72,7 +59,7 @@ export class Groups extends Component {
|
|||||||
<button
|
<button
|
||||||
className="btn btn-primary adjacent-span-spacing"
|
className="btn btn-primary adjacent-span-spacing"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
this.props.history.push("/create-group");
|
history.push("/create-group");
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
New Group
|
New Group
|
||||||
@@ -83,5 +70,13 @@ export class Groups extends Component {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
}
|
|
||||||
|
Groups.propTypes = {
|
||||||
|
user_data: PropTypes.array,
|
||||||
|
groups_data: PropTypes.array,
|
||||||
|
refreshUserData: PropTypes.func,
|
||||||
|
refreshGroupsData: PropTypes.func,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Groups;
|
||||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user