Skip to content

Commit 0182029

Browse files
authored
Merge pull request #40 from rwth-acis/release/v.1.0.2
Release/v.1.0.2
2 parents 39dfcc5 + 8c7e140 commit 0182029

File tree

10 files changed

+232
-61
lines changed

10 files changed

+232
-61
lines changed

README.md

Lines changed: 137 additions & 54 deletions
Large diffs are not rendered by default.

SyncMeta Models/BotMetaModel.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,6 +1269,50 @@
12691269
}
12701270
}
12711271
},
1272+
"646c1466c4bf34e8267c4f27": {
1273+
"label": {
1274+
"id": "646c1466c4bf34e8267c4f27[label]",
1275+
"name": "Label",
1276+
"value": {
1277+
"id": "646c1466c4bf34e8267c4f27[label]",
1278+
"name": "Label",
1279+
"value": "crType"
1280+
}
1281+
},
1282+
"left": 3295.999999999998,
1283+
"top": 6164.666666666664,
1284+
"width": 150,
1285+
"height": 100,
1286+
"zIndex": 16035,
1287+
"type": "Enumeration",
1288+
"attributes": {
1289+
"[attributes]": {
1290+
"id": "[attributes]",
1291+
"name": "Attributes",
1292+
"type": "SingleValueListAttribute",
1293+
"list": {
1294+
"c596b17505c1ab2465c91d3e[value]": {
1295+
"id": "c596b17505c1ab2465c91d3e[value]",
1296+
"name": "c596b17505c1ab2465c91d3e[value]",
1297+
"value": {
1298+
"id": "c596b17505c1ab2465c91d3e[value]",
1299+
"name": "c596b17505c1ab2465c91d3e[value]",
1300+
"value": "Text Message"
1301+
}
1302+
},
1303+
"4a08265717bc14dec36db08e[value]": {
1304+
"id": "4a08265717bc14dec36db08e[value]",
1305+
"name": "4a08265717bc14dec36db08e[value]",
1306+
"value": {
1307+
"id": "4a08265717bc14dec36db08e[value]",
1308+
"name": "4a08265717bc14dec36db08e[value]",
1309+
"value": "Interactive Message"
1310+
}
1311+
}
1312+
}
1313+
}
1314+
}
1315+
},
12721316
"5529bde8544426cd5580efc1": {
12731317
"label": {
12741318
"id": "5529bde8544426cd5580efc1[label]",
@@ -4154,6 +4198,21 @@
41544198
"attributes": {},
41554199
"type": "Bi-Dir-Association"
41564200
},
4201+
"a2fc139715fd3b1f4a3c1584": {
4202+
"label": {
4203+
"id": "a2fc139715fd3b1f4a3c1584[label]",
4204+
"name": "Label",
4205+
"value": {
4206+
"id": "a2fc139715fd3b1f4a3c1584[label]",
4207+
"name": "Label",
4208+
"value": "Type"
4209+
}
4210+
},
4211+
"source": "dd34599cb11fbaa06554d5ea",
4212+
"target": "646c1466c4bf34e8267c4f27",
4213+
"attributes": {},
4214+
"type": "Bi-Dir-Association"
4215+
},
41574216
"3eefc7d9ef22d58361826cd2": {
41584217
"label": {
41594218
"id": "3eefc7d9ef22d58361826cd2[label]",

Utilities Frontend/app/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/node_modules
22
/bower_components
3-
config.json
43
/build
54
/dist

Utilities Frontend/app/config.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"webhost": "<WEBHOST>",
3+
"oidc_client_id": "<OIDC_CLIENT_ID>",
4+
"yjs_address": "<YJS_ADDRESS>",
5+
"yjs_resource_path": "<YJS_RESOURCE_PATH>",
6+
"contact_service_url": "<CONTACT_SERVICE_URL>"
7+
}

Utilities Frontend/app/config.json.sample

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"webhost": "<WEBHOST>",
33
"oidc_client_id": "<OIDC_CLIENT_ID>",
44
"yjs_address": "<YJS_ADDRESS>",
5-
"yjs_resource_path": "<YJS_RESOURCE_PATH>"
5+
"yjs_resource_path": "<YJS_RESOURCE_PATH>",
6+
"contact_service_url": "<CONTACT_SERVICE_URL>"
67
}

Utilities Frontend/app/gulpfile.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,15 @@ gulp.task('copy:modules', () => {
1818

1919
gulp.task('copy:src', () => {
2020
const config = JSON.parse(fs.readFileSync('./config.json'));
21+
// choose the package.json file (edit this later)
22+
const packageInfo = JSON.parse(fs.readFileSync('./package.json'));
2123
const copySrc = gulp.src('src/**')
2224
.pipe(replace('{WEBHOST}', config.webhost))
2325
.pipe(replace('{OIDC_CLIENT_ID}', config.oidc_client_id))
2426
.pipe(replace('{YJS_ADDRESS}', config.yjs_address))
2527
.pipe(replace('{YJS_RESOURCE_PATH}', config.yjs_resource_path))
28+
.pipe(replace('{STATUSBAR_SUBTITLE}', "v" + packageInfo.version))
29+
.pipe(replace('{CONTACT_SERVICE_URL}', config.contact_service_url))
2630
.pipe(gulp.dest('dist/src'));
2731
const copyIndex = gulp.src('index.html')
2832
.pipe(gulp.dest('dist'));

Utilities Frontend/app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "SocialBotFramework",
3+
"version": "1.0.2",
34
"description": "Frontend of Social Bot Framework",
45
"scripts": {
56
"start": "polymer serve --port 8082 dist",

Utilities Frontend/app/src/static-app.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class StaticApp extends PolymerElement {
6565
oidcpopupsignouturl="/src/callbacks/popup-signout-callback.html"
6666
oidcsilentsigninturl="/src/callbacks/silent-callback.html"
6767
oidcclientid="{OIDC_CLIENT_ID}"
68+
subtitle="{STATUSBAR_SUBTITLE}"
6869
autoAppendWidget=true
6970
></las2peer-frontend-statusbar>
7071
@@ -159,8 +160,11 @@ class StaticApp extends PolymerElement {
159160
ready() {
160161
super.ready();
161162
const statusBar = this.shadowRoot.querySelector("#statusBar");
162-
statusBar.addEventListener('signed-in', this.handleLogin);
163-
statusBar.addEventListener('signed-out', this.handleLogout);
163+
console.log("{CONTACT_SERVICE_URL}");
164+
console.log("{OIDC_CLIENT_ID}");
165+
statusBar.setAttribute("baseUrl", {CONTACT_SERVICE_URL});
166+
statusBar.addEventListener('signed-in',(event) => this.handleLogin(event));
167+
statusBar.addEventListener('signed-out',(event) => this.handleLogout(event));
164168
this.displayCurrentRoomName();
165169
}
166170

@@ -202,9 +206,12 @@ class StaticApp extends PolymerElement {
202206
}
203207

204208
handleLogin(event) {
205-
localStorage.setItem("access_token", event.detail.access_token);
206-
localStorage.setItem("userinfo_endpoint", "https://api.learning-layers.eu/auth/realms/main/protocol/openid-connect/userinfo");
207-
location.reload();
209+
if(localStorage.getItem("access_token") == null){
210+
localStorage.setItem("access_token", event.detail.access_token);
211+
localStorage.setItem("userinfo_endpoint", "https://api.learning-layers.eu/auth/realms/main/protocol/openid-connect/userinfo");
212+
location.reload();
213+
}
214+
208215
}
209216

210217
handleLogout() {

Utilities Frontend/app/src/vls.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,14 @@
368368
"dd34599cb11fbaa06554d5ea": {
369369
"label": "Chat Response",
370370
"attributes": {
371+
"a5844a8bde0637231a942b70": {
372+
"key": "Type",
373+
"value": "crType",
374+
"options": {
375+
"Text":"Text",
376+
"Interactive Message":"Interactive Message"
377+
}
378+
},
371379
"a5844a8bde0637231a942b69": {
372380
"key": "Message",
373381
"value": "string"

Utilities Frontend/docker/docker-entrypoint.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ fi
2222
#### RASA_NLU and SBF_MANAGER are optional ####
2323
check_if_exists "$RASA_NLU" "RASA_NLU"
2424
check_if_exists "$SBF_MANAGER" "SBF_MANAGER"
25+
check_if_exists "$CONTACT_SERVICE_URL" "CONTACT_SERVICE_URL"
2526

2627
#### Replace SBF Manager and Rasa-NLU URLs ####
2728
sed -i "s={RASA_NLU}=$RASA_NLU=g" app/src/model-training.js
@@ -49,6 +50,7 @@ sed -i "s=<WEBHOST>=$WEBHOST=g" config.json
4950
sed -i "s=<OIDC_CLIENT_ID>=$OIDC_CLIENT_ID=g" config.json
5051
sed -i "s=<YJS_ADDRESS>=$YJS=g" config.json
5152
sed -i "s=<YJS_RESOURCE_PATH>=$YJS_RESOURCE_PATH=g" config.json
53+
sed -i "s=<CONTACT_SERVICE_URL>=$CONTACT_SERVICE_URL=g" config.json
5254
npm run build
5355
cd ..
5456

0 commit comments

Comments
 (0)