Git Product home page Git Product logo

slack-feedback's Introduction

Slack Feedback

Chat box for quick app feedback sent to a Slack channel from a Grails project. Optionally the plugin can be configured to allow responses from Slack back to the application users.

Feedback in Grails Feedback in Slack

Requirements

  • Slack account with Admin permissions
  • jQuery
  • Grails project with Spring Security installed
  • Semantic UI
    • NOTE: Currently Slack Feedback only supports use with the Semantic UI frontend framework, additional instructions for use without Semantic UI will be a future improvement

Feedback from Grails to Slack

This is the basic configuration of Slack Feedback and possible even if your application is hidden behind a firewall. User feedback can be posted from the Grails application out to Slack.

Slack Requirements

  • Create an Incoming WebHooks integration
  • Select a channel to post messages to
    • NOTE: This can be overwritten in the config. This is helpful if multiple projects use the same webhook.
  • Add the WebHook url to the config as shown below

Config

All config items contain the prefix grails.plugin.slackfeedback.

NOTE: Config items with * after them are secret information. It is highly reccommended to put this information in secret files and pull it into the Grails project at runtime.

  • webhook - The Incoming WebHook URL provided by Slack*
  • channel - The channel to post to [Optional]
  • userDomainClassName - The full package name of the Spring Security User object (e.g. 'com.theconnman.feedback.User') [Required for Outgoing WebHooks]

Chatbox Layout

Slack Feedback provides a single layout template which contains all necessary HTML and JavaScript. A basic use of the layout is below:

<g:render template="/layouts/chatbox" plugin="slack-feedback" />

To trigger the modals contined within the template call the JavaScript function slackFeedback(). A simple button which does this is shown below and can be placed anywhere on a page:

<div class="ui primary button" onclick="slackFeedback()">Feedback</div>

An example using the Chatbox layout and trigger in a Semantic UI menu can be found in the Slack Feedback plugin test project.

Layout Parameters

The chatbox template takes multiple optional parameters which customize the modals. These are passed in model attribute as a map. An example is shown below:

<g:render template="/layouts/chatbox" plugin="slack-feedback" model="[title: 'Need help or have some feedback?', maxlength: 1000]" />
  • title - The title of the form modal

    • Default: 'Send Us A Comment'
  • label - The label of the textarea

    • Default: 'Feedback'
  • placeholder - Placeholder text for the textarea

    • Default: ''
  • maxlength - Maximum character length of the textarea

    • Default: 255
  • successText - Success modal title

    • Default: 'Feedback Successfully Sent'
  • errorText - Error modal title

    • Default: 'An Error Occured, Please Try Again Later'

Feedback from Slack to Grails

It's one thing to have feedback come into Slack, it's another to be able to respond back to the app from within Slack. Below are instructions on how to configure Outgoing WebHooks for Slack and use them to communicate back to your Grails application.

Slack Requirements

  • Create an Outgoing WebHooks integraion
  • Select a channel to post messages to
  • Add a set of trigger words
  • Add [url]/slack/post where [url] is the URL of your publicly visible Grails application

Config

The same instructions from the above Config section apply.

  • token - The Outgoing WebHook token provided by Slack* [Required for Outgoing WebHooks]

SF TagLib

Slack Feedback also adds a taglib (the namespace is sf) which can be used to render user messages and message counts. The docs are included in the JavaDocs of the taglib. Examples of how to use the taglib tags can be found in the example views in the plugin.

For <sf:eachMessage> the body of the tag is executed for each message a user has. For a full list of fields for the Message object refer to the Message domain object. The use of message.author is encouraged instead of directly calling message.respondent.

Slack Response Syntax

During the Slack Outgoing WebHooks integration setup a set of trigger words were set up. The following syntax must be used when sending a message through Slack on a channel set up with the Outgoing WebHook:

[trigger] [username]: [message]

The following is an example of the correct format:

Message admin: Test message to admin using the trigger word Message

Development

Thank you for taking an interest furthering the development of Slack Feedback. Testing integration with Slack can be a bit difficult especially when a development machine needs to receive a POST request from Slack. To get around this issue I use the Advanced REST client for Chrome to simulate Slack POSTs to the system. Outgoing WebHook integrations provide a sample POST request which I modified slightly to send through the REST client. For outgoing feedback I created a test channel in my personal Slack account to send data out to.

slack-feedback's People

Contributors

burtbeckwith avatar theconnman avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

burtbeckwith

slack-feedback's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.