Skip to content

Commit

Permalink
Added FEEDBACK_SURVEY_URL environment variable. The feedback button i…
Browse files Browse the repository at this point in the history
…s only displayed on this variable being set. Moved the feedback button position to the left-hand side.
  • Loading branch information
barnettwilliam committed Jan 26, 2024
1 parent 4c1ed07 commit f2298d7
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 5 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
2 changes: 1 addition & 1 deletion platform/public/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
box-shadow: 0 4px 8px 0 gray, 0 6px 20px 0 gray;
background-color: lightblue;
bottom: 5%;
right: 2%;
left: 2%;
transition-duration: 0.4s;
}

Expand Down
5 changes: 3 additions & 2 deletions platform/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
<body class="h-100" onresize="fit()" onload="fit();updateGutterVisibility();">
<div id="preloader"><img src="images/preloader.gif" width="100px"></div>

<div id='feedback-button'>
<p><a href="FEEDBAK_SURVEY_URL" target="_blank" rel="noopener noreferrer">
<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>
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 f2298d7

Please sign in to comment.