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

Ajax notifications #2829

Merged
merged 8 commits into from Jun 26, 2018
Merged

Conversation

namangupta01
Copy link
Member

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!
Closes #2277

  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts
  • PR is descriptively titled
  • PR body includes fixes #0000-style reference to original issue #
  • ask @publiclab/reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If 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

We have a loose schedule of reviewing and pulling in changes every Tuesday and Friday, and publishing changes on Fridays.

Thanks!

@plotsbot
Copy link
Collaborator

plotsbot commented Jun 14, 2018

2 Messages
📖 @namangupta01 Thank you for your pull request! I’m here to help with some tips and recommendations. Please take a look at the list provided and help us review and accept your contribution! And don’t be discouraged if you see errors – we’re here to help.
📖 It looks like you haven’t marked all the checkboxes. Help us review and accept your suggested changes by going through the steps one by one. If it is still a ‘Work in progresss’, please include ‘[WIP]’ in the title.

Generated by 🚫 Danger

$('#like-button-' + node_id).on('click', clicknotliked);
$('#like-button-' + node_id).off('click', clickliked);
new Noty({
theme: 'mint',
Copy link
Member

Choose a reason for hiding this comment

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

Could we reduce repetition by centralizing our default settings into javascripts/noty.js in a variable, and then this could become a single line?

@@ -11,6 +11,8 @@
<% end %>
<meta name="author" content="Public Lab contributors" />
<link href="https://<%= request.host %>/feed.rss" rel="alternate" type="application/rss+xml" title="Public Lab research" />
<link href="/lib/noty/lib/noty.css" rel="stylesheet">
<script src="/lib/noty/lib/noty.js" type="text/javascript"></script>
Copy link
Member

Choose a reason for hiding this comment

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

And if this is on every page, we could get it compiled in, at /app/assets/javascripts/application.js and /app/assets/stylesheets/application.css

bower.json Outdated
@@ -26,7 +26,8 @@
"short-code-forms": "jywarren/short-code-forms#~0.0.1",
"leaflet-blurred-location": "publiclab/leaflet-blurred-location#master",
"chart.js": "v2.7.0",
"typeahead.js-browserify": "Javier-Rotelli/typeahead.js-browserify#~1.0.7"
"typeahead.js-browserify": "Javier-Rotelli/typeahead.js-browserify#~1.0.7",
"noty": "3.1.4"
Copy link
Member

Choose a reason for hiding this comment

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

Can you also add this to the Yarn PR so we don't break it in the future -- in #2659 ? Thanks!

@namangupta01
Copy link
Member Author

Here's the gif
ezgif com-video-to-gif 9

@namangupta01
Copy link
Member Author

@jywarren Please check if i correctly added the jquery-confirm in bower.json file.
Thanks!

@namangupta01 namangupta01 reopened this Jun 16, 2018
@ghost ghost added in progress and removed in progress labels Jun 16, 2018
}
Copy link
Member

Choose a reason for hiding this comment

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

Sorry just checking - are we missing a closing ) here?

@@ -0,0 +1,11 @@
function notyNotification(theme, timeout, type, layout, text){
Copy link
Member

Choose a reason for hiding this comment

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

Awesome!

@namangupta01
Copy link
Member Author

@jywarren do we need to adjust code climate ?

@jywarren
Copy link
Member

i approved them. good to go? 😄

@namangupta01
Copy link
Member Author

Yeah! 👍

@namangupta01
Copy link
Member Author

Is it good to go? Does this new delete design is fine acc. to you?

@jywarren
Copy link
Member

Ack sorry, looks like it needs a rebase again? Otherwise great!

$("#c<%= comment.cid %>").remove()
$('#comment-count')[0].innerHTML = parseInt($('#comment-count')[0].innerHTML)-1
})
$("#c<%= comment.cid %>delete-btn-2").bind('ajax:success', function(e,response){
Copy link
Member Author

Choose a reason for hiding this comment

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

@jywarren I think this was redundant. What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

@ViditChitkara As you are working a lot on commenting i think you may have idea about this...is this redundant here?

@jywarren
Copy link
Member

I wonder if @ViditChitkara could take a look through this code, having recently worked a lot on commenting?

@namangupta01
Copy link
Member Author

yes but after rebasing this needs some work. Will update this pr in some time.

@namangupta01
Copy link
Member Author

@jywarren It is now good to merge. You can also test this on unstable.

@jywarren jywarren merged commit e08cad5 into publiclab:master Jun 26, 2018
@ghost ghost removed the ready label Jun 26, 2018
@jywarren
Copy link
Member

Awesome, thanks!!!

SrinandanPai pushed a commit to SrinandanPai/plots2 that referenced this pull request May 5, 2019
* Added notyjs for ajax call notifications

* Added notyjs for ajax call notifications and added jquery-confirm for confimation modal

* Added notyjs for ajax call notifications and added jquery-confirm for confimation modal

* Minor Changes

* Minor changes

* Changed notification text

* Minor changes

* Minor change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add notifications via Ajax Calls with Noty
3 participants