Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NAE-2033] Welcome dashboard #263

Merged
merged 7 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions nae.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,17 @@
"path": "drawer"
}
},
"demo-dashboard": {
"component": {
"class": "NavigationDashboardExampleComponent",
"from": "./doc/navigation-dashboard-example/navigation-dashboard-example.component"
},
"access": "private",
"navigation": true,
"routing": {
"path": "dashboard"
}
},
"demo-double-drawer": {
"component": {
"class": "DoubleDrawerExampleComponent",
Expand Down Expand Up @@ -1302,6 +1313,9 @@
},
"groupNavigation": {
"groupNavigationRoute": "group-nav"
},
"doubleDrawer": {
"url": "drawer-double"
}
}
}
12 changes: 10 additions & 2 deletions projects/nae-example-app/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ import {
} from './doc/single-tabbed-view/single-tabbed-task-view/single-tabbed-task-view.component';
import {ImpersonationDemoComponent} from './doc/impersonation-demo/impersonation-demo.component';
import { ChangePasswordComponent } from './doc/forms/change-password/change-password.component';
import { NavigationDashboardExampleComponent } from './doc/navigation-dashboard-example/navigation-dashboard-example.component';
import { LayoutModule } from '@angular/cdk/layout';
import { MatToolbarModule } from '@angular/material/toolbar';
import { MatListModule } from '@angular/material/list';

