Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arsnova-lite
Manage
Activity
Members
Labels
Plan
Issues
24
Issue boards
Milestones
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
Show more breadcrumbs
ARSnova
arsnova-lite
Commits
469b8084
Commit
469b8084
authored
6 years ago
by
Lukas Mauß
Browse files
Options
Downloads
Patches
Plain Diff
Add websocket service in feedback
parent
0e0bb18f
Branches
176-feedback-websockets
No related merge requests found
Pipeline
#21004
failed with stages
in 3 minutes and 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/components/shared/feedback-barometer-page/feedback-barometer-page.component.ts
+12
-5
12 additions, 5 deletions
...dback-barometer-page/feedback-barometer-page.component.ts
with
12 additions
and
5 deletions
src/app/components/shared/feedback-barometer-page/feedback-barometer-page.component.ts
+
12
−
5
View file @
469b8084
...
...
@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
import
{
AuthenticationService
}
from
'
../../../services/http/authentication.service
'
;
import
{
UserRole
}
from
'
../../../models/user-roles.enum
'
;
import
{
NotificationService
}
from
'
../../../services/util/notification.service
'
;
import
{
RxStompService
}
from
'
@stomp/ng2-stompjs
'
;
/* ToDo: Use TranslateService */
...
...
@@ -18,16 +19,22 @@ export class FeedbackBarometerPageComponent implements OnInit {
{
state
:
3
,
name
:
'
sentiment_very_dissatisfied
'
,
message
:
'
You
\'
ve lost me.
'
,
count
:
0
,
},
];
userRole
:
UserRole
;
roomId
:
number
;
feedBackUrl
=
'
/Room/
'
+
this
.
roomId
;
d
ummy
=
[
2
,
3
,
2
,
0
,
1
];
// dummy data -> delete this with api implementation and add get-data
d
ata
=
[
2
,
3
,
2
,
1
];
// dummy data -> delete this with api implementation and add get-data
constructor
(
private
authenticationService
:
AuthenticationService
,
private
notification
:
NotificationService
,
)
{}
private
notification
:
NotificationService
,
private
rxStompService
:
RxStompService
)
{}
ngOnInit
()
{
this
.
userRole
=
this
.
authenticationService
.
getRole
();
this
.
updateFeedback
(
this
.
dummy
);
this
.
rxStompService
.
watch
(
this
.
feedBackUrl
).
subscribe
(
message
=>
{
this
.
data
=
message
.
body
;
// Adjust to backend implementation
});
this
.
updateFeedback
(
this
.
data
);
}
private
updateFeedback
(
data
)
{
...
...
@@ -39,8 +46,8 @@ export class FeedbackBarometerPageComponent implements OnInit {
}
submitFeedback
(
state
:
string
)
{
this
.
dummy
[
state
]
+=
1
;
// delete this with api implementation and add submit-data
this
.
updateFeedback
(
this
.
d
ummy
);
this
.
rxStompService
.
publish
({
destination
:
this
.
feedBackUrl
,
body
:
state
});
this
.
updateFeedback
(
this
.
d
ata
);
this
.
notification
.
show
(
`Feedback submitted to room.`
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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