Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Feeder React Feedback | 64 | 6 months ago | 53 | January 18, 2022 | 25 | mit | JavaScript | |||
The easiest way to collect feedback across your React apps | ||||||||||
Feedback Bot | 35 | 4 months ago | 2 | mit | Python | |||||
In Short This is An Personalized Livegram Bot Made Using Python.. Follow Me @HeimanPictures & Star This Repo | ||||||||||
Ecommerce | 23 | 3 years ago | mit | HTML | ||||||
Ecommerce project || Python Django | ||||||||||
Activeadmin_jobs | 23 | 1 | 3 years ago | 9 | February 05, 2018 | 12 | mit | Ruby | ||
It's a Rails engine that allows you to play nice with Active Job in Active Admin providing user feedback | ||||||||||
Django Basic Feedback | 13 | 8 years ago | bsd-3-clause | Python | ||||||
Provides a Feedback button on your pages and lets you view feedback via Django's admin site. Requires jQuery. | ||||||||||
Requery | 11 | 1 | 7 years ago | 9 | December 06, 2018 | 6 | JavaScript | |||
Store e run queries on database to help system manager of a Django website | ||||||||||
Online Exam System | 7 | 3 years ago | mit | PHP | ||||||
A web project based on Online-Exam-system .Database used : MySql and Backend : PHP......... PROJECT STATUS : COMPLETED. | ||||||||||
Anyway Feedback | 7 | 7 years ago | 1 | PHP | ||||||
Simple WordPress plugin to gather user feedback. | ||||||||||
Opiniodev Feedback Forum | 6 | 10 years ago | PHP | |||||||
Simple open source feedback forum. Use it as you like it. | ||||||||||
Mosaic | 5 | 13 years ago | Ruby | |||||||
Ruby library for building a mosaic image from several sources. STILL UNDER CONSTRUCTION! I will announce an official working release. |
It's a Rails engine that allows you to play nice with Active Job in Active Admin providing user feedback.
Add to your Gemfile:
source 'https://rails-assets.org' do
gem 'rails-assets-growl', '~> 1.3.1'
end
gem "activeadmin_jobs"
bundle install
rails generate activeadmin_jobs:install
If you use AdminUser
class in ActiveAdmin
you will need to add the following code:
class AdminUser < ActiveRecord::Base
include JobNotifier::Identifier
identify_job_through(:id, :email)
# more code...
end
To make it easy I'm going to explain how to use this gem with an example.
Example:
As an admin user:
Next, I will explain how to solve each step:
Suppose you want to go to the import form from the AdminUser
's index page. To do that, you can add an action_item
with a collection_action
:
/your_app/app/admin/admin_users.rb
ActiveAdmin.register AdminUser do
# more code...
action_item :import_users, only: :index do
link_to "Import Users", import_form_admin_admin_users_path
end
collection_action :import_form, title: "Import Users" do
# Nothing here. We just want to render the form.
end
end
With the related wiew:
your_app/app/views/admin/admin_users/import_form.html.erb
<%= semantic_form_for :data, url: { action: :import }, method: :post do |f| %>
<%= f.inputs "Form" do %>
<%= f.input :source, as: :file, label: "File", :hint => "Excel file with thousands rows that need to be processed in background..." %>
<% end %>
<%= f.actions do %>
<%= f.action :submit, as: :button, label: "Import" %>
<% end %>
<% end %>
You need to add the endpoint pointed in the form action too.
/your_app/app/admin/admin_users.rb
ActiveAdmin.register AdminUser do
# more code...
collection_action :import, title: "Import Users", method: :post do
# We fill this in the next step.
end
end
Inside the import action definition, you need to call the job in charge of parsing the .xls file. To do this:
First, we need to create the job. We need to do it using perform_with_feedback
method provided by Job Notifier gem. You can see how it works reading the Third and Fourth Steps of the usage section.
/your_app/app/jobs/user_upload_job.rb
class UserUploadJob < ActiveJob::Base
def perform_with_feedback(xls_path)
# Here you need to process the file an return a success or error result.
#
# Lets say I'm going to return this message:
#
# "Users successfully loaded"
#
# with a successful result and something like this:
#
# errors = [
# { row: 4, errors: ["Invalid First Name", "Invalid Category"] },
# { row: 6, errors: ["Invalid Last Name"] },
# { row: 84, errors: ["Invalid ID"] }
# ]
#
# raise JobNotifier::Error::Validation.new(errors)
#
# with unsuccessful result.
end
end
Then, we call the job in the import action:
/your_app/app/admin/admin_users.rb
ActiveAdmin.register AdminUser do
# more code...
collection_action :import, title: "Import Users", method: :post do
file_path = get_file_path(params[:data][:source]) # I'm not going to implement this. It's just an example.
UserUploadJob.perform_later(current_admin_user.job_identifier, file_path)
end
end
You don't need to do nothing here, the gem will do it for you using jQuery Growl.
On success...
On error...
The gem includes an index view for jobs. There, you can see a jobs list with the current state of each job.
To show feedback, you need to add one partial by possible job state prefixed by the job's class name in snake_case. For example:
If you have the UserUploadJob
job, following the convention: _[job_class_name].[job_state].html.erb
, you will need two partials:
One for success...
/your_app/app/views/admin/jobs/_user_upload_job.finished.html.erb
<%= result %>
Remember: we get this: "Users successfully loaded" as
result
on success.
One for error...
/your_app/app/views/admin/jobs/_user_upload_job.failed.html.erb
<h2>Errors :(</h2>
<% result.each do |record| %>
<h3>Row #<%= record[:row] %>:</h3>
<ul>
<% record[:errors].each do |error| %>
<li><%= error %></li>
<% end %>
</ul>
<% end %>
Remember: we get something like this:
[
{ row: 4, errors: ["Invalid First Name", "Invalid Category"] },
{ row: 6, errors: ["Invalid Last Name"] },
{ row: 84, errors: ["Invalid ID"] }
]
as result
on error.
Those partials will be rendered in the job's show view depending on its state.
If you want to translate your notifications, you can do it following this convention:
/your_app/config/locales/en.yml
en:
activeadmin_jobs:
[job_class_name]:
description: "XXX"
finished:
title: "XXX"
one: "XXX"
other: "XXX"
failed:
title: "XXX"
one: "XXX"
other: "XXX"
For example:
en:
activeadmin_jobs:
user_upload_job:
description: "Users upload through .xls file"
finished:
title: "Users have been uploaded! :)"
one: "One .xls file was completed with no errors. Click here to see the result"
other: ".xls files were completed with no errors. Click here to see the result"
failed:
title: "Error trying to upload users :("
one: "One .xls file could not be uploaded. Click here to see errors"
other: ".xls files could not be uploaded. Click here to see errors"
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)Thank you contributors!
Active Admin Jobs is maintained by platanus.
Active Admin Jobs is © 2016 platanus, spa. It is free software and may be redistributed under the terms specified in the LICENSE file.