diff --git a/src/app/model/enumeration/menu-type.model.ts b/src/app/model/enumeration/menu-type.model.ts index 08ad953ec02da0fb9bb41227a6413a639d489984..92a2b79ee4415f8623c5fab112362fc248809ec4 100644 --- a/src/app/model/enumeration/menu-type.model.ts +++ b/src/app/model/enumeration/menu-type.model.ts @@ -1,6 +1,7 @@ export enum MenuType { SHARED = 'SHARED', PERSONAL = 'PERSONAL', + PUBLIC = 'PUBLIC' } export namespace MenuType { diff --git a/src/app/pages/dashboard-management/dashboard-page/dashboard-page.component.html b/src/app/pages/dashboard-management/dashboard-page/dashboard-page.component.html index a876c8e90efdc4c10d81fcdc601527553beb14e2..3b54444686bbb1a271753a4c6b74e0c91e12800e 100644 --- a/src/app/pages/dashboard-management/dashboard-page/dashboard-page.component.html +++ b/src/app/pages/dashboard-management/dashboard-page/dashboard-page.component.html @@ -3,68 +3,71 @@ <h4>{{'general.manage'|translate}} {{'general.dashboard'|translate}}</h4> </nb-card-header> - <nb-card-body [formGroup]="page" > - - <div class="row"> - <nb-form-field class="col-6 mb-1 mt-1"> - <div class="d-flex flex-column"> - <label for="name" class="label mr-2"> - {{'dashboardPage.name'|translate}} * - </label> - <input type="text" nbInput fullWidth fieldSize="small" placeholder="{{'dashboardPage.name'|translate}}" - name="name" formControlName="name" nbTooltip="{{'general.mandatory_field'|translate}}"> - </div> - </nb-form-field> - - <nb-form-field class="col-6 mb-1 mt-1"> - <div class="d-flex flex-column"> - <label for="shared" class="label mr-2"> - <nb-icon icon="info-outline" nbTooltip="{{'dashboardPage.shared_info'|translate}}" ></nb-icon> - {{'dashboardPage.shared'|translate}} {{disabledTarget?'':'*'}} - </label> - - <nb-select fullWidth formControlName="shared" size="small" name="shared" - placeholder="{{'dashboardPage.shared'|translate}}" - [nbTooltip]="getMessageDisabledTarget()"> - <nb-option *ngFor="let item of sharedDomain" [value]="item"> - {{item}} - </nb-option> - </nb-select> + <nb-stepper orientation="horizontal"> + <nb-step> + <nb-card-body [formGroup]="page" > + <div class="row"> + <nb-form-field class="col-6 mb-1 mt-1"> + <div class="d-flex flex-column"> + <label for="name" class="label mr-2"> + {{'dashboardPage.name'|translate}} * + </label> + <input type="text" nbInput fullWidth fieldSize="small" placeholder="{{'dashboardPage.name'|translate}}" + name="name" formControlName="name" nbTooltip="{{'general.mandatory_field'|translate}}"> + </div> + </nb-form-field> - <!-- toggle --> - <!-- - <nb-card-body class="example-items-col"> - <nb-toggle [nbTooltip]="getMessageDisabledTarget()" formControlName="shared">{{'dashboardPage.shared'|translate}}</nb-toggle> - </nb-card-body> - --> - + <!-- <nb-form-field class="col-6 mb-1 mt-1"> + <div class="d-flex flex-column"> + <label for="shared" class="label mr-2"> + <nb-icon icon="info-outline" nbTooltip="{{'dashboardPage.shared_info'|translate}}" ></nb-icon> + {{'dashboardPage.shared'|translate}} {{disabledTarget?'':'*'}} + </label> + + <nb-select fullWidth formControlName="shared" size="small" name="shared" + placeholder="{{'dashboardPage.shared'|translate}}" + [nbTooltip]="getMessageDisabledTarget()"> + <nb-option *ngFor="let item of sharedDomain" [value]="item"> + {{item}} + </nb-option> + </nb-select> + </div> + </nb-form-field> --> + + + <nb-form-field class="col-12 mb-1 mt-1"> + <div class="d-flex flex-column"> + <label for="description" class="label mr-2"> + {{'dashboardPage.description'|translate}} + </label> + <input type="text" nbInput fullWidth fieldSize="small" placeholder="{{'dashboardPage.description'|translate}}" + description="name" formControlName="description"> + </div> + </nb-form-field> </div> - </nb-form-field> - - - <nb-form-field class="col-12 mb-1 mt-1"> - <div class="d-flex flex-column"> - <label for="description" class="label mr-2"> - {{'dashboardPage.description'|translate}} - </label> - <input type="text" nbInput fullWidth fieldSize="small" placeholder="{{'dashboardPage.description'|translate}}" - description="name" formControlName="description"> + + <div class="row"> + <nb-form-field class="col-12 mb-1 mt-1"> + <div class="d-flex flex-column"> + <label for="note" class="label mr-2"> + {{'dashboardPage.note'|translate}} + </label> + <textarea nbInput fullWidth rows="3" type="text" fieldSize="small" placeholder="{{'dashboardPage.note'|translate}}" + name="note" formControlName="note"></textarea> + </div> + </nb-form-field> </div> - </nb-form-field> - </div> + </nb-card-body> + </nb-step> + <nb-step> + <ngx-menu-filter [pageId]="pageId" [pageName]="pageName" (sendFilter)="updateSharedPersonalTypology($event)" ></ngx-menu-filter> + </nb-step> + <nb-step> + <ngx-target-filter [pageId]="pageId" [disabledTarget]="disabledTarget"></ngx-target-filter> + </nb-step> + </nb-stepper> - <div class="row"> - <nb-form-field class="col-12 mb-1 mt-1"> - <div class="d-flex flex-column"> - <label for="note" class="label mr-2"> - {{'dashboardPage.note'|translate}} - </label> - <textarea nbInput fullWidth rows="3" type="text" fieldSize="small" placeholder="{{'dashboardPage.note'|translate}}" - name="note" formControlName="note"></textarea> - </div> - </nb-form-field> - </div> - </nb-card-body> + <nb-card-footer class="d-flex justify-content-between"> <button nbButton status="primary" (click)="backClicked()" size="small"> @@ -78,6 +81,4 @@ </nb-card> -<ngx-menu-filter [pageId]="pageId" [pageName]="pageName" (sendFilter)="updateSharedPersonalTypology($event)" ></ngx-menu-filter> -<ngx-target-filter [pageId]="pageId" [disabledTarget]="disabledTarget"></ngx-target-filter> diff --git a/src/app/pages/dashboard-management/services/form-manager.service.ts b/src/app/pages/dashboard-management/services/form-manager.service.ts index 7fafacdf2d5a348db580650b94366f9b6b2dcc04..d084009641e1ca5a6828acf9bee8c6df180cb042 100644 --- a/src/app/pages/dashboard-management/services/form-manager.service.ts +++ b/src/app/pages/dashboard-management/services/form-manager.service.ts @@ -19,7 +19,7 @@ export class FormManagerService { name: new FormControl(page.name || null, Validators.required), description: new FormControl(page.description || null), note: new FormControl(page.note || null), - shared: new FormControl(page.shared || null, Validators.required), + shared: new FormControl(page.shared || false, Validators.required), content: new FormControl(page.content || null), }; diff --git a/src/app/pages/dashboard-management/services/menu-mapper.service.ts b/src/app/pages/dashboard-management/services/menu-mapper.service.ts index 23330d72ecfb0c7d574567ebc10dc172e92e7378..912324282fcefa56f4863cbb0e415072e0911f59 100644 --- a/src/app/pages/dashboard-management/services/menu-mapper.service.ts +++ b/src/app/pages/dashboard-management/services/menu-mapper.service.ts @@ -52,13 +52,16 @@ export class MenuMapperService { nbMenuItem.title = menuBlock.label; } if (menuBlock.type !== undefined && menuBlock.type !== null) { - nbMenuItem.icon = menuBlock.type == MenuType.SHARED ? 'globe-outline' : 'lock-outline'; + nbMenuItem.icon == 'globe-outline' + if(menuBlock.type != MenuType.PUBLIC){ + nbMenuItem.icon = menuBlock.type == MenuType.SHARED ? 'share-outline' : 'lock-outline'; + } } //console.log('Check not undef: ', menuBlock.linkedItems !== undefined, 'Check not null: ', menuBlock.linkedItems !== null); //console.log('Menu items: ', menuBlock.linkedItems); if (menuBlock.linkedItems !== undefined || menuBlock.linkedItems !== null) { - // console.log('### menuBlock.linkedItems ===> ', menuBlock.linkedItems); + console.log('### menuBlock.linkedItems ===> ', menuBlock.linkedItems); nbMenuItem.children = menuBlock.linkedItems.map(item => this.mapItemToNbMenuItem(item)); // TODO: finish } return nbMenuItem; diff --git a/src/app/pages/pages-menu.ts b/src/app/pages/pages-menu.ts index a8e1e4edbb96680fa9274d372c97d9b84f5a55a0..77259263e0da8bac45a00ad5a78d960f5f9c3d62 100644 --- a/src/app/pages/pages-menu.ts +++ b/src/app/pages/pages-menu.ts @@ -36,32 +36,6 @@ export const MENU_ITEMS: NbMenuItem[] = [ name: 'idm-administration' } }, - { - title: 'Manage Dashboard Pages', - link: '/pages/dashboard-management/manage-dashboard-pages', - data: { - name: 'dashboard-manage' - } - }, - { - title: 'Manage Menu Blocks', - link: '/pages/dashboard-management/manage-menu-blocks', - data: { - name: 'dashboard-menu-blocks' - } - }, - { - title: 'Clone Dashboard', - link: '/pages/dashboard-management/dashboard-clone-wizard', - data: { - name: 'dashboard-clone' - } - } - /*, - { - title: 'Manage Dashboard Target', - link: '/pages/dashboard-management/manage-dashboard-target', - }*/ ], data: { name: 'administration' @@ -169,6 +143,41 @@ export const MENU_ITEMS: NbMenuItem[] = [ } ], }, + { + title: 'Dashboard Section', + icon: 'settings-2-outline', + children: [ + { + title: 'Manage Dashboard Pages', + link: '/pages/dashboard-management/manage-dashboard-pages', + data: { + name: 'dashboard-manage' + } + }, + // { + // title: 'Manage Menu Blocks', + // link: '/pages/dashboard-management/manage-menu-blocks', + // data: { + // name: 'dashboard-menu-blocks' + // } + // }, + { + title: 'Clone Dashboard', + link: '/pages/dashboard-management/dashboard-clone-wizard', + data: { + name: 'dashboard-clone' + } + } + /*, + { + title: 'Manage Dashboard Target', + link: '/pages/dashboard-management/manage-dashboard-target', + }*/ + ], + data: { + name: 'dashboard-management' + } + }, { title: 'Data Catalogue', icon: 'search-outline', @@ -219,73 +228,6 @@ export const MENU_ITEMS: NbMenuItem[] = [ }, ], }, - // { - // title: 'Maps', - // icon: 'map-outline', - // data:{ - // name:"maps", - // isDemo:true, - // pilot:"URBANITE" - // }, - // children: [ - // { - // title: 'Amsterdam Tram Maps', - // link: '/pages/maps/leaflet', - // }, - // { - // title: 'Amsterdam Tram Compare', - // link: '/pages/maps/single-map', - // } - // ], - // }, - // { - // title: 'Charts', - // icon: 'pie-chart-outline', - // data:{ - // name:"charts", - // isDemo:true, - // pilot:"URBANITE" - // }, - // children: [ - // { - // title: 'Echarts', - // link: '/pages/charts/echarts', - // }, - // { - // title: 'Charts.js', - // link: '/pages/charts/chartjs', - // }, - // { - // title: 'D3', - // link: '/pages/charts/d3', - // }, - // ], - // }, - // { - // title: 'UI Features', - // icon: 'keypad-outline', - // link: '/pages/ui-features', - // data:{ - // name:"ui-features", - // isDemo:true, - // pilot:"URBANITE" - // }, - // children: [ - // { - // title: 'Grid', - // link: '/pages/ui-features/grid', - // }, - // { - // title: 'Icons', - // link: '/pages/ui-features/icons', - // }, - // { - // title: 'Typography', - // link: '/pages/ui-features/typography', - // } - // ], - // }, - { title: 'Urbanite Project', icon: 'info-outline', @@ -299,5 +241,28 @@ export const MENU_ITEMS: NbMenuItem[] = [ // } // ], }, - + // { + // title: 'Private Dashboards', + // icon: 'lock-outline', + // link: '/pages/about/info', + // data: { + // name: "about" + // }, + // }, + // { + // title: 'Shared Dashboards', + // icon: 'share-outline', + // link: '/pages/about/info', + // data: { + // name: "about" + // }, + // }, + // { + // title: 'Public Dashboards', + // icon: 'globe-outline', + // link: '/pages/about/info', + // data: { + // name: "about" + // }, + // }, ]; diff --git a/src/assets/config.json b/src/assets/config.json index a3f0cb81e19c5f7bf981eb0716b69347c39bb847..07af5a9671c387f3416b4f7253263700192cedb0 100644 --- a/src/assets/config.json +++ b/src/assets/config.json @@ -1,9 +1,9 @@ { "defaultLanguage":"en", "dashboardBaseURL":"http://localhost:4200", - "enableAuthentication":false, + "enableAuthentication":true, "authProfile": "oidc", - "idmBaseURL":"http://localhost:8080", + "idmBaseURL":"https://messina.urbanite.esilab.org", "idmRealmName":"urbanite", "client_id":"urbanite", "client_secret": "", @@ -31,7 +31,7 @@ ], "enable_demo_pages":true, "pilots":["URBANITE","AMSTERDAM","BILBAO","HELSINKI","MESSINA"], - "default_pilot":"AMSTERDAM", + "default_pilot":"MESSINA", "amsterdam":{ "api_base_url":"https://urbanite-node1.comune.messina.it", "token":"mcOUnnIyupQJzbitPX7Q2MnyqrVQUkmo" diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 07e3a146326c238acbd9c14db5abbf94d2b36eb5..aea051cdd4aa2854b80bd1a6069dbbc403983635 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -153,6 +153,7 @@ "menuBlock": { "list": "Menu Blocks", "title": "Menu Block", + "search" : "Search", "created": "Menu Block has been succesfully created", "updated": "Menu Block has been succesfully updated", "deleted": "Menu Block has been succesfully deleted",