Commit c9622107 by Tuukka Kivilahti

some untested changes, to give onja some code

1 parent ad375ccd
......@@ -31,6 +31,7 @@
npm-debug.log
testem.log
/typings
package-lock.json
# e2e
/e2e/*.js
......
......@@ -13,9 +13,9 @@ ng-palvelimessa on bugi, ja se ei osaa jakaa tavaraa muusta hakemistosta kuin /.
moyaproxy.conf.json sisältää proxyasetukset porttiin 8080.
Käyttö:
`ng serve --proxy-config=moyaproxy.conf.json --base-href=/`
`ng serve --preserve-symlinks --proxy-config=moyaproxy.conf.json --base-href=/`
Tämän jälkeen kirjaa selaimesi sisään moyaan: http://localhost:4200/MoyaWeb/ ja surffata softaan: http://localhost:4200/MoyaNG/
Tämän jälkeen kirjaa selaimesi sisään moyaan: http://localhost:4200/MoyaWeb/ ja surffata softaan: http://localhost:4200/
### HMR
......
......@@ -13,47 +13,45 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^4.1.2",
"@angular/common": "^4.1.2",
"@angular/compiler": "^4.1.2",
"@angular/compiler-cli": "^4.1.2",
"@angular/core": "^4.1.2",
"@angular/forms": "^4.1.2",
"@angular/http": "^4.1.2",
"@angular/material": "^2.0.0-beta.1",
"@angular/platform-browser": "^4.1.2",
"@angular/platform-browser-dynamic": "^4.1.2",
"@angular/platform-server": "^4.1.2",
"@angular/router": "^4.1.2",
"bootstrap": "^4.0.0-alpha.6",
"core-js": "^2.4.1",
"@angular/animations": "^4.4.4",
"@angular/common": "^4.4.4",
"@angular/compiler": "^4.4.4",
"@angular/core": "^4.4.4",
"@angular/forms": "^4.4.4",
"@angular/http": "^4.4.4",
"@angular/material": "^2.0.0-beta.12",
"@angular/platform-browser": "^4.4.4",
"@angular/platform-browser-dynamic": "^4.4.4",
"@angular/platform-server": "^4.4.4",
"@angular/router": "^4.4.4",
"bootstrap": "^4.0.0-beta",
"core-js": "^2.5.1",
"moya-angular-common": "file:../moya-angular-common/src",
"ng2-bootstrap": "^1.3.3",
"node-sass": "^4.5.0",
"rxjs": "^5.0.1",
"rxjs": "^5.4.3",
"ts-helpers": "^1.1.1",
"zone.js": "^0.8.10"
"zone.js": "^0.8.18"
},
"devDependencies": {
"@angular/cli": "^1.1.0-beta.1",
"@angular/compiler-cli": "^4.1.2",
"@angular/cli": "^1.4.5",
"@angular/compiler-cli": "^4.4.4",
"@angularclass/hmr": "^1.2.2",
"@types/jasmine": "2.5.47",
"@types/node": "^7.0.18",
"@types/node": "^7.0.43",
"codelyzer": "~3.0.1",
"jasmine-core": "2.6.1",
"jasmine-spec-reporter": "4.1.0",
"karma": "1.7.0",
"karma-chrome-launcher": "^2.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.6.0",
"node-sass": "^4.5.0",
"protractor": "~5.1.1",
"node-sass": "^4.5.3",
"protractor": "^5.1.2",
"raw-loader": "^0.5.1",
"sass-loader": "^6.0.5",
"sass-loader": "^6.0.6",
"ts-node": "3.0.4",
"tslint": "^5.2.0",
"typescript": "~2.3.2"
"tslint": "^5.7.0",
"typescript": "^2.5.3"
}
}
......@@ -8,6 +8,7 @@
<div id="contentarea">
<div id="topbar">
<top-menu></top-menu>
<h1>{{"Testing"|i18n}}</h1>
</div>
<div id="content">
<router-outlet></router-outlet>
......
......@@ -11,7 +11,6 @@ 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 { I18nDirective } from './directives/i18n.directive';
import {TestComponent} from './test/test.component';
import { AdminMenuComponent } from './menu/admin-menu/admin-menu.component';
import {TopMenuComponent} from './menu/top-menu/top-menu.component';
......@@ -21,6 +20,7 @@ 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',
......@@ -57,7 +57,6 @@ const appRoutes: Routes = [
ViplistComponent,
OldMoyaComponent,
SafePipe,
I18nDirective,
TestComponent,
TopMenuComponent,
LeftMenuComponent,
......@@ -66,7 +65,8 @@ const appRoutes: Routes = [
UserMenuComponent,
UserComponent,
InfoComponent,
AdminComponent
AdminComponent,
I18nPipe
],
imports: [
BrowserModule,
......
import {Directive, ElementRef, TemplateRef, ViewContainerRef} from '@angular/core';
@Directive({
selector: '[i18n]'
})
export class I18nDirective {
constructor(
private viewContainer: ViewContainerRef) {
console.log(this.viewContainer);
// console.log(el.nativeElement.style.background);
}
}
......@@ -25,15 +25,51 @@ export class MENU {
static USER: MenuGroup[] = [
{
'name': 'Event',
'items': [
{ 'path': '/user/old', 'name': 'Poll', 'params': {p: 'poll/index.jsf'} },
{ 'path': '/user/old', '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'} },
]},
{
'name': 'Computerplaces',
'items': [
{ 'path': '/user/old', 'name': 'Own Places', 'params': {p: 'place/myGroups.jsf'} },
{ 'path': '/user/old', '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'} },
]},
{
'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'} },
]},
{
'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'} },
]},
{
'name': 'POLL',
'name': 'Lectures and Courses',
'items': [
{ 'path': '/user/old', 'name': 'Jotain', 'params': {p: 'poll/index.jsf'} },
{ 'path': '/user/old', 'name': 'Participate', 'params': {p: 'lectures/viewLectures.jsf'} },
]},
];
......
import { Pipe, PipeTransform } from '@angular/core'
@Pipe({
name: 'i18n'
})
export class I18nPipe implements PipeTransform {
i18n = require('../../i18n/i18n.json')
transform(value: any, args?: any): any {
return this.i18n[value];
}
}
{
"Testing": "ja sana",
"tosting": "asdfa asdf a"
}
......@@ -443,10 +443,15 @@ public class BootstrapBean implements BootstrapBeanLocal {
"ALTER TABLE product_dependencies ADD CONSTRAINT FK_product_dependencies_supporter_id FOREIGN KEY (supporter_id) REFERENCES products (id)",
});
dbUpdates.add(new String[] {
"ALTER TABLE menuitem ADD COLUMN angularpage BOOLEAN NOT NULL DEFAULT false;"
});
dbUpdates.add(new String[] {
"ALTER TABLE menuitem DROP COLUMN angularpage;"
});
}
public BootstrapBean() {
......
......@@ -71,12 +71,4 @@ public class Menuitem extends GenericEntity {
public void setNavigations(List<MenuNavigation> navigations) {
this.navigations = navigations;
}
public boolean isAngularPage() {
return angularPage;
}
public void setAngularPage(boolean angularPage) {
this.angularPage = angularPage;
}
}
......@@ -288,12 +288,8 @@ public class PrimeMenuView extends GenericCDIView {
item.setValue(key);
if(m.getItem().isAngularPage()) {
// item.setHref(outcome);
item.setOnclick("angularMenuNavigation('" + outcome +"');");
} else {
item.setOutcome(outcome);
}
item.setOutcome(outcome);
}
return item;
}
......
......@@ -101,10 +101,6 @@ public class LayoutView implements Serializable {
selectedSet = new HashSet<>();
selectedTop = menubean.findNavigation(getPagepath());
if(selectedTop != null && selectedTop.getItem().isAngularPage() && angularPageName.getPagename() != null) {
selectedTop = menubean.findNavigation(angularPageName.getPagename());
}
if (selectedTop == null)
return null;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!