Skip to content

[NAE-1703] Dashboard #120

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

Merged
merged 56 commits into from
May 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
7af984b
[NAE-1704] Dashboard data field component
minop Sep 7, 2022
eceb7ec
[NAE-1704] Dashboard data field component
minop Sep 7, 2022
d1a6063
[NAE-1704] Dashboard data field component
minop Sep 7, 2022
10f6b1e
[NAE-1704] Dashboard data field component
minop Sep 7, 2022
ec2d72c
[NAE-1704] Dashboard data field component
minop Sep 9, 2022
828c472
[NAE-1704] Dashboard data field component
minop Sep 9, 2022
c8d09f8
[NAE-1704] Dashboard data field component
minop Sep 9, 2022
30256c2
[NAE-1704] Dashboard data field component
minop Sep 9, 2022
2aaed33
[NAE-1704] Dashboard data field component
minop Sep 9, 2022
6da15d3
[NAE-1704] Dashboard data field component
minop Sep 9, 2022
f94ef37
[NAE-1704] Dashboard data field component
minop Sep 9, 2022
3c0821d
[NAE-1704] Dashboard data field component
minop Sep 9, 2022
e137a86
[NAE-1704] Dashboard data field component
minop Sep 9, 2022
370aafb
[NAE-1704] Dashboard data field component
minop Sep 12, 2022
c95484d
[NAE-1704] Dashboard data field component
minop Sep 12, 2022
03981f3
[NAE-1704] Dashboard data field component
minop Sep 12, 2022
c2a187a
[NAE-1704] Dashboard data field component
mazarijuraj Sep 12, 2022
8b860bd
[NAE-1704] Dashboard data field component
minop Sep 12, 2022
dfd8d5f
Merge remote-tracking branch 'origin/NAE-1704' into NAE-1704
minop Sep 12, 2022
2e2496b
[NAE-1711] Dashboard tile content component
minop Sep 12, 2022
8b07963
[NAE-1711] Dashboard tile content component
minop Sep 12, 2022
5d9741b
[NAE-1704] Dashboard data field component
mazarijuraj Sep 13, 2022
84bd5f5
Merge branch 'NAE-1704' into NAE-1711
mazarijuraj Sep 13, 2022
462caef
[NAE-1711] Dashboard tile content component
mazarijuraj Sep 13, 2022
ee1457e
[NAE-1711] Dashboard tile content component
mazarijuraj Sep 13, 2022
960c639
[NAE-1711] Dashboard tile content component
mazarijuraj Sep 13, 2022
f42a15e
[NAE-1711] Dashboard tile content component
Sep 15, 2022
0f051d7
[NAE-1711] Dashboard tile content component
Sep 16, 2022
71ce1f5
[NAE-1711] Dashboard tile content component
mazarijuraj Sep 21, 2022
5cdb90f
[NAE-1711] Dashboard tile content component
Sep 22, 2022
9fe045a
[NAE-1711] Dashboard tile content component
Sep 27, 2022
71f54cf
[NAE-1711] Dashboard tile content component
Sep 28, 2022
ca93334
[NAE-1711] Dashboard tile content component
Sep 28, 2022
14b1d61
Merge remote-tracking branch 'origin/release/6.3.0' into NAE-1711
Kovy95 Oct 3, 2022
d07ce75
[NAE-1703] Dashboard
Kovy95 Oct 3, 2022
b7037af
[NAE-1703] Dashboard
Oct 4, 2022
45e49f6
Merge remote-tracking branch 'origin/NAE-1711' into NAE-1711
Oct 4, 2022
5337c46
[NAE-1703] Dashboard
Oct 5, 2022
517f509
[NAE-1703] Dashboard
Oct 6, 2022
0698718
Merge remote-tracking branch 'origin/release/6.3.0' into NAE-1711
machacjozef Oct 6, 2022
998c14f
[NAE-1711] Dashboard
renczesstefan Oct 7, 2022
854d004
Release 6.3.0-beta.1
machacjozef Oct 7, 2022
268ca70
Release 6.3.0-beta.1
machacjozef Oct 7, 2022
d956e29
Release 6.3.0-beta.1
machacjozef Oct 7, 2022
af8867b
[NAE-1711] Dashboard
renczesstefan Oct 12, 2022
c119a96
[NAE-1711] Dashboard
renczesstefan Oct 12, 2022
e3e2b10
Merge remote-tracking branch 'origin/release/6.3.0' into NAE-1711
machacjozef Oct 12, 2022
8f2aeeb
Merge remote-tracking branch 'origin/release/6.3.0' into NAE-1711
machacjozef Oct 12, 2022
5c186c3
[NAE-1711] Dashboard
renczesstefan Oct 14, 2022
e2692bd
Merge remote-tracking branch 'origin/release/6.3.0' into NAE-1711
machacjozef Oct 20, 2022
16b659c
Merge remote-tracking branch 'origin/release/6.3.0' into NAE-1711
machacjozef Dec 19, 2022
32c6984
Release 6.3.0-beta.4
machacjozef Dec 19, 2022
c85578a
Merge branch 'release/6.3.0' into NAE-1711
renczesstefan Dec 20, 2022
0ee1cfc
[NAE-1703] Dashboard
renczesstefan Feb 3, 2023
c9ad4bd
[NAE-1871] Fields change its position in task
renczesstefan Apr 20, 2023
34fc5eb
Merge branch 'release/6.3.0' into NAE-1711
renczesnetgrif May 5, 2023
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Full Changelog: [https://github.com/netgrif/components/commits/v6.3.0](https://g
### Added

- [NAE-1678] User impersonation
- [NAE-1703] Dashboard
- [NAE-1809] UserList field show selected users
- [NAE-1835] Change password component
- [NAE-1841] Idle timer component
Expand Down
11 changes: 11 additions & 0 deletions nae.json
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,17 @@
"path": "titleConfig"
}
},
"demo-dashboard-case-view": {
"component": {
"class": "DashboardCaseExampleComponent",
"from": "./doc/dashboard-case-example/dashboard-case-example.component"
},
"access": "private",
"navigation": true,
"routing": {
"path": "dashboard-cases"
}
},
"demo-dashboard-view": {
"component": {
"class": "DashboardExampleComponent",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@netgrif/components-project",
"version": "6.3.0-rc.8",
"version": "6.3.0-rc.9",
"description": "Netgrif Application Engine Frontend project. Project includes angular libraries as base for NAE applications.",
"homepage": "https://components.netgrif.com",
"license": "SEE LICENSE IN LICENSE",
Expand Down
91 changes: 66 additions & 25 deletions projects/nae-example-app/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {Injector, NgModule} from '@angular/core';
import {AppRoutingModule} from './app-routing.module';
import {AppComponent} from './app.component';
import {
AuthenticationModule,
ConfigurationService,
CovalentModule,
DashboardPortalComponentRegistryService,
DialogModule,
MaterialModule,
NAE_SNACKBAR_HORIZONTAL_POSITION,
Expand Down Expand Up @@ -64,13 +65,17 @@ import {
AuthenticationComponentModule,
CaseViewComponentModule,
DashboardComponentModule,
DataFieldsComponentModule, EmailSubmissionFormComponentModule,
DataFieldsComponentModule,
EmailSubmissionFormComponent,
EmailSubmissionFormComponentModule,
FilterFieldContentModule,
ForgottenPasswordFormComponentModule,
HeaderComponentModule,
LoginFormComponentModule,
NavigationComponentModule,
PanelComponentModule,
ProfileComponentModule, RedirectComponentModule,
ProfileComponentModule,
RedirectComponentModule,
RegistrationFormComponentModule,
SearchComponentModule,
SideMenuComponentModule,
Expand All @@ -79,29 +84,49 @@ import {
ChangePasswordFormComponentModule,
ToolbarComponentModule,
TreeCaseViewComponentModule,
WorkflowViewComponentModule
WorkflowViewComponentModule,
FilterFieldTabViewComponent, FilterFieldTabbedCaseViewComponent, DefaultTabbedTaskViewComponent
} from '@netgrif/components';
import {UserInviteComponent} from './doc/user-invite/user-invite.component';
import {ExamplePortalCardComponent} from './doc/dashboard-example/piechart-card/example-portal-card.component';
import {NgxChartsModule} from '@swimlane/ngx-charts';
import { ResetPasswordFormComponent } from './doc/forms/reset-password-form/reset-password-form.component';
import { PublicTaskViewComponent } from './doc/public-task-view/public-task-view.component';
import { PublicWorkflowViewComponent } from './doc/public-workflow-view/public-workflow-view.component';
import {ResetPasswordFormComponent} from './doc/forms/reset-password-form/reset-password-form.component';
import {PublicTaskViewComponent} from './doc/public-task-view/public-task-view.component';
import {PublicWorkflowViewComponent} from './doc/public-workflow-view/public-workflow-view.component';
import {PublicResolverComponent} from './doc/public-resolver/public-resolver.component';
import { GroupViewComponent } from './doc/group-view/group-view.component';
import { DemoTitleConfigContent0TaskViewComponent } from './doc/demo-title-config/content/0/demo-title-config-content0-task-view.component';
import { DemoTitleConfigContent1CaseViewComponent } from './doc/demo-title-config/content/1/demo-title-config-content1-case-view.component';
import { DemoTitleConfigContent2CaseViewComponent } from './doc/demo-title-config/content/2/demo-title-config-content2-case-view.component';
import { DemoTitleConfigContent3CaseViewComponent } from './doc/demo-title-config/content/3/demo-title-config-content3-case-view.component';
import { TitleConfigComponent } from './doc/demo-title-config/title-config.component';
import { ExampleRedirectComponent } from './doc/redirect/example-redirect.component';
import { ActiveGroupComponent } from './doc/active-group/active-group.component';
import { WrapperEmptyViewComponent } from './views/wrapper/wrapper-empty-view.component';
import {GroupViewComponent} from './doc/group-view/group-view.component';
import {
DemoTitleConfigContent0TaskViewComponent
} from './doc/demo-title-config/content/0/demo-title-config-content0-task-view.component';
import {
DemoTitleConfigContent1CaseViewComponent
} from './doc/demo-title-config/content/1/demo-title-config-content1-case-view.component';
import {
DemoTitleConfigContent2CaseViewComponent
} from './doc/demo-title-config/content/2/demo-title-config-content2-case-view.component';
import {
DemoTitleConfigContent3CaseViewComponent
} from './doc/demo-title-config/content/3/demo-title-config-content3-case-view.component';
import {TitleConfigComponent} from './doc/demo-title-config/title-config.component';
import {ExampleRedirectComponent} from './doc/redirect/example-redirect.component';
import {ActiveGroupComponent} from './doc/active-group/active-group.component';
import {WrapperEmptyViewComponent} from './views/wrapper/wrapper-empty-view.component';
import {DoubleDrawerExampleComponent} from './doc/double-drawer-example/double-drawer-example.component';
import { PublicSingleTaskViewComponent } from './doc/public-single-task-view/public-single-task-view.component';
import { BreadcrumbsExampleComponent } from './doc/breadcrumbs-example/breadcrumbs-example.component';
import {PublicSingleTaskViewComponent} from './doc/public-single-task-view/public-single-task-view.component';
import {BreadcrumbsExampleComponent} from './doc/breadcrumbs-example/breadcrumbs-example.component';
import {ComponentPortal} from '@angular/cdk/portal';
import {DashboardCaseExampleComponent} from './doc/dashboard-case-example/dashboard-case-example.component';
import {
SingleTabbedCaseViewComponent
} from './doc/single-tabbed-view/single-tabbed-case-view/single-tabbed-case-view.component';
import {
SingleTabbedTaskViewComponent
} 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 {
Dashboard
} from '../../../netgrif-components-core/src/lib/data-fields/text-field/dashboard-portal-text-field/dashboard-view-constants';

export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http);
Expand Down Expand Up @@ -158,6 +183,10 @@ export function HttpLoaderFactory(http: HttpClient) {
DoubleDrawerExampleComponent,
PublicSingleTaskViewComponent,
BreadcrumbsExampleComponent,
DashboardCaseExampleComponent,
SingleTabbedCaseViewComponent,
SingleTabbedTaskViewComponent,
BreadcrumbsExampleComponent,
ChangePasswordComponent
],
imports: [
Expand Down Expand Up @@ -208,21 +237,33 @@ export function HttpLoaderFactory(http: HttpClient) {
WorkflowViewComponentModule,
NgxChartsModule,
EmailSubmissionFormComponentModule,
RedirectComponentModule
RedirectComponentModule,
FilterFieldContentModule
],
providers: [{
provide: ConfigurationService,
useClass: NaeExampleAppConfigurationService
},
{ provide: NAE_SNACKBAR_VERTICAL_POSITION, useValue: SnackBarVerticalPosition.TOP },
{ provide: NAE_SNACKBAR_HORIZONTAL_POSITION, useValue: SnackBarHorizontalPosition.LEFT },
provide: ConfigurationService,
useClass: NaeExampleAppConfigurationService
},
{provide: NAE_SNACKBAR_VERTICAL_POSITION, useValue: SnackBarVerticalPosition.TOP},
{provide: NAE_SNACKBAR_HORIZONTAL_POSITION, useValue: SnackBarHorizontalPosition.LEFT},
ResourceProvider,
TranslateService,
TranslatePipe,
TranslateStore,
{ provide: ViewService, useClass: NaeExampleAppViewService },
{provide: ViewService, useClass: NaeExampleAppViewService},
],
bootstrap: [AppComponent]
})
export class AppModule {

constructor(registry: DashboardPortalComponentRegistryService) {
registry.register('email', (injector: Injector) => new ComponentPortal(EmailSubmissionFormComponent, null, injector));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to replace these string literals with constants.

registry.register('workflow-view', (injector: Injector) => new ComponentPortal(WorkflowViewExampleComponent, null, injector));
registry.register('task-view', (injector: Injector) => new ComponentPortal(TaskViewComponent, null, injector));
registry.register('case-view', (injector: Injector) => new ComponentPortal(CaseViewComponent, null, injector));
registry.register('tab-view', (injector: Injector) => new ComponentPortal(TabbedViewsExampleComponent, null, injector));
registry.register(Dashboard.FILTER_TAB_VIEW_ID, (injector: Injector) => new ComponentPortal(FilterFieldTabViewComponent, null, injector));
registry.registerType(Dashboard.FILTER_CASE_VIEW_ID, FilterFieldTabbedCaseViewComponent);
registry.registerType(Dashboard.FILTER_TASK_VIEW_ID, DefaultTabbedTaskViewComponent);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div fxLayout="column" fxLayoutAlign="start stretch" class="full-height">
<nc-tab-view #tabView [initialTabs]="tabs" stretch="true" class="full-height" fxFlex="100"></nc-tab-view>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.full-height {
height: 100%;
min-height: 100%;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {ComponentFixture, TestBed} from '@angular/core/testing';

import {DashboardCaseExampleComponent} from './dashboard-case-example.component';

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

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [DashboardCaseExampleComponent]
})
.compileComponents();
});

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

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import {Component, OnInit} from '@angular/core';
import {
AllowedNetsService,
AllowedNetsServiceFactory,
CaseViewService,
CategoryFactory,
defaultCaseSearchCategoriesFactory,
FilterRepository,
MergeOperator,
NAE_BASE_FILTER,
NAE_NEW_CASE_COMPONENT,
NAE_NEW_CASE_CONFIGURATION,
NAE_SEARCH_CATEGORIES,
NAE_VIEW_ID_SEGMENT,
SearchService,
SimpleFilter,
UserService,
ViewIdService
} from '@netgrif/components-core';
import {NewCaseComponent} from '@netgrif/components';
import {
SingleTabbedCaseViewComponent
} from '../single-tabbed-view/single-tabbed-case-view/single-tabbed-case-view.component';
import {
SingleTabbedTaskViewComponent
} from '../single-tabbed-view/single-tabbed-task-view/single-tabbed-task-view.component';

