-
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.
Merge pull request #20 from cdalton713/react-frontend
frontend mostly done
- Loading branch information
Showing
25 changed files
with
1,190 additions
and
488 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import axios from "axios"; | ||
|
||
export default axios.create({ | ||
baseURL: `http://localhost/`, | ||
baseURL: `http://localhost:3000/api/`, | ||
}); |
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,61 @@ | ||
import { | ||
fields, | ||
workLogFields, | ||
} from "../components/form/ManageTicketForm/fields"; | ||
|
||
export const dataFetchReducer = (state, action) => { | ||
switch (action.type) { | ||
case "CLEAR_FORM": | ||
const newData = state.data; | ||
newData.map((o) => (o.value = "")); | ||
return { | ||
...state, | ||
data: newData, | ||
}; | ||
case "FETCH_INIT": | ||
return { | ||
...state, | ||
isLoading: true, | ||
isError: false, | ||
}; | ||
case "FETCH_TICKET_SUCCESS": | ||
return { | ||
...state, | ||
isLoading: false, | ||
isError: false, | ||
data: action.payload, | ||
}; | ||
case "FETCH_TECHNICIANS_SUCCESS": | ||
return { | ||
...state, | ||
isLoading: false, | ||
isError: false, | ||
selectTechnicianOptions: action.payload, | ||
}; | ||
case "FETCH_FAILURE": | ||
return { | ||
...state, | ||
isLoading: false, | ||
isError: true, | ||
}; | ||
case "UPDATE_DATA": | ||
return { | ||
...state, | ||
data: action.payload, | ||
}; | ||
case "FETCH_WORK_LOG_SUCCESS": | ||
return { | ||
...state, | ||
workLogData: action.payload, | ||
workLogLoading: false, | ||
}; | ||
case "FETCH_ASSIGN_LOG_SUCCESS": | ||
return { | ||
...state, | ||
assignLogData: action.payload, | ||
assignLogLoading: false, | ||
}; | ||
default: | ||
throw new Error(); | ||
} | ||
}; |
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 |
---|---|---|
|
@@ -10,4 +10,4 @@ export const App = () => { | |
); | ||
}; | ||
|
||
export const DEBUG_ON = true; | ||
export const DEBUG_ON = false; |
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,15 @@ | ||
import React from "react"; | ||
|
||
import { EuiCallOut, EuiLink } from "@elastic/eui"; | ||
|
||
export const ErrorCallout = ({ errMsg }, ...props) => { | ||
return ( | ||
<EuiCallOut | ||
title="Sorry, there was an error" | ||
color="danger" | ||
iconType="alert" | ||
> | ||
<p>{errMsg}</p> | ||
</EuiCallOut> | ||
); | ||
}; |
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
Oops, something went wrong.