Skip to content

Commit

Permalink
emptyState for inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
GiridharRNair committed Jan 14, 2024
1 parent e63e389 commit d43b9c3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ Dockerized and deployed on the Azure Web App Service after running the Python sc

### Testing

The Python script responsible for generating the SQLite database is tested using Python's built-in unit test module. To run the tests, run `python db_setup/test_db.py` or `npm run test_db`.
The Python script responsible for generating the SQLite database is tested using Python's built-in unit test module. To run the tests, run `python db_setup/test_db.py` or `npm run test-db`.

The Gin API is tested using Go tests. To run the tests, run `cd api && go test` or `npm run test_api`.
The Gin API is tested using Go tests. To run the tests, run `cd api && go test` or `npm run test-api`.

## Local Development

Expand Down
Binary file modified api/db/utdgrades.db
Binary file not shown.
6 changes: 4 additions & 2 deletions src/components/Inputs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ function Inputs({ setProfessor, setCourse, professor, course }) {
suggestWhenEmpty={true}
freeSolo={true}
isLoading={professorLoading}
emptyState="Professor not found"
onSelectOption={(value) => {
setProfessor(value.item.label);
autocompleteValues(value.item.label, course);
Expand Down Expand Up @@ -72,7 +73,7 @@ function Inputs({ setProfessor, setCourse, professor, course }) {
)}
</InputRightElement>
</InputGroup>
{professorSuggestions.length > 0 && !professorLoading && (
{!professorLoading && (
<AutoCompleteList>
{professorSuggestions.map((professorOption, index) => (
<AutoCompleteItem value={professorOption} key={index}>
Expand All @@ -90,6 +91,7 @@ function Inputs({ setProfessor, setCourse, professor, course }) {
suggestWhenEmpty={true}
freeSolo={true}
isLoading={courseLoading}
emptyState={`Course(s) not found ${professor ? `for ${professor}` : ""}`}
onSelectOption={(value) => setCourse(value.item.label)}
>
<InputGroup>
Expand Down Expand Up @@ -117,7 +119,7 @@ function Inputs({ setProfessor, setCourse, professor, course }) {
)}
</InputRightElement>
</InputGroup>
{courseSuggestions.length > 0 && !courseLoading && (
{!courseLoading && (
<AutoCompleteList>
{courseSuggestions.map((courseOption, index) => (
<AutoCompleteItem value={courseOption} key={index}>
Expand Down

0 comments on commit d43b9c3

Please sign in to comment.