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

66 add news improvements #116

Closed
wants to merge 8 commits into from
Closed

Conversation

Davidcodes00
Copy link
Contributor

#66

@alexcoaton alexcoaton self-requested a review July 12, 2022 02:52
@Davidcodes00
Copy link
Contributor Author

@alexcoaton linting passing, tests failing as automatic tests yet to be written

Copy link
Contributor

@alexcoaton alexcoaton left a 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={
Copy link
Contributor

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?
Copy link
Contributor

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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this what results in the "Required" text in the view? Should it read "*required" and be styled in red perhaps?

image

@@ -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'
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove.

Copy link
Contributor

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"
Copy link
Contributor

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.

@ahnwarez ahnwarez closed this Jul 16, 2022
@ahnwarez ahnwarez deleted the 66-add-news-improvements branch July 16, 2022 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants