Git Product home page Git Product logo

feedback-widget's Introduction

PDS Feedback Widget

PDS Feedback Widget Javascript-based overlay and modal window that provides a user with a form to provide comments or feedback on the web page they are currently accessing. When a comment is submitted, it will be sent to the PDS Help Desk and forwarded to the applicable node that has the application deployed.

Register

Before being able to use this widget, you will need to register your hostname with the Engineering Node in order to enable the Google Re-captcha that is part of the application.

Submit a request to the PDS Help Desk <https://pds.nasa.gov/?feedback=true>_ with the following information:

  • Hostname(s) for your website
  • Point(s) of contact to receive the Feedback

System Requirements

  • Apache Web Server
  • PHP 5.2+

Notes

  • The Feedback widget can be installed on other web servers which have PHP enabled, but the exact steps may differ depending upon the software and configuration.
  • Web servers without PHP will not be able to use the Feedback widget.
  • For PHP versions prior to 8.0.0, verify the JSON extension is enabled.

Resources

A few links that may be helpful for installing and configuring PHP on your Apache Web Server:

Install

Here are the steps for deploying the Feedback widget to your website on an Apache Web Server:

  1. Register with Engineering Node if you have not already.

  2. Add the following code snippet between the <head> tag on each page of your website. If your website uses a header file, you can place it in there:

<!-- PDS Feedback Widget -->
<!-- Only add JQuery if you do not already include a library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src='https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit' async defer></script>
<link rel="stylesheet" href="/feedback/css/feedback.css"  type="text/css" media="screen" />
<script src="/feedback/js/modernizr-custom.js"></script>
<script src="/feedback/js/config.js"></script>
<script src="/feedback/js/feedback.js"></script>
<!-- -->
  1. Download the Feedback Widget tar or zip from Github to your local machine, then copy to your home directory on the machine hosting the website.

  2. From your home directory on the machine hosting your website, unpack the widget:

tar -xvzf <.tar.gz>

#or

unzip <.zip>
  1. If you did not receive it when you registered with the Engineering Node, email the PDS Help Desk for the Re-captcha secret key. From the root folder of the widget, open feedback/recaptcha-v3-verify.php and replace $SECRET_CODE within the single quotation marks with the provided secret key.

  2. Next, configure the Feedback Widget . From the root folder of the widget, open feedback/js/config.js in your text editor of choice.

    A list and explanation of optional configurable variables can be found in the following section. Note: It is highly recommended that you update additionalLinks to provide help information unique to your website.

  3. Now we want to move the files needed for the widget to the home directory for your website, or WEB_HOME_PATH. This WEB_HOME_PATH is the path where your homepage resides. For example, if your homepage is /my/website/index.html, then your WEB_HOME_PATH is /my/website/. To move the files, from the command-line:

    • macOS / Linux

      # Make sure you are in the the feedback widget
      $ pwd
      /path/to/feedback-widget
      
      # Run deploy.sh to push the files to WEB_HOME_PATH
      $ ./deploy.sh /my/website
      sending incremental file list
      feedback/
      feedback/recaptcha-v3-verify.php
      feedback/css/
      feedback/css/feedback.css
      feedback/image/
      feedback/image/iconfinder_Help.svg
      feedback/image/msg_icon.png
      feedback/js/
      feedback/js/config.js
      feedback/js/feedback.js 
      feedback/js/modernizr-custom.js  
      
    • Windows TBD

Configurable Variables

Variable Description Default Value Accepted Values or Types0
header The header or title in the Feedback popup. "Help Desk" text
feedbackType Type of feedback for the user to specify if he or she so desires. "Comment,Question,Problem/Bug,Kudos,Other" text1
additionalLinks Additional link(s) the user may find helpful. --- ---
 - title The text displayed for the link. "Information for Data Users"
"Information for Proposers"
"Information for Providers"
"OpenPlanetary Forum"
"Site Map"
text
 - url The URL of the link. "https://pds.nasa.gov/home/users/"
"https://pds.nasa.gov/home/proposers/"
"https://pds.nasa.gov/home/providers/"
"https://forum.openplanetary.org"
"https://pds.nasa.gov/site-help.shtml"
valid URLs
label The text on the Feedback tab. "Need Help?" text
color The color of the Feedback tab. "#0b3d91" (NASA blue) text2
fontColor The color of the text on the Feedback tab. "#ffffff" (white) text2
fontSize The size of the text on the Feedback tab. "16" integer3,5
size --- --- ---
 - width The width of the Feedback tab. "150" integer3,5
 - height The height of the Feedback tab. "60" integer3,5
placement --- --- ---
 - side The side of screen to attach the Feedback tab. "right" "RIGHT" "LEFT" "TOP" "BOTTOM"
 - offset The offset from top or left side of the screen.7 "50" integer4,5 ∈ [0,100]6

