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 7fc72cd8
authored
Apr 02, 2018
by
Tuukka Kivilahti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
viplist as testmodule , rewriting folder structure as planned on codecamp
1 parent
c220a30c
Show whitespace changes
Inline
Side-by-side
Showing
49 changed files
with
179 additions
and
324 deletions
code/moya-angular/README.md
code/moya-angular/src/app/app-routing.module.ts
code/moya-angular/src/app/app.component.html
code/moya-angular/src/app/app.module.ts
code/moya-angular/src/app/components/moya-locale/moya-locale.component.ts
code/moya-angular/src/app/components/moya-locale/moya-locale.service.ts
code/moya-angular/src/app/menu/admin-menu/admin-menu.component.html
code/moya-angular/src/app/menu/defines/menu.ts
code/moya-angular/src/app/menu/info-menu/info-menu.component.html
code/moya-angular/src/app/menu/left-menu/left-menu.component.ts
code/moya-angular/src/app/menu/user-menu/user-menu.component.html
code/moya-angular/src/app/pages/login/login-routing.module.ts → code/moya-angular/src/app/modules/login/login-routing.module.ts
code/moya-angular/src/app/pages/admin/admin.component.scss → code/moya-angular/src/app/modules/login/login.component.css
code/moya-angular/src/app/pages/login/login.component.html → code/moya-angular/src/app/modules/login/login.component.html
code/moya-angular/src/app/pages/login/login.component.spec.ts → code/moya-angular/src/app/modules/login/login.component.spec.ts
code/moya-angular/src/app/pages/login/login.component.ts → code/moya-angular/src/app/modules/login/login.component.ts
code/moya-angular/src/app/pages/login/login.module.ts → code/moya-angular/src/app/modules/login/login.module.ts
code/moya-angular/src/app/pages/admin/admin-routing.module.ts → code/moya-angular/src/app/modules/old-moya/old-moya-routing.module.ts
code/moya-angular/src/app/pages/old-moya/old-moya.component.html → code/moya-angular/src/app/modules/old-moya/old-moya.component.html
code/moya-angular/src/app/pages/old-moya/old-moya.component.scss → code/moya-angular/src/app/modules/old-moya/old-moya.component.scss
code/moya-angular/src/app/pages/old-moya/old-moya.component.spec.ts → code/moya-angular/src/app/modules/old-moya/old-moya.component.spec.ts
code/moya-angular/src/app/pages/old-moya/old-moya.component.ts → code/moya-angular/src/app/modules/old-moya/old-moya.component.ts
code/moya-angular/src/app/pages/old-moya/old-moya.module.ts → code/moya-angular/src/app/modules/old-moya/old-moya.module.ts
code/moya-angular/src/app/modules/viplist/info/info-viplist-page.component.html
code/moya-angular/src/app/modules/viplist/info/info-viplist-page.component.ts
code/moya-angular/src/app/shared/models/vip-product-delivery.model.ts → code/moya-angular/src/app/modules/viplist/models/vip-product-delivery.model.ts
code/moya-angular/src/app/shared/models/vip-product.model.ts → code/moya-angular/src/app/modules/viplist/models/vip-product.model.ts
code/moya-angular/src/app/shared/models/vip.model.ts → code/moya-angular/src/app/modules/viplist/models/vip.model.ts
code/moya-angular/src/app/pages/user/user-routing.module.ts → code/moya-angular/src/app/modules/viplist/viplist-routing.module.ts
code/moya-angular/src/app/modules/viplist/viplist.service.ts
code/moya-angular/src/app/pages/admin/admin.component.html
code/moya-angular/src/app/pages/admin/admin.component.spec.ts
code/moya-angular/src/app/pages/admin/admin.component.ts
code/moya-angular/src/app/pages/admin/admin.module.ts
code/moya-angular/src/app/pages/info/info-routing.module.ts
code/moya-angular/src/app/pages/info/info.component.html
code/moya-angular/src/app/pages/info/info.component.scss
code/moya-angular/src/app/pages/info/info.component.spec.ts
code/moya-angular/src/app/pages/info/info.component.ts
code/moya-angular/src/app/pages/info/info.module.ts
code/moya-angular/src/app/pages/login/login.component.css
code/moya-angular/src/app/pages/user/user.component.html
code/moya-angular/src/app/pages/user/user.component.scss
code/moya-angular/src/app/pages/user/user.component.spec.ts
code/moya-angular/src/app/pages/user/user.component.ts
code/moya-angular/src/app/pages/user/user.module.ts
code/moya-angular/src/assets/i18n/en.json
code/moya-angular/src/assets/i18n/fi.json
code/moya-angular/src/assets/i18n/sv.json
code/moya-angular/README.md
View file @
7fc72cd
...
...
@@ -39,18 +39,26 @@ Jos tulee muita järkeviä kokonaisuuksia, joita voi käyttää muualla, jaa oma
*
app
*
modules
*
viplist
*
viplist.component
*
viplist.module
*
viplist-manager
*
viplist-info.component
*
viplist-admin.component
*
viplist-manager.module
*
models
*
viplist.model
*
pizza
*
user-pizza
*
user-pizza.component
*
admin-pizza
*
admin-pizza.component
*
services
*
pizza.service
*
pizza-user
*
pizza-user.component
*
pizza-user.service
*
pizza-user.module
*
pizza-manager
*
pizza-admin.component
*
pizza-info.component
*
pizza-manager.module
*
pizza-manager.service
*
common
*
pizza-list.component (shared for user / admin pizza)
*
pizza.module
*
models
*
pizza.model
*
shared
*
components
*
services
...
...
code/moya-angular/src/app/app-routing.module.ts
View file @
7fc72cd
import
{
NgModule
}
from
'@angular/core'
;
import
{
CommonModule
}
from
'@angular/common'
;
import
{
Routes
,
RouterModule
,
PreloadAllModules
}
from
'@angular/router'
;
import
{
LoginComponent
}
from
'./pages/login/login.component'
;
import
{
InfoComponent
}
from
'./pages/info/info.component'
;
import
{
LoginComponent
}
from
'./modules/login/login.component'
;
import
{
FrontpageComponent
}
from
"./components/frontpage/frontpage.component"
;
import
{
ViplistModule
}
from
"./modules/viplist/viplist.module"
;
import
{
InfoViplistPageComponent
}
from
"./modules/viplist/info/info-viplist-page.component"
;
const
APP_ROUTES
:
Routes
=
[
{
path
:
'info'
,
loadChildren
:
'app/pages/info/info.module#InfoModule'
},
{
path
:
'admin'
,
loadChildren
:
'app/pages/admin/admin.module#AdminModule'
},
{
path
:
'user'
,
loadChildren
:
'app/pages/user/user.module#UserModule'
},
{
path
:
'login'
,
component
:
LoginComponent
},
{
path
:
''
,
pathMatch
:
'full'
,
redirectTo
:
'login'
},
{
path
:
'**'
,
component
:
LoginComponent
}
/*{ path: 'viplist', loadChildren: 'app/modules/viplist/viplist.module#ViplistModule' },*/
{
path
:
'viplist'
,
component
:
InfoViplistPageComponent
},
{
path
:
'old/info'
,
loadChildren
:
'app/modules/old-moya/old-moya.module#OldMoyaModule'
},
{
path
:
''
,
pathMatch
:
'full'
,
component
:
FrontpageComponent
}
];
@
NgModule
({
...
...
code/moya-angular/src/app/app.component.html
View file @
7fc72cd
<div
id=
"top-container"
>
<div
id=
"left-menu"
>
<
router-outlet
name=
"left-menu"
></router-outlet
>
<
left-menu></left-menu
>
</div>
<div
id=
"contentarea"
>
...
...
@@ -13,4 +13,3 @@
<router-outlet></router-outlet>
</div>
</div>
\ No newline at end of file
code/moya-angular/src/app/app.module.ts
View file @
7fc72cd
...
...
@@ -13,15 +13,17 @@ import { MoyaLocaleComponent } from './components/moya-locale/moya-locale.compon
import
{
TopMenuComponent
}
from
'./menu/top-menu/top-menu.component'
;
import
{
AppComponent
}
from
'./app.component'
;
import
{
NgModule
}
from
'@angular/core'
;
import
{
MatTableModule
}
from
"@angular/material"
;
import
{
ViplistModule
}
from
"./modules/viplist/viplist.module"
;
import
{
LoginModule
}
from
"./pages/login/login.module"
;
import
{
LoginModule
}
from
"./modules/login/login.module"
;
import
{
LeftMenuModule
}
from
"./menu/left-menu/left-menu.module"
;
import
{
FrontpageComponent
}
from
'./components/frontpage/frontpage.component'
;
@
NgModule
({
declarations
:
[
AppComponent
,
TopMenuComponent
,
MoyaLocaleComponent
,
FrontpageComponent
],
imports
:
[
BrowserModule
,
...
...
@@ -30,6 +32,13 @@ import {LoginModule} from "./pages/login/login.module";
HttpClientModule
,
ViplistModule
,
LoginModule
,
LeftMenuModule
,
// remove
ViplistModule
,
// /remove
AlertModule
.
forRoot
(),
TranslateModule
.
forRoot
({
...
...
code/moya-angular/src/app/components/moya-locale/moya-locale.component.ts
View file @
7fc72cd
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
DEFAULT_LOCALE
,
MoyaLocaleService
}
from
'./moya-locale.service'
;
import
{
TranslateService
}
from
'@ngx-translate/core'
;
const
ENGLISH
=
'en'
;
const
FINNISH
=
'fi'
;
const
SWEDISH
=
'sv'
;
import
{
DEFAULT_LOCALE
,
ENGLISH
,
FINNISH
,
MoyaLocaleService
,
SWEDISH
}
from
'./moya-locale.service'
;
@
Component
({
selector
:
'moya-locale'
,
...
...
@@ -17,24 +12,18 @@ export class MoyaLocaleComponent implements OnInit {
svSelected
=
true
;
enSelected
=
true
;
constructor
(
private
localeService
:
MoyaLocaleService
,
private
translate
:
TranslateService
)
{
// fallback language
translate
.
setDefaultLang
(
DEFAULT_LOCALE
);
this
.
selectLocale
(
DEFAULT_LOCALE
);
}
constructor
(
private
localeService
:
MoyaLocaleService
)
{
}
ngOnInit
()
{
this
.
localeService
.
getUserLocale
().
subscribe
(
locale
=>
{
this
.
selectLocale
(
locale
);
}
);
this
.
localeService
.
getUserLocale
().
subscribe
(
locale
=>
{
this
.
updateFlagStatus
(
locale
);
}
);
}
selectLocale
(
locale
:
string
,
save
=
false
):
void
{
updateFlagStatus
(
locale
:
string
):
void
{
if
(
!
[
ENGLISH
,
FINNISH
,
SWEDISH
].
includes
(
locale
))
{
return
;
}
this
.
translate
.
use
(
locale
);
this
.
fiSelected
=
this
.
svSelected
=
this
.
enSelected
=
false
;
switch
(
locale
)
{
...
...
@@ -48,22 +37,17 @@ export class MoyaLocaleComponent implements OnInit {
this
.
svSelected
=
true
;
break
;
}
if
(
save
)
{
this
.
localeService
.
setUserLocale
(
locale
);
}
}
selectEnglish
()
{
this
.
selectLocale
(
ENGLISH
,
true
);
this
.
updateFlagStatus
(
this
.
localeService
.
selectLocale
(
ENGLISH
,
true
)
);
}
selectFinnish
()
{
this
.
selectLocale
(
FINNISH
,
true
);
this
.
updateFlagStatus
(
this
.
localeService
.
selectLocale
(
FINNISH
,
true
)
);
}
selectSwedish
()
{
this
.
selectLocale
(
SWEDISH
,
true
);
this
.
updateFlagStatus
(
this
.
localeService
.
selectLocale
(
SWEDISH
,
true
)
);
}
}
code/moya-angular/src/app/components/moya-locale/moya-locale.service.ts
View file @
7fc72cd
import
{
Injectable
}
from
'@angular/core'
;
import
{
Observable
}
from
'rxjs/Observable'
;
import
{
MoyaLocale
}
from
'./moya-locale.model'
;
import
{
MOYA_BASE_URL
,
MoyaRestTool
}
from
'../../shared/tools/moya-rest.tool'
;
import
{
MOYA_BASE_URL
}
from
'../../shared/tools/moya-rest.tool'
;
import
{
HttpClient
}
from
'@angular/common/http'
;
import
'rxjs/add/operator/catch'
;
import
{
TranslateService
}
from
"@ngx-translate/core"
;
export
const
DEFAULT_LOCALE
=
'fi'
;
export
const
ENGLISH
=
'en'
;
export
const
FINNISH
=
'fi'
;
export
const
SWEDISH
=
'sv'
;
export
const
DEFAULT_LOCALE
=
FINNISH
;
const
LOCALSTORAGE_NAME
=
'currently used locale code'
;
@
Injectable
()
export
class
MoyaLocaleService
{
constructor
(
private
http
:
HttpClient
)
{
}
selectedLocale
:
string
;
constructor
(
private
http
:
HttpClient
,
private
translate
:
TranslateService
)
{
this
.
translate
.
setDefaultLang
(
DEFAULT_LOCALE
);
this
.
getUserLocale
().
subscribe
();
}
/**
* Returns same locale you did give this as a parameter.
*
* @param {string} locale
* @param {boolean} save
* @return {string}
*/
selectLocale
(
locale
:
string
,
save
=
false
):
string
{
if
(
!
[
ENGLISH
,
FINNISH
,
SWEDISH
].
includes
(
locale
))
{
return
;
}
this
.
translate
.
use
(
locale
);
this
.
selectedLocale
=
locale
;
if
(
save
)
{
this
.
setUserLocale
(
locale
);
}
return
locale
;
}
/**
* Order of Locale:
...
...
@@ -23,24 +64,29 @@ export class MoyaLocaleService {
*/
public
getUserLocale
():
Observable
<
string
>
{
// If there is already locale, don't bother of running this rest stuff again
if
(
this
.
selectedLocale
)
{
return
new
Observable
<
string
>
(
x
=>
x
.
next
(
this
.
selectedLocale
));
}
return
this
.
http
.
get
<
MoyaLocale
>
(
MOYA_BASE_URL
+
'/v3/locale/'
)
.
catch
(
x
=>
Observable
.
of
({}
as
MoyaLocale
))
.
map
(
locale
=>
{
if
(
locale
&&
locale
.
userLocale
)
{
return
locale
.
userLocale
;
return
this
.
selectLocale
(
locale
.
userLocale
)
;
}
const
storageLocale
=
localStorage
.
getItem
(
LOCALSTORAGE_NAME
);
if
(
storageLocale
)
{
return
storageLocale
;
return
this
.
selectLocale
(
storageLocale
)
;
}
if
(
locale
.
eventLocale
)
{
return
locale
.
eventLocale
;
return
this
.
selectLocale
(
locale
.
eventLocale
)
;
}
return
DEFAULT_LOCALE
;
return
this
.
selectLocale
(
DEFAULT_LOCALE
)
;
});
}
...
...
code/moya-angular/src/app/menu/admin-menu/admin-menu.component.html
View file @
7fc72cd
<
left-menu
[
menu
]="
menu
"
styleClass=
"adminMenu"
></left-menu
>
<
!-- <left-menu [menu]="menu" styleClass="adminMenu"></left-menu> --
>
code/moya-angular/src/app/menu/defines/menu.ts
View file @
7fc72cd
import
{
MenuGroup
}
from
'../models/menu-group.model'
;
import
{
OldMoyaComponent
}
from
"../../modules/old-moya/old-moya.component"
;
/**
* Created by tuukka on 13/05/17.
*/
...
...
@@ -10,16 +11,17 @@ export class MENU {
{
'name'
:
'Kauppa'
,
'items'
:
[
{
'path'
:
'/
admin/old
'
,
'name'
:
'Products'
,
'params'
:
{
p
:
'product/list.jsf'
}
}
{
'path'
:
'/
old/admin
'
,
'name'
:
'Products'
,
'params'
:
{
p
:
'product/list.jsf'
}
}
]}
];
static
INFO
:
MenuGroup
[]
=
[
{
'name'
:
'Users'
,
'items'
:
[
{
'path'
:
'/
info/old
'
,
'name'
:
'List users'
,
'params'
:
{
p
:
'useradmin/list.jsf'
}
},
{
'path'
:
'/
info/
viplist'
,
'name'
:
'VipList'
}
{
'path'
:
'/
old/info
'
,
'name'
:
'List users'
,
'params'
:
{
p
:
'useradmin/list.jsf'
}
},
{
'path'
:
'/viplist'
,
'name'
:
'VipList'
}
]}
];
...
...
@@ -27,49 +29,49 @@ export class MENU {
{
'name'
:
'Event'
,
'items'
:
[
{
'path'
:
'/
user/old
'
,
'name'
:
'Poll'
,
'params'
:
{
p
:
'poll/index.jsf'
}
},
{
'path'
:
'/
user/old
'
,
'name'
:
'Invite friends'
,
'params'
:
{
p
:
'user/invite.jsf'
}
},
{
'path'
:
'/
old/user
'
,
'name'
:
'Poll'
,
'params'
:
{
p
:
'poll/index.jsf'
}
},
{
'path'
:
'/
old/user
'
,
'name'
:
'Invite friends'
,
'params'
:
{
p
:
'user/invite.jsf'
}
},
]},
{
'name'
:
'Shop'
,
'items'
:
[
{
'path'
:
'/
user/old
'
,
'name'
:
'Buy Tickets'
,
'params'
:
{
p
:
'shop/createBill.jsf'
}
},
{
'path'
:
'/
user/old
'
,
'name'
:
'Reserve Places'
,
'params'
:
{
p
:
'neomap/reserve.jsf'
}
},
{
'path'
:
'/
user/old
'
,
'name'
:
'Change Places'
,
'params'
:
{
p
:
'neomap/moveplaces.jsf'
}
},
{
'path'
:
'/
user/old
'
,
'name'
:
'Food Orders'
,
'params'
:
{
p
:
'foodwave/list.jsf'
}
},
{
'path'
:
'/
user/old
'
,
'name'
:
'Own Orders'
,
'params'
:
{
p
:
'bill/list.jsf'
}
},
{
'path'
:
'/
user/old
'
,
'name'
:
'Account Events'
,
'params'
:
{
p
:
'user/accountEvents.jsf'
}
},
{
'path'
:
'/
old/user
'
,
'name'
:
'Buy Tickets'
,
'params'
:
{
p
:
'shop/createBill.jsf'
}
},
{
'path'
:
'/
old/user
'
,
'name'
:
'Reserve Places'
,
'params'
:
{
p
:
'neomap/reserve.jsf'
}
},
{
'path'
:
'/
old/user
'
,
'name'
:
'Change Places'
,
'params'
:
{
p
:
'neomap/moveplaces.jsf'
}
},
{
'path'
:
'/
old/user
'
,
'name'
:
'Food Orders'
,
'params'
:
{
p
:
'foodwave/list.jsf'
}
},
{
'path'
:
'/
old/user
'
,
'name'
:
'Own Orders'
,
'params'
:
{
p
:
'bill/list.jsf'
}
},
{
'path'
:
'/
old/user
'
,
'name'
:
'Account Events'
,
'params'
:
{
p
:
'user/accountEvents.jsf'
}
},
]},
{
'name'
:
'Computerplaces'
,
'items'
:
[
{
'path'
:
'/
user/old
'
,
'name'
:
'Own Places'
,
'params'
:
{
p
:
'place/myGroups.jsf'
}
},
{
'path'
:
'/
user/old
'
,
'name'
:
'Placemap'
,
'params'
:
{
p
:
'neomap/view.jsf'
}
},
{
'path'
:
'/
old/user
'
,
'name'
:
'Own Places'
,
'params'
:
{
p
:
'place/myGroups.jsf'
}
},
{
'path'
:
'/
old/user
'
,
'name'
:
'Placemap'
,
'params'
:
{
p
:
'neomap/view.jsf'
}
},
]},
{
'name'
:
'Competitions'
,
'items'
:
[
{
'path'
:
'/
user/old
'
,
'name'
:
'Compos'
,
'params'
:
{
p
:
'voting/compolist.jsf'
}
},
{
'path'
:
'/
user/old
'
,
'name'
:
'My entries'
,
'params'
:
{
p
:
'voting/myEntries.jsf'
}
},
{
'path'
:
'/
old/user
'
,
'name'
:
'Compos'
,
'params'
:
{
p
:
'voting/compolist.jsf'
}
},
{
'path'
:
'/
old/user
'
,
'name'
:
'My entries'
,
'params'
:
{
p
:
'voting/myEntries.jsf'
}
},
]},
{
'name'
:
'Profile'
,
'items'
:
[
{
'path'
:
'/
user/old
'
,
'name'
:
'My Information'
,
'params'
:
{
p
:
'user/edit.jsf'
}
},
{
'path'
:
'/
user/old
'
,
'name'
:
'Request Role'
,
'params'
:
{
p
:
'orgrole/requestRole.jsf'
}
},
{
'path'
:
'/
user/old
'
,
'name'
:
'Change password'
,
'params'
:
{
p
:
'user/changePassword.jsf'
}
},
{
'path'
:
'/
user/old
'
,
'name'
:
'Set GameIDs'
,
'params'
:
{
p
:
'user/gameids.jsf'
}
},
{
'path'
:
'/
old/user
'
,
'name'
:
'My Information'
,
'params'
:
{
p
:
'user/edit.jsf'
}
},
{
'path'
:
'/
old/user
'
,
'name'
:
'Request Role'
,
'params'
:
{
p
:
'orgrole/requestRole.jsf'
}
},
{
'path'
:
'/
old/user
'
,
'name'
:
'Change password'
,
'params'
:
{
p
:
'user/changePassword.jsf'
}
},
{
'path'
:
'/
old/user
'
,
'name'
:
'Set GameIDs'
,
'params'
:
{
p
:
'user/gameids.jsf'
}
},
]},
{
'name'
:
'Tournaments'
,
'items'
:
[
{
'path'
:
'/
user/old
'
,
'name'
:
'Tournaments List'
,
'params'
:
{
p
:
'tournaments/index.jsf'
}
},
{
'path'
:
'/
user/old
'
,
'name'
:
'My Participations'
,
'params'
:
{
p
:
'tournaments/myparticipations.jsf'
}
},
{
'path'
:
'/
old/user
'
,
'name'
:
'Tournaments List'
,
'params'
:
{
p
:
'tournaments/index.jsf'
}
},
{
'path'
:
'/
old/user
'
,
'name'
:
'My Participations'
,
'params'
:
{
p
:
'tournaments/myparticipations.jsf'
}
},
]},
{
'name'
:
'Lectures and Courses'
,
'items'
:
[
{
'path'
:
'/
user/old
'
,
'name'
:
'Participate'
,
'params'
:
{
p
:
'lectures/viewLectures.jsf'
}
},
{
'path'
:
'/
old/user
'
,
'name'
:
'Participate'
,
'params'
:
{
p
:
'lectures/viewLectures.jsf'
}
},
]},
];
...
...
code/moya-angular/src/app/menu/info-menu/info-menu.component.html
View file @
7fc72cd
<
left-menu
[
menu
]="
menu
"
styleClass=
"infoMenu"
></left-menu
>
<
!-- <left-menu [menu]="menu" styleClass="infoMenu"></left-menu> --
>
code/moya-angular/src/app/menu/left-menu/left-menu.component.ts
View file @
7fc72cd
import
{
Component
,
OnInit
,
Input
}
from
'@angular/core'
;
import
{
MenuGroup
}
from
'../models/menu-group.model'
;
import
{
MENU
}
from
"../defines/menu"
;
@
Component
({
selector
:
'left-menu'
,
...
...
@@ -8,10 +9,7 @@ import {MenuGroup} from '../models/menu-group.model';
})
export
class
LeftMenuComponent
implements
OnInit
{
@
Input
()
menu
:
MenuGroup
[];
@
Input
()
styleClass
:
string
;
constructor
()
{
...
...
@@ -19,6 +17,8 @@ export class LeftMenuComponent implements OnInit {
}
ngOnInit
()
{
this
.
menu
=
MENU
.
INFO
;
this
.
styleClass
=
"infoMenu"
;
}
}
code/moya-angular/src/app/menu/user-menu/user-menu.component.html
View file @
7fc72cd
<
left-menu
[
menu
]="
menu
"
styleClass=
"userMenu"
></left-menu
>
<
!-- <left-menu [menu]="menu" styleClass="userMenu"></left-menu> --
>
code/moya-angular/src/app/
pag
es/login/login-routing.module.ts
→
code/moya-angular/src/app/
modul
es/login/login-routing.module.ts
View file @
7fc72cd
File moved
code/moya-angular/src/app/
pages/admin/admin.component.s
css
→
code/moya-angular/src/app/
modules/login/login.component.
css
View file @
7fc72cd
File moved
code/moya-angular/src/app/
pag
es/login/login.component.html
→
code/moya-angular/src/app/
modul
es/login/login.component.html
View file @
7fc72cd
File moved
code/moya-angular/src/app/
pag
es/login/login.component.spec.ts
→
code/moya-angular/src/app/
modul
es/login/login.component.spec.ts
View file @
7fc72cd
File moved
code/moya-angular/src/app/
pag
es/login/login.component.ts
→
code/moya-angular/src/app/
modul
es/login/login.component.ts
View file @
7fc72cd
File moved
code/moya-angular/src/app/
pag
es/login/login.module.ts
→
code/moya-angular/src/app/
modul
es/login/login.module.ts
View file @
7fc72cd
import
{
LoginRoutingModule
}
from
'./login-routing.module'
;
import
{
NgModule
}
from
'@angular/core'
;
import
{
CommonModule
}
from
'@angular/common'
;
import
{
LoginComponent
}
from
'./login.component'
;
import
{
TopMenuComponent
}
from
'../../menu/top-menu/top-menu.component'
;
import
{
LoginComponent
}
from
"./login.component"
;
@
NgModule
({
imports
:
[
CommonModule
,
LoginRoutingModule
],
declarations
:
[]
declarations
:
[
LoginComponent
]
})
export
class
LoginModule
{
}
code/moya-angular/src/app/
pages/admin/admin
-routing.module.ts
→
code/moya-angular/src/app/
modules/old-moya/old-moya
-routing.module.ts
View file @
7fc72cd
import
{
OldMoyaComponent
}
from
'./../old-moya/old-moya.component'
;
import
{
AdminMenuComponent
}
from
'./../../menu/admin-menu/admin-menu.component'
;
import
{
OldMoyaComponent
}
from
'../../modules/old-moya/old-moya.component'
;
import
{
NgModule
}
from
'@angular/core'
;
import
{
Routes
,
RouterModule
}
from
'@angular/router'
;
import
{
AdminComponent
}
from
'./admin.component'
;
const
routes
:
Routes
=
[
{
path
:
''
,
component
:
AdminMenuComponent
,
outlet
:
'left-menu'
},
{
path
:
''
,
pathMatch
:
'full'
,
component
:
AdminComponent
},
{
path
:
'old'
,
component
:
OldMoyaComponent
}
{
path
:
''
,
pathMatch
:
'full'
,
component
:
OldMoyaComponent
},
];
@
NgModule
({
...
...
code/moya-angular/src/app/
pag
es/old-moya/old-moya.component.html
→
code/moya-angular/src/app/
modul
es/old-moya/old-moya.component.html
View file @
7fc72cd
File moved
code/moya-angular/src/app/
pag
es/old-moya/old-moya.component.scss
→
code/moya-angular/src/app/
modul
es/old-moya/old-moya.component.scss
View file @
7fc72cd
File moved
code/moya-angular/src/app/
pag
es/old-moya/old-moya.component.spec.ts
→
code/moya-angular/src/app/
modul
es/old-moya/old-moya.component.spec.ts
View file @
7fc72cd
File moved
code/moya-angular/src/app/
pag
es/old-moya/old-moya.component.ts
→
code/moya-angular/src/app/
modul
es/old-moya/old-moya.component.ts
View file @
7fc72cd
File moved
code/moya-angular/src/app/
pag
es/old-moya/old-moya.module.ts
→
code/moya-angular/src/app/
modul
es/old-moya/old-moya.module.ts
View file @
7fc72cd
import
{
PipesModule
}
from
'.
/.
./../shared/pipes/pipes.module'
;
import
{
PipesModule
}
from
'../../shared/pipes/pipes.module'
;
import
{
OldMoyaComponent
}
from
'./old-moya.component'
;
import
{
NgModule
}
from
'@angular/core'
;
import
{
CommonModule
}
from
'@angular/common'
;
...
...
code/moya-angular/src/app/modules/viplist/info/info-viplist-page.component.html
View file @
7fc72cd
<mat-table
#
table
[
dataSource
]="
vips
|
async
"
>
<ng-container
matColumnDef=
"host"
>
<mat-header-cell
*
matHeaderCellDef
translate
>
vip.host
</mat-header-cell>
<mat-cell
*
matCellDef=
"let v"
>
{{v.host.firstname}} {{ v.host.lastname}}
</mat-cell>
<mat-header-cell
*
matHeaderCellDef
translate
>
vip.host
</mat-header-cell>
<mat-cell
*
matCellDef=
"let v"
>
{{v.host.firstname}} {{ v.host.lastname}}
</mat-cell>
</ng-container>
<ng-container
matColumnDef=
"
host
"
>
<mat-header-cell
*
matHeaderCellDef
translate
>
vip.shortdescr
</mat-header-cell>
<ng-container
matColumnDef=
"
shortdescr
"
>
<mat-header-cell
*
matHeaderCellDef
translate
>
vip.shortdescr
</mat-header-cell>
<mat-cell
*
matCellDef=
"let v"
>
{{v.shortdescr}}
</mat-cell>
</ng-container>
<ng-container
matColumnDef=
"
host
"
>
<mat-header-cell
*
matHeaderCellDef
translate
>
vip.description
</mat-header-cell>
<ng-container
matColumnDef=
"
description
"
>
<mat-header-cell
*
matHeaderCellDef
translate
>
vip.description
</mat-header-cell>
<mat-cell
*
matCellDef=
"let v"
>
{{v.description}}
</mat-cell>
</ng-container>
<ng-container
matColumnDef=
"
host
"
>
<mat-header-cell
*
matHeaderCellDef
translate
>
vip.products
</mat-header-cell>
<ng-container
matColumnDef=
"
products
"
>
<mat-header-cell
*
matHeaderCellDef
translate
>
vip.products
</mat-header-cell>
<mat-cell
*
matCellDef=
"let v"
>
<div
*
ngFor=
"let p of v.products"
class=
"row"
>
<div
style=
"display: inline-block;"
>
{{p.name}}
</div>
...
...
@@ -26,6 +26,7 @@
</mat-cell>
</ng-container>
<mat-header-row
*
matHeaderRowDef=
"displayedColumns"
></mat-header-row>
<mat-row
*
matRowDef=
"let row; columns: displayedColumns;"
></mat-row>
</mat-table>
code/moya-angular/src/app/modules/viplist/info/info-viplist-page.component.ts
View file @
7fc72cd
import
{
Component
,
NgZone
,
OnInit
}
from
'@angular/core'
;
import
{
Observable
}
from
'rxjs/Observable'
;
import
{
Vip
}
from
'../
../../shared/
models/vip.model'
;
import
{
Vip
}
from
'../models/vip.model'
;
import
{
ViplistService
}
from
'../viplist.service'
;
@
Component
({
...
...
code/moya-angular/src/app/
shared
/models/vip-product-delivery.model.ts
→
code/moya-angular/src/app/
modules/viplist
/models/vip-product-delivery.model.ts
View file @
7fc72cd
File moved
code/moya-angular/src/app/
shared
/models/vip-product.model.ts
→
code/moya-angular/src/app/
modules/viplist
/models/vip-product.model.ts
View file @
7fc72cd
File moved
code/moya-angular/src/app/
shared
/models/vip.model.ts
→
code/moya-angular/src/app/
modules/viplist
/models/vip.model.ts
View file @
7fc72cd
import
{
VipProduct
}
from
'./vip-product.model'
;
import
{
User
}
from
'./user.model'
;
import
{
User
}
from
'.
./../../shared/models
/user.model'
;
/**
* Created by tuukka on 04/02/17.
*/
...
...
code/moya-angular/src/app/
pages/user/user
-routing.module.ts
→
code/moya-angular/src/app/
modules/viplist/viplist
-routing.module.ts
View file @
7fc72cd
import
{
OldMoyaComponent
}
from
'./../old-moya/old-moya.component'
;
import
{
UserMenuComponent
}
from
'./../../menu/user-menu/user-menu.component'
;
import
{
NgModule
}
from
'@angular/core'
;
import
{
Routes
,
RouterModule
}
from
'@angular/router'
;
import
{
UserComponent
}
from
'./user.component'
;
const
routes
:
Routes
=
[
{
path
:
''
,
pathMatch
:
'full'
,
component
:
UserComponent
},
{
path
:
''
,
component
:
UserMenuComponent
,
outlet
:
'left-menu'
},
{
path
:
'old'
,
component
:
OldMoyaComponent
}
import
{
InfoViplistPageComponent
}
from
"./info/info-viplist-page.component"
;
const
routes
:
Routes
=
[
{
path
:
''
,
component
:
InfoViplistPageComponent
}
];
@
NgModule
({
imports
:
[
RouterModule
.
forChild
(
routes
)],
exports
:
[
RouterModule
]
})
export
class
User
RoutingModule
{
}
export
class
Viplist
RoutingModule
{
}
code/moya-angular/src/app/modules/viplist/viplist.service.ts
View file @
7fc72cd
import
{
Injectable
}
from
'@angular/core'
;
import
{
Vip
}
from
'.
./../shared
/models/vip.model'
;
import
{
Vip
}
from
'./models/vip.model'
;
import
{
User
}
from
'../../shared/models/user.model'
;
import
{
UserService
}
from
'../../shared/services/user.service'
;
import
{
Observable
}
from
'rxjs/Observable'
;
...
...
code/moya-angular/src/app/pages/admin/admin.component.html
deleted
100644 → 0
View file @
c220a30
<p>
admin works!
</p>
code/moya-angular/src/app/pages/admin/admin.component.spec.ts
deleted
100644 → 0
View file @
c220a30
import
{
async
,
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
AdminComponent
}
from
'./admin.component'
;
describe
(
'AdminComponent'
,
()
=>
{
let
component
:
AdminComponent
;
let
fixture
:
ComponentFixture
<
AdminComponent
>
;
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
declarations
:
[
AdminComponent
]
})
.
compileComponents
();
}));
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
AdminComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should be created'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
code/moya-angular/src/app/pages/admin/admin.component.ts
deleted
100644 → 0
View file @
c220a30
import
{
Component
,
OnInit
}
from
'@angular/core'
;
@
Component
({
selector
:
'moya-admin'
,
templateUrl
:
'./admin.component.html'
,
styleUrls
:
[
'./admin.component.scss'
]
})
export
class
AdminComponent
implements
OnInit
{
constructor
()
{
}
ngOnInit
()
{
}
}
code/moya-angular/src/app/pages/admin/admin.module.ts
deleted
100644 → 0
View file @
c220a30
import
{
OldMoyaModule
}
from
'./../old-moya/old-moya.module'
;
import
{
AdminMenuComponent
}
from
'./../../menu/admin-menu/admin-menu.component'
;
import
{
NgModule
}
from
'@angular/core'
;
import
{
CommonModule
}
from
'@angular/common'
;
import
{
AdminRoutingModule
}
from
'./admin-routing.module'
;
import
{
AdminComponent
}
from
'./admin.component'
;
import
{
LeftMenuModule
}
from
'../../menu/left-menu/left-menu.module'
;
@
NgModule
({
imports
:
[
CommonModule
,
AdminRoutingModule
,
LeftMenuModule
,
OldMoyaModule
],
declarations
:
[
AdminComponent
,
AdminMenuComponent
]
})
export
class
AdminModule
{
}
code/moya-angular/src/app/pages/info/info-routing.module.ts
deleted
100644 → 0
View file @
c220a30
import
{
InfoViplistPageComponent
}
from
'../../modules/viplist/info/info-viplist-page.component'
;
import
{
OldMoyaComponent
}
from
'./../old-moya/old-moya.component'
;
import
{
InfoMenuComponent
}
from
'./../../menu/info-menu/info-menu.component'
;
import
{
NgModule
}
from
'@angular/core'
;
import
{
Routes
,
RouterModule
}
from
'@angular/router'
;
import
{
InfoComponent
}
from
'./info.component'
;
const
routes
:
Routes
=
[
{
path
:
''
,
component
:
InfoMenuComponent
,
outlet
:
'left-menu'
},
{
path
:
''
,
pathMatch
:
'full'
,
component
:
OldMoyaComponent
},
{
path
:
'old'
,
component
:
OldMoyaComponent
},
{
path
:
'viplist'
,
component
:
InfoViplistPageComponent
}
];
@
NgModule
({
imports
:
[
RouterModule
.
forChild
(
routes
)],
exports
:
[
RouterModule
]
})
export
class
InfoRoutingModule
{
}
code/moya-angular/src/app/pages/info/info.component.html
deleted
100644 → 0
View file @
c220a30
<p>
info works!
</p>
code/moya-angular/src/app/pages/info/info.component.scss
deleted
100644 → 0
View file @
c220a30
File mode changed
code/moya-angular/src/app/pages/info/info.component.spec.ts
deleted
100644 → 0
View file @
c220a30
import
{
async
,
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
InfoComponent
}
from
'./info.component'
;
describe
(
'InfoComponent'
,
()
=>
{
let
component
:
InfoComponent
;
let
fixture
:
ComponentFixture
<
InfoComponent
>
;
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
declarations
:
[
InfoComponent
]
})
.
compileComponents
();
}));
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
InfoComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should be created'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
code/moya-angular/src/app/pages/info/info.component.ts
deleted
100644 → 0
View file @
c220a30
import
{
Component
,
OnInit
}
from
'@angular/core'
;
@
Component
({
selector
:
'moya-info'
,
templateUrl
:
'./info.component.html'
,
styleUrls
:
[
'./info.component.scss'
]
})
export
class
InfoComponent
implements
OnInit
{
constructor
()
{
}
ngOnInit
()
{
}
}
code/moya-angular/src/app/pages/info/info.module.ts
deleted
100644 → 0
View file @
c220a30
import
{
OldMoyaModule
}
from
'./../old-moya/old-moya.module'
;
import
{
NgModule
}
from
'@angular/core'
;
import
{
CommonModule
}
from
'@angular/common'
;
import
{
InfoRoutingModule
}
from
'./info-routing.module'
;
import
{
InfoComponent
}
from
'./info.component'
;
import
{
InfoMenuComponent
}
from
'../../menu/info-menu/info-menu.component'
;
import
{
LeftMenuModule
}
from
'../../menu/left-menu/left-menu.module'
;
@
NgModule
({
imports
:
[
CommonModule
,
InfoRoutingModule
,
LeftMenuModule
,
OldMoyaModule
],
declarations
:
[
InfoComponent
,
InfoMenuComponent
]
})
export
class
InfoModule
{
}
code/moya-angular/src/app/pages/login/login.component.css
deleted
100644 → 0
View file @
c220a30
File mode changed
code/moya-angular/src/app/pages/user/user.component.html
deleted
100644 → 0
View file @
c220a30
<p>
{{'test.user' | translate}} works!
</p>
<div
translate
>
test.user
</div>
code/moya-angular/src/app/pages/user/user.component.scss
deleted
100644 → 0
View file @
c220a30
File mode changed
code/moya-angular/src/app/pages/user/user.component.spec.ts
deleted
100644 → 0
View file @
c220a30
import
{
async
,
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
UserComponent
}
from
'./user.component'
;
describe
(
'UserComponent'
,
()
=>
{
let
component
:
UserComponent
;
let
fixture
:
ComponentFixture
<
UserComponent
>
;
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
declarations
:
[
UserComponent
]
})
.
compileComponents
();
}));
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
UserComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should be created'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
code/moya-angular/src/app/pages/user/user.component.ts
deleted
100644 → 0
View file @
c220a30
import
{
Component
,
OnInit
}
from
'@angular/core'
;
@
Component
({
selector
:
'moya-user'
,
templateUrl
:
'./user.component.html'
,
styleUrls
:
[
'./user.component.scss'
]
})
export
class
UserComponent
implements
OnInit
{
constructor
()
{
}
ngOnInit
()
{
}
}
code/moya-angular/src/app/pages/user/user.module.ts
deleted
100644 → 0
View file @
c220a30
import
{
PipesModule
}
from
'./../../shared/pipes/pipes.module'
;
import
{
OldMoyaModule
}
from
'./../old-moya/old-moya.module'
;
import
{
NgModule
}
from
'@angular/core'
;
import
{
CommonModule
}
from
'@angular/common'
;
import
{
UserRoutingModule
}
from
'./user-routing.module'
;
import
{
UserComponent
}
from
'./user.component'
;
import
{
UserMenuComponent
}
from
'../../menu/user-menu/user-menu.component'
;
import
{
LeftMenuModule
}
from
'../../menu/left-menu/left-menu.module'
;
import
{
TranslateModule
}
from
'@ngx-translate/core'
;
@
NgModule
({
imports
:
[
CommonModule
,
UserRoutingModule
,
LeftMenuModule
,
OldMoyaModule
,
TranslateModule
.
forRoot
()
],
declarations
:
[
UserComponent
,
UserMenuComponent
]
})
export
class
UserModule
{
}
code/moya-angular/src/assets/i18n/en.json
View file @
7fc72cd
{
"test"
:
{
"user"
:
"User"
},
"general"
:
{
"yes"
:
"Yes"
,
"no"
:
"No"
,
"save"
:
"Save"
,
"edit"
:
"Edit"
,
"control"
:
"Control"
},
"vip"
:
{
"host"
:
"Host"
,
"shortdescr"
:
"Name"
,
"description"
:
"Description"
,
"products"
:
"Products"
,
"deliver"
:
"Deliver"
}
}
code/moya-angular/src/assets/i18n/fi.json
View file @
7fc72cd
{
"test"
:
{
"user"
:
"Käyttäjä"
},
"general"
:
{
"yes"
:
"Kyllä"
,
"no"
:
"Ei"
,
"save"
:
"Tallenna"
,
"edit"
:
"Muokkaa"
,
"control"
:
"Hallitse"
},
"vip"
:
{
"host"
:
"Isäntä"
,
"shortdescr"
:
"Nimi"
,
"description"
:
"Kuvaus"
,
"products"
:
"Tuotteet"
,
"deliver"
:
"Toimita"
}
}
code/moya-angular/src/assets/i18n/sv.json
View file @
7fc72cd
{
"test"
:
{
"user"
:
"Användare"
,
"user"
:
"Användare"
},
"general"
:
{
"yes"
:
"Ja"
,
"no"
:
"Nej"
,
"save"
:
"Spara"
,
"edit"
:
"Edigera"
,
"control"
:
"Kontrollera"
,
"control"
:
"Kontrollera"
},
"vip"
:
{
"host"
:
"Värd"
,
"shortdescr"
:
"Namn"
,
"description"
:
"Beskrivning"
,
"products"
:
"Produkter"
,
"deliver"
:
"Leverera"
,
"deliver"
:
"Leverera"
}
}
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