@healthcatalyst/catalyst-docfx-template 1.0.125 → 1.0.126

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@healthcatalyst/catalyst-docfx-template",
3
- "version": "1.0.125",
3
+ "version": "1.0.126",
4
4
  "license": "MIT",
5
5
  "description": "A DocFX Template patching the Default template.",
6
6
  "publishConfig": {
package/styles/main.js CHANGED
@@ -6,8 +6,6 @@ if (!String.prototype.startsWith) {
6
6
  };
7
7
  }
8
8
 
9
- var profile;
10
-
11
9
  $(function() {
12
10
  // version dropdown
13
11
  var $version = $('#version').on('change', function() {
@@ -39,16 +37,6 @@ $(function() {
39
37
  $version.val(window.location.host);
40
38
  }
41
39
  });
42
-
43
- $.ajax({
44
- global: false,
45
- url: "https://docs.healthcatalyst.com/api/profile",
46
- dataType: "json",
47
- success: function (data) {
48
- profile = data;
49
- console.log( profile );
50
- }
51
- });
52
40
  });
53
41
 
54
42
  // lightbox2 (Lokesh Dhakar, https://lokeshdhakar.com/projects/lightbox2, MIT License)
@@ -58,14 +46,25 @@ $('article img').each(function() {
58
46
  $e.wrap("<a data-lightbox='image' data-title='" + title + "' href='" + $e.attr('src') + "' class='expand-img'></a>");
59
47
  });
60
48
 
61
- // feedback from to GSheets integration
49
+ // feedback form to product catalog database
62
50
  if ($('#feedback-survey').length > 0) {
63
51
  // console.log('feedback form is loaded');
64
52
  document.getElementById("feedback-response").style.display = "none";
65
53
  document.getElementById("feedback-survey").style.display = "none";
66
54
  document.getElementById("no-wrong").style.display = "none";
67
- const scriptURL = 'https://productdatabase-prod-svc.azurewebsites.net/feedback.add'
68
- const form = document.forms['feedback']
55
+ const scriptURL = 'https://productdatabase-prod-svc.azurewebsites.net/feedback.add';
56
+ const form = document.forms['feedback'];
57
+ var profile;
58
+
59
+ // Load user profile data from Okta for form submission
60
+ $.ajax({
61
+ global: false,
62
+ url: "https://docs.healthcatalyst.com/api/profile",
63
+ dataType: "json",
64
+ success: function (data) {
65
+ profile = data;
66
+ }
67
+ });
69
68
 
70
69
  function fillUrl() {
71
70
  var currentPage = window.location.href;
@@ -98,7 +97,6 @@ if ($('#feedback-survey').length > 0) {
98
97
  }
99
98
 
100
99
  form.addEventListener('submit', e => {
101
- console.log(profile);
102
100
  e.preventDefault();
103
101
  var formData = new FormData(form);
104
102
  var feedbackForm = {
@@ -109,9 +107,9 @@ if ($('#feedback-survey').length > 0) {
109
107
  suggestions: formData.get("helpful?") === "no" && formData.get("suggest") ? formData.get("suggest") : "",
110
108
  date: new Date()
111
109
  };
112
- /*fetch(scriptURL, { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify(feedbackForm) })
110
+ fetch(scriptURL, { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify(feedbackForm) })
113
111
  .then(response => console.log('Success!', response))
114
- .catch(error => console.error('Error!', error.message))*/
112
+ .catch(error => console.error('Error!', error.message));
115
113
  $(".feedback-container").toggle();
116
114
  $("#feedback-response").toggle(500);
117
115
  })