Skip to content

Commit 1b384f8

Browse files
authored
feat: 3553 new UI comparing pages
* feat: 3553 Remove duplicate comparison headers and apply card styling * feat: Apply card styling to document comparison for all embedding contexts * feat: Implement shared compare shell and apply design * feat: Align multi-policy with two-policy design while preserving wide scroll * feat: redesign schema comparison page to match policy UI pattern * feat: redesign module comparison page to match policy UI pattern * feat: redesign document comparison page to match multi-policy UI pattern * feat: redesign tool comparison page to match multi-policy UI pattern * feat: redesign embedded record comparison with static description card and projected controls * fix: align comparison page header spacing to 42px top padding * feat: sync document dropdown with tree open/close events * fix: headers in multy policy, tools, documents pages
1 parent aceeed4 commit 1b384f8

24 files changed

Lines changed: 2185 additions & 1319 deletions

frontend/src/app/modules/analytics/compare-document/compare-document.component.html

Lines changed: 17 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,29 @@
11
<div class="content" [style.min-width.px]="minWidth">
2-
@if (headers.length && type==='tree') {
3-
<div class="item-headers" [style.grid-template-columns]="_gridStyle">
4-
@for (item of headers; track item) {
5-
<div [style.grid-column-start]="item.column" class="item-header">
6-
<span class="item-header-name">
7-
{{ item.name }}
8-
</span>
9-
<span class="item-header-rate item-header-color-{{item.color}}">
10-
{{ item.rate }}
11-
</span>
12-
</div>
13-
}
14-
</div>
15-
}
16-
172
@if (resultContext) {
183
<div class="list">
4+
@if (!disableHeader) {
5+
<section class="document-description-section">
6+
<div class="document-description-title">Description</div>
7+
<div class="document-description-card"
8+
[style.grid-template-columns]="'repeat(' + size + ', minmax(0, 1fr))'">
9+
@for (context of resultContext; track context) {
10+
<div class="document-description-column">
11+
<ng-container *ngTemplateOutlet="resultInfo; context: context"></ng-container>
12+
</div>
13+
}
14+
</div>
15+
</section>
16+
}
17+
18+
<ng-content select="[policyControls]"></ng-content>
19+
1920
<p-accordion
2021
class="compare-document-accordion"
2122
[multiple]="true"
22-
[value]="['description', 'documents']"
23+
[value]="['documents']"
2324
expandIcon="pi pi-chevron-down icon-start"
2425
collapseIcon="pi pi-chevron-up icon-start"
2526
>
26-
@if (!disableHeader) {
27-
<p-accordion-panel value="description">
28-
<p-accordion-header>Description</p-accordion-header>
29-
<p-accordion-content>
30-
<div class="info-container" [style.grid-template-columns]="_gridStyle">
31-
@for (context of resultContext; track context) {
32-
@if (context.right) {
33-
<div [style.grid-column-start]="2 * context.index"
34-
class="middle-compare-result compare-result"
35-
[attr.open]="true">
36-
</div>
37-
}
38-
<div [style.grid-column-start]="2 * context.index + 1"
39-
[attr.open]="true"
40-
[ngClass]="{
41-
'left-compare-result': context.left,
42-
'right-compare-result': context.right,
43-
'compare-result': true
44-
}">
45-
<ng-container *ngTemplateOutlet="resultInfo; context: context"></ng-container>
46-
</div>
47-
}
48-
</div>
49-
</p-accordion-content>
50-
</p-accordion-panel>
51-
}
5227
@if (treeContext) {
5328
<p-accordion-panel value="documents">
5429
<p-accordion-header>{{ comparationLabels.documentsLabel }}</p-accordion-header>

frontend/src/app/modules/analytics/compare-document/compare-document.component.scss

Lines changed: 108 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -15,59 +15,41 @@
1515
font-size: 20px;
1616
}
1717

