diff --git a/front/src/app/app.module.ts b/front/src/app/app.module.ts index 47ce997..fada27b 100644 --- a/front/src/app/app.module.ts +++ b/front/src/app/app.module.ts @@ -109,7 +109,7 @@ import { ElementSeriesComponent, ElementTrackComponent, ElementSeasonComponent, PopInComponent, PopInUploadProgress, PopInDeleteConfirm, - ], + ], bootstrap: [ AppComponent ], diff --git a/front/src/common/component/top-menu/top-menu.html b/front/src/common/component/top-menu/top-menu.html new file mode 100644 index 0000000..a046d04 --- /dev/null +++ b/front/src/common/component/top-menu/top-menu.html @@ -0,0 +1,47 @@ +
+ +
+ +
+
\ No newline at end of file diff --git a/front/src/common/component/top-menu/top-menu.less b/front/src/common/component/top-menu/top-menu.less new file mode 100644 index 0000000..9da7d0d --- /dev/null +++ b/front/src/common/component/top-menu/top-menu.less @@ -0,0 +1,176 @@ + + +.element-pos-left { + z-index: 5; + float: left; +} +.element-pos-right { + z-index: 5; + float: right; +} +.element-pos-center { + z-index: 5; + float: none; +} + +.top { + .sub-menu { + + position: fixed; + + min-width:150px; + min-height:70px; + + display: block; + overflow: visible; + + box-shadow: none; + flex-direction: column; + flex-wrap: nowrap; + justify-content: flex-start; + box-sizing: border-box; + flex-shrink: 0; + margin: 0; + padding: 0 3px 0 3px; + border: none; + z-index: 300; + box-shadow: 0px 2px 4px 0 rgba(0, 0, 0, 0.6); + + .item { + display:block; + float: top; + line-height: 56px; + z-index: 4; + margin: 3px 0px 3px 0px; + /*padding: 0px 3px 0px 3px;*/ + border: 0px; /*0px 3px 0px 3px solid transparent;*/ + /*text-transform: uppercase;*/ + font-weight: bold; + font-size: 17px; + width:100%; + } + + .material-icons { + vertical-align: middle; + } + /* Create an Arraw on the top ob the box ... */ + &:after, &:before { + bottom: 100%; + right: 13px; + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; + pointer-events: none; + } + + &:after { + border-color: rgba(136, 183, 213, 0); + border-bottom-color: #263238; + border-width: 15px; + margin-left: -15px; + } + + } + .menu-left { + top:75px; + left:15px; + } + .menu-right { + top:75px; + right:15px; + } + + .fill-all { + position: absolute; + top: 0; + left: 0; + width:100%; + height:100%; + /* + background-color: #0F0; + */ + z-index:400; + } + + .main-menu { + position: fixed; + top:0px; + left:0px; + + display: block; + overflow: visible; + + box-shadow: none; + min-height: 56px; + flex-direction: column; + flex-wrap: nowrap; + justify-content: flex-start; + box-sizing: border-box; + flex-shrink: 0; + width: 100%; + margin: 0; + padding: 0 12px 0 12px; + border: none; + max-height: 1000px; + z-index: 3; + box-shadow: 0px 2px 4px 0 rgba(0, 0, 0, 0.6); + + .item { + display:block; + float: left; + line-height: 56px; + z-index: 4; + margin: 0 3px 0 3px; + border: 0; + text-transform: uppercase; + font-weight: bold; + font-size: 17px; + .comment { + visibility: "hidden"; + } + @media all and (min-width: 700px) { + .comment { + visibility: "visible"; + } + } + + } + + .ariane { + display:block; + float: left; + line-height: 56px; + z-index: 4; + padding: 0 0 0 15px; + margin: 0 3px 0 3px; + border: 0; + text-transform: uppercase; + font-weight: bold; + font-size: 15px; + .item_ariane_separator { + display:block; + float: left; + line-height: 56px; + z-index: 4; + margin: 0 3px 0 3px; + border: 0; + text-transform: uppercase; + font-weight: bold; + font-size: 30px; + } + } + + .material-icons { + vertical-align: middle; + } + + .avatar { + height:42px; + width:42px; + border-radius: 50%; + vertical-align: middle; + } + } +} diff --git a/front/src/common/component/top-menu/top-menu.ts b/front/src/common/component/top-menu/top-menu.ts new file mode 100644 index 0000000..e0519ca --- /dev/null +++ b/front/src/common/component/top-menu/top-menu.ts @@ -0,0 +1,67 @@ +/** @file + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @license PROPRIETARY (see license file) + */ +import { Component, OnInit, Input } from '@angular/core'; + +import { Router } from '@angular/router'; +import { isNullOrUndefined } from '../../utils'; +import { MenuItem } from '../../model/menu-item'; + + +@Component({ + selector: 'app-top-menu', + templateUrl: './top-menu.html', + styleUrls: [ './top-menu.less' ] +}) +export class TopMenuComponent implements OnInit { + @Input() menu: MenuItem[]; + subMenu: MenuItem[] = null; + + constructor(private router: Router) { + + } + + getPosition(data: string) : string { + return `float: ${data}`; + } + + ngOnInit() { + + } + onOutUserProperty(): void { + console.log('onOutUserProperty ==> event...'); + this.subMenu = undefined; + } + + + onGeneric(data: MenuItem, event: any): void { + console.log(`onGeneric()`); + // check if we need to navigate + if (!isNullOrUndefined(data.navigateTo)) { + // remove in every case the subMenu: + console.log("Navigate request !!!"); + this.subMenu = undefined + this.router.navigate([ data.navigateTo ]); + return; + } + // check if we need to display a submenu + if (isNullOrUndefined(data.subMenu)) { + console.log("No menu !!!"); + //just a toggle mode: + data.subMenu = undefined; + return; + } + if (this.subMenu === data.subMenu) { + console.log("Toggle menu"); + //just a toggle mode: + this.subMenu = undefined; + return; + } + console.log(`Set Menu: ${JSON.stringify(data.subMenu)}`); + // set the requested menu + this.subMenu = data.subMenu; + } + +} diff --git a/front/src/common/model/menu-item.ts b/front/src/common/model/menu-item.ts new file mode 100644 index 0000000..ca5354d --- /dev/null +++ b/front/src/common/model/menu-item.ts @@ -0,0 +1,58 @@ +import { isNumberFinite, isObject, isOptionalOf, isString, isNullOrUndefined, isOptionalArrayOf } from "../utils"; + +export enum MenuPosition { + LEFT = "left", + RIGHT = "right", + CENTER = "none", +} + +export function isMenuPosition(data: any): data is MenuPosition { + return data === "left" + || data === "right" + || data === "none"; + +} + +export interface MenuItem { + // Position of the menue element + position: MenuPosition; + // Hover help + hover?: string; + // Icon of the menue (need to be a meterial-icon name + icon?: string; + // Displayed Title + title: string; + // Jump Link (If undefined: it is considered as text and not a button) + navigateTo?: string; + // Menu model For a subList of elements + subMenu?: MenuItem[]; +}; + + +export function isMenuItem(data: any): data is MenuItem { + if (isNullOrUndefined(data)) { + return false; + } + if (!isObject(data)) { + return false; + } + if (!isMenuPosition(data.position)) { + return false; + } + if (!isOptionalOf(data.hover, isString)) { + return false; + } + if (!isOptionalOf(data.icon, isString)) { + return false; + } + if (!isString(data.title)) { + return false; + } + if (!isOptionalOf(data.navigateTo, isString)) { + return false; + } + if (!isOptionalArrayOf(data.subMenu, isMenuItem)) { + return false; + } + return true; +} \ No newline at end of file diff --git a/front/src/common/scene/forbidden/forbidden.html b/front/src/common/scene/forbidden/forbidden.html new file mode 100644 index 0000000..eb22c03 --- /dev/null +++ b/front/src/common/scene/forbidden/forbidden.html @@ -0,0 +1,6 @@ +
+
+
+
+
+
\ No newline at end of file diff --git a/front/src/common/scene/forbidden/forbidden.less b/front/src/common/scene/forbidden/forbidden.less new file mode 100644 index 0000000..9a6a44f --- /dev/null +++ b/front/src/common/scene/forbidden/forbidden.less @@ -0,0 +1,51 @@ + +.full-mode{ + width:100%; + height:100%; + top:0; + left:0; + margin:0; + padding:0; + border:0; + float:left; + display:block; +} + +.centered { + position:relative; + max-width:500px; + padding: 16px 32px 16px 32px; + + top: 50%; + left: 50%; + transform: ~"translate(-50%, -50%)"; + font-size: 30px; + + font-weight: 600; + text-align: left; + line-height: 200%; +} + +.error { + font-size: 55px; + background-size: 45px; + /*background-attachment: fixed;*/ + background-position: 0% 50%; + padding: 0 0 0 58px; + margin: 17px 0 17px 0; + text-shadow:0px 0px 4px #000000; + color: rgb(160, 44, 44); + i { + font-size: 55px; + } +} + +.comment { + background-size: 45px; + /*background-attachment: fixed;*/ + background-position: 0% 50%; + padding: 0 0 0 58px; + margin: 17px 0 17px 0; + text-shadow:0px 0px 4px #07213a; + color: white; +} diff --git a/front/src/common/scene/forbidden/forbidden.ts b/front/src/common/scene/forbidden/forbidden.ts new file mode 100644 index 0000000..67b3b57 --- /dev/null +++ b/front/src/common/scene/forbidden/forbidden.ts @@ -0,0 +1,16 @@ +/** @file + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @license PROPRIETARY (see license file) + */ + +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-forbidden', + templateUrl: './forbidden.html', + styleUrls: [ './forbidden.less' ] +}) +export class ForbiddenScene { + constructor() { } +} diff --git a/front/src/common/service/local-storage.ts b/front/src/common/service/local-storage.ts index 45eb232..4b0a2b2 100644 --- a/front/src/common/service/local-storage.ts +++ b/front/src/common/service/local-storage.ts @@ -16,7 +16,7 @@ import { environment } from 'environments/environment'; } set(cname: string, cvalue: string): void { - console.error(`storage set: ${cname} : ${cvalue}`); + //console.debug(`storage set: ${cname} : ${cvalue}`); localStorage.setItem(this.baseLocalStorageName + cname, cvalue); } // limit at the current session ... @@ -25,7 +25,7 @@ import { environment } from 'environments/environment'; } remove(cname: string) : void { - console.error(`storage remove: ${cname}`); + //console.debug(`storage remove: ${cname}`); localStorage.removeItem(this.baseLocalStorageName + cname); } removeSession(cname: string) : void { @@ -33,10 +33,10 @@ import { environment } from 'environments/environment'; } get(cname: string) : string | undefined { - console.error(`storage get: ${cname}`); + //console.debug(`storage get: ${cname}`); // TODO check expire day... const data = localStorage.getItem(this.baseLocalStorageName + cname); - console.log(`get value form the storage (1): ${data}`) + //console.debug(`get value form the storage (1): ${data}`) if (data === null || data === undefined) { return undefined; } @@ -51,4 +51,4 @@ import { environment } from 'environments/environment'; } } - \ No newline at end of file + diff --git a/front/src/environments/environment.prod.ts b/front/src/environments/environment.prod.ts index e14bcce..bcb557a 100644 --- a/front/src/environments/environment.prod.ts +++ b/front/src/environments/environment.prod.ts @@ -9,12 +9,12 @@ export const environment = { applName: "karusic", defaultServer: "karusic", server: { - karusic: 'http://192.168.1.156/karusic/api', - karauth: 'http://192.168.1.156/karauth/api', + karusic: `${location.origin}/karusic/api`, + karauth: `${location.origin}/karauth/api`, }, - ssoSignIn: 'http://192.168.1.156/karso/signin/karusic/', - ssoSignUp: 'http://192.168.1.156/karso/signup/karusic/', - ssoSignOut: 'http://192.168.1.156/karso/signout/karusic/', + ssoSignIn: `${location.origin}/karso/signin/karusic/`, + ssoSignUp: `${location.origin}/karso/signup/karusic/`, + ssoSignOut: `${location.origin}/karso/signout/karusic/`, frontBaseUrl: '', apiMode: 'REWRITE' }; \ No newline at end of file diff --git a/front/src/environments/environment.ts b/front/src/environments/environment.ts index cbfde23..356de3d 100644 --- a/front/src/environments/environment.ts +++ b/front/src/environments/environment.ts @@ -35,6 +35,22 @@ export const environment_local = { apiMode: 'REWRITE' }; +export const environment_full_local = { + production: false, + // URL of development API + applName: "karusic", + defaultServer: "karusic", + server: { + karusic: 'http://localhost:19080/karusic/api', + karauth: 'http://localhost:15080/karauth/api', + }, + ssoSignIn: 'http://localhost:4200/signin/karusic-dev/', + ssoSignUp: 'http://localhost:4200/signup/karusic-dev/', + ssoSignOut: 'http://localhost:4200/signout/karusic-dev/', + frontBaseUrl: '', + apiMode: 'REWRITE' +}; + export const environment_hybrid = { production: false, // URL of development API @@ -50,5 +66,5 @@ export const environment_hybrid = { frontBaseUrl: '', apiMode: 'REWRITE' }; -export const environment = environment_back_prod; +export const environment = environment_full_local; diff --git a/front/src/typings.d.ts b/front/src/typings.d.ts deleted file mode 100644 index d3a1a83..0000000 --- a/front/src/typings.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* SystemJS module definition */ -interface NodeModule { - id: string; -} - - -declare let module: NodeModule;