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 0b0a1953
authored
Apr 01, 2018
by
Riina Antikainen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added new event component
1 parent
84446692
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
94 additions
and
40 deletions
code/moya-management-portal/src/app/app.component.html
code/moya-management-portal/src/app/app.component.ts
code/moya-management-portal/src/app/app.mock.module.ts
code/moya-management-portal/src/app/app.module.ts
code/moya-management-portal/src/app/organization/event-list/event-service.service.spec.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.scss
code/moya-management-portal/src/app/organization/new-event/new-event.component.spec.ts
code/moya-management-portal/src/app/organization/new-event/new-event.component.ts
code/moya-management-portal/src/app/organization/new-organization/new-organization.component.ts
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/organization/organization.module.ts
code/moya-management-portal/src/app/app.component.html
View file @
0b0a195
<!--The content below is only a placeholder and can be replaced.-->
<!--The content below is only a placeholder and can be replaced.-->
<div>
<moya-organization></moya-organization>
<moya-organization-list
(
selected
)="
onOrganizationChange
($
event
)"
style=
"float:top, left;"
></moya-organization-list>
\ No newline at end of file
<h1
style=
"text-align:center; margin-left:25%; display:inline-block"
>
Welcome to {{ title }}!
</h1>
<a
style=
"float:right; font-size:20px; margin-top: 20px"
href=
"#"
>
Moya Login
</a>
</div>
<div
style=
"width:50%; float:left"
>
<h2
style=
"margin-left: 10px"
>
Tulevat tapahtumat
</h2>
<moya-event-list
[
organisation
]="
currentOrganisation
"
style=
"margin-top:5em;"
></moya-event-list>
</div>
<div
style=
"width:50%; float:right"
>
<h2>
Ei omaa organisaatiota?
</h2>
<button
(
click
)="
newOrg
()"
>
Luo uusi organisaatio
</button>
<moya-new-organization></moya-new-organization>
</div>
code/moya-management-portal/src/app/app.component.ts
View file @
0b0a195
...
@@ -7,13 +7,7 @@ import { AppService } from './shared/app.service';
...
@@ -7,13 +7,7 @@ import { AppService } from './shared/app.service';
styleUrls
:
[
'./app.component.scss'
]
styleUrls
:
[
'./app.component.scss'
]
})
})
export
class
AppComponent
{
export
class
AppComponent
{
title
=
'Moay'
;
public
currentOrganisation
:
string
;
constructor
(
private
appService
:
AppService
)
{
constructor
(
private
appService
:
AppService
)
{
console
.
log
(
this
.
appService
.
get
());
console
.
log
(
this
.
appService
.
get
());
}
}
onOrganizationChange
(
event
)
{
this
.
currentOrganisation
=
event
;
}
}
}
code/moya-management-portal/src/app/app.mock.module.ts
View file @
0b0a195
import
{
BrowserModule
}
from
'@angular/platform-browser'
;
import
{
BrowserModule
}
from
'@angular/platform-browser'
;
import
{
NgModule
}
from
'@angular/core'
;
import
{
NgModule
}
from
'@angular/core'
;
import
{
AppComponent
}
from
'./app.component'
;
import
{
AppComponent
}
from
'./app.component'
;
import
{
AppMockService
}
from
'./shared/app.mock.service'
;
import
{
AppMockService
}
from
'./shared/app.mock.service'
;
import
{
AppService
}
from
'./shared/app.service'
;
import
{
AppService
}
from
'./shared/app.service'
;
import
{
OrganizationModule
}
from
'./organization/organization.module'
;
import
{
OrganizationModule
}
from
'./organization/organization.module'
;
import
{
BrowserAnimationsModule
}
from
'@angular/platform-browser/animations'
;
import
{
BrowserAnimationsModule
}
from
'@angular/platform-browser/animations'
;
@
NgModule
({
@
NgModule
({
declarations
:
[
declarations
:
[
AppComponent
,
AppComponent
],
],
imports
:
[
imports
:
[
BrowserModule
,
BrowserModule
,
...
...
code/moya-management-portal/src/app/app.module.ts
View file @
0b0a195
import
{
BrowserModule
}
from
'@angular/platform-browser'
;
import
{
BrowserModule
}
from
'@angular/platform-browser'
;
import
{
NgModule
}
from
'@angular/core'
;
import
{
NgModule
}
from
'@angular/core'
;
import
{
AppComponent
}
from
'./app.component'
;
import
{
AppComponent
}
from
'./app.component'
;
import
{
AppService
}
from
'./shared/app.service'
;
import
{
AppService
}
from
'./shared/app.service'
;
...
...
code/moya-management-portal/src/app/organization/event-list/event-service.service.spec.ts
View file @
0b0a195
import
{
TestBed
,
inject
}
from
'@angular/core/testing'
;
import
{
TestBed
,
inject
}
from
'@angular/core/testing'
;
import
{
EventsService
}
from
'./event-service.service'
;
import
{
EventsService
}
from
'./event-service.service'
;
describe
(
'EventsService'
,
()
=>
{
describe
(
'EventsService'
,
()
=>
{
...
...
code/moya-management-portal/src/app/organization/new-event/new-event.component.html
0 → 100644
View file @
0b0a195
<form
[
formGroup
]="
eventForm
"
(
ngSubmit
)="
onSubmit
()"
>
<mat-form-field>
<input
matInput
required
placeholder=
"Event name"
formControlName=
"name"
>
</mat-form-field>
<mat-divider
[
vertical
]="
true
"
></mat-divider>
<mat-form-field>
<input
matInput
placeholder=
"Address"
formControlName=
"address"
>
</mat-form-field>
<button
mat-button
type=
"submit"
>
Submit
</button>
</form>
\ No newline at end of file
code/moya-management-portal/src/app/organization/new-event/new-event.component.scss
0 → 100644
View file @
0b0a195
File mode changed
code/moya-management-portal/src/app/organization/new-event/new-event.component.spec.ts
0 → 100644
View file @
0b0a195
import
{
async
,
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
NewEventComponent
}
from
'./new-event.component'
;
describe
(
'NewEventComponent'
,
()
=>
{
let
component
:
NewEventComponent
;
let
fixture
:
ComponentFixture
<
NewEventComponent
>
;
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
declarations
:
[
NewEventComponent
]
})
.
compileComponents
();
}));
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
NewEventComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should create'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
code/moya-management-portal/src/app/organization/new-event/new-event.component.ts
0 → 100644
View file @
0b0a195
import
{
Component
,
OnInit
}
from
'@angular/core'
;
@
Component
({
selector
:
'moya-new-event'
,
templateUrl
:
'./new-event.component.html'
,
styleUrls
:
[
'./new-event.component.scss'
]
})
export
class
NewEventComponent
implements
OnInit
{
constructor
()
{
}
ngOnInit
()
{
}
}
code/moya-management-portal/src/app/organization/new-organization/new-organization.component.ts
View file @
0b0a195
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
FormControl
,
FormGroup
}
from
'@angular/forms'
;
import
{
FormControl
,
FormGroup
}
from
'@angular/forms'
;
@
Component
({
@
Component
({
...
@@ -23,6 +23,7 @@ export class NewOrganizationComponent implements OnInit {
...
@@ -23,6 +23,7 @@ export class NewOrganizationComponent implements OnInit {
ngOnInit
()
{
ngOnInit
()
{
}
}
onSubmit
()
{
onSubmit
()
{
const
values
=
{
const
values
=
{
'name'
:
this
.
organizationForm
.
get
(
'name'
).
value
,
'name'
:
this
.
organizationForm
.
get
(
'name'
).
value
,
...
...
code/moya-management-portal/src/app/organization/organization-list/organization-list.component.ts
View file @
0b0a195
import
{
EventsService
}
from
'./../event-list/event-service.service'
;
import
{
Component
,
OnInit
,
Output
}
from
'@angular/core'
;
import
{
Component
,
OnInit
,
Output
}
from
'@angular/core'
;
import
{
OrganizationListService
}
from
'./organization-list.service'
;
import
{
OrganizationListService
}
from
'./organization-list.service'
;
import
{
EventEmitter
}
from
'@angular/core'
;
import
{
EventEmitter
}
from
'@angular/core'
;
...
@@ -16,7 +17,7 @@ export class OrganizationListComponent implements OnInit {
...
@@ -16,7 +17,7 @@ export class OrganizationListComponent implements OnInit {
selected
=
new
EventEmitter
();
selected
=
new
EventEmitter
();
public
organizations
=
[
public
organizations
=
[
{
name
:
'Assemly Organization'
},
{
name
:
'Assem
b
ly Organization'
},
{
name
:
'Assemly'
},
{
name
:
'Assemly'
},
{
name
:
'Organization'
}
{
name
:
'Organization'
}
];
];
...
...
code/moya-management-portal/src/app/organization/organization.component.html
View file @
0b0a195
<p>
<div>
organization works!
<moya-organization-list
(
selected
)="
onOrganizationChange
($
event
)"
style=
"float:top, left;"
></moya-organization-list>
</p>
<h1
style=
"text-align:center; margin-left:25%; display:inline-block"
>
Welcome to {{ title }}!
</h1>
<a
style=
"float:right; font-size:20px; margin-top: 20px"
href=
"#"
>
Moya Login
</a>
</div>
<div
style=
"width:50%; float:left"
>
<h2
style=
"margin-left: 10px"
>
Tulevat tapahtumat
</h2>
<moya-event-list
[
organisation
]="
currentOrganisation
"
style=
"margin-top:5em;"
></moya-event-list>
</div>
<div
style=
"width:50%; float:right"
>
<h2>
Ei omaa organisaatiota?
</h2>
<button
mat-button
(
click
)="
newOrg
()"
>
Create new organization
</button>
<moya-new-organization></moya-new-organization>
<moya-new-event></moya-new-event>
</div>
code/moya-management-portal/src/app/organization/organization.component.ts
View file @
0b0a195
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
EventListComponent
}
from
'./event-list/event-list.component'
;
@
Component
({
@
Component
({
selector
:
'moya-organization'
,
selector
:
'moya-organization'
,
...
@@ -7,9 +8,16 @@ import { Component, OnInit } from '@angular/core';
...
@@ -7,9 +8,16 @@ import { Component, OnInit } from '@angular/core';
})
})
export
class
OrganizationComponent
implements
OnInit
{
export
class
OrganizationComponent
implements
OnInit
{
title
=
'Moay'
;
public
currentOrganisation
:
string
;
constructor
()
{
}
constructor
()
{
}
ngOnInit
()
{
ngOnInit
()
{
}
}
onOrganizationChange
(
event
)
{
this
.
currentOrganisation
=
event
;
}
}
}
code/moya-management-portal/src/app/organization/organization.module.ts
View file @
0b0a195
...
@@ -3,15 +3,16 @@ import { CommonModule } from '@angular/common';
...
@@ -3,15 +3,16 @@ import { CommonModule } from '@angular/common';
import
{
NewOrganizationComponent
}
from
'./new-organization/new-organization.component'
;
import
{
NewOrganizationComponent
}
from
'./new-organization/new-organization.component'
;
import
{
OrganizationListComponent
}
from
'./organization-list/organization-list.component'
;
import
{
OrganizationListComponent
}
from
'./organization-list/organization-list.component'
;
import
{
EventListComponent
}
from
'./event-list/event-list.component'
;
import
{
EventListComponent
}
from
'./event-list/event-list.component'
;
import
{
MatSelectModule
}
from
'@angular/material/select'
;
import
{
MatSelectModule
}
from
'@angular/material/select'
;
import
{
OrganizationListService
}
from
'./organization-list/organization-list.service'
;
import
{
OrganizationListService
}
from
'./organization-list/organization-list.service'
;
import
{
MatCardModule
}
from
'@angular/material/card'
;
import
{
MatCardModule
}
from
'@angular/material/card'
;
import
{
OrganizationComponent
}
from
'./organization.component'
;
import
{
OrganizationComponent
}
from
'./organization.component'
;
import
{
FormsModule
}
from
'@angular/forms'
;
import
{
FormsModule
}
from
'@angular/forms'
;
import
{
EventsService
}
from
'./event-list/event-service.service'
;
import
{
EventsService
}
from
'./event-list/event-service.service'
;
import
{
ReactiveFormsModule
}
from
'@angular/forms'
;
import
{
ReactiveFormsModule
}
from
'@angular/forms'
;
import
{
MatInputModule
}
from
'@angular/material/input'
;
import
{
MatInputModule
}
from
'@angular/material/input'
;
import
{
MatButtonModule
,
MatDividerModule
}
from
'@angular/material'
;
import
{
MatButtonModule
,
MatDividerModule
}
from
'@angular/material'
;
import
{
NewEventComponent
}
from
'./new-event/new-event.component'
;
@
NgModule
({
@
NgModule
({
imports
:
[
imports
:
[
...
@@ -25,7 +26,7 @@ import {MatButtonModule, MatDividerModule} from '@angular/material';
...
@@ -25,7 +26,7 @@ import {MatButtonModule, MatDividerModule} from '@angular/material';
FormsModule
FormsModule
],
],
providers
:
[
OrganizationListService
,
EventsService
],
providers
:
[
OrganizationListService
,
EventsService
],
declarations
:
[
NewOrganizationComponent
,
OrganizationListComponent
,
EventListComponent
,
OrganizationComponent
],
declarations
:
[
NewOrganizationComponent
,
OrganizationListComponent
,
EventListComponent
,
OrganizationComponent
,
NewEventComponent
],
exports
:
[
NewOrganizationComponent
,
OrganizationListComponent
,
EventListComponent
],
exports
:
[
NewOrganizationComponent
,
OrganizationListComponent
,
EventListComponent
,
OrganizationComponent
,
NewEventComponent
],
})
})
export
class
OrganizationModule
{
}
export
class
OrganizationModule
{
}
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