This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
outline/app/scenes/Settings/People.js
Tom Moor 8cbcb77486 Base model refactor (#810)
* Big upgrades

* WIP: Stash

* Stash, 30 flow errors left

* Downgrade mobx

* WIP

* When I understand the difference between class and instance methods

* 💚

* Fixes: File import
Model saving edge cases
pinning and starring docs
Collection editing
Upgrade mobx devtools

* Notification settings saving works

* Disabled settings

* Document mailer

* Working notifications

* Colletion created notification
Ensure not notified for own actions

* Tidy up

* Document updated event only for document creation
Add indexes
Notification setting on user creation

* Commentary

* Fixed: Notification setting on signup

* Fix document move / duplicate stale data
Add BaseModel.refresh method

* Fixes: Title in sidebar not updated after editing document

* 💚

* Improve / restore error handling
Better handle offline errors

* 👕
2018-12-04 22:24:30 -08:00

77 lines
2.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// @flow
import * as React from 'react';
import invariant from 'invariant';
import { observer, inject } from 'mobx-react';
import AuthStore from 'stores/AuthStore';
import UsersStore from 'stores/UsersStore';
import CenteredContent from 'components/CenteredContent';
import PageTitle from 'components/PageTitle';
import HelpText from 'components/HelpText';
import UserListItem from './components/UserListItem';
import List from 'components/List';
import Tabs from 'components/Tabs';
import Tab from 'components/Tab';
type Props = {
auth: AuthStore,
users: UsersStore,
match: Object,
};
@observer
class People extends React.Component<Props> {
componentDidMount() {
this.props.users.fetchPage({ limit: 100 });
}
render() {
const { auth, match } = this.props;
const { filter } = match.params;
const currentUser = auth.user;
invariant(currentUser, 'User should exist');
let users = this.props.users.active;
if (filter === 'all') {
users = this.props.users.orderedData;
} else if (filter === 'admins') {
users = this.props.users.admins;
}
return (
<CenteredContent>
<PageTitle title="People" />
<h1>People</h1>
<HelpText>
Everyone that has signed into Outline appears here. Its possible that
there are other users who have access through Single Sign-On but
havent signed into Outline yet.
</HelpText>
<Tabs>
<Tab to="/settings/people" exact>
Active
</Tab>
<Tab to="/settings/people/admins" exact>
Admins
</Tab>
<Tab to="/settings/people/all" exact>
Everyone
</Tab>
</Tabs>
<List>
{users.map(user => (
<UserListItem
key={user.id}
user={user}
showMenu={!!currentUser.isAdmin && currentUser.id !== user.id}
/>
))}
</List>
</CenteredContent>
);
}
}
export default inject('auth', 'users')(People);