Skip to content

Commit 8ebe886

Browse files
committed
Improvement[TW29167]: Migrate change report tab to change report page
1 parent fa63bb8 commit 8ebe886

File tree

17 files changed

+186
-72
lines changed

17 files changed

+186
-72
lines changed

web/apps/osee/src/app/actra/components/add-attachments-dialog/add-attachments-dialog.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ <h3 class="tw-font-semibold">Add attachments</h3>
8989
</button>
9090
<button
9191
mat-button
92-
class="tw-rounded tw-bg-primary tw-px-3 tw-py-2 tw-text-background-background hover:tw-bg-osee-neutral-87 disabled:tw-opacity-50"
92+
class="tw-rounded tw-bg-osee-blue-7 tw-px-3 tw-py-2 tw-text-background-background hover:tw-bg-osee-neutral-87 disabled:tw-opacity-50 dark:tw-bg-osee-blue-10"
9393
color="primary"
9494
type="button"
9595
[disabled]="files().length === 0"

web/apps/osee/src/app/actra/components/update-attachment-dialog/update-attachment-dialog.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ <h3 class="tw-font-semibold">Update attachment</h3>
8585
</button>
8686
<button
8787
mat-button
88-
class="tw-rounded tw-bg-primary tw-px-3 tw-py-2 tw-text-background-background hover:tw-bg-osee-neutral-87 disabled:tw-opacity-50"
88+
class="tw-rounded tw-bg-osee-blue-7 tw-px-3 tw-py-2 tw-text-background-background hover:tw-bg-osee-neutral-87 disabled:tw-opacity-50 dark:tw-bg-osee-blue-10"
8989
color="primary"
9090
type="button"
9191
[disabled]="!file()"

web/apps/osee/src/app/actra/components/workflow-attachments/workflow-attachments.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ <h2 class="tw-text-xl tw-font-semibold">Attachments</h2>
2222
matTooltipShowDelay="300">
2323
<button
2424
mat-raised-button
25-
class="tw-bg-primary tw-text-background-background hover:tw-bg-osee-neutral-87"
25+
class="tw-bg-osee-blue-7 tw-text-background-background hover:tw-bg-osee-neutral-87 dark:tw-bg-osee-blue-10"
2626
(click)="openAddDialog()"
2727
[disabled]="loadingGlobal() === 'true'">
2828
Add Attachments
@@ -40,7 +40,7 @@ <h2 class="tw-text-xl tw-font-semibold">Attachments</h2>
4040
matTooltipShowDelay="300">
4141
<button
4242
mat-raised-button
43-
class="tw-bg-primary tw-text-background-background hover:tw-bg-osee-neutral-87 disabled:tw-bg-background-selected-disabled-button"
43+
class="tw-bg-osee-blue-7 tw-text-background-background hover:tw-bg-osee-neutral-87 disabled:tw-bg-background-selected-disabled-button dark:tw-bg-osee-blue-10"
4444
(click)="deleteSelected()"
4545
[disabled]="
4646
loadingGlobal() === 'true' || selectedCount() === 0

web/apps/osee/src/app/actra/workflow/actra-workflow-editor.component.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@
106106
[workingBranch]="wf.workingBranch"
107107
(updated)="updateWorkflow()" />
108108

109+
<osee-change-report-button
110+
[inputBranchId]="wf.workingBranch.id"
111+
[inputBranchType]="wf.workingBranch.branchState" />
112+
109113
<div
110114
[matTooltip]="
111115
wf.branchEditable

web/apps/osee/src/app/actra/workflow/actra-workflow-editor.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import { ActivatedRoute, Router, RouterLink } from '@angular/router';
4848
import { ActraPageTitleComponent } from '../actra-page-title/actra-page-title.component';
4949
import { WorkflowAttachmentsComponent } from '../components/workflow-attachments/workflow-attachments.component';
5050
import { CreateWorkingBranchFromWorkflowButtonComponent } from '../../configuration-management/components/create-working-branch-from-workflow-button/create-working-branch-from-workflow-button';
51+
import { ChangeReportButtonComponent } from '../../ple/artifact-explorer/lib/components/hierarchy/change-report-button/change-report-button.component';
5152

5253
@Component({
5354
selector: 'osee-actra-workflow-editor',
@@ -66,6 +67,7 @@ import { CreateWorkingBranchFromWorkflowButtonComponent } from '../../configurat
6667
MatIconButton,
6768
ActraPageTitleComponent,
6869
RouterLink,
70+
ChangeReportButtonComponent,
6971
],
7072
templateUrl: './actra-workflow-editor.component.html',
7173
})

web/apps/osee/src/app/ple/artifact-explorer/lib/components/artifact-tab-group/artifact-tab-group.component.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,6 @@
5757
@case ('Artifact') {
5858
<osee-artifact-editor [tab]="tab" />
5959
}
60-
@case ('ChangeReport') {
61-
<osee-change-report-table
62-
[branchId]="
63-
tab.branchId
64-
"></osee-change-report-table>
65-
}
6660
@default {
6761
No tab defined for this type
6862
}

web/apps/osee/src/app/ple/artifact-explorer/lib/components/change-report-table/change-report-table.component.ts

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,7 @@
1111
* Boeing - initial API and implementation
1212
**********************************************************************/
1313
import { AsyncPipe } from '@angular/common';
14-
import {
15-
Component,
16-
Input,
17-
OnChanges,
18-
SimpleChanges,
19-
inject,
20-
} from '@angular/core';
14+
import { Component, inject, input } from '@angular/core';
2115
import {
2216
MatCell,
2317
MatCellDef,
@@ -32,15 +26,10 @@ import {
3226
} from '@angular/material/table';
3327
import { HeaderService } from '@osee/shared/services';
3428
import { changeReportRow } from '@osee/shared/types/change-report';
35-
import {
36-
BehaviorSubject,
37-
combineLatest,
38-
of,
39-
shareReplay,
40-
switchMap,
41-
} from 'rxjs';
29+
import { combineLatest, of, shareReplay, switchMap } from 'rxjs';
4230
import { changeReportHeaders } from './change-report-table-headers';
4331
import { ChangeReportService } from './services/change-report.service';
32+
import { toObservable } from '@angular/core/rxjs-interop';
4433

4534
@Component({
4635
selector: 'osee-change-report-table',
@@ -60,17 +49,11 @@ import { ChangeReportService } from './services/change-report.service';
6049
MatRowDef,
6150
],
6251
})
63-
export class ChangeReportTableComponent implements OnChanges {
52+
export class ChangeReportTableComponent {
6453
private headerService = inject(HeaderService);
6554
private crService = inject(ChangeReportService);
6655

67-
@Input() branchId = '';
68-
69-
ngOnChanges(changes: SimpleChanges): void {
70-
if (changes.branchId) {
71-
this.branchId$.next(this.branchId);
72-
}
73-
}
56+
branchId = input.required<string>();
7457

7558
headers: (keyof changeReportRow)[] = [
7659
'ids',
@@ -86,10 +69,11 @@ export class ChangeReportTableComponent implements OnChanges {
8669
return this.headerService.getHeaderByName(changeReportHeaders, value);
8770
}
8871

89-
branchId$ = new BehaviorSubject<string>('');
72+
private branchId$ = toObservable(this.branchId);
9073

9174
branch = this.branchId$.pipe(
92-
switchMap((branchId) => this.crService.getBranchInfo(branchId))
75+
switchMap((id) => this.crService.getBranchInfo(id)),
76+
shareReplay(1)
9377
);
9478

9579
parentBranch = this.branch.pipe(

web/apps/osee/src/app/ple/artifact-explorer/lib/components/editor/relation-delete-dialog/relation-delete-dialog.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
-->
1313
<div
1414
mat-dialog-title
15-
class="tw-flex tw-justify-center tw-bg-primary tw-p-0 tw-text-background">
15+
class="tw-flex tw-justify-center tw-bg-osee-blue-7 tw-p-0 tw-text-background dark:tw-bg-osee-blue-10">
1616
<div class="tw-mt-1">Remove Relation?</div>
1717
</div>
1818
<mat-dialog-content class="tw-mt-4 tw-flex">

web/apps/osee/src/app/ple/artifact-explorer/lib/components/hierarchy/change-report-button/change-report-button.component.ts

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,46 +10,69 @@
1010
* Contributors:
1111
* Boeing - initial API and implementation
1212
**********************************************************************/
13-
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
13+
import {
14+
ChangeDetectionStrategy,
15+
Component,
16+
computed,
17+
inject,
18+
input,
19+
} from '@angular/core';
1420
import { toSignal } from '@angular/core/rxjs-interop';
1521
import { CurrentBranchInfoService, UiService } from '@osee/shared/services';
1622
import { map } from 'rxjs';
1723
import { ArtifactExplorerTabService } from '../../../services/artifact-explorer-tab.service';
1824
import { MatButton } from '@angular/material/button';
1925
import { MatIcon } from '@angular/material/icon';
2026
import { MatTooltip } from '@angular/material/tooltip';
27+
import { RouterLink } from '@angular/router';
2128

2229
@Component({
2330
selector: 'osee-change-report-button',
24-
imports: [MatButton, MatIcon, MatTooltip],
31+
imports: [MatButton, MatIcon, MatTooltip, RouterLink],
2532
template: `@if (branchId() && branchType()) {
26-
<button
27-
mat-flat-button
28-
class="tw-flex tw-justify-center tw-bg-osee-blue-7 tw-text-background-background dark:tw-bg-osee-blue-10 [&_*]:tw-m-0"
29-
(click)="openChangeReport()"
30-
matTooltip="Change Report">
31-
<mat-icon class="material-icons-outlined">differences</mat-icon>
32-
</button>
33+
<a
34+
[routerLink]="'/ple/change-report/' + branchId()"
35+
target="_blank">
36+
<button
37+
mat-flat-button
38+
class="tw-flex tw-justify-center tw-bg-osee-blue-7 tw-text-background-background dark:tw-bg-osee-blue-10 [&_*]:tw-m-0"
39+
matTooltip="Change Report">
40+
<mat-icon class="material-icons-outlined">differences</mat-icon>
41+
</button>
42+
</a>
3343
}`,
3444
changeDetection: ChangeDetectionStrategy.OnPush,
3545
})
3646
export class ChangeReportButtonComponent {
47+
inputBranchType = input<string>('');
48+
inputBranchId = input<string>('');
49+
3750
private currentBranchService = inject(CurrentBranchInfoService);
3851
private tabService = inject(ArtifactExplorerTabService);
3952
private uiService = inject(UiService);
4053

41-
protected branchType = toSignal(this.uiService.type, { initialValue: '' });
42-
protected branchId = toSignal(this.uiService.id, { initialValue: '' });
54+
protected serviceBranchType = toSignal(this.uiService.type, {
55+
initialValue: '',
56+
});
57+
protected serviceBranchId = toSignal(this.uiService.id, {
58+
initialValue: '',
59+
});
60+
61+
protected branchType = computed(() =>
62+
this.inputBranchType() === ''
63+
? this.serviceBranchType()
64+
: this.inputBranchType()
65+
);
66+
67+
protected branchId = computed(() =>
68+
this.inputBranchId() === ''
69+
? this.serviceBranchId()
70+
: this.inputBranchId()
71+
);
4372

4473
branchName = toSignal(
4574
this.currentBranchService.currentBranch.pipe(
4675
map((branch) => branch.name)
4776
)
4877
);
49-
50-
openChangeReport() {
51-
this.tabService.addChangeReportTab(
52-
'Change Report - ' + this.branchName()
53-
);
54-
}
5578
}

web/apps/osee/src/app/ple/artifact-explorer/lib/services/artifact-explorer-tab.service.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,6 @@ export class ArtifactExplorerTabService {
6464
this.SelectedIndex = this.tabs().length - 1;
6565
}
6666

67-
addChangeReportTab(tabTitle: string) {
68-
const newTab: tab = {
69-
tabId: this.generateTabId(),
70-
tabType: 'ChangeReport',
71-
tabTitle,
72-
branchId: this.branchId(),
73-
branchName: this.branchName(),
74-
viewId: this.viewId(),
75-
};
76-
this.addTab(newTab);
77-
}
78-
7967
addArtifactTab(artifact: artifactWithRelations) {
8068
this.addArtifactTabOnBranch(artifact, this.branchId(), this.viewId());
8169
}
@@ -116,8 +104,6 @@ export class ArtifactExplorerTabService {
116104
switch (tab.tabType) {
117105
case 'Artifact':
118106
return tab.artifact.icon.icon;
119-
case 'ChangeReport':
120-
return 'differences';
121107
default:
122108
return '';
123109
}

0 commit comments

Comments
 (0)