-
Notifications
You must be signed in to change notification settings - Fork 209
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
Shorten UI code with new $step
method
#710
Conversation
Signed-off-by: tech4GT <varun.gupta1798@gmail.com> dist update Revert "dist update" This reverts commit 9ee2a98.
@publiclab/is-reviewers please review. |
I'm going to change the names to |
@publiclab/is-reviewers I have made the changes and rebased. Please review |
@jywarren can you please merge my PRs before the other ones since I will not be able to touch my PC until 16th of april. I don't know if I will get time past that date as well. |
Hi, sorry I missed this way back. I'm wondering if we could pass this with the utility functions we make available to steps: https://github.com/publiclab/image-sequencer/blob/main/CONTRIBUTING.md#draw What do you think? I like the idea of a convenience method, though! Thanks! |
Also, i think it'd be best to have a test -- no rush on this, i know you're busy, but just to reply (finally, apologies again!) |
No need for an apology. Also I think tests and docs can be added in a followup by somebody else since I'm not very experienced with jasmine and also someone can add to the docs(maybe a newcomer) very easily. What do you think? |
Could you open up a new issue linking here and proposing adding tests built
on this PR? We could then merge them together. Thanks!
…On Mon, Mar 4, 2019, 10:25 AM Harsh Khandeparkar ***@***.***> wrote:
No need for an apology. Also I think tests and docs can be added in a
followup by somebody else since I'm not very experienced with jasmine and
also someone can add to the docs(maybe a newcomer) very easily. What do you
think?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#710 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ9Wf_d6nivbyt-uHbPk3ARwTtijHks5vTTqygaJpZM4aQOqP>
.
|
Sure!
On Mon 4 Mar, 2019, 9:01 PM Jeffrey Warren, <notifications@github.com>
wrote:
… Could you open up a new issue linking here and proposing adding tests built
on this PR? We could then merge them together. Thanks!
On Mon, Mar 4, 2019, 10:25 AM Harsh Khandeparkar ***@***.***
>
wrote:
> No need for an apology. Also I think tests and docs can be added in a
> followup by somebody else since I'm not very experienced with jasmine and
> also someone can add to the docs(maybe a newcomer) very easily. What do
you
> think?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <
#710 (comment)
>,
> or mute the thread
> <
https://github.com/notifications/unsubscribe-auth/AABfJ9Wf_d6nivbyt-uHbPk3ARwTtijHks5vTTqygaJpZM4aQOqP
>
> .
>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#710 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AhKOn0Ru31HlfnplW5djSZ18GD82InJ4ks5vTTxMgaJpZM4aQOqP>
.
|
Shall I open it now or after this is merged? |
Let's do it now, and wait to merge this until the test is completed. I
prefer to have it be tested before merging, i hope you understand!
…On Mon, Mar 4, 2019 at 10:33 AM Harsh Khandeparkar ***@***.***> wrote:
Shall I open it now or after this is merged?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#710 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJzb87dlm7w0PWT7ndKCtKOzbNW2Oks5vTTyWgaJpZM4aQOqP>
.
|
Yep. Sure! |
test/ui/scopeQuery.spec.js
Outdated
}) | ||
|
||
}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay so basically you are testing your new method by creating an example html! Why don't we test it for a particular step? I mean a module. I understand the results would be same but I want to know if you tried doing that and have been stuck as it happened with me as well!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It took me a day to figure this out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah the way is great as we basically have to test the functionality but have you tried it for a module? I just want to know if you faced issues with doing it with jasmine-jquery and fixtures and spyOnEvent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aashna27 I didn't understand your question properly. If there is some problem in my code, please let me know here. If you want to ask some questions, DM me on gitter and resolve this conversation. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hear what @aashna27 is saying here, but although I see the logic in the suggestion of the HTML fixture being of similar structure to the one @harshkhandeparkar has used, I think it's basically OK for now. The important thing is that it serves a generalized purpose and that the HTML example here properly demonstrates it. Thanks!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, now I understand. This is just a unit test, maybe we can write integration tests in the future. Currently, even the unit tests are incomplete so maybe integration tests and e2e tests can be written in the near future. What do ya'll say?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aashna27 I didn't understand your question properly. If there is some problem in my code, please let me know here. If you want to ask some questions, DM me on gitter and resolve this conversation. Thanks!
No no problem with the code just wanted to know if you tried another approach, this one is great though!
test/ui/scopeQuery.spec.js
Outdated
}) | ||
|
||
}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah the way is great as we basically have to test the functionality but have you tried it for a module? I just want to know if you faced issues with doing it with jasmine-jquery and fixtures and spyOnEvent
Hi, all, this looks really good and with one extra addition I think it is good to merge. @harshkhandeparkar you've written some great docs in the Also cc @MargaretAN9 who is working on an overall image-sequencer manual at https://publiclab.org/notes/MaggPi/06-10-2019/draft-of-public-lab-image-sequencer-user-manual-comments-welcome, as this will change some of the UI helper methods behaviors. @MargaretAN9 will you post your manual for comment in Markdown in a PR in this repository? Thank you! |
@jywarren at the time the docs were written, I didn't think I would have time to write them myself so I made the FTO. But it ended up helping a first timer anyway 😄 |
awesome!
…On Tue, Jun 18, 2019 at 10:10 AM Harsh Khandeparkar < ***@***.***> wrote:
@jywarren <https://github.com/jywarren> at the time the docs were
written, I didn't think I would have time to write them myself so I made
the FTO. But it ended up helping a first timer anyway 😄
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#710?email_source=notifications&email_token=AAAF6J5B2ZR2HBM6PRL3VF3P3DUEZA5CNFSM4GSA5KH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX6YBMI#issuecomment-503152817>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAF6J7IVQEFE5ODTXFZJJTP3DUEZANCNFSM4GSA5KHQ>
.
|
Wow! I could rebase it from the browser. New GitHub features, which are added silently, are awesome. |
All good here? Can you mention when it's totally ready to merge? Thank you! |
@aashna27 please review this again. Made the requested changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, I think it is all set!! 🎉
Thanks a ton!
@jywarren please review this.
…On Fri, 21 Jun, 2019, 10:54 PM aashna27, ***@***.***> wrote:
***@***.**** approved this pull request.
Great, I think it is all set!! 🎉
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#710?email_source=notifications&email_token=AIJI5H6XGZPB5JFX2JXAG5DP3UFD7A5CNFSM4GSA5KH2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB4JZK2I#pullrequestreview-252941673>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIJI5HZZFYDUUZLZ7VE322DP3UFD7ANCNFSM4GSA5KHQ>
.
|
🎉 |
Fixes #833
Refactors the UI code by using new methods
$step
and$stepAll
.instead of
Use
Also with (what I call)
selector chaining
:How does it work
scopeSelector
andscopeSelectorAll
methods fromlib/scopeQuery.js
jQuery
object (from inside the scope) but with newelem
andelemAll
methods.This method can reduce the frequent occurrences of
$(step.ui.querySelector('q'))
especially withselector chaining
.Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!
npm test
@publiclab/reviewers
and@publiclab/is-reviewers
for help, in a comment belowIf tests do fail, click on the red
X
to learn why by reading the logs.Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software
Thanks!