Merge pull request #118 from Quantum-P3/feature/dashboard

add page dashboard
This commit is contained in:
Eduardo Quiros 2021-08-10 03:01:37 +00:00 committed by GitHub
commit 3c58e9f4c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 142 additions and 0 deletions

View File

@ -0,0 +1 @@
<p>dashboard-admin works!</p>

View File

@ -0,0 +1,24 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { DashboardAdminComponent } from './dashboard-admin.component';
describe('DashboardAdminComponent', () => {
let component: DashboardAdminComponent;
let fixture: ComponentFixture<DashboardAdminComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [DashboardAdminComponent],
}).compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(DashboardAdminComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,12 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'jhi-dashboard-admin',
templateUrl: './dashboard-admin.component.html',
styleUrls: ['./dashboard-admin.component.scss'],
})
export class DashboardAdminComponent implements OnInit {
constructor() {}
ngOnInit(): void {}
}

View File

@ -0,0 +1 @@
<p>dashboard-user works!</p>

View File

@ -0,0 +1,24 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { DashboardUserComponent } from './dashboard-user.component';
describe('DashboardUserComponent', () => {
let component: DashboardUserComponent;
let fixture: ComponentFixture<DashboardUserComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [DashboardUserComponent],
}).compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(DashboardUserComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,12 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'jhi-dashboard-user',
templateUrl: './dashboard-user.component.html',
styleUrls: ['./dashboard-user.component.scss'],
})
export class DashboardUserComponent implements OnInit {
constructor() {}
ngOnInit(): void {}
}

View File

@ -0,0 +1,14 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { DashboardUserComponent } from './dashboard-user/dashboard-user.component';
import { DashboardAdminComponent } from './dashboard-admin/dashboard-admin.component';
import { SharedModule } from '../../shared/shared.module';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
import { DashboardRoutingModule } from './route/dashboard-routing.module';
@NgModule({
declarations: [DashboardUserComponent, DashboardAdminComponent],
imports: [CommonModule, SharedModule, DashboardRoutingModule, FontAwesomeModule],
})
export class DashboardModule {}

View File

@ -0,0 +1,25 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { DashboardUserComponent } from '../dashboard-user/dashboard-user.component';
import { DashboardAdminComponent } from '../dashboard-admin/dashboard-admin.component';
import { UserRouteAccessService } from '../../../core/auth/user-route-access.service';
const dashboardRoute: Routes = [
{
path: 'admin',
component: DashboardAdminComponent,
canActivate: [UserRouteAccessService],
},
{
path: 'user',
component: DashboardUserComponent,
canActivate: [UserRouteAccessService],
},
];
@NgModule({
imports: [RouterModule.forChild(dashboardRoute)],
exports: [RouterModule],
})
export class DashboardRoutingModule {}

View File

@ -82,6 +82,16 @@ import { RouterModule } from '@angular/router';
data: { pageTitle: 'dataSurveyApp.usuarioExtra.plantillas.title' },
loadChildren: () => import('./usuario-plantillas/usuario-plantillas.module').then(m => m.UsuarioPlantillasModule),
},
{
path: 'dashboard',
data: { pageTitle: 'dataSurveyApp.Dashboard.title' },
loadChildren: () => import('./dashboard/dashboard.module').then(m => m.DashboardModule),
},
{
path: 'dashboard',
data: { pageTitle: 'dataSurveyApp.Dashboard.title' },
loadChildren: () => import('./dashboard/dashboard.module').then(m => m.DashboardModule),
},
/* jhipster-needle-add-entity-route - JHipster will add entity modules routes here */
]),
],

View File

@ -24,6 +24,12 @@ export const ADMIN_ROUTES: RouteInfo[] = [
// },
{ path: '/pagina-principal', title: 'Inicio', type: 'link', icontype: 'nc-icon nc-world-2' },
{
path: '/dashboard/admin',
title: 'Dashboard',
type: 'link',
icontype: 'nc-icon nc-chart-bar-32',
},
{
path: '/encuesta',
title: 'Encuestas',
@ -58,6 +64,12 @@ export const ADMIN_ROUTES: RouteInfo[] = [
export const USER_ROUTES: RouteInfo[] = [
{ path: '/pagina-principal', title: 'Inicio', type: 'link', icontype: 'nc-icon nc-world-2' },
{
path: '/dashboard/user',
title: 'Dashboard',
type: 'link',
icontype: 'nc-icon nc-chart-bar-32',
},
{
path: '/encuesta',
title: 'Encuestas',

View File

@ -0,0 +1,7 @@
{
"dataSurveyApp": {
"Dashboard": {
"title": "Dashboard"
}
}
}