Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b3eaa941
authored
Apr 01, 2018
by
Riina Antikainen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New event buttons works
1 parent
d3586d07
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
14 deletions
code/moya-management-portal/src/app/organization/event-list/event-list.component.ts
code/moya-management-portal/src/app/organization/event-list/event-service.service.ts
code/moya-management-portal/src/app/organization/new-event/new-event.component.html
code/moya-management-portal/src/app/organization/new-event/new-event.component.ts
code/moya-management-portal/src/app/organization/organization-list/organization-list.component.ts
code/moya-management-portal/src/app/organization/event-list/event-list.component.ts
View file @
b3eaa94
...
...
@@ -16,7 +16,7 @@ export class EventListComponent implements OnInit, OnChanges {
}
onClick
()
{
console
.
log
(
'
Nappitoimii
'
);
console
.
log
(
'
Button works
'
);
}
ngOnInit
()
{
...
...
@@ -26,7 +26,8 @@ export class EventListComponent implements OnInit, OnChanges {
ngOnChanges
(
changes
:
SimpleChanges
):
void
{
console
.
log
(
'toimii'
,
changes
,
this
.
organization
.
name
);
this
.
events
=
this
.
appService
.
get
(
changes
.
organization
.
currentValue
);
this
.
events
=
this
.
appService
.
get
(
this
.
organization
.
name
);
// this.events = this.appService.get(changes.organization.currentValue);
console
.
log
(
'ei toi'
);
}
}
code/moya-management-portal/src/app/organization/event-list/event-service.service.ts
View file @
b3eaa94
...
...
@@ -5,7 +5,7 @@ export class EventsService {
get
(
org
:
String
)
{
console
.
log
(
org
);
if
(
org
===
'Assemly'
)
{
if
(
org
===
'Assem
b
ly'
)
{
return
[
{
title
:
'Assembly Winter 18'
,
date
:
'1.2.2018 - 3.2.2018'
},
{
title
:
'Assembly Summer 18'
,
date
:
'1.2.2018 - 3.2.2018'
},
...
...
code/moya-management-portal/src/app/organization/new-event/new-event.component.html
View file @
b3eaa94
<form
[
formGroup
]="
eventF
orm
"
(
ngSubmit
)="
onSubmit
()"
>
<form
[
formGroup
]="
f
orm
"
(
ngSubmit
)="
onSubmit
()"
>
<mat-form-field>
<input
matInput
required
placeholder=
"Event name"
formControlName=
"name"
>
</mat-form-field>
...
...
@@ -9,5 +9,6 @@
<input
matInput
required
placeholder=
"Url"
formControlName=
"url"
>
</mat-form-field>
<button
mat-button
(
click
)='
onSubmit
()'
>
Submit
</button>
<button
mat-button
type=
"submit"
[
disabled
]="!
form
.
valid
"
>
Submit
</button>
<button
mat-button
(
ngClick
)="
goBack
()"
>
Back
</button>
</form>
\ No newline at end of file
code/moya-management-portal/src/app/organization/new-event/new-event.component.ts
View file @
b3eaa94
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
FormControl
,
FormGroup
}
from
'@angular/forms'
;
import
{
FormControl
,
FormGroup
,
FormBuilder
,
Validators
}
from
'@angular/forms'
;
import
{
Router
}
from
'@angular/router'
;
@
Component
({
...
...
@@ -9,22 +9,27 @@ import { Router } from '@angular/router';
})
export
class
NewEventComponent
implements
OnInit
{
public
eventForm
=
new
FormGroup
({
name
:
new
FormControl
(),
url
:
new
FormControl
()
});
form
:
FormGroup
;
constructor
(
private
_router
:
Router
)
{
}
constructor
(
private
formBuilder
:
FormBuilder
,
private
_router
:
Router
)
{
}
ngOnInit
()
{
this
.
form
=
this
.
formBuilder
.
group
({
name
:
[
null
,
Validators
.
required
],
url
:
[
null
,
Validators
.
required
]
});
}
onSubmit
()
{
const
values
=
{
'name'
:
this
.
eventF
orm
.
get
(
'name'
).
value
,
'url'
:
this
.
eventForm
.
get
(
'url'
).
value
,
'name'
:
this
.
f
orm
.
get
(
'name'
).
value
,
'url'
:
this
.
form
.
get
(
'url'
).
value
};
this
.
_router
.
navigate
([
'/organization'
]);
}
goBack
()
{
this
.
_router
.
navigate
([
'/organization'
]);
}
}
code/moya-management-portal/src/app/organization/organization-list/organization-list.component.ts
View file @
b3eaa94
...
...
@@ -18,7 +18,7 @@ export class OrganizationListComponent implements OnInit {
public
organizations
:
Organization
[]
=
[
{
id
:
1
,
name
:
'Assembly Organization'
},
{
id
:
3
,
name
:
'Assemly'
},
{
id
:
3
,
name
:
'Assem
b
ly'
},
{
id
:
30
,
name
:
'Organization'
}
];
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment