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

Estimating backend #19

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Estimating backend #19

wants to merge 7 commits into from

Conversation

mariana0pachon
Copy link
Contributor

@mariana0pachon mariana0pachon commented Jul 22, 2019

DNM until base branch #14 is merged

  • Create estimate model to have 1 estimate per user per story
  • Get list of valid estimates for a project from PT and only display those options in the frontend
  • On selection change in frontend, execute migration and store point estimates for that story for that user in the database
  • Add query to view user estimates for each story

Things to fix:

  • Estimate that is selected is stored in the database for the appropriate user and story but is not then reflected in the frontend. This might be because the type of Estimate is not invalidated by URQL from the beginning, so once something appears there it does not know how to handle it. But this might not be the problem, because I tried reloading the page when the database is populated and nothing was shown either.
  • The input select does not change when switching stories. Again, this should probably come directly from the database.

@mariana0pachon mariana0pachon added the do not merge Reviewable, but some condition must be met before merging label Jul 23, 2019
@mariana0pachon mariana0pachon force-pushed the mpp/display_stories branch 6 times, most recently from 72666e9 to 5936af8 Compare July 26, 2019 13:15
@mariana0pachon mariana0pachon changed the base branch from mpp/display_stories to master July 29, 2019 14:56
@mariana0pachon mariana0pachon force-pushed the mpp/estimate_backend branch 2 times, most recently from 763feea to 658277f Compare July 29, 2019 20:12
@mariana0pachon mariana0pachon removed the do not merge Reviewable, but some condition must be met before merging label Jul 29, 2019
Copy link
Collaborator

@cbarber cbarber left a comment

Choose a reason for hiding this comment

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

Some minor things and conflicts.


def self.join_user_project(user:, project:)
p = Project.find_by(id: project.id)
p = Project.create!(id: project.id) if p.nil?
Copy link
Collaborator

Choose a reason for hiding this comment

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

find_or_create_by. I think this would move the need for this method entirely:
user.projects << Project.find_or_create_by(id: project.id)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I don't think this method is used at all... so I will just get rid of it. We do this instead:

      pr = Project.find_or_initialize_by(id: p.id)
      pr.name = p.name
      pr.save!
      self.projects << pr

where self is a User

end

est
else { message: 'Invalid point value for this project\'s schema' }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: move the object return to a line beneath else

}

const EstimateSelect = ({ projectId, storyId }: Props) => {
const state = useStore().getState();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this actually update on state changes? I thought we needed useSelector for a different issue.

if (res.fetching) {
return <>Loading GraphQL...</>;
} else if (res.error) {
console.log(res.error);
Copy link
Collaborator

Choose a reason for hiding this comment

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

console.error and you'll need a tslint.disable-next-line no-console comment.

@mariana0pachon mariana0pachon added the do not merge Reviewable, but some condition must be met before merging label Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Reviewable, but some condition must be met before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants