Merge branch 'master' into signup_helper

This commit is contained in:
2023-08-20 23:06:02 +00:00
6 changed files with 23 additions and 28 deletions

View File

@@ -198,6 +198,11 @@ function App() {
as={Link}
to='/classes'
/>
<Dropdown.Item
content='Storage'
as={Link}
to='/storage'
/>
<Dropdown.Item
content='Utilities'
as={Link}

View File

@@ -2,7 +2,6 @@ import React, { useState, useEffect } from 'react';
import { Link, useParams, useHistory } from 'react-router-dom';
import './light.css';
import { MembersDropdown } from './Members.js';
import { StorageList } from './Storage.js';
import { isAdmin, BasicTable, requester } from './utils.js';
import { Button, Container, Form, Grid, Header, Message, Segment, Table } from 'semantic-ui-react';
@@ -35,11 +34,6 @@ export function Debug(props) {
<p><Link to='/display/lcars2'>LCARS2 Display</Link></p>
<Header size='medium'>Storage</Header>
<StorageList token={token} />
</Container>
);
};

View File

@@ -178,7 +178,7 @@ export function Members(props) {
<Container>
<Header size='large'>Member List</Header>
<p>Search by name, email, Spacebar username, or member ID:</p>
<p>Search by name, email, Spacebar username, member ID, or member shelf:</p>
<Input autoFocus focus icon='search'
placeholder='Search...'
@@ -250,7 +250,11 @@ export function Members(props) {
'None'
}
</Item.Description>
<Item.Description>Joined: {x.member.application_date || 'Unknown'}</Item.Description>
{sort === 'newest_active' ?
<Item.Description>Started: {x.member.current_start_date || 'Unknown'}</Item.Description>
:
<Item.Description>Joined: {x.member.application_date || 'Unknown'}</Item.Description>
}
</>
}
</Item.Content>

View File

@@ -47,7 +47,6 @@ function EditStorage(props) {
const [loading, setLoading] = useState(false);
const [success, setSuccess] = useState(false);
const { id } = useParams();
const history = useHistory();
const handleSubmit = (e) => {
if (loading) return;
@@ -69,25 +68,11 @@ function EditStorage(props) {
});
};
const saveAndNext = (e) => {
e.preventDefault();
handleSubmit(e)
.then(res => {
setStorage(false);
history.push('/storage/' + (parseInt(id) + 1));
});
};
return (
<div>
<Header size='medium'>Edit Storage {storage.shelf_id}</Header>
<Form onSubmit={handleSubmit}>
<Form.Button floated='right' onClick={saveAndNext} loading={loading} error={error.non_field_errors}>
Save and edit next
</Form.Button>
<StorageEditor token={token} input={input} setInput={setInput} error={error} />
<Form.Group widths='equal'>