-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tweaks: Projects layout, Vite upgrade; replace react-table with expli…
…cit markup (#118) * styling tweaks; vite upgrade; replace react-table with explicit markup * fix tests
- Loading branch information
Showing
22 changed files
with
1,313 additions
and
830 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
libs/tup-components/src/projects/users/UserDetail/UserDetail.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
.user-detail-container { | ||
width: 50%; | ||
margin-left: -25px; | ||
margin-top: -20px; | ||
} | ||
|
||
.user-info-banner { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
libs/tup-components/src/projects/users/UserList/ManageTeam.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { InlineMessage, LoadingSpinner } from '@tacc/core-components'; | ||
import { useProfile, useProjectUsers } from '@tacc/tup-hooks'; | ||
import React from 'react'; | ||
import { Input, InputGroup, Button, InputGroupAddon } from 'reactstrap'; | ||
import styles from './UserList.module.css'; | ||
|
||
const ManageTeam: React.FC<{ projectId: number }> = ({ projectId }) => { | ||
const { data: currentUser } = useProfile(); | ||
const { data: users } = useProjectUsers(projectId); | ||
const currentUserRole = | ||
(users ?? []).find((user) => user.username === currentUser?.username) | ||
?.role || ''; | ||
|
||
if (!['PI', 'Delegate'].includes(currentUserRole)) return null; | ||
|
||
const addUser = (e: React.FormEvent<HTMLFormElement>) => { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
console.log('submitting'); | ||
}; | ||
|
||
return ( | ||
<> | ||
<div style={{ paddingTop: '10px', marginRight: '10px' }}> | ||
<div style={{ paddingBottom: '16px' }}> | ||
<span style={{ fontSize: '1.5rem' }}> | ||
<strong>Manage Team</strong> | ||
</span>{' '} | ||
({users?.length} Users) | ||
</div> | ||
<form onSubmit={(e) => addUser(e)} style={{ paddingBottom: '16px' }}> | ||
<label htmlFor="add-user">Add New User</label> | ||
<InputGroup> | ||
<InputGroupAddon addonType="prepend"> | ||
<Button | ||
type="submit" | ||
style={{ | ||
borderColor: '#AFAFAF', | ||
backgroundColor: '#F4F4F4', | ||
borderRadius: '0', | ||
color: '#484848', | ||
}} | ||
> | ||
Add <LoadingSpinner placement="inline"></LoadingSpinner> | ||
</Button> | ||
</InputGroupAddon> | ||
<Input placeholder="Enter Username" id="add-user" /> | ||
</InputGroup> | ||
<InlineMessage type="error">User not found.</InlineMessage> | ||
</form> | ||
</div> | ||
<div className={styles['separator']}></div> | ||
</> | ||
); | ||
}; | ||
|
||
export default ManageTeam; |
Oops, something went wrong.