Skip to content

Commit

Permalink
Merge pull request #167 from mdenet/feature/user-feedback-button
Browse files Browse the repository at this point in the history
Added button for collecting user feedback.
  • Loading branch information
barnettwilliam authored Jan 26, 2024
2 parents 3e684d6 + f2298d7 commit 293cc79
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 3 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,12 @@ The default test configurations provided by the activities server
For activities that use backend tool functions the corresponding tool server must be available to process the requests.

The Epsilon backend docker services for a fully function configuration can be found [here](https://github.com/epsilonlabs/playground-docker).


### Environment Variables
This section documents the environment variables supported by the platform.

| Name | Type | Description | Example |
| --- | --- | --- | --- |
| TOKEN_SERVER_URL | Url | The url of the token server. Used for GitHub authentication enabling saving and private git repository access. | https://tokenserver.mde-network.org |
| FEEDBACK_SURVEY_URL | Url | The url that is used for the user feedback button. | https://forms.office.com/?id=X |
5 changes: 4 additions & 1 deletion platform/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ COPY package*.json ./

COPY platform/ ./platform/

# Refer to readme.md for a complete list of supported environment varibles
ARG TOKEN_SERVER_URL=http://127.0.0.1:10000

RUN npm ci --workspace=platform\
&& npm run build --workspace=platform -- --env tokenServerUrl=${TOKEN_SERVER_URL}\
&& npm run build --workspace=platform --\
--env tokenServerUrl=${TOKEN_SERVER_URL}\
--env feedbackSurveyUrl=${FEEDBACK_SURVEY_URL}\
&& npm run package --workspace=platform


Expand Down
18 changes: 17 additions & 1 deletion platform/public/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,20 @@
.button-dark {
background-color: darkslategrey;
color: aliceblue;
}
}

#feedback-button {
position: absolute !important;
z-index: 10000 !important;
padding: 12px;
border-radius: 20px;
box-shadow: 0 4px 8px 0 gray, 0 6px 20px 0 gray;
background-color: lightblue;
bottom: 5%;
left: 2%;
transition-duration: 0.4s;
}

#feedback-button:hover {
background-color: #3498db;
}
38 changes: 38 additions & 0 deletions platform/public/images/rate_review.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions platform/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@

<div id="preloader"><img src="images/preloader.gif" width="100px"></div>

<div id="feedback-button" style="display:none">
<!--feedback href set by env variable FEEDBACK_SURVEY_URL in dockerfile-->
<p><a id="feedback-url" target="_blank" rel="noopener noreferrer">
<img src="images/rate_review.svg" alt="Feedback" width="20" height="20">
</a></p>
</div>

<div id="login" style="display:none">
<h2>Login</h2>
<p>
Expand Down
6 changes: 5 additions & 1 deletion platform/src/Playground.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@ export var toolsManager;

var urlParameters = new URLSearchParams(window.location.search);


if (FEEDBACK_SURVEY_URL){
PlaygroundUtility.setFeedbackButtonUrl(FEEDBACK_SURVEY_URL);
PlaygroundUtility.showFeedbackButton();
}

document.getElementById("btnnologin").onclick= () => {

PlaygroundUtility.hideLogin();
}

Expand Down
8 changes: 8 additions & 0 deletions platform/src/PlaygroundUtility.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ class PlaygroundUtility {
document.getElementById("login").style.display = "block";
}

static showFeedbackButton(){
document.getElementById("feedback-button").style.display = "block";
}

static setFeedbackButtonUrl(url){
document.getElementById("feedback-url").href = url;
}

}

export { PlaygroundUtility };
1 change: 1 addition & 0 deletions platform/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports = (env) => {
plugins: [
new DefinePlugin({
'TOKEN_SERVER_URL': JSON.stringify(env.tokenServerUrl),
'FEEDBACK_SURVEY_URL': JSON.stringify(env.feedbackSurveyUrl),
}),
]
};
Expand Down

0 comments on commit 293cc79

Please sign in to comment.