export const newCaseConfigFactory = () => {
return {useCachedProcesses: false};
};

export const dashboardAllowedNetsFactory = (factory: AllowedNetsServiceFactory) => {
return factory.createFromArray(['dashboard']);
};

const baseFilterFactory = (filterRepository: FilterRepository, userService: UserService) => {
const filter = SimpleFilter.fromCaseQuery({process: {identifier: 'dashboard'}})
.merge(SimpleFilter.fromCaseQuery({author: {email: userService.user.email}}), MergeOperator.AND);
return {filter};
};

@Component({
selector: 'nae-app-dashboard-case-example',
templateUrl: './dashboard-case-example.component.html',
styleUrls: ['./dashboard-case-example.component.scss'],
providers: [
{
provide: NAE_NEW_CASE_CONFIGURATION,
useFactory: newCaseConfigFactory,
deps: []
},
CategoryFactory,
CaseViewService,
SearchService,
ViewIdService,
{
provide: NAE_VIEW_ID_SEGMENT,
useValue: 'my-dashboards'
},
{
provide: NAE_SEARCH_CATEGORIES,
useFactory: defaultCaseSearchCategoriesFactory,
deps: [CategoryFactory]
},
{
provide: NAE_BASE_FILTER,
useFactory: baseFilterFactory,
deps: [FilterRepository, UserService]
},
{
provide: AllowedNetsService,
useFactory: dashboardAllowedNetsFactory,
deps: [AllowedNetsServiceFactory]
},
{
provide: NAE_NEW_CASE_COMPONENT,
useValue: NewCaseComponent
}
]
})
export class DashboardCaseExampleComponent implements OnInit {

public tabs = [];

constructor(public userService: UserService) {
const filter = SimpleFilter.fromCaseQuery({process: {identifier: 'dashboard'}}).merge(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you using .merge? It is possible to define author and process in the same query, isn't it?

SimpleFilter.fromCaseQuery({author: {email: userService.user.email}}), MergeOperator.AND
);
this.tabs = [
{
label: {
text: 'My dashboards',
},
canBeClosed: false,
tabContentComponent: SingleTabbedCaseViewComponent,
injectedObject: {
tabViewComponent: SingleTabbedTaskViewComponent,
loadFilter: filter,
tabViewOrder: 0,
shouldUseCache: false
}
},
]
}

ngOnInit(): void {
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<div class="case-view-container" fxLayout="column" fxLayoutAlign="start stretch">

<mat-card class="case-view-search-container">
<div fxLayout="row" fxLayoutAlign="space-between">
<div fxLayoutAlign="start center" fxFlex>
<nc-search class="search-width" (filterLoaded)="loadFilter($event)"
(filterSaved)="saveFilter($event)"></nc-search>
</div>
<nc-create-case-button [newCaseCreationConfig]="newCaseCreationConfig"
(caseCreatedEvent)="handleCaseClick($event)"></nc-create-case-button>
</div>
</mat-card>

<div class="full-height transform-div custom-scrollbar" [ngClass]="{'overflow-div': getOverflowStatus()}"
fxLayout="column" fxLayoutAlign="start stretch">
<div class="full-height transform-div max-width-fix" fxLayout="column" fxLayoutAlign="start stretch">
<nc-header #header [type]="headerType" [maxHeaderColumns]="7" [responsiveHeaders]="true"
class="case-header-padding" [ngStyle]="{'width': getWidth()}"></nc-header>

<nc-case-list [selectedHeaders$]="selectedHeaders$" [showDeleteMenu]="true" [width]="getWidth()"
(caseClick)="handleCaseClick($event)" [responsiveBody]="true" fxFlex [textEllipsis]="true"
[redirectEnabled]="true"></nc-case-list>
</div>
</div>
</div>
Loading