export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http);
Expand Down Expand Up @@ -189,7 +193,8 @@ export function HttpLoaderFactory(http: HttpClient) {
SingleTabbedCaseViewComponent,
SingleTabbedTaskViewComponent,
BreadcrumbsExampleComponent,
ChangePasswordComponent
ChangePasswordComponent,
NavigationDashboardExampleComponent
],
imports: [
BrowserModule,
Expand Down Expand Up @@ -242,7 +247,10 @@ export function HttpLoaderFactory(http: HttpClient) {
RedirectComponentModule,
FilterFieldContentModule,
DialogComponentsModule,
FrontActionModule
FrontActionModule,
LayoutModule,
MatToolbarModule,
MatListModule
],
providers: [{
provide: ConfigurationService,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<nc-dashboard></nc-dashboard>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.sidenav-container {
height: 100%;
}

.sidenav {
width: 200px;
}

.sidenav .mat-toolbar {
background: inherit;
}

.mat-toolbar.mat-primary {
position: sticky;
top: 0;
z-index: 1;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { LayoutModule } from '@angular/cdk/layout';
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { MatListModule } from '@angular/material/list';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatToolbarModule } from '@angular/material/toolbar';

import { NavigationDashboardExampleComponent } from './navigation-dashboard-example.component';

describe('NavigationDashboardExampleComponent', () => {
let component: NavigationDashboardExampleComponent;
let fixture: ComponentFixture<NavigationDashboardExampleComponent>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [NavigationDashboardExampleComponent],
imports: [
NoopAnimationsModule,
LayoutModule,
MatButtonModule,
MatIconModule,
MatListModule,
MatSidenavModule,
MatToolbarModule,
]
}).compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(NavigationDashboardExampleComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should compile', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component } from '@angular/core';
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
import { Observable } from 'rxjs';
import { map, shareReplay } from 'rxjs/operators';

@Component({
selector: 'nae-app-navigation-dashboard-example',
templateUrl: './navigation-dashboard-example.component.html',
styleUrls: ['./navigation-dashboard-example.component.scss']
})
export class NavigationDashboardExampleComponent {

constructor() {}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {waitForAsync, ComponentFixture, TestBed} from '@angular/core/testing';
import {PublicWorkflowViewComponent} from './public-workflow-view.component';
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
import {HttpClientTestingModule} from '@angular/common/http/testing';
import {RouterModule} from '@angular/router';
import {CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA} from '@angular/core';
import {
AuthenticationMethodService,
Expand All @@ -22,6 +21,7 @@ import {
WorkflowHeaderService
} from '@netgrif/components-core';
import {PanelComponentModule, SideMenuContentComponentModule, HeaderComponentModule} from '@netgrif/components';
import {RouterTestingModule} from '@angular/router/testing';

describe('PublicWorkflowViewComponent', () => {
let component: PublicWorkflowViewComponent;
Expand All @@ -40,7 +40,7 @@ describe('PublicWorkflowViewComponent', () => {
HttpClientTestingModule,
SideMenuContentComponentModule,
TranslateLibModule,
RouterModule.forRoot([], {relativeLinkResolution: 'legacy'})
RouterTestingModule.withRoutes([], { relativeLinkResolution: 'legacy' }),
],
schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
providers: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
[apiModuleImport]="'ToolbarModule'"></nae-app-documentation>

<ng-template #toolbarExample>
<nc-toolbar appName="Example" loggedUser="Anton Mrkvička" [logoSrc]="logoSrc" [logoAlt]="logoAlt"></nc-toolbar>
<nc-toolbar [toolbarConfig]="toolbarConfig"></nc-toolbar>
<p>{{ 'toolbar-example.text' | translate }}</p>
</ng-template>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Component, OnInit} from '@angular/core';
import {TranslateService} from '@ngx-translate/core';
import {ToolbarConfig} from '@netgrif/components-core';

@Component({
selector: 'nae-app-toolbar-example',
Expand All @@ -10,8 +11,17 @@ export class ToolbarExampleComponent implements OnInit {
readonly TITLE = 'Toolbar';
readonly DESCRIPTION = 'Ukážka toolbaru...';

logoSrc = 'assets/img/netgrif_full_white.svg';
logoAlt = 'Netgrif';
public toolbarConfig: ToolbarConfig = {
profileEnabled: false,
languageEnabled: false,
logoutEnabled: false,
simpleToolbar: true,
toolbarName: {
defaultValue: "Netgrif",
translations: {}
},
toolbarLogo: "assets/img/netgrif_full_white.svg"
};

constructor(public translate: TranslateService) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ import {BreadcrumbsExampleComponent} from './doc/breadcrumbs-example/breadcrumbs
import {DashboardCaseExampleComponent} from './doc/dashboard-case-example/dashboard-case-example.component';
import {ImpersonationDemoComponent} from './doc/impersonation-demo/impersonation-demo.component';
import {ChangePasswordComponent} from "./doc/forms/change-password/change-password.component";
import {
NavigationDashboardExampleComponent
} from './doc/navigation-dashboard-example/navigation-dashboard-example.component';

@Injectable({
providedIn: 'root'
Expand Down Expand Up @@ -82,6 +85,7 @@ export class NaeExampleAppViewService extends ViewService {
{id: 'RailExampleComponent', class: RailExampleComponent},
{id: 'DrawerExampleComponent', class: DrawerExampleComponent},
{id: 'DoubleDrawerExampleComponent', class: DoubleDrawerExampleComponent},
{id: 'NavigationDashboardExampleComponent', class: NavigationDashboardExampleComponent},
{id: 'RegisterFormComponent', class: RegisterFormComponent},
{id: 'PasswordFormComponent', class: PasswordFormComponent},
{id: 'LoginFormComponent', class: LoginFormComponent},
Expand Down
3 changes: 3 additions & 0 deletions projects/netgrif-components-core/src/commons/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,9 @@ export interface Services {
groupNavigation?: {
groupNavigationRoute: string,
};
doubleDrawer?: {
url: string,
}

[k: string]: any;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {waitForAsync, ComponentFixture, TestBed} from '@angular/core/testing';
import {FlexLayoutModule, FlexModule} from '@angular/flex-layout';
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
import {HttpClientTestingModule} from '@angular/common/http/testing';
import {RouterModule} from '@angular/router';
import {Component} from '@angular/core';
import {AbstractLoadingModeComponent} from './abstract-loading-mode.component';
import {CaseHeaderService} from '../../case-header/case-header.service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {ConfigurationService} from '../../configuration/configuration.service';
import {TestConfigurationService} from '../../utility/tests/test-config';
import {ViewService} from '../../routing/view-service/view.service';
import {TestViewService} from '../../utility/tests/test-view-service';
import {RouterModule} from '@angular/router';
import {ErrorSnackBarComponent} from '../../snack-bar/components/error-snack-bar/error-snack-bar.component';
import {SuccessSnackBarComponent} from '../../snack-bar/components/success-snack-bar/success-snack-bar.component';
import {BrowserDynamicTestingModule} from '@angular/platform-browser-dynamic/testing';
Expand Down
Loading
Loading