plots2 icon indicating copy to clipboard operation
plots2 copied to clipboard

Refactor wikis and questions partials to use local variable

Open cesswairimu opened this issue 8 years ago • 8 comments

Please describe the problem (or idea)

What happened just before the problem occurred? Or what problem could this idea solve?

From this https://github.com/publiclab/plots2/pull/3711 PR conversation we found that some partials are using instance variables which makes it hard for them to be rendered anywhere. Its a good first-timer issue

What did you expect to see that you didn't?

We would like them to use a local variable if present and default to an instance variable if not. They should be defined as https://github.com/publiclab/plots2/blob/master/app/views/notes/_notes.html.erb#L1 and replace the instance variable with a local variable everywhere else in the file.

Please show us where to look

The partials to be refactored are https://github.com/publiclab/plots2/blob/master/app/views/wiki/_wikis.html.erb https://github.com/publiclab/plots2/blob/master/app/views/questions/_questions.html.erb add <% wikis = wikis || @wikis %> and replace @wiki with wiki everywhere else in the file.

What's your PublicLab.org username?

@cess

cesswairimu avatar Nov 07 '18 15:11 cesswairimu

Thanks for opening your first issue! This space is protected by our Code of Conduct - and we're here to help. Please follow the issue template to help us help you 👍🎉😄 If you have screenshots or a gif to share demonstrating the issue, that's really helpful! 📸

welcome[bot] avatar Nov 07 '18 15:11 welcome[bot]

Can I work on this?

gyi2521 avatar Nov 07 '18 19:11 gyi2521

Yeah sure @gyi2521 go ahead.

cesswairimu avatar Nov 07 '18 19:11 cesswairimu

Thanks!

On Wed, Nov 7, 2018 at 2:28 PM Cess [email protected] wrote:

Yeah sure @gyi2521 https://github.com/gyi2521 go ahead.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/3915#issuecomment-436747712, or mute the thread https://github.com/notifications/unsubscribe-auth/AoIINw7C0YtMPjiREt1MR9jMSUJM6oleks5uszRNgaJpZM4YSmzE .

gyi2521 avatar Nov 07 '18 19:11 gyi2521

@gyi2521 submitted a fix in #3847!

jywarren avatar Nov 11 '18 19:11 jywarren

@cesswairimu can you please review #3918 and resolve the conflict. So that we can merge it?

SidharthBansal avatar Dec 06 '18 23:12 SidharthBansal

@SidharthBansal cool, on it.

cesswairimu avatar Dec 07 '18 08:12 cesswairimu

Closing the issue as per your request in #3918. Feel free to close the issues which are completed.

SidharthBansal avatar Dec 07 '18 10:12 SidharthBansal