-
Notifications
You must be signed in to change notification settings - Fork 1
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
66 add news improvements #116
Conversation
…dd-news-improvements
@alexcoaton linting passing, tests failing as automatic tests yet to be written |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The feature looks great peeps!
I've suggested a few changes - ask me if you have any questions.
@@ -45,6 +45,7 @@ export default function App() { | |||
<Routes> | |||
<Route path="/" element={<AdminGardens />} /> | |||
<Route path="/admin/gardens/add" element={<AddGarden />} /> | |||
<Route path="/gardens/news/add" element={<AddNews />} /> | |||
<Route | |||
path="/admin/gardens/:id/news/add" | |||
element={ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this route should be admin/news/add no? If it's an admin only feature.
) : null} | ||
<Field | ||
className="border-2 border-lightGreen bg-white rounded-sm w-5/6" | ||
//specfic to dropdown formatting? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this comment is resolved, remove it.
Gardens | ||
</label> | ||
{errors.gardenId && touched.gardenId ? ( | ||
<div>{errors.gardenId}</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1,28 +1,36 @@ | |||
import React from 'react' | |||
import { render, screen, waitFor } from '@testing-library/react' | |||
import userEvent from '@testing-library/user-event' | |||
|
|||
// import renderWithRedux from '@testing-library/render-with-redux' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented code.
import NewsForm from './NewsForm' | ||
|
||
// make mock.jest data like news.test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the rest of the commented code below.
formData={initialState} | ||
action="Create News" | ||
initialFormData={initialFormData} | ||
action="Post News" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this to something more friendly like formTitle="Post News". With the name action, it looks like it's supposed to do something else, like a callback or dispatch a redux action.
#66