Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hainrich
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Konrad Völkel
hainrich
Commits
8506627b
Commit
8506627b
authored
3 months ago
by
Konrad Völkel
Browse files
Options
Downloads
Patches
Plain Diff
better feedback channel
parent
841fa33c
No related branches found
No related tags found
No related merge requests found
Pipeline
#152446
passed
3 months ago
Stage: deploy
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
modules/feedback.js
+14
-40
14 additions, 40 deletions
modules/feedback.js
modules/ui.js
+2
-2
2 additions, 2 deletions
modules/ui.js
styles.css
+12
-10
12 additions, 10 deletions
styles.css
with
28 additions
and
52 deletions
modules/feedback.js
100644 → 100755
+
14
−
40
View file @
8506627b
/**
open mail client of user with prewritten message and stat
s */
/**
feedback now opens a Google Form prefilled with our parameter
s */
export
function
submitFeedback
(
query
,
bestAnswers
,
feedback
)
{
export
function
submitFeedback
(
query
,
bestAnswers
,
feedback
)
{
/** temporary mail adress, adjust if needed */
const
url
=
'
https://docs.google.com/forms/d/e/1FAIpQLScv6hLxUZN42pZYkW28FL3WkXZbL_dzdGo0sE-LdeJbIzTi2g/viewform?usp=pp_url
'
;
const
feedbackAdress
=
'
huepfen-richtlinie.7r@icloud.com
'
;
const
timestamp
=
new
Date
().
toISOString
();
let
subject
=
''
;
let
message
=
''
;
const
bestAnswersAsString
=
Object
.
entries
(
bestAnswers
)
const
bestAnswersAsString
=
Object
.
entries
(
bestAnswers
)
.
map
(([
question
,
token
])
=>
`> Question:
${
question
}
\n > Answer:
${
token
}
\n`
)
.
map
(([
question
,
token
])
=>
`> Question:
${
question
}
\n> Answer:
${
token
}
`
)
.
join
(
"
\n\n
"
);
.
join
(
'
\n\n
'
);
if
(
feedback
===
'
good
'
)
{
subject
=
'
Positive Feedback: FAQ Search Feature
'
;
message
=
`Hello,
\nI used your FAQ search feature and was pleased with the result.
\nI also have some additional suggestions: ...
\nDetails below:
\nYou asked:
${
query
}
\nMost fitting responses:\n\n
${
bestAnswersAsString
}
\nFeedback:
${
feedback
}
\nTimestamp:
${
timestamp
}
\nKeep it up!
\nBest regards`
;
}
else
if
(
feedback
===
'
bad
'
)
{
subject
=
'
Negative Feedback: FAQ Search Feature
'
;
message
=
`Hello,
\nI tried used FAQ search feature, and unfortunately, I was not satisfied with this result.
\nI also have some additional suggestions: ...
\nDetails below:
\nYou asked:
${
query
}
\nMost fitting responses:
${
bestAnswersAsString
}
\nFeedback:
${
feedback
}
\nTimestamp:
${
timestamp
}
\nI hope this feedback lets you improve the experience.
\nBest regards`
;
}
const
encodedQuery
=
encodeURIComponent
(
query
);
const
encodedBestAnswers
=
encodeURIComponent
(
bestAnswersAsString
);
const
newSubject
=
en
codeURIComponent
(
subject
)
;
const
formFeedback
=
`
en
try.293085603=
${
feedback
}
`
;
const
body
=
encodeURIComponent
(
message
)
;
const
formQuery
=
`entry.430302024=
${
encodedQuery
}
`
;
const
mailtoLink
=
`mailto:
${
feedbackAdress
}
?subject=
${
newSubject
}
&body=
${
body
}
`
;
const
formAnswer
=
`entry.1738087812=
${
encodedBestAnswers
}
`
;
window
.
location
.
href
=
mailtoLink
;
const
newUrl
=
`
${
url
}
&
${
formFeedback
}
&
${
formQuery
}
&
${
formAnswer
}
`
;
window
.
open
(
newUrl
,
'
_blank
'
);
}
}
This diff is collapsed.
Click to expand it.
modules/ui.js
100644 → 100755
+
2
−
2
View file @
8506627b
...
@@ -99,14 +99,14 @@ export function drawFeedbackButtons(query, bestTokens) {
...
@@ -99,14 +99,14 @@ export function drawFeedbackButtons(query, bestTokens) {
plusButton
.
innerHTML
=
'
<i class="fa-solid fa-thumbs-up"></i>
'
;
plusButton
.
innerHTML
=
'
<i class="fa-solid fa-thumbs-up"></i>
'
;
plusButton
.
className
=
'
feedback-button thumbs-up
'
;
plusButton
.
className
=
'
feedback-button thumbs-up
'
;
plusButton
.
onclick
=
function
()
{
plusButton
.
onclick
=
function
()
{
submitFeedback
(
query
,
bestTokens
,
'
good
'
);
submitFeedback
(
query
,
bestTokens
,
'
Yes
'
);
};
};
const
minusButton
=
document
.
createElement
(
'
button
'
);
const
minusButton
=
document
.
createElement
(
'
button
'
);
minusButton
.
innerHTML
=
'
<i class="fa-solid fa-thumbs-down"></i>
'
;
minusButton
.
innerHTML
=
'
<i class="fa-solid fa-thumbs-down"></i>
'
;
minusButton
.
className
=
'
feedback-button thumbs-down
'
;
minusButton
.
className
=
'
feedback-button thumbs-down
'
;
minusButton
.
onclick
=
function
()
{
minusButton
.
onclick
=
function
()
{
submitFeedback
(
query
,
bestTokens
,
'
bad
'
);
submitFeedback
(
query
,
bestTokens
,
'
No
'
);
};
};
feedbackContainer
.
appendChild
(
plusButton
);
feedbackContainer
.
appendChild
(
plusButton
);
...
...
This diff is collapsed.
Click to expand it.
styles.css
100644 → 100755
+
12
−
10
View file @
8506627b
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
#chatbox
{
#chatbox
{
position
:
sticky
;
position
:
sticky
;
max-height
:
9
00px
;
max-height
:
12
00px
;
overflow
:
hidden
;
overflow
:
hidden
;
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
left
:
10px
;
left
:
10px
;
padding
:
10px
;
padding
:
10px
;
display
:
flex
;
display
:
flex
;
max-height
:
3
00px
;
max-height
:
5
00px
;
flex-direction
:
column
;
flex-direction
:
column
;
overflow-x
:
hidden
;
overflow-x
:
hidden
;
z-index
:
-3
;
z-index
:
-3
;
...
@@ -89,7 +89,8 @@
...
@@ -89,7 +89,8 @@
color
:
white
;
color
:
white
;
margin-left
:
40px
;
margin-left
:
40px
;
margin
:
10px
2
;
margin
:
10px
2
;
max-width
:
60%
;
max-width
:
75%
;
font-size
:
18px
;
word-wrap
:
break-word
;
word-wrap
:
break-word
;
cursor
:
default
;
cursor
:
default
;
opacity
:
0
;
opacity
:
0
;
...
@@ -129,6 +130,7 @@
...
@@ -129,6 +130,7 @@
margin-left
:
10px
;
margin-left
:
10px
;
margin
:
10px
2
;
margin
:
10px
2
;
max-width
:
60%
;
max-width
:
60%
;
font-size
:
17px
;
word-wrap
:
break-word
;
word-wrap
:
break-word
;
text-align
:
middle
;
text-align
:
middle
;
z-index
:
100
;
z-index
:
100
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment