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

chore(parts): 630 create extended part detailed View #1072

Merged
merged 26 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3601e2b
chore(parts): 630 create extended part detailed View
ds-mmaul Mar 14, 2024
279b78f
chore(parts): 630 create extended part detailed View
ds-mmaul Mar 15, 2024
80ef5f1
chore(parts): 630 moved startInvestigationComponent to new detailed view
ds-mmaul Mar 15, 2024
68ce043
chore(parts): 630 implement table page by url params on parts table
ds-mmaul Mar 15, 2024
f4cb552
chore(parts): 630 implement table page by url params on other parts t…
ds-mmaul Mar 15, 2024
57a1d89
chore(parts): 630 add parts action buttons
ds-mmaul Mar 15, 2024
242962f
chore(parts): 630 add parts action buttons
ds-mmaul Mar 18, 2024
e69f147
Merge branch 'main' into feature/#630-extended-part-detail-view
ds-mmaul Mar 18, 2024
63a40b4
chore(parts): 630 provide tooltip and restriction logic on action but…
ds-mmaul Mar 18, 2024
f3bcf77
chore(parts): 630 add create notification view to detail action
ds-mmaul Mar 19, 2024
57e9368
chore(parts): 630 add create notification view to detail action
ds-mmaul Mar 19, 2024
1e60ab6
Merge branch 'main' into feature/#630-extended-part-detail-view
ds-mmaul Mar 19, 2024
bdd423e
chore(parts): 630 bugfix
ds-mmaul Mar 19, 2024
a912b59
chore(parts): 630 bugfix
ds-mmaul Mar 19, 2024
73e47bf
Merge branch 'main' into feature/#630-extended-part-detail-view
ds-mmaul Mar 19, 2024
a6f7380
Merge branch 'main' into feature/#630-extended-part-detail-view
ds-mmaul Mar 20, 2024
0328d17
chore(parts): 630 fix and add tests
ds-mmaul Mar 20, 2024
1fe22ce
chore(parts): 630 fix and add tests
ds-mmaul Mar 20, 2024
d8a0a63
chore(parts): 630 fix and add tests
ds-mmaul Mar 20, 2024
6ce6e29
chore(parts): 630 fix and add tests
ds-mmaul Mar 20, 2024
48a96e0
chore(parts): 630 fix and add tests
ds-mmaul Mar 20, 2024
cfb6993
chore(parts): 630 documentation, code refactoring
ds-mmaul Mar 21, 2024
2d17d33
chore(parts): 630 documentation, code refactoring
ds-mmaul Mar 21, 2024
67da67a
chore(parts): 630 removed old part detailed view
ds-mmaul Mar 21, 2024
b13ce29
Merge branch 'main' into feature/#630-extended-part-detail-view
ds-mmaul Mar 21, 2024
fa49c9d
chore(parts): 630 refactoring
ds-mmaul Mar 21, 2024
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ _**For better traceability add the corresponding GitHub issue number in each cha
### Removed
- Shedlock, resilence4j, templateResolver as not used anymore

### Added
- #630 Added Parts extended detailed view

## [10.7.0 - 18.03.2024]

### Added
Expand Down
17 changes: 17 additions & 0 deletions docs/src/docs/user/user-manual.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,23 @@ Detailed information on the IDs for the manufactured part/batch.

Information about the identifiers at the customer for the respective part/batch.

==== Traction battery code data

If the asset has the "traction battery code" aspect model, an additional section underneath will be displayed.
In this section there are detailed information about the traction battery and a table with its subcomponents

==== Creation of a quality incident from detailed view

By clicking on the "announcement" icon you can create a quality incident from the detailed view, containing the part information in the currently opened detailed view. If this
functionality is disabled, a tooltip will provide information explaining the reason. You can trigger the tooltip by hovering above the button.

==== Publish asset from detailed view

By clicking on the "publish" icon, you can publish the currently opened part from the detailed view. If the icon is disabled,
a tooltip will provide information explaining the reason. You can trigger the tooltip by hovering above the button



== Other parts

List view of the supplied/delivered parts and batches (Supplier parts / Customer parts).
Expand Down
Binary file modified docs/src/images/arc42/user-guide/parts-list-detailed-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions frontend/cypress/support/step_definitions/admin-contracts.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Then, When } from '@badeball/cypress-cucumber-preprocessor';
import { AdminPage, AdminViewTab } from '../../integration/pages/AdminPage';
import {Then, When} from '@badeball/cypress-cucumber-preprocessor';
import {AdminPage, AdminViewTab} from '../../integration/pages/AdminPage';

