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
49c17327
Commit
49c17327
authored
6 years ago
by
Lukas Mauß
Browse files
Options
Downloads
Patches
Plain Diff
Implement room-joining
parent
4a956665
1 merge request
!137
Resolve "Direct entry"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/components/home/new-landing/new-landing.component.html
+2
-7
2 additions, 7 deletions
...pp/components/home/new-landing/new-landing.component.html
src/app/components/home/new-landing/new-landing.component.ts
+8
-16
8 additions, 16 deletions
src/app/components/home/new-landing/new-landing.component.ts
with
10 additions
and
23 deletions
src/app/components/home/new-landing/new-landing.component.html
+
2
−
7
View file @
49c17327
...
...
@@ -2,15 +2,10 @@
<form>
<div
fxLayout=
"row"
fxLayoutAlign=
"center"
fxLayoutGap=
"10px"
>
<mat-form-field
class=
"number"
>
<input
matInput
#roomId
placeholder=
"Join Session!"
maxlength=
"8"
[matAutocomplete]=
"auto"
/>
<input
matInput
#roomId
placeholder=
"Join Session!"
maxlength=
"8"
/>
<mat-hint
align=
"end"
>
{{roomId.value.length}} / 8
</mat-hint>
<mat-autocomplete
#auto
="
matAutocomplete
"
>
<mat-option
*ngFor=
"let session of sessions"
[value]=
"session.id"
>
{{session.name}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
<button
mat-fab
color=
"primary"
type=
"submit"
(click)=
"
login(
)"
>
<button
mat-fab
color=
"primary"
type=
"submit"
(click)=
"
joinRoom(roomId.value
)"
>
<mat-icon>
input
</mat-icon>
</button>
</div>
...
...
This diff is collapsed.
Click to expand it.
src/app/components/home/new-landing/new-landing.component.ts
+
8
−
16
View file @
49c17327
...
...
@@ -4,16 +4,7 @@ import { MatDialog } from '@angular/material';
import
{
AuthenticationService
}
from
'
../../../services/http/authentication.service
'
;
import
{
User
}
from
'
../../../models/user
'
;
import
{
UserRole
}
from
'
../../../models/user-roles.enum
'
;
export
class
Session
{
name
:
string
;
id
:
number
;
constructor
(
name
:
string
,
id
:
number
)
{
this
.
id
=
id
;
this
.
name
=
name
;
}
}
import
{
Router
}
from
'
@angular/router
'
;
@
Component
({
selector
:
'
app-new-landing
'
,
...
...
@@ -22,17 +13,14 @@ export class Session {
})
export
class
NewLandingComponent
implements
OnInit
{
sessions
:
Session
[]
=
new
Array
<
Session
>
();
user
:
User
;
constructor
(
public
authenticationService
:
AuthenticationService
,
private
router
:
Router
,
public
dialog
:
MatDialog
)
{
}
ngOnInit
()
{
this
.
sessions
[
0
]
=
new
Session
(
'
Angular
'
,
98299243
);
this
.
sessions
[
1
]
=
new
Session
(
'
Typescript
'
,
52009627
);
this
.
sessions
[
2
]
=
new
Session
(
'
Angular
'
,
48590407
);
this
.
authenticationService
.
watchUser
.
subscribe
(
newUser
=>
this
.
user
=
newUser
);
}
...
...
@@ -42,9 +30,13 @@ export class NewLandingComponent implements OnInit {
});
}
login
():
void
{
joinRoom
(
id
:
number
)
{
if
(
!
this
.
user
)
{
this
.
authenticationService
.
guestLogin
(
UserRole
.
PARTICIPANT
).
subscribe
();
this
.
authenticationService
.
guestLogin
(
UserRole
.
PARTICIPANT
).
subscribe
(
loggedIn
=>
{
if
(
loggedIn
===
'
true
'
)
{
this
.
router
.
navigate
([
`/participant/room/
${
id
}
`
]);
}
});
}
}
}
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