18-
.item-headers {
19-
display: grid;
18+
/* Multi-document is wide and scrolls horizontally. Keep the projected
19+
Type/Export actions pinned to the right edge of the scroll viewport. */
20+
:host ::ng-deep .compare-page-actions {
2021
position: sticky;
21-
z-index: 4;
22-
left: 0;
23-
top: 0;
24-
padding-left: 53px;
25-
padding-right: 33px;
26-
height: 22px;
27-
background: var(--guardian-background, #fff);
28-
opacity: 0.95;
29-
border-bottom: 1px solid var(--guardian-border-color, #eee);
30-
overflow: hidden;
31-
32-
.item-header {
33-
border-left: 1px solid var(--guardian-border-color, #bbb);
34-
border-right: 1px solid var(--guardian-border-color, #bbb);
35-
font-size: 12px;
36-
color: var(--guardian-font-color, #444);
37-
padding-left: 12px;
38-
padding-right: 100px;
39-
overflow: hidden;
40-
position: relative;
41-
margin-right: -2px;
42-
}
43-
44-
.item-header-rate {
45-
top: 0;
46-
right: 16px;
47-
position: absolute;
48-
font-weight: 500;
49-
text-align: end;
50-
}
22+
right: -28px;
23+
width: max-content;
24+
margin-left: auto;
25+
z-index: 5;
26+
}
5127

52-
.item-header-color-green {
53-
color: var(--guardian-success-color, #008d0c);
54-
}
28+
.document-description-section {
29+
margin-bottom: 8px;
30+
}
5531

56-
.item-header-color-yellow {
57-
color: var(--guardian-warning-color, #c79604);
58-
}
32+
.document-description-title {
33+
color: var(--guardian-header-color, #000);
34+
font-size: 16px;
35+
font-weight: 600;
36+
line-height: 24px;
37+
margin-bottom: 12px;
38+
}
5939

60-
.item-header-color-red {
61-
color: var(--guardian-failure-color, #e70000);
62-
}
40+
.document-description-card {
41+
display: grid;
42+
gap: 64px;
43+
background: var(--guardian-background, #fff);
44+
border: 1px solid var(--guardian-border-color, #e1e7ef);
45+
border-radius: 8px;
46+
box-shadow: 0 4px 12px rgb(0 0 0 / 6%);
47+
padding: 24px 28px;
48+
box-sizing: border-box;
49+
}
6350

64-
.item-header-name {
65-
text-overflow: ellipsis;
66-
overflow: hidden;
67-
white-space: nowrap;
68-
width: 100%;
69-
display: block;
70-
}
51+
.document-description-column {
52+
min-width: 0;
7153
}
7254

7355
.compare-btn {
@@ -196,16 +178,27 @@
196178

197179

198180
.result-info {
199-
padding-left: 5px;
181+
padding: 0;
200182

201183
.result-info-field {
202184
display: grid;
203-
grid-template-columns: 100px 50%;
185+
grid-template-columns: 100px minmax(0, 1fr);
186+
gap: 12px;
187+
min-height: 24px;
188+
align-items: center;
204189
}
205190

206191
.result-info-field-name {
207-
font-weight: bold;
208-
color: var(--guardian-grid-color, #686868);
192+
font-size: 12px;
193+
font-weight: 600;
194+
color: var(--guardian-font-color, #172033);
195+
}
196+
197+
.result-info-field-value {
198+
min-width: 0;
199+
color: var(--guardian-font-color, #172033);
200+
font-size: 12px;
201+
overflow-wrap: anywhere;
209202
}
210203
}
211204

@@ -901,33 +894,88 @@
901894
}
902895

903896
:host ::ng-deep .compare-document-accordion {
897+
background: transparent;
898+
904899
.p-accordionpanel {
905-
border-bottom: 1px solid var(--guardian-border-color, #d6dbe3);
900+
margin-bottom: 8px;
901+
border: 0;
902+
border-radius: 8px;
903+
background: var(--guardian-background, #fff);
904+
box-shadow: 0 4px 12px rgb(0 0 0 / 6%);
905+
/* clip (not hidden) so it is not a scroll container — lets the sticky
906+
chevron pin to the viewport while the wide tree scrolls. */
907+
overflow: clip;
908+
}
909+
910+
.p-accordioncontent {
911+
border: 0;
912+
background: var(--guardian-background, #fff);
913+
display: block;
914+
width: 100%;
915+
max-width: 100%;
916+
}
917+
918+
p-motion,
919+
.p-accordioncontent-wrapper {
920+
display: block;
921+
width: 100%;
922+
max-width: 100%;
923+
box-sizing: border-box;
906924
}
907925

908926
.p-accordionheader {
909-
gap: 8px;
927+
display: flex;
928+
align-items: center;
929+
justify-content: space-between;
930+
gap: 16px;
910931
width: 100%;
911-
min-height: 48px;
912-
padding: 0 10px;
932+
box-sizing: border-box;
933+
min-height: 50px;
934+
padding: 0 20px;
913935
background: var(--guardian-background, #fff);
914936
border: 0;
915937
color: var(--guardian-font-color, #172033);
938+
font-size: 14px;
916939
font-weight: 600;
940+
line-height: 20px;
917941
text-align: left;
918942
box-shadow: none;
943+
/* keep the sticky toggle chevron bound to the real horizontal scroller */
944+
overflow: visible;
945+
}
946+
947+
.p-accordionheader > :not(.p-accordionheader-toggle-icon) {
948+
order: 1;
949+
flex: 1 1 auto;
950+
min-width: 0;
919951
}
920952

921953
.p-accordionheader-toggle-icon {
922-
flex: 0 0 auto;
923-
width: 14px;
924-
height: 14px;
925-
margin: 0;
954+
order: 2;
955+
display: inline-flex !important;
956+
align-items: center;
957+
justify-content: center;
958+
flex: 0 0 16px;
959+
width: 16px;
960+
height: 16px;
961+
margin-left: 0;
962+
color: var(--guardian-grid-color, #848fa9);
963+
font-size: 12px;
964+
line-height: 1;
965+
opacity: 1;
966+
visibility: visible;
967+
position: sticky;
968+
right: -28px;
969+
z-index: 3;
926970
}
927971

928972
.p-accordioncontent-content {
929973
padding: 0;
930974
background: var(--guardian-background, #fff);
931975
border: 0;
976+
width: 100%;
977+
max-width: 100%;
978+
overflow-x: auto;
979+
overflow-y: hidden;
932980
}
933981
}

0 commit comments

Comments
 (0)