Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Riina Antikainen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3f479bc0
authored
Feb 10, 2018
by
Tuukka Kivilahti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
working test version
1 parent
45a70c54
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
53 additions
and
92 deletions
code/moya-angular/src/app/app.component.html
code/moya-angular/src/app/app.module.ts
code/moya-angular/src/app/menu/admin-menu/admin-menu.component.ts
code/moya-angular/src/app/viplist/viplist.component.ts
code/moya-beans/ejbModule/fi/codecrew/moya/beans/BootstrapBean.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/JaasBean.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/MenuBean.java
code/moya-beans/ejbModule/fi/codecrew/moya/facade/MenuitemFacade.java
code/moya-database/src/main/java/fi/codecrew/moya/model/Menuitem.java
code/moya-web/src/main/java/fi/codecrew/moya/rest/v3/VipRestViewV3.java
code/moya-web/src/main/java/fi/codecrew/moya/rest/v3/pojo/VipRestPojoV3.java
code/pom.xml
code/moya-angular/src/app/app.component.html
View file @
3f479bc
...
...
@@ -8,7 +8,7 @@
<div
id=
"contentarea"
>
<div
id=
"topbar"
>
<top-menu></top-menu>
<
h1>
{{"Testing"|i18n}}
</h1
>
<
!-- h1>{{"Testing"|i18n}}</h1 --
>
</div>
<div
id=
"content"
>
<router-outlet></router-outlet>
...
...
code/moya-angular/src/app/app.module.ts
View file @
3f479bc
import
{
BrowserModule
}
from
'@angular/platform-browser'
;
import
{
NgModule
}
from
'@angular/core'
;
import
{
FormsModule
}
from
'@angular/forms'
;
import
{
HttpModule
}
from
'@angular/http'
;
import
{
BrowserModule
}
from
'@angular/platform-browser'
;
import
{
NgModule
}
from
'@angular/core'
;
import
{
FormsModule
}
from
'@angular/forms'
;
import
{
HttpModule
}
from
'@angular/http'
;
import
{
AppComponent
}
from
'./app.component'
;
import
{
ViplistComponent
}
from
'./viplist/viplist.component'
;
import
{
AppComponent
}
from
'./app.component'
;
import
{
ViplistComponent
}
from
'./viplist/viplist.component'
;
import
{
AlertModule
}
from
'ng2-bootstrap'
;
import
{
MoyaRestModule
}
from
'moya-angular-common'
;
import
{
RouterModule
,
Routes
}
from
'@angular/router'
;
import
{
OldMoyaComponent
}
from
'./old-moya/old-moya.component'
;
import
{
SafePipe
}
from
'./pipes/safe.pipe'
;
import
{
RouterModule
,
Routes
}
from
'@angular/router'
;
import
{
OldMoyaComponent
}
from
'./old-moya/old-moya.component'
;
import
{
SafePipe
}
from
'./pipes/safe.pipe'
;
import
{
TestComponent
}
from
'./test/test.component'
;
import
{
AdminMenuComponent
}
from
'./menu/admin-menu/admin-menu.component'
;
import
{
AdminMenuComponent
}
from
'./menu/admin-menu/admin-menu.component'
;
import
{
TopMenuComponent
}
from
'./menu/top-menu/top-menu.component'
;
import
{
LeftMenuComponent
}
from
'./menu/left-menu/left-menu.component'
;
import
{
InfoMenuComponent
}
from
'./menu/info-menu/info-menu.component'
;
import
{
UserMenuComponent
}
from
'./menu/user-menu/user-menu.component'
;
import
{
UserComponent
}
from
'./user/user.component'
;
import
{
InfoComponent
}
from
'./info/info.component'
;
import
{
AdminComponent
}
from
'./admin/admin.component'
;
import
{
I18nPipe
}
from
'./pipes/i18n.pipe'
;
import
{
InfoMenuComponent
}
from
'./menu/info-menu/info-menu.component'
;
import
{
UserMenuComponent
}
from
'./menu/user-menu/user-menu.component'
;
import
{
UserComponent
}
from
'./user/user.component'
;
import
{
InfoComponent
}
from
'./info/info.component'
;
import
{
AdminComponent
}
from
'./admin/admin.component'
;
import
{
I18nPipe
}
from
'./pipes/i18n.pipe'
;
const
appRoutes
:
Routes
=
[
{
path
:
'user'
,
{
path
:
'user'
,
children
:
[
{
path
:
''
,
component
:
UserMenuComponent
,
outlet
:
'left-menu'
},
{
path
:
''
,
pathMatch
:
'full'
,
component
:
UserComponent
},
{
path
:
'old'
,
component
:
OldMoyaComponent
},
{
path
:
''
,
component
:
UserMenuComponent
,
outlet
:
'left-menu'
},
{
path
:
''
,
pathMatch
:
'full'
,
component
:
UserComponent
},
{
path
:
'old'
,
component
:
OldMoyaComponent
},
]
},
{
path
:
'info'
,
{
path
:
'info'
,
children
:
[
{
path
:
''
,
component
:
InfoMenuComponent
,
outlet
:
'left-menu'
},
{
path
:
''
,
pathMatch
:
'full'
,
component
:
OldMoyaComponent
},
{
path
:
'old'
,
component
:
OldMoyaComponent
},
{
path
:
'viplist'
,
component
:
ViplistComponent
},
{
path
:
''
,
component
:
InfoMenuComponent
,
outlet
:
'left-menu'
},
{
path
:
''
,
pathMatch
:
'full'
,
component
:
OldMoyaComponent
},
{
path
:
'old'
,
component
:
OldMoyaComponent
},
{
path
:
'viplist'
,
component
:
ViplistComponent
},
]
},
{
path
:
'admin'
,
{
path
:
'admin'
,
children
:
[
{
path
:
''
,
component
:
AdminMenuComponent
,
outlet
:
'left-menu'
},
{
path
:
''
,
pathMatch
:
'full'
,
component
:
AdminComponent
},
{
path
:
'old'
,
component
:
OldMoyaComponent
},
{
path
:
''
,
component
:
AdminMenuComponent
,
outlet
:
'left-menu'
},
{
path
:
''
,
pathMatch
:
'full'
,
component
:
AdminComponent
},
{
path
:
'old'
,
component
:
OldMoyaComponent
},
]
},
{
path
:
'old'
,
pathMatch
:
'prefix'
,
component
:
OldMoyaComponent
},
{
path
:
'old'
,
pathMatch
:
'prefix'
,
component
:
OldMoyaComponent
},
];
@
NgModule
({
declarations
:
[
AppComponent
,
...
...
@@ -73,10 +75,11 @@ const appRoutes: Routes = [
FormsModule
,
HttpModule
,
AlertModule
.
forRoot
(),
MoyaRestModule
.
forRoot
()
,
MoyaRestModule
.
forRoot
(),
RouterModule
.
forRoot
(
appRoutes
)
],
providers
:
[],
bootstrap
:
[
AppComponent
]
})
export
class
AppModule
{
}
export
class
AppModule
{
}
code/moya-angular/src/app/menu/admin-menu/admin-menu.component.ts
View file @
3f479bc
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
}
from
'@angular/core'
;
import
{
MenuGroup
}
from
'../../models/menu-group.model'
;
import
{
MENU
}
from
'../defines/menu'
;
...
...
@@ -7,13 +7,7 @@ import {MENU} from '../defines/menu';
templateUrl
:
'./admin-menu.component.html'
,
styleUrls
:
[
'./admin-menu.component.scss'
]
})
export
class
AdminMenuComponent
implements
OnInit
{
menu
:
MenuGroup
[]
=
MENU
.
ADMIN
;
constructor
()
{
}
ngOnInit
()
{
}
export
class
AdminMenuComponent
{
menu
:
MenuGroup
[]
=
MENU
.
ADMIN
;
}
code/moya-angular/src/app/viplist/viplist.component.ts
View file @
3f479bc
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Observable
}
from
'rxjs'
;
import
{
ViplistService
,
Vip
}
from
'moya-angular-common'
;
...
...
@@ -11,7 +11,8 @@ export class ViplistComponent implements OnInit {
vips
:
Observable
<
Array
<
Vip
>>
;
constructor
(
private
viplistService
:
ViplistService
)
{
}
constructor
(
private
viplistService
:
ViplistService
)
{
}
ngOnInit
()
{
...
...
code/moya-beans/ejbModule/fi/codecrew/moya/beans/BootstrapBean.java
View file @
3f479bc
...
...
@@ -442,7 +442,7 @@ public class BootstrapBean implements BootstrapBeanLocal {
"ALTER TABLE account_events DROP COLUMN delivered_count;"
});
/*
dbUpdates.add(new String[] {
"ALTER TABLE menuitem ADD COLUMN angularpage BOOLEAN NOT NULL DEFAULT false;"
});
...
...
@@ -450,7 +450,7 @@ public class BootstrapBean implements BootstrapBeanLocal {
dbUpdates.add(new String[] {
"ALTER TABLE menuitem DROP COLUMN angularpage;"
});
});
*/
}
public
BootstrapBean
()
{
...
...
code/moya-beans/ejbModule/fi/codecrew/moya/beans/JaasBean.java
View file @
3f479bc
...
...
@@ -48,7 +48,6 @@ import fi.codecrew.moya.model.ApplicationPermission;
import
fi.codecrew.moya.model.EventUser
;
import
fi.codecrew.moya.model.LanEvent
;
import
fi.codecrew.moya.model.Role
;
import
sun.reflect.generics.reflectiveObjects.NotImplementedException
;
/**
* Session Bean implementation class SessionHandlerBean
...
...
code/moya-beans/ejbModule/fi/codecrew/moya/beans/MenuBean.java
View file @
3f479bc
...
...
@@ -140,9 +140,6 @@ public class MenuBean implements MenuBeanLocal {
MenuNavigation
helpmenu
=
usermenu
.
addPage
(
null
,
null
);
helpmenu
.
setKey
(
"topnavi.help"
);
helpmenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/help"
),
UserPermission
.
HELPPAGE
);
helpmenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/angular"
,
true
),
null
).
setVisible
(
false
);
MenuNavigation
userkauppa
=
usermenu
.
addPage
(
null
,
null
);
userkauppa
.
setKey
(
"topnavi.usershop"
);
...
...
code/moya-beans/ejbModule/fi/codecrew/moya/facade/MenuitemFacade.java
View file @
3f479bc
...
...
@@ -43,32 +43,7 @@ public class MenuitemFacade extends IntegerPkGenericFacade<Menuitem> {
public
Menuitem
findOrCreate
(
String
url
)
{
return
findOrCreate
(
url
,
false
);
}
public
Menuitem
findOrCreate
(
String
url
,
boolean
angularPage
)
{
if
(
url
==
null
||
url
.
isEmpty
())
{
return
null
;
}
try
{
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaQuery
<
Menuitem
>
cq
=
cb
.
createQuery
(
Menuitem
.
class
);
Root
<
Menuitem
>
root
=
cq
.
from
(
Menuitem
.
class
);
cq
.
where
(
cb
.
equal
(
root
.
get
(
Menuitem_
.
url
),
url
));
Menuitem
ret
=
super
.
getSingleNullableResult
(
getEm
()
.
createQuery
(
cq
));
if
(
ret
==
null
)
{
ret
=
new
Menuitem
();
ret
.
setUrl
(
url
);
ret
.
setAngularPage
(
angularPage
);
create
(
ret
);
}
return
ret
;
}
catch
(
Exception
e
)
{
logger
.
warn
(
"Exception menussa"
+
url
,
e
);
}
return
null
;
return
findOrCreate
(
url
);
}
}
code/moya-database/src/main/java/fi/codecrew/moya/model/Menuitem.java
View file @
3f479bc
...
...
@@ -38,9 +38,6 @@ public class Menuitem extends GenericEntity {
@Column
(
nullable
=
false
,
unique
=
true
)
private
String
url
;
@Column
(
nullable
=
false
,
name
=
"angularpage"
)
private
boolean
angularPage
=
false
;
@Lob
private
String
description
;
...
...
code/moya-web/src/main/java/fi/codecrew/moya/rest/v3/VipRestViewV3.java
View file @
3f479bc
...
...
@@ -7,7 +7,6 @@ import fi.codecrew.moya.beans.VipBeanLocal;
import
fi.codecrew.moya.model.EventUser
;
import
fi.codecrew.moya.model.Vip
;
import
fi.codecrew.moya.model.VipProduct
;
import
fi.codecrew.moya.rest.v2.pojo.VipProductPojo
;
import
fi.codecrew.moya.rest.v3.pojo.VipRestPojoV3
;
import
fi.codecrew.moya.utilities.SearchQuery
;
import
fi.codecrew.moya.utilities.SearchResult
;
...
...
@@ -102,7 +101,7 @@ public class VipRestViewV3 {
vip
.
setEventUser
(
eventuser
);
vip
.
setCreator
(
curruser
);
vip
.
setHost
(
host
);
/*
for (VipProductPojo p : create.products) {
VipProduct prod = new VipProduct(vip);
vip.getProducts().add(prod);
...
...
@@ -113,7 +112,7 @@ public class VipRestViewV3 {
}
prod.setQuantity(p.quantity);
prod.setNotes(p.notes);
}
}
*/
vipbean
.
create
(
vip
);
...
...
code/moya-web/src/main/java/fi/codecrew/moya/rest/v3/pojo/VipRestPojoV3.java
View file @
3f479bc
...
...
@@ -2,7 +2,7 @@ package fi.codecrew.moya.rest.v3.pojo;
import
fi.codecrew.moya.model.Vip
;
import
fi.codecrew.moya.model.VipProduct
;
import
fi.codecrew.moya.rest.
v2.pojo
.VipProductPojo
;
import
fi.codecrew.moya.rest.
pojo.vip.v2
.VipProductPojo
;
import
io.swagger.annotations.ApiModel
;
import
javax.xml.bind.annotation.XmlRootElement
;
...
...
@@ -51,9 +51,10 @@ public class VipRestPojoV3 {
if
(
v
.
getHost
()
!=
null
)
{
r
.
hostId
=
v
.
getHost
().
getUser
().
getId
();
}
/*
for (VipProduct prod : v.getProducts()) {
r.products.add(VipProductPojo.create(prod));
}
}
*/
return
r
;
}
}
code/pom.xml
View file @
3f479bc
...
...
@@ -47,8 +47,8 @@
<rewriteservlet.version>
3.4.1.Final
</rewriteservlet.version>
<iudex.standalone>
1.0.23
</iudex.standalone>
<js.node.version>
v
6.9.1
</js.node.version>
<js.npm.version>
4.1.2
</js.npm.version>
<js.node.version>
v
8.6.0
</js.node.version>
<js.npm.version>
5.6.0
</js.npm.version>
<eirslett.frontend.version>
1.4
</eirslett.frontend.version>
</properties>
...
...
@@ -92,11 +92,6 @@
<repositories>
<repository>
<id>
prime-repo
</id>
<name>
PrimeFaces Maven Repository
</name>
<url>
https://repository.primefaces.org
</url>
</repository>
<repository>
<id>
iudex
</id>
<url>
http://iudex.fi/maven/
</url>
</repository>
...
...
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