let currentContractId: string;

Expand All @@ -8,13 +8,13 @@ When('navigate to administration view tab {string}', (tabName: AdminViewTab) =>
const header = AdminPage.getHeaderOfTabView(tabName);
switch (tabName) {
case AdminViewTab.BPN_CONFIGURATION_VIEW:
header.contains('BPN - EDC Konfiguration').should('be.visible');
header.contains('BPN - EDC Konfiguration').should('be.visible') || header.contains('BPN - EDC configuration').should('be.visible');
break;
case AdminViewTab.IMPORT_VIEW:
header.contains('Trace-X Datenimport').should('be.visible');
header.contains('Trace-X Datenimport').should('be.visible') || header.contains('Trace-X Data import').should('be.visible');
break;
case AdminViewTab.CONTRACT_VIEW:
header.contains('Verträge').should('be.visible');
header.contains('Verträge').should('be.visible') || header.contains('Contracts').should('be.visible');
break;
default: {
throw new Error(`The View Tab header ${ tabName } did not load or is not existing`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
right: -5px;
transition: opacity;
border-radius: 16px;
z-index: 101;
}

.user-menu-items {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
position: relative;
transition: all 0.5s;
max-height: 80vh;
overflow: hidden;
overflow: auto;
}

.sidenav--expanded {
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/app/modules/page/other-parts/other-parts.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { getI18nPageProvider } from '@core/i18n';
import { PartDetailsModule } from '@shared/modules/part-details/partDetails.module';
import { SupplierPartsComponent } from '@page/other-parts/presentation/supplier-parts/supplier-parts.component';
import { PartsDetailModule } from '@page/parts/detail/parts-detail.module';
import { FormatPartSemanticDataModelToCamelCasePipe } from '@shared/pipes/format-part-semantic-data-model-to-camelcase.pipe';
import { BomLifecycleSettingsService } from '@shared/service/bom-lifecycle-settings.service';
import { SharedModule } from '@shared/shared.module';
import { TemplateModule } from '@shared/template.module';
import { AngularSplitModule } from 'angular-split';
import { OtherPartsFacade } from './core/other-parts.facade';
import { OtherPartsService } from './core/other-parts.service';
import { OtherPartsState } from './core/other-parts.state';
import { OtherPartsRoutingModule } from './other-parts.routing';
import { OtherPartsComponent } from './presentation/other-parts.component';
import { SupplierPartsComponent } from '@page/other-parts/presentation/supplier-parts/supplier-parts.component';
import { CustomerPartsComponent } from './presentation/customer-parts/customer-parts.component';
import { AngularSplitModule } from 'angular-split';
import { BomLifecycleSettingsService } from '@shared/service/bom-lifecycle-settings.service';
import { OtherPartsComponent } from './presentation/other-parts.component';

@NgModule({
declarations: [ OtherPartsComponent, SupplierPartsComponent, CustomerPartsComponent ],
imports: [ CommonModule, TemplateModule, SharedModule, OtherPartsRoutingModule, PartDetailsModule, AngularSplitModule ],
imports: [ CommonModule, TemplateModule, SharedModule, OtherPartsRoutingModule, PartsDetailModule, AngularSplitModule ],
providers: [
OtherPartsState,
OtherPartsFacade,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { OtherPartsComponent } from '@page/other-parts/presentation/other-parts.component';
import { PartsDetailComponent } from '@page/parts/detail/parts-detail.component';
import { I18NEXT_NAMESPACE_RESOLVER } from 'angular-i18next';

export /** @type {*} */
Expand All @@ -33,6 +34,13 @@ const PARTS_ROUTING: Routes = [
data: { i18nextNamespaces: [ 'page.otherParts', 'partDetail' ] },
resolve: { i18next: I18NEXT_NAMESPACE_RESOLVER },
},
{
path: ':partId',
pathMatch: 'full',
component: PartsDetailComponent,
data: { i18nextNamespaces: [ 'page.otherParts', 'partDetail' ] },
resolve: { i18next: I18NEXT_NAMESPACE_RESOLVER },
},
];

@NgModule({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,22 @@
********************************************************************************/


import { Component, Input, OnDestroy, OnInit, QueryList, ViewChildren } from '@angular/core';
import { Pagination } from '@core/model/pagination.model';
import { OtherPartsFacade } from '@page/other-parts/core/other-parts.facade';
import { MainAspectType } from '@page/parts/model/mainAspectType.enum';
import { AssetAsBuiltFilter, AssetAsPlannedFilter, Part } from '@page/parts/model/parts.model';
import { TableType } from '@shared/components/multi-select-autocomplete/table-type.model';
import { PartsTableComponent } from '@shared/components/parts-table/parts-table.component';
import { TableSortingUtil } from '@shared/components/table/table-sorting.util';
import { TableEventConfig, TableHeaderSort } from '@shared/components/table/table.model';
import { toAssetFilter, toGlobalSearchAssetFilter } from '@shared/helper/filter-helper';
import { setMultiSorting } from '@shared/helper/table-helper';
import { View } from '@shared/model/view.model';
import { PartDetailsFacade } from '@shared/modules/part-details/core/partDetails.facade';
import { StaticIdService } from '@shared/service/staticId.service';
import { Observable } from 'rxjs';
import {Component, Input, OnDestroy, OnInit, QueryList, ViewChildren} from '@angular/core';
import {ActivatedRoute, Params, Router} from '@angular/router';
import {Pagination} from '@core/model/pagination.model';
import {OtherPartsFacade} from '@page/other-parts/core/other-parts.facade';
import {MainAspectType} from '@page/parts/model/mainAspectType.enum';
import {AssetAsBuiltFilter, AssetAsPlannedFilter, Part} from '@page/parts/model/parts.model';
import {TableType} from '@shared/components/multi-select-autocomplete/table-type.model';
import {PartsTableComponent} from '@shared/components/parts-table/parts-table.component';
import {TableSortingUtil} from '@shared/components/table/table-sorting.util';
import {TableEventConfig, TableHeaderSort} from '@shared/components/table/table.model';
import {containsAtleastOneFilterEntry, toAssetFilter, toGlobalSearchAssetFilter} from '@shared/helper/filter-helper';
import {setMultiSorting} from '@shared/helper/table-helper';
import {View} from '@shared/model/view.model';
import {PartDetailsFacade} from '@shared/modules/part-details/core/partDetails.facade';
import {StaticIdService} from '@shared/service/staticId.service';
import {Observable} from 'rxjs';


@Component({
Expand All @@ -47,8 +48,8 @@ export class CustomerPartsComponent implements OnInit, OnDestroy {

public readonly customerTabLabelId = this.staticIdService.generateId('OtherParts.customerTabLabel');

public tableCustomerAsBuiltSortList: TableHeaderSort[];
public tableCustomerAsPlannedSortList: TableHeaderSort[];
public tableCustomerAsBuiltSortList: TableHeaderSort[] = [];
public tableCustomerAsPlannedSortList: TableHeaderSort[] = [];

private ctrlKeyState = false;

Expand All @@ -58,10 +59,15 @@ export class CustomerPartsComponent implements OnInit, OnDestroy {
assetAsBuiltFilter: AssetAsBuiltFilter;
assetsAsPlannedFilter: AssetAsPlannedFilter;

public currentPartTablePage = {AS_BUILT_CUSTOMER_PAGE: 0, AS_PLANNED_CUSTOMER_PAGE: 0}


constructor(
private readonly otherPartsFacade: OtherPartsFacade,
private readonly partDetailsFacade: PartDetailsFacade,
private readonly staticIdService: StaticIdService,
private readonly router: Router,
private readonly route: ActivatedRoute
) {

window.addEventListener('keydown', (event) => {
Expand All @@ -73,6 +79,8 @@ export class CustomerPartsComponent implements OnInit, OnDestroy {
}

public ngOnInit(): void {
this.route.queryParams.subscribe(params => this.setupPageByUrlParams(params));

if (this.bomLifecycle === MainAspectType.AS_BUILT) {
this.customerPartsAsBuilt$ = this.otherPartsFacade.customerPartsAsBuilt$;
this.tableCustomerAsBuiltSortList = [];
Expand All @@ -97,10 +105,10 @@ export class CustomerPartsComponent implements OnInit, OnDestroy {
filterActivated(isAsBuilt: boolean, assetFilter: any): void {
if (isAsBuilt) {
this.assetAsBuiltFilter = assetFilter;
this.otherPartsFacade.setCustomerPartsAsBuilt(0, 50, [], toAssetFilter(this.assetAsBuiltFilter, true));
this.otherPartsFacade.setCustomerPartsAsBuilt(this.currentPartTablePage['AS_BUILT_CUSTOMER_PAGE'] ?? 0, 50, [], toAssetFilter(this.assetAsBuiltFilter, true));
} else {
this.assetsAsPlannedFilter = assetFilter;
this.otherPartsFacade.setCustomerPartsAsPlanned(0, 50, [], toAssetFilter(this.assetsAsPlannedFilter, false));
this.otherPartsFacade.setCustomerPartsAsPlanned(this.currentPartTablePage['AS_PLANNED_CUSTOMER_PAGE'] ?? 0, 50, [], toAssetFilter(this.assetsAsPlannedFilter, false));
}
}

Expand All @@ -110,17 +118,23 @@ export class CustomerPartsComponent implements OnInit, OnDestroy {

public onSelectItem(event: Record<string, unknown>): void {
this.partDetailsFacade.selectedPart = event as unknown as Part;
let tableData = {};
for(let component of this.partsTableComponents) {
tableData[component.tableType+"_PAGE"] = component.pageIndex;
}
this.router.navigate([`otherParts/${event?.id}`], {queryParams: tableData})
}

public onAsBuiltTableConfigChange({ page, pageSize, sorting }: TableEventConfig): void {
this.setTableSortingList(sorting, MainAspectType.AS_BUILT);
this.currentPartTablePage['AS_BUILT_CUSTOMER_PAGE'] = page;

let pageSizeValue = 50;
if (pageSize !== 0) {
pageSizeValue = pageSize;
}

if (this.assetAsBuiltFilter) {
if (this.assetAsBuiltFilter && containsAtleastOneFilterEntry(this.assetAsBuiltFilter)) {
this.otherPartsFacade.setCustomerPartsAsBuilt(0, pageSizeValue, this.tableCustomerAsBuiltSortList, toAssetFilter(this.assetAsBuiltFilter, true));
} else {
this.otherPartsFacade.setCustomerPartsAsBuilt(page, pageSizeValue, this.tableCustomerAsBuiltSortList);
Expand All @@ -129,13 +143,14 @@ export class CustomerPartsComponent implements OnInit, OnDestroy {

public onAsPlannedTableConfigChange({ page, pageSize, sorting }: TableEventConfig): void {
this.setTableSortingList(sorting, MainAspectType.AS_PLANNED);
this.currentPartTablePage['AS_PLANNED_CUSTOMER_PAGE'] = page;

let pageSizeValue = 50;
if (pageSize !== 0) {
pageSizeValue = pageSize;
}

if (this.assetsAsPlannedFilter) {
if (this.assetsAsPlannedFilter && containsAtleastOneFilterEntry(this.assetsAsPlannedFilter)) {
this.otherPartsFacade.setCustomerPartsAsPlanned(0, pageSizeValue, this.tableCustomerAsPlannedSortList, toAssetFilter(this.assetsAsPlannedFilter, true));
} else {
this.otherPartsFacade.setCustomerPartsAsPlanned(page, pageSizeValue, this.tableCustomerAsPlannedSortList);
Expand All @@ -147,6 +162,14 @@ export class CustomerPartsComponent implements OnInit, OnDestroy {
TableSortingUtil.setTableSortingList(sorting, tableSortList, this.ctrlKeyState);
}

private setupPageByUrlParams(params: Params ) {
if(!params) {
return;
}
this.onAsBuiltTableConfigChange({page: params['AS_BUILT_CUSTOMER_PAGE'], pageSize: 50, sorting: null});
this.onAsPlannedTableConfigChange({page: params['AS_PLANNED_CUSTOMER_PAGE'], pageSize: 50, sorting: null});
}

protected readonly MainAspectType = MainAspectType;
protected readonly TableType = TableType;
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,4 @@
</mat-tab-group>
</as-split-area>
</as-split>

<app-part-detail [showRelation]="false"
[showStartInvestigation]="showStartInvestigationArray[selectedTab]"></app-part-detail>
</div>
Loading