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

feat: [NR-NMP-134] Calculate Nutrients Page #141

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

lunamoonmoon
Copy link

@lunamoonmoon lunamoonmoon commented Jan 16, 2025

Pull Request Standards

  • The title of the PR is accurate
  • The title includes the type of change [HOTFIX, FEATURE, etc]
  • The PR title includes the ticket number in format of [NMP-###]
  • Documentation is updated to reflect change

Description

This PR includes the following proposed change(s):

  • Created calculate nutrients page
  • Added tabs for each field added on the calculate page
  • Added basic modal for the add fertilizer button
  • Added fertilizer dropdown

Screenshot 2025-01-14 at 1 47 04 PM
Screenshot 2025-01-14 at 1 47 16 PM


Thanks for the PR!

Deployments, as required, will be available below:

Please create PRs in draft mode. Mark as ready to enable:

After merge, new images are deployed in:

@@ -361,3 +361,5 @@ poetry.toml
pyrightconfig.json

# End of https://www.toptal.com/developers/gitignore/api/node,java,python,go
.env.template
Copy link
Contributor

Choose a reason for hiding this comment

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

.env.templates should not be gitignored. The point of the templates is to let ppl know what the variable names are without letting them see the real deal. They should be synced to the repo.

* @summary Type definition for fieldType File
*/

type fieldType = {
Copy link
Contributor

Choose a reason for hiding this comment

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

In most syntax, type names have each letter capitalized; they aren't camel-case.

Also, is this "field" like "a grass field"?

*/

type fieldType = {
Fields: any[];
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this any type? Also why does a Field have a Fields array? What does this object actually represent/which file does it correlate to?

setFields(parsedData.years[0].Fields);
}
const parsedData = JSON.parse(state.nmpFile);
setFields(parsedData.years[0].Fields);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it safe to assume the index 0 here? Would someone ever be able to index into another year?

</thead>
<tbody>
<td>Crops</td>
{/* {field.Crops.map((crop) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason to keep this commented-out code>?

export default function FieldTable({ key, field, setFields }) {
const [isModalVisible, setIsModalVisible] = useState(false);

const fertilizerOptions = [
Copy link
Contributor

Choose a reason for hiding this comment

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

You should be getting these options from the _FertilizerTypes__20241212 table.

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.

Create Calculate Nutrients Screen with Fertilizer Dropdown
3 participants