Feedback

Add a simple user feedback widget to any page.

Overview

HQ has a custom feedback component that uses Knockout Components. See feedback.js for full documentation.

Usage

The best way to learn how to use this component is to look at existing code to see how it's being used in HQ.

OData Feeds make use of the feedback component. In this use case the component is placed outside of a knockout model, so data-apply-bindings="false" is not required, as in example below.

A Working Example

The example below demonstrates the feedback component inside of a knockout model. The feedback url is taken from initialPageData which "reverses" the styleguide_submit_feedback_demo URL from the registerurl template tag.

HTML
<div id="feedback-example">
  <feedback
    data-apply-bindings="false"
    params="
      featureName: featureName,
      url: url
    "
  ></feedback>
</div>
JS
import $ from 'jquery';
import initialPageData from 'hqwebapp/js/initial_page_data';
import 'hqwebapp/js/components/bootstrap5/feedback';

$(function () {
    $("#feedback-example").koApplyBindings(function () {
        let self = {};

        self.featureName = 'My New Feature';

        self.url = initialPageData.reverse("styleguide_submit_feedback_demo");

        return self;
    });
});