0: All values must be enclosed within double quotation marks.
1: Separate multiple values with a comma.
2: Must be written as a hexadecimal, RGB, or HSL color, or be from this list of accepted color names. If you are unfamiliar with these formats, sites such as ColorHexa can help you find an exact color in the accepted formats. Be sure to include '#', 'rgb()', or 'hsl()' within the double quotations in config.js as needed.
3: Used with the unit 'px' at 1px = 1/96th of an inch. For a digital facsimile of how different px values render on your screen, there are resources such as this w3schools widget. (To use, adjust the integer value for any font-size in the left pane then click the green 'Run' button near the top to refresh the results in the right pane.)
4: Used with the unit 'vh' or 'vw' at 1vh or 1vw = 1/100th of the browser window's height or width.
5: Enter the integer value only. Do not include such characters as '%', 'vh', 'vw', 'px', 'pt', 'em', 'rem', etc.
6: If this value is not in the range of 0 to 100 (inclusive) or is such that a part of the tab would not be visible, the most extreme value allowed which keeps the entire tab visible will be applied.
7: Depending on the side of screen specified, this places the vertical center of the tab proportional to the height of the screen or the left corner of the tab proportional to the width of the screen. For instance, if you fill in config.js as follows:

  placement: {
    side: "bottom",
    offset: "0"
  }

the Feedback tab will be on the bottom of the screen squarely in the left corner.

  placement: {
    side: "left",
    offset: "25"
  }

places the Feedback tab on the left side of the screen a quarter of the way down from the top.

Uninstall

The following steps will help you uninstall the feedback widget:

  1. Remove the following code snippet from any web pages it was added to:
<!-- PDS Feedback Widget -->
<!-- Only add JQuery if you do not already include a librar -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src='https://www.google.com/recaptcha/api.js?render=explicit' async defer></script>
<link rel="stylesheet" href="/feedback/css/feedback.css"  type="text/css" media="screen" />
<script src="/feedback/js/modernizr-custom.js"><script>
<script src="/feedback/js/config.js"></script>
<script src="/feedback/js/feedback.js"></script>
<!-- -->
  1. Remove the files from WEB_HOME_PATH/feedback:
# Unix example
rm -fr /my/website/feedback

License

LICENSE.txt

feedback-widget's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

conormcneil

feedback-widget's Issues

Feedback cuts off Comment with special characters

🐛 Describe the bug

TextArea submission is being cut off.

📜 To Reproduce

Steps to reproduce the behavior:

  1. Go to pds.nasa.gov
  2. Click on 'Need Help?' to open Feedback widget
  3. Enter comment and Submit
  4. Follow up with pds_operator to see what was received

🕵️ Expected behavior

Comment is cut off if a special character is used.

📚 Version of Software Used

v1.2.1

🩺 Test Data / Additional context

Special characters are the suspected culprit (not yet verified) because there is no maxLength set on the form element. This issue was brought to our attention when a user submitted feedback on an RMS site (email thread with subj: 'Feedback from pds-rings.seti.org')

🏞Screenshots

🖥 System Info

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

🦄 Related requirements

⚙️ Engineering Details

Readme edits

The README looks pretty good, but there are a couple of issues in the "Configured Variables" table:

  • Footnote (5) tells users to enter integer values only, not units like "px" or "vw". But every single corresponding "default" value has explicit units shown, and there is no indication of what units will be applied to the naked integer.

    What you have now is likely to lead to needless confusion and frustration. If the user cannot select units, then the default values in this table shouldn't show them, and the description should name the (de facto required) unit explicitly. But if the user cannot select units, then there shouldn't be any units in the config.js file, either - you're basically instructing users to remove the units that are already in there! If what you mean is "Do not change the units that are in config.js", then say that - but expect users to change them anyway.

  • The "placement -offset" line shows a value range of "[0,95)" [sic]. The use of an opening bracket with a closing parenthesis looks like a typo; if it isn't one it needs to be explained.

  • The set of values itself is also somewhat mysterious. I don't see why "0" would be an allowed value on one extreme, but "100" is not allowed on the other. It's also not immediately clear to me why the unit is "vh" regardless of whether the widget is placed top/bottom or left/right. Perhaps it is clear to CSS programmers?

  • This table does not follow the order or the syntax in the config.js file, and it's not sorted in alphabetical order, either. If the table were any longer it would be kind of annoying to have to scroll back and forth looking for things. Still, one order or the other should be applied.

  • The structure of the "followUpLinks" section is more complex than what is in the table.That's not a major issue for people who know JSON, but that does not necessarily describe people who would be tasked with implementing this widget.

    On the whole, I'd re-order the table to match config.js, and I would expand the content of the "followUpLinks" line the same way as has been done for "size" and "placement". Then I'd expand the description to include a) what in the JSON structure can be changed ("url" only? "title"?); and b) to remove the implication that anything in there should be a multivalued list of URLs - unless that is actually valid.

Feedback does not let submissions through for SBN

🐛 Describe the bug

For SBN-UMD, a submission gives the message "Are you a bot? Suspicious behavior detected."
For SBN-PSI, a submission gives the message "Status: error; Error: Not Found"

📜 To Reproduce

Steps to reproduce the behavior:

  1. Go to
  2. Open the Feedback form by clicking the blue tab on the right side of the screen which says "Need Help?"
  3. Fill in some comment and click the button to "Send Feedback"
  4. See message

🕵️ Expected behavior

The message should be something like, "Thank you for making the PDS a better site. If you provided an email address, a PDS representative will get back to you as soon as possible."

📚 Version of Software Used

?

🩺 Test Data / Additional context

SBN-UMD had updates to their servers, after which the widget stopped working. I do not know if this applies to SBN-PSI as well.


🦄 Related requirements

⚙️ Engineering Details

Feedback says (CORS) error but submits

🐛 Describe the bug

On submitting something to the Feedback widget, a message will come up that "There was an error sending your feedback." Opening dev tools shows a CORS error. However, the submission goes through. This has been tested from the ATM site, two SBN PSI sites (https://arcnav.psi.edu/ and https://sbn.psi.edu/pds/) and the PDS gamma site.

Notes:

  • brought to our attention by Mike Drum
  • this didn't seem to be a problem in March (#17 (comment)), unless it was a problem at that time and unnoticed until now

📜 To Reproduce

Steps to reproduce the behavior:

  1. Go to pds.nasa.gov
  2. Click on "Need Help?" to open the Feedback modal
  3. Fill in with your information, indicate it's for testing, and submit
  4. See error

🕵️ Expected behavior

Either the submission should not go through, or the feedback widget should give the "Thank you for making PDS a better site" message.

📚 Version of Software Used

v1.3.0, at least on gamma

🩺 Test Data / Additional context

🏞Screenshots

image

🖥 System Info

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

🦄 Related requirements

⚙️ Engineering Details

Feedback says (CORS) error but submits

🐛 Describe the bug

Same issue as #18
I am still seeing the error message, but the feedback was submitted to the system.

🕵️ Expected behavior

user should see the "Thank you" message instead.

🐛 Related Test cases

#18

📜 To Reproduce

...

🖥 Environment Info

  • Operating System: [e.g. MacOSX with Docker Desktop vX.Y]
    ...

📚 Version of Software Used

No response

🩺 Test Data / Additional context

No response

🦄 Related requirements

🦄 #xyz

⚙️ Engineering Details

No response

As a designer/developer, I want to provide other ways of triggering the feedback modal.

We would like to discuss the possibility of having alternate ways of triggering the feedback widget that don't involve the floating button that resides on the right side of the browser. Reason being that some of us feel that the button is distracting and would rather like to have the widget triggered by say a "Contact Us" link somewhere on the site like the footer perhaps.

Would this be acceptable and if so, would it require any changes to the widgets implementation?

ReCaptcha error on ATM web site

Checked for duplicates

No - I haven't checked

🐛 Describe the bug

When I used the feedback widget on ATM website, the pop raises an error asking if I am sure if I am not a bot.

image

🕵️ Expected behavior

I expected the feedback widget to recognize I am not a bot.

📜 To Reproduce

Go on ATM web site https://pds-atmospheres.nmsu.edu/ and use the feedback widget deployed there.

🖥 Environment Info

No response

📚 Version of Software Used

No response

🩺 Test Data / Additional context

No response

🦄 Related requirements

🦄 #xyz

⚙️ Engineering Details

There is no error in the developer tool's console or the network tab.

Unable to change font size from config.js

From user:

There is a small bug in the feedback widget. feedback.css line
634 sets the default font size to 16, but it does it for the
".feedbackTab p" element. The config.js file overrides the parent
".feedbackTab" style, but the "p" element still gets its size from
feedback.css. The end result is it's not possible to change the font
size using config.js.

Update documentation describing how to enable PHP on HTTP server

I followed the directions but could not get the widget to show for either:

Maybe the web server is missing something, but, if so, the directions should say what the requirements are.

email service return 404 error

Checked for duplicates

Yes - I've already checked

🐛 Describe the bug

When I do a request to the Help button on any node web site (e.g. pds.nasa.gov or sbn).

I get a 404 error on the back-end email service.

But the email message arrives to the support email.

This looks like the previous bug #21 but I would say the cause is different and CORS is not the issue here.

🕵️ Expected behavior

I expected not to have this pop-up error.

📜 To Reproduce

...

🖥 Environment Info

  • Version of this software [e.g. vX.Y.Z]
  • Operating System: [e.g. MacOSX with Docker Desktop vX.Y]
    ...

📚 Version of Software Used

No response

🩺 Test Data / Additional context

No response

🦄 Related requirements

🦄 #xyz

⚙️ Engineering Details

No response

🎉 Integration & Test

No response

Feedback form is bombarded by spam emails

🐛 Describe the bug

[email protected] was spammed by [email protected] at 120+ spam emails per minute.

📜 To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

🕵️ Expected behavior

📚 Version of Software Used

🩺 Test Data / Additional context

🏞Screenshots

🖥 System Info

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

🦄 Related requirements

⚙️ Engineering Details

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.