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 d3586d07
authored
Apr 01, 2018
by
Riina Antikainen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Almost done routing
1 parent
1f81dba7
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
31 additions
and
26 deletions
code/moya-management-portal/src/app/app.mock.module.ts
code/moya-management-portal/src/app/organization/event-list/event-list.component.scss
code/moya-management-portal/src/app/organization/event-list/event-list.component.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.html
code/moya-management-portal/src/app/organization/organization-list/organization-list.component.ts
code/moya-management-portal/src/app/organization/organization.component.html
code/moya-management-portal/src/app/organization/organization.component.ts
code/moya-management-portal/src/app/app.mock.module.ts
View file @
d3586d0
...
...
@@ -22,7 +22,7 @@ import { NewEventComponent } from './organization/new-event/new-event.component'
RouterModule
.
forRoot
([
{
path
:
'new-organization'
,
component
:
NewOrganizationComponent
},
{
path
:
'organization'
,
component
:
OrganizationComponent
},
{
path
:
'new-event'
,
component
:
NewEventComponent
},
{
path
:
'new-event
/:id
'
,
component
:
NewEventComponent
},
{
path
:
''
,
redirectTo
:
'organization'
,
pathMatch
:
'full'
}
],
{
useHash
:
true
})
],
...
...
code/moya-management-portal/src/app/organization/event-list/event-list.component.scss
View file @
d3586d0
@import
"~@angular/material/prebuilt-themes/indigo-pink.css"
;
\ No newline at end of file
code/moya-management-portal/src/app/organization/event-list/event-list.component.ts
View file @
d3586d0
import
{
Component
,
OnInit
,
Input
,
SimpleChanges
}
from
'@angular/core'
;
import
{
EventsService
}
from
'./event-service.service'
;
import
{
OnChanges
}
from
'@angular/core/src/metadata/lifecycle_hooks'
;
import
{
Organization
}
from
'../organization-list/organization-list.component'
;
@
Component
({
selector
:
'moya-event-list'
,
...
...
@@ -8,7 +9,7 @@ import { OnChanges } from '@angular/core/src/metadata/lifecycle_hooks';
styleUrls
:
[
'./event-list.component.scss'
]
})
export
class
EventListComponent
implements
OnInit
,
OnChanges
{
@
Input
()
organization
:
string
;
@
Input
()
organization
:
Organization
;
public
events
:
any
;
constructor
(
private
appService
:
EventsService
)
{
...
...
@@ -19,12 +20,13 @@ export class EventListComponent implements OnInit, OnChanges {
}
ngOnInit
()
{
console
.
log
(
this
.
organization
);
this
.
events
=
this
.
appService
.
get
(
this
.
organization
);
console
.
log
(
'testi'
,
this
.
organization
.
name
);
this
.
events
=
this
.
appService
.
get
(
this
.
organization
.
name
);
}
ngOnChanges
(
changes
:
SimpleChanges
):
void
{
console
.
log
(
changes
);
console
.
log
(
'toimii'
,
changes
,
this
.
organization
.
name
);
this
.
events
=
this
.
appService
.
get
(
changes
.
organization
.
currentValue
);
console
.
log
(
'ei toi'
);
}
}
code/moya-management-portal/src/app/organization/new-event/new-event.component.html
View file @
d3586d0
...
...
@@ -9,5 +9,5 @@
<input
matInput
required
placeholder=
"Url"
formControlName=
"url"
>
</mat-form-field>
<button
mat-button
type=
"submit"
>
Submit
</button>
<button
mat-button
(
click
)='
onSubmit
()'
>
Submit
</button>
</form>
\ No newline at end of file
code/moya-management-portal/src/app/organization/new-event/new-event.component.ts
View file @
d3586d0
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
FormControl
,
FormGroup
}
from
'@angular/forms'
;
import
{
Router
}
from
'@angular/router'
;
@
Component
({
selector
:
'moya-new-event'
,
...
...
@@ -13,7 +14,7 @@ export class NewEventComponent implements OnInit {
url
:
new
FormControl
()
});
constructor
()
{
}
constructor
(
private
_router
:
Router
)
{
}
ngOnInit
()
{
}
...
...
@@ -23,6 +24,7 @@ export class NewEventComponent implements OnInit {
'name'
:
this
.
eventForm
.
get
(
'name'
).
value
,
'url'
:
this
.
eventForm
.
get
(
'url'
).
value
,
};
this
.
_router
.
navigate
([
'/organization'
]);
}
}
code/moya-management-portal/src/app/organization/organization-list/organization-list.component.html
View file @
d3586d0
<mat-form-field>
<mat-select
placeholder=
"Organization"
[(
ngModel
)]="
selectedValue
"
(
ngModelChange
)="
onChange
($
event
)"
>
<mat-option
*
ngFor=
"let organization of organizations"
value=
{{organization.name}}
>
{{organization.name}}
</mat-option>
<mat-option
*
ngFor=
"let organization of organizations"
[
value
]="
organization
"
>
{{organization.name}}
</mat-option>
</mat-select>
</mat-form-field>
\ No newline at end of file
code/moya-management-portal/src/app/organization/organization-list/organization-list.component.ts
View file @
d3586d0
import
{
OrganizationComponent
}
from
'./../organization.component'
;
import
{
EventsService
}
from
'./../event-list/event-service.service'
;
import
{
Component
,
OnInit
,
Output
}
from
'@angular/core'
;
import
{
OrganizationListService
}
from
'./organization-list.service'
;
import
{
EventEmitter
}
from
'@angular/core'
;
@
Component
({
selector
:
'moya-organization-list'
,
templateUrl
:
'./organization-list.component.html'
,
...
...
@@ -11,15 +11,15 @@ import { EventEmitter } from '@angular/core';
})
export
class
OrganizationListComponent
implements
OnInit
{
public
selectedValue
:
string
;
public
selectedValue
:
Organization
;
@
Output
()
selected
=
new
EventEmitter
();
selected
=
new
EventEmitter
<
Organization
>
();
public
organizations
=
[
{
name
:
'Assembly Organization'
},
{
name
:
'Assemly'
},
{
name
:
'Organization'
}
public
organizations
:
Organization
[]
=
[
{
id
:
1
,
name
:
'Assembly Organization'
},
{
id
:
3
,
name
:
'Assemly'
},
{
id
:
30
,
name
:
'Organization'
}
];
constructor
(
private
organizationListService
:
OrganizationListService
)
{
...
...
@@ -34,3 +34,8 @@ export class OrganizationListComponent implements OnInit {
}
}
export
interface
Organization
{
id
:
number
;
name
:
string
;
}
code/moya-management-portal/src/app/organization/organization.component.html
View file @
d3586d0
...
...
@@ -6,16 +6,11 @@
<a
style=
"float:right; font-size:20px; margin-top: 20px"
href=
"#"
>
Moya Login
</a>
</div>
<div
style=
"width:50%; float:left"
>
<<<<<<
< HEAD
<h2
style=
"margin-left: 10px"
>
Coming events
</h2>
<moya-event-list
[
organisation
]="
currentOrganisation
"
style=
"margin-top:5em;"
></moya-event-list>
=======
<h2
style=
"margin-left: 10px"
>
Tulevat tapahtumat
</h2>
<moya-event-list
[
organization
]="
currentOrganization
"
style=
"margin-top:5em;"
></moya-event-list>
>>>>>>> b6bb15bc0dea08e0c1d6588d2424d194218ce163
<moya-event-list
*
ngIf=
"currentOrganization"
[
organization
]="
currentOrganization
"
style=
"margin-top:5em;"
></moya-event-list>
</div>
<div
style=
"width:50%; float:right"
>
<div
style=
"width:50%; float:right"
>
<h2>
Ei omaa organisaatiota?
</h2>
<a
[
routerLink
]="['/
new-organization
']"
><button
mat-button
>
Create new organization
</button></a>
<a
[
routerLink
]="['/
new-event
'
]"
><button
mat-button
>
Create new event
</button></a>
<a
*
ngIf=
"currentOrganization"
[
routerLink
]="['/
new-event
',
currentOrganization
.
id
]"
><button
mat-button
>
Create new event
</button></a>
</div>
code/moya-management-portal/src/app/organization/organization.component.ts
View file @
d3586d0
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Organization
}
from
'./organization-list/organization-list.component'
;
@
Component
({
selector
:
'moya-organization'
,
...
...
@@ -8,7 +9,7 @@ import { Component, OnInit } from '@angular/core';
export
class
OrganizationComponent
implements
OnInit
{
title
=
'Moay'
;
public
currentOrganization
:
string
;
public
currentOrganization
:
Organization
;
constructor
()
{
}
...
...
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