Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove load & continue feature #55

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function App() {

const restartApp = (e) => {
e.preventDefault();
if(btnState == 'Save & Exit') {
if(btnState == 'Restart') {
setAppID(undefined);
setStepHistory([]);
setFormData(undefined);
Expand All @@ -55,7 +55,7 @@ function App() {
<p><img src={header.logoURL} alt={header.logoAlt}></img> <span>{header.text}</span></p>
<form onSubmit={restartApp}>
{(step > 0) ? <button className="back" onClick={(e)=>{setbtnState(e.target.innerText)}}><span>&laquo;</span> Back</button> : ""}
<button className="restart" onClick={(e)=>{setbtnState(e.target.innerText)}}>Save & Exit</button>
<button className="restart" onClick={(e)=>{setbtnState(e.target.innerText)}}>Restart</button>
</form>
</div>
);
Expand Down
32 changes: 0 additions & 32 deletions src/components/Form/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,24 +557,6 @@ function Form(props) {
});
break;

case 'loadApplication':
e.json().then(data => {
if(data.status == 'incomplete'){
setAppID(data.id);
setFormData(data.answers);
tempHistory = stepHistory;
tempHistory.push(currentStep);
setStepHistory(tempHistory);
setStep(1);
}else{
tempHistory = stepHistory;
tempHistory.push(currentStep);
setStepHistory(tempHistory);
setStep(2);
}
});
break;

default:
tempHistory = stepHistory;
tempHistory.push(currentStep);
Expand All @@ -590,9 +572,6 @@ function Form(props) {
case 'saveForm':
break;

case 'loadApplication':
break;

default:;
break;
}
Expand All @@ -604,9 +583,6 @@ function Form(props) {
case 'saveForm':
break;

case 'loadApplication':
break;

default:
break;
}
Expand Down Expand Up @@ -854,14 +830,6 @@ function Form(props) {
Connector.start('get',`https://apis.detroitmi.gov/property_applications/${inputData['app-id']}/status/`,null,false,null,'application/json',(e)=>{handleAPICalls(e, 'getStatus', step)},(e)=>{handleAPICalls(e, 'getStatus', step)});
break;

case 'answers':
if(requirements.service == 'surveys'){
Connector.start('get',`https://apis.detroitmi.gov/${requirements.service}${requirements.surveyID}/`,null,false,null,'application/json',(e)=>{handleAPICalls(e, 'loadApplication', step)},(e)=>{handleAPICalls(e, 'loadApplication', step)});
}else{
Connector.start('get',`https://apis.detroitmi.gov/property_applications/${inputData['app-id']}/answers/`,null,false,null,'application/json',(e)=>{handleAPICalls(e, 'loadApplication', step)},(e)=>{handleAPICalls(e, 'loadApplication', step)});
}
break;

default:
break;
}
Expand Down
Loading