plots2 icon indicating copy to clipboard operation
plots2 copied to clipboard

Refactoring profile.html.erb code pt.1

Open sashadev-sky opened this issue 7 years ago • 6 comments

First Time?

This is a first-timers-only issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.

If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!

We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you 💝

If you have contributed before, consider leaving this one for someone new, and looking through our general help wanted issues. Thanks!

🤔 What you will need to know.

Nothing. This issue is meant to welcome you to Open Source :) We are happy to walk you through the process.

The problem

Our code in app/views/users/profile.html.erb is very verbose... we could use some refactoring

We can start by refactoring out a re-occuring line from the code. For now, the 1st line of:

https://github.com/publiclab/plots2/blob/1931439c0c799b3e3420a9dcaace7a54cf895bd4/app/views/users/profile.html.erb#L212-L214

Solution

Change the line in the code block found in the "The Problem" section to use your new helper method instead.

That line can be updated to <% if current_profile_user %>

Thanks!!

Steps to Fix

  • [ ] Claim this issue with a comment here, below, and ask any clarifying questions you need
  • [ ] Fork the repository and set it up locally following the main repo README instructions https://github.com/publiclab/plots2
  • [ ] Create a new feature branch with a unique name descriptive to the issue
  • [ ] Try to fix the issue following the steps above, but even before you're done, you can: commit your changes to your branch and start a pull request (see contributing to Public Lab software) but mark it as "in progress" if you have questions or if you haven't finished
  • [ ] Reference this issue in your pull request body
  • [ ] Once you submit your pull request, an additional checklist will be provided for getting it merged

💬 Get help

If you need any help - here are some options:

  • Comment below
  • Join our gitter chat at https://gitter.im/publiclab/publiclab

sashadev-sky avatar Dec 19 '18 19:12 sashadev-sky

i would like to work on this issue.

capedcrusader23 avatar Dec 21 '18 17:12 capedcrusader23

Hi @capedcrusader23 you can surely work once #4343 gets merged. Thanks!

grvsachdeva avatar Dec 21 '18 18:12 grvsachdeva

ok i made a pr but it had some indentation error,will solve it.

capedcrusader23 avatar Dec 21 '18 18:12 capedcrusader23

@capedcrusader23 I have updated the issue a little. Please take a look. thanks!

grvsachdeva avatar Dec 21 '18 18:12 grvsachdeva

hey @capedcrusader23, I fixed an almost identical issue a few days ago but noticed yours is still open. Can I help you in any way?

dtlight avatar Dec 27 '18 22:12 dtlight

Hi, @capedcrusader23 - as I noted in your pull request, a very big PR inadvertently overwrote your changes and resolved this. I'd like to suggest perhaps you might pick up a new issue and we'd be happy to work with you on it! Your solution was great, so no fault there; it just happened that we had a big PR that modified 91 files on the way, and it kind of absorbed this one. My apologies! But thank you for your help!

jywarren avatar Jan 03 '19 20:01 jywarren