From 615c860f8e940d795e1b963e92b86a09acb237c6 Mon Sep 17 00:00:00 2001 From: Jessica Manoel Date: Sat, 26 Jun 2021 17:06:53 -0300 Subject: [PATCH 01/13] Adicionando client no gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8c89fe60..3ab8ef2c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ target/* /target npm-debug.log /bin/ +client/* \ No newline at end of file From f188ea90562fcccfabf10bd13911afb28dbd1b42 Mon Sep 17 00:00:00 2001 From: Jessica Manoel Date: Sat, 26 Jun 2021 17:12:02 -0300 Subject: [PATCH 02/13] =?UTF-8?q?Eliminando=20c=C3=B3digo=20desnecess?= =?UTF-8?q?=C3=A1rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/owners/NewOwnerPage.tsx | 8 -------- 1 file changed, 8 deletions(-) diff --git a/client/src/components/owners/NewOwnerPage.tsx b/client/src/components/owners/NewOwnerPage.tsx index f6965eed..3180e3f5 100644 --- a/client/src/components/owners/NewOwnerPage.tsx +++ b/client/src/components/owners/NewOwnerPage.tsx @@ -16,14 +16,6 @@ const newOwner = (): IOwner => ({ export default () => ; -// export default class NewOwnerPage extends React.Component { - -// context: IRouterContext; - -// static contextTypes = { -// router: React.PropTypes.object.isRequired -// }; - // constructor() { // super(); // this.onInputChange = this.onInputChange.bind(this); From a2690703620b0ec755e1e491c8a183e80f8b9944 Mon Sep 17 00:00:00 2001 From: Jessica Manoel Date: Sat, 26 Jun 2021 17:38:37 -0300 Subject: [PATCH 03/13] =?UTF-8?q?Eliminando=20c=C3=B3digo=20desnecess?= =?UTF-8?q?=C3=A1rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/owners/NewOwnerPage.tsx | 8 -------- 1 file changed, 8 deletions(-) diff --git a/client/src/components/owners/NewOwnerPage.tsx b/client/src/components/owners/NewOwnerPage.tsx index 3180e3f5..224f9ffd 100644 --- a/client/src/components/owners/NewOwnerPage.tsx +++ b/client/src/components/owners/NewOwnerPage.tsx @@ -16,14 +16,6 @@ const newOwner = (): IOwner => ({ export default () => ; -// constructor() { -// super(); -// this.onInputChange = this.onInputChange.bind(this); -// this.onSubmit = this.onSubmit.bind(this); - -// this.state = { owner: newOwner() }; -// } - // onSubmit(event) { // event.preventDefault(); From d841a4b3565f1f3cd81f91670cb04598c37fcda8 Mon Sep 17 00:00:00 2001 From: Jessica Manoel Date: Sat, 26 Jun 2021 17:39:55 -0300 Subject: [PATCH 04/13] =?UTF-8?q?Eliminando=20c=C3=B3digo=20desnecess?= =?UTF-8?q?=C3=A1rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/owners/NewOwnerPage.tsx | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/client/src/components/owners/NewOwnerPage.tsx b/client/src/components/owners/NewOwnerPage.tsx index 224f9ffd..878a786b 100644 --- a/client/src/components/owners/NewOwnerPage.tsx +++ b/client/src/components/owners/NewOwnerPage.tsx @@ -16,24 +16,6 @@ const newOwner = (): IOwner => ({ export default () => ; -// onSubmit(event) { -// event.preventDefault(); - -// const { owner } = this.state; - -// submitForm('/api/owner', owner, (status, response) => { -// if (status === 201) { -// const newOwner = response as IOwner; -// this.context.router.push({ -// pathname: '/owners/' + newOwner.id -// }); -// } else { -// console.log('ERROR?!...', response); -// this.setState({ error: response }); -// } -// }); -// } - // onInputChange(name: string, value: string) { // const { owner } = this.state; // const modifiedOwner = Object.assign({}, owner, { [name]: value }); From 521fe86226c384b574bff2307cbcaf10ae7d137a Mon Sep 17 00:00:00 2001 From: Jessica Manoel Date: Sat, 26 Jun 2021 17:40:56 -0300 Subject: [PATCH 05/13] =?UTF-8?q?Eliminando=20c=C3=B3digo=20desnecess?= =?UTF-8?q?=C3=A1rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/owners/NewOwnerPage.tsx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/client/src/components/owners/NewOwnerPage.tsx b/client/src/components/owners/NewOwnerPage.tsx index 878a786b..cfc882c3 100644 --- a/client/src/components/owners/NewOwnerPage.tsx +++ b/client/src/components/owners/NewOwnerPage.tsx @@ -16,12 +16,6 @@ const newOwner = (): IOwner => ({ export default () => ; -// onInputChange(name: string, value: string) { -// const { owner } = this.state; -// const modifiedOwner = Object.assign({}, owner, { [name]: value }); -// this.setState({ owner: modifiedOwner }); -// } - // render() { // const { owner, error } = this.state; // return ( From c9e1c7cb16564a59f0198a21750b02c5324494d6 Mon Sep 17 00:00:00 2001 From: Jessica Manoel Date: Sat, 26 Jun 2021 17:43:28 -0300 Subject: [PATCH 06/13] =?UTF-8?q?Eliminando=20c=C3=B3digo=20desnecess?= =?UTF-8?q?=C3=A1rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/owners/NewOwnerPage.tsx | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/client/src/components/owners/NewOwnerPage.tsx b/client/src/components/owners/NewOwnerPage.tsx index cfc882c3..301a4047 100644 --- a/client/src/components/owners/NewOwnerPage.tsx +++ b/client/src/components/owners/NewOwnerPage.tsx @@ -14,28 +14,4 @@ const newOwner = (): IOwner => ({ pets: [] }); -export default () => ; - -// render() { -// const { owner, error } = this.state; -// return ( -// -//

New Owner

-//
-//
-// -// -// -// -// -//
-//
-//
-// -//
-//
-//
-//
-// ); -// } -// } \ No newline at end of file +export default () => ; \ No newline at end of file From ef10999f0fee1f0d41b89648f60e406669e35c96 Mon Sep 17 00:00:00 2001 From: Jessica Manoel Date: Sat, 26 Jun 2021 17:49:06 -0300 Subject: [PATCH 07/13] =?UTF-8?q?Eliminando=20c=C3=B3digo=20desnecess?= =?UTF-8?q?=C3=A1rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/middleware/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/middleware/api.ts b/client/src/middleware/api.ts index 43cab2ea..d70a84c6 100644 --- a/client/src/middleware/api.ts +++ b/client/src/middleware/api.ts @@ -1,4 +1,4 @@ -// // taken from by https://github.com/reactjs/redux/blob/master/examples/real-world/middleware/api.js + // type IApiCallMethod = 'GET' | 'POST' | 'PATCH'; From d57fb2b95236f32862a600ba4d4042d61bd9c1ba Mon Sep 17 00:00:00 2001 From: Jessica Manoel Date: Sat, 26 Jun 2021 17:50:06 -0300 Subject: [PATCH 08/13] =?UTF-8?q?Eliminando=20c=C3=B3digo=20desnecess?= =?UTF-8?q?=C3=A1rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/middleware/api.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/client/src/middleware/api.ts b/client/src/middleware/api.ts index d70a84c6..225f4640 100644 --- a/client/src/middleware/api.ts +++ b/client/src/middleware/api.ts @@ -1,7 +1,4 @@ - -// type IApiCallMethod = 'GET' | 'POST' | 'PATCH'; - // export interface IApiCallData { // endpoint: string; // method?: IApiCallMethod; From 1d96669323c44baa45e3e212df43361ebee7d632 Mon Sep 17 00:00:00 2001 From: Jessica Manoel Date: Sat, 26 Jun 2021 18:01:15 -0300 Subject: [PATCH 09/13] =?UTF-8?q?Eliminando=20c=C3=B3digo=20desnecess?= =?UTF-8?q?=C3=A1rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/middleware/api.ts | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/client/src/middleware/api.ts b/client/src/middleware/api.ts index 225f4640..e7266abc 100644 --- a/client/src/middleware/api.ts +++ b/client/src/middleware/api.ts @@ -1,32 +1,4 @@ -// export interface IApiCallData { -// endpoint: string; -// method?: IApiCallMethod; -// // fetching, onSuccess, onFailure -// types: string[]; -// body?: any; -// successMessage?: string; -// } - -// const CALL_API = 'CALL_API'; - -// export interface IApiAction { -// CALL_API: IApiCallData; -// } - -// function doApiCall(store, apiCallData: IApiCallData) { - -// const params: any = { -// headers: {} -// }; -// params.method = apiCallData.method || 'GET'; -// params.body = JSON.stringify(apiCallData.body); -// if (params.body) { -// params.headers['Accept'] = 'application/json'; -// params.headers['Content-Type'] = 'application/json'; -// } - - // return fetch(`http://localhost:8080${apiCallData.endpoint}`, params) // .then(response => // response.json().then(json => ({ json, response })) From bbd83e07fcded7ca5f7e76b1b2a1003ab5acb94f Mon Sep 17 00:00:00 2001 From: Jessica Manoel Date: Sat, 26 Jun 2021 18:02:05 -0300 Subject: [PATCH 10/13] =?UTF-8?q?Eliminando=20c=C3=B3digo=20desnecess?= =?UTF-8?q?=C3=A1rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/middleware/api.ts | 41 ------------------------------------ 1 file changed, 41 deletions(-) diff --git a/client/src/middleware/api.ts b/client/src/middleware/api.ts index e7266abc..8b137891 100644 --- a/client/src/middleware/api.ts +++ b/client/src/middleware/api.ts @@ -1,42 +1 @@ -// return fetch(`http://localhost:8080${apiCallData.endpoint}`, params) -// .then(response => -// response.json().then(json => ({ json, response })) -// ).then(({ json, response }) => { -// if (!response.ok) { -// return Promise.reject(json); -// } - -// return json; -// }); -// } - -// export default store => next => action => { -// function actionWith(data) { -// const finalAction = Object.assign({}, action, data); -// delete finalAction[CALL_API]; -// return finalAction; -// } - -// const callAPI: IApiCallData = action[CALL_API]; -// if (typeof callAPI === 'undefined') { -// // not an API call -// return next(action); -// } - - -// const { endpoint, types } = callAPI; - -// const [requestType, successType, failureType] = types; - -// // before sending the request: send action that request begins -// next(actionWith({ type: requestType })); - -// return doApiCall(store, callAPI).then( -// response => next(actionWith({payload: response, type: successType, success: callAPI.successMessage})), -// error => next(actionWith({ -// type: failureType, -// error: error.message || 'Something bad happened' -// })) -// ); -// }; From 66380991e8f8cfa5f8728971496c8c9903a3677c Mon Sep 17 00:00:00 2001 From: Jessica Manoel Date: Sat, 26 Jun 2021 18:03:50 -0300 Subject: [PATCH 11/13] =?UTF-8?q?Eliminando=20arquivo=20desnecess=C3=A1rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/middleware/api.ts | 1 - 1 file changed, 1 deletion(-) delete mode 100644 client/src/middleware/api.ts diff --git a/client/src/middleware/api.ts b/client/src/middleware/api.ts deleted file mode 100644 index 8b137891..00000000 --- a/client/src/middleware/api.ts +++ /dev/null @@ -1 +0,0 @@ - From 04d0e2da2d868c8d41376c285205bbf632ba7e5f Mon Sep 17 00:00:00 2001 From: Jessica Manoel Date: Sat, 26 Jun 2021 18:09:40 -0300 Subject: [PATCH 12/13] =?UTF-8?q?Eliminando=20c=C3=B3digo=20desnecess?= =?UTF-8?q?=C3=A1rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/tests/__tests__/fetch-mock.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/client/tests/__tests__/fetch-mock.js b/client/tests/__tests__/fetch-mock.js index 2ee1f6a1..de3dfbf8 100644 --- a/client/tests/__tests__/fetch-mock.js +++ b/client/tests/__tests__/fetch-mock.js @@ -54,14 +54,6 @@ fetch.mockResponseOnce = (body, init) => { ); }; -// fetch.mockResponses = (...responses) => { -// responses.forEach(([body, init]) => { -// fetch.mockImplementationOnce( -// () => Promise.resolve(new ResponseWrapper(body, init)) -// ); -// }) -// }; - // Default mock is just a empty string. fetch.mockResponse(''); From 7eeff06785086e617dd8b4238fa4b6b3cec56ea7 Mon Sep 17 00:00:00 2001 From: Jessica Manoel Date: Sat, 26 Jun 2021 18:15:03 -0300 Subject: [PATCH 13/13] =?UTF-8?q?Eliminando=20c=C3=B3digo=20desnecess?= =?UTF-8?q?=C3=A1rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/server.js | 1 - 1 file changed, 1 deletion(-) diff --git a/client/server.js b/client/server.js index bc5ea74d..5ec811a3 100644 --- a/client/server.js +++ b/client/server.js @@ -243,7 +243,6 @@ function runDevServer(port, protocol) { // clearConsole(); console.log(chalk.cyan('Starting the development server...')); console.log(); - // openBrowser(port, protocol); }); }