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
c2fc9629
Commit
c2fc9629
authored
5 years ago
by
Lukas Mauß
Browse files
Options
Downloads
Patches
Plain Diff
Refactor setting role on room join
parent
0152f7db
1 merge request
!364
Refactor setting role on room join
Pipeline
#29656
failed with stages
in 3 minutes and 20 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/components/shared/room-join/room-join.component.ts
+18
-4
18 additions, 4 deletions
src/app/components/shared/room-join/room-join.component.ts
with
18 additions
and
4 deletions
src/app/components/shared/room-join/room-join.component.ts
+
18
−
4
View file @
c2fc9629
...
@@ -9,6 +9,8 @@ import { TranslateService } from '@ngx-translate/core';
...
@@ -9,6 +9,8 @@ import { TranslateService } from '@ngx-translate/core';
import
{
AuthenticationService
}
from
'
../../../services/http/authentication.service
'
;
import
{
AuthenticationService
}
from
'
../../../services/http/authentication.service
'
;
import
{
UserRole
}
from
'
../../../models/user-roles.enum
'
;
import
{
UserRole
}
from
'
../../../models/user-roles.enum
'
;
import
{
User
}
from
'
../../../models/user
'
;
import
{
User
}
from
'
../../../models/user
'
;
import
{
Moderator
}
from
'
../../../models/moderator
'
;
import
{
ModeratorService
}
from
'
../../../services/http/moderator.service
'
;
@
Component
({
@
Component
({
selector
:
'
app-room-join
'
,
selector
:
'
app-room-join
'
,
...
@@ -30,7 +32,8 @@ export class RoomJoinComponent implements OnInit {
...
@@ -30,7 +32,8 @@ export class RoomJoinComponent implements OnInit {
private
router
:
Router
,
private
router
:
Router
,
public
notificationService
:
NotificationService
,
public
notificationService
:
NotificationService
,
private
translateService
:
TranslateService
,
private
translateService
:
TranslateService
,
public
authenticationService
:
AuthenticationService
public
authenticationService
:
AuthenticationService
,
private
moderatorService
:
ModeratorService
)
{
)
{
}
}
...
@@ -95,9 +98,20 @@ export class RoomJoinComponent implements OnInit {
...
@@ -95,9 +98,20 @@ export class RoomJoinComponent implements OnInit {
this
.
router
.
navigate
([
`/creator/room/
${
this
.
room
.
shortId
}
/comments`
]);
this
.
router
.
navigate
([
`/creator/room/
${
this
.
room
.
shortId
}
/comments`
]);
}
else
{
}
else
{
this
.
roomService
.
addToHistory
(
this
.
room
.
id
);
this
.
roomService
.
addToHistory
(
this
.
room
.
id
);
this
.
authenticationService
.
setAccess
(
this
.
room
.
shortId
,
UserRole
.
PARTICIPANT
);
this
.
moderatorService
.
get
(
this
.
room
.
id
).
subscribe
((
moderators
:
Moderator
[])
=>
{
let
isModerator
=
false
;
this
.
router
.
navigate
([
`/participant/room/
${
this
.
room
.
shortId
}
/comments`
]);
for
(
const
m
of
moderators
)
{
if
(
m
.
userId
===
this
.
user
.
id
)
{
this
.
authenticationService
.
setAccess
(
this
.
room
.
shortId
,
UserRole
.
EXECUTIVE_MODERATOR
);
this
.
router
.
navigate
([
`/moderator/room/
${
this
.
room
.
shortId
}
/comments`
]);
isModerator
=
true
;
}
}
if
(
!
isModerator
)
{
this
.
authenticationService
.
setAccess
(
this
.
room
.
shortId
,
UserRole
.
PARTICIPANT
);
this
.
router
.
navigate
([
`/participant/room/
${
this
.
room
.
shortId
}
/comments`
]);
}
});
}
}
}
}
}
}
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