Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
31350d1
Story #16471: Clean code - stricter compiler options
marob Aug 4, 2026
8975f99
Story #16471: Clean code - remove barrel files
marob Aug 18, 2026
6ab3cc7
Story #16471: Clean code - use standalone components
marob Aug 19, 2026
c129c0c
Story #16471: Clean code - optimize imports
marob Aug 19, 2026
06ef54b
Story #16471: Clean code - other fixes
marob Aug 19, 2026
1452201
Story #16471: Clean code - manual fixes
marob Aug 19, 2026
5ceb76e
Story #16471: Clean code - manual fixes
marob Aug 26, 2026
8699eb9
Story #16471: Clean code - WIP
marob Aug 27, 2026
534dc4a
Story #16471: Clean code - WIP
marob Aug 27, 2026
d112174
Story #16471: Clean code - WIP
marob Aug 27, 2026
84d9085
Story #16471: Clean code - WIP
marob Aug 27, 2026
2d022dc
Story #16471: Clean code - WIP
marob Aug 27, 2026
9d95438
Story #16471: Clean code - WIP
marob Aug 27, 2026
a66b8b0
Story #16471: Clean code - WIP
marob Aug 27, 2026
c0fe97f
Story #16471: Clean code - WIP replace animations
marob Sep 1, 2026
8dbae4d
Story #16471: Clean code - fix portal
marob Sep 1, 2026
81ba6dc
Story #16471: Clean code - fix design system
marob Sep 2, 2026
e2ea42d
Story #16471: Clean code - fix prettier
marob Sep 7, 2026
4c70699
Story #16471: Clean code - fix CI post rebase
marob Sep 7, 2026
e4da6cf
Story #16471: Clean code - WIP fix archive-search
marob Sep 7, 2026
bff6eb2
Story #16471: Clean code - fix stepper
marob Sep 8, 2026
c8d8362
Story #16471: Clean code - WIP fix collect
marob Sep 8, 2026
e9d6fff
Story #16471: Clean code - fix after rebase
marob Sep 16, 2026
a305767
Story #16471: Clean code - fix tests
marob Sep 16, 2026
cf59c3d
Story #16471: Clean code - WIP fix archive-search
marob Sep 16, 2026
fa67b30
Story #16471: Clean code - import material tokens
marob Sep 16, 2026
d8eb26e
Story #16471: Clean code - fix build
marob Sep 23, 2026
90b1c87
Story #16471: Clean code - fix pastis
marob Sep 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion ui/ui-frontend/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,8 @@
"options": {
"tsConfig": "projects/vitamui-library/tsconfig.spec.json",
"setupFiles": [
"test.ts"
"test.ts",
"projects/vitamui-library/test.ts"
],
"outputFile": "junit/vitamui-library.xml"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,40 +34,16 @@
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL-C license and that you accept its terms.
*/
import { Component } from '@angular/core';
import { TestBed } from '@angular/core/testing';
import { MatSidenavModule } from '@angular/material/sidenav';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { Router } from '@angular/router';
import { of } from 'rxjs';
import { AuthService, StartupService } from 'vitamui-library';
import { AppComponent } from './app.component';

@Component({
// eslint-disable-next-line @angular-eslint/component-selector
selector: 'router-outlet',
template: '',
})
class RouterOutletStubComponent {}

@Component({
// eslint-disable-next-line @angular-eslint/component-selector
selector: 'vitamui-common-subrogation-banner',
template: '',
})
class SubrogationBannerStubComponent {}
import { provideRouter } from '@angular/router';

describe('AppComponent', () => {
beforeEach(async () => {
const startupServiceStub = { configurationLoaded: () => true, printConfiguration: () => {} };
await TestBed.configureTestingModule({
imports: [MatSidenavModule, NoopAnimationsModule, SubrogationBannerStubComponent, RouterOutletStubComponent],
declarations: [AppComponent],
providers: [
{ provide: StartupService, useValue: startupServiceStub },
{ provide: AuthService, useValue: { userLoaded: of(null) } },
{ provide: Router, useValue: { navigate: () => {} } },
],
imports: [AppComponent],
providers: [provideRouter([])],
}).compileComponents();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@
* knowledge of the CeCILL-C license and that you accept its terms.
*/
import { Component } from '@angular/core';
import { FooterComponent, HeaderModule, SubrogationModule, VitamuiBodyComponent } from 'vitamui-library';
import { RouterOutlet } from '@angular/router';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: false,
imports: [HeaderModule, VitamuiBodyComponent, RouterOutlet, FooterComponent, SubrogationModule],
})
export class AppComponent {
title = 'Archive Search Application';
Expand Down
82 changes: 0 additions & 82 deletions ui/ui-frontend/projects/archive-search/src/app/app.module.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,15 @@ import { MatMenuModule } from '@angular/material/menu';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatTreeModule } from '@angular/material/tree';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ActivatedRoute } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';
import { of } from 'rxjs';
import {
BASE_URL,
DescriptionLevel,
ENVIRONMENT,
InjectorModule,
LoggerModule,
StartupService,
TenantSelectionService,
Unit,
UnitType,
VitamUICommonModule,
Expand All @@ -60,27 +58,19 @@ import {
import { environment } from '../../../environments/environment.prod';
import { ArchiveService } from '../archive.service';
import { ArchivePreviewComponent } from './archive-preview.component';
import { provideHttpClientTesting } from '@angular/common/http/testing';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';

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

@Pipe({
name: 'truncate',
standalone: false,
})
@Pipe({ name: 'truncate' })
class MockTruncatePipe implements PipeTransform {
transform(value: number): number {
return value;
}
}

@Pipe({
name: 'unitI18n',
standalone: false,
})
@Pipe({ name: 'unitI18n' })
class MockUnitI18nPipe implements PipeTransform {
transform(value: number): number {
return value;
Expand All @@ -91,16 +81,18 @@ describe('ArchivePreviewComponent', () => {
const activatedRouteMock = {
params: of({ tenantIdentifier: 1 }),
data: of({ appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' }),
snapshot: { params: { tenantIdentifier: 1 }, data: { appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' } },
};

const archiveServiceMock = {
getBaseUrl: () => '/fake-api',
buildArchiveUnitPath: () => of({ resumePath: '', fullPath: '' }),
receiveDownloadProgressSubject: () => of(true),
hasArchiveSearchRole: () => of(true),
selectUnitWithInheritedRules: () => of({}),
};

await TestBed.configureTestingModule({
declarations: [ArchivePreviewComponent, MockTruncatePipe, MockUnitI18nPipe],
schemas: [NO_ERRORS_SCHEMA],
imports: [
MatMenuModule,
Expand All @@ -109,16 +101,15 @@ describe('ArchivePreviewComponent', () => {
MatSidenavModule,
InjectorModule,
LoggerModule.forRoot(),
RouterTestingModule,
MatIconModule,
BrowserAnimationsModule,
VitamUICommonModule,
InjectorModule,
LoggerModule.forRoot(),
ArchivePreviewComponent,
MockTruncatePipe,
MockUnitI18nPipe,
],
providers: [
{ provide: ArchiveService, useValue: archiveServiceMock },
{ provide: BASE_URL, useValue: '/fake-api' },
{ provide: ActivatedRoute, useValue: activatedRouteMock },
{ provide: ENVIRONMENT, useValue: environment },
{ provide: WINDOW_LOCATION, useValue: window.location },
Expand All @@ -129,10 +120,17 @@ describe('ArchivePreviewComponent', () => {
setTenantIdentifier: () => {},
},
},
provideHttpClient(withInterceptorsFromDi()),
provideHttpClientTesting(),
],
}).compileComponents();
})
.overrideProvider(ArchiveService, { useValue: archiveServiceMock })
.overrideProvider(TenantSelectionService, {
useValue: {
getSelectedTenant: () => ({
identifier: 42,
}),
},
})
.compileComponents();
});

beforeEach(() => {
Expand All @@ -147,6 +145,7 @@ describe('ArchivePreviewComponent', () => {
'#opi': '',
Title_: { fr: 'Teste', en: 'Test' },
Description_: { fr: 'DescriptionFr', en: 'DescriptionEn' },
DescriptionLevel: DescriptionLevel.OTHER_LEVEL,
};
fixture.detectChanges();
});
Expand Down Expand Up @@ -227,15 +226,6 @@ describe('ArchivePreviewComponent', () => {
});

describe('DOM', () => {
it('should have 5 mat-tab', () => {
// When
const nativeElement = fixture.nativeElement;
const matTabElements = nativeElement.querySelectorAll('mat-tab');

// Then
expect(matTabElements.length).toEqual(5);
});

it('should have 1 mat-tab-group', () => {
// When
const nativeElement = fixture.nativeElement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,63 @@ import {
Component,
EventEmitter,
HostListener,
inject,
Input,
OnChanges,
OnInit,
Output,
SimpleChanges,
ViewChild,
inject,
} from '@angular/core';
import { MatTab, MatTabChangeEvent, MatTabGroup, MatTabHeader } from '@angular/material/tabs';
import { ActivatedRoute } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
import type { Unit } from 'vitamui-library';
import { AccessContract, AccessContractService, unitToVitamuiIcon } from 'vitamui-library';
import { TranslatePipe, TranslateService } from '@ngx-translate/core';
import {
AccessContract,
AccessContractService,
ClickOutsideDirective,
PipesModule,
TooltipDirective,
Unit,
unitToVitamuiIcon,
VitamuiMenuButtonComponent,
VitamuiSidenavHeaderComponent,
} from 'vitamui-library';
import { ArchiveUnitDescriptionTabComponent } from './archive-unit-description-tab/archive-unit-description-tab.component';
import { ArchiveSharedDataService } from '../../core/archive-shared-data.service';
import { MatMenuItem } from '@angular/material/menu';
import { CommonModule, NgClass } from '@angular/common';
import { ArchiveUnitInformationTabComponent } from './archive-unit-information-tab/archive-unit-information-tab.component';
import { ArchiveUnitRulesDetailsTabComponent } from './archive-unit-rules-details-tab/archive-unit-rules-details-tab.component';
import { ArchiveUnitObjectsDetailsTabComponent } from './archive-unit-objects-details-tab/archive-unit-objects-details-tab.component';
import { ReactiveFormsModule } from '@angular/forms';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { ArchiveUnitHistoryTabComponent } from './archive-unit-history-tab/archive-unit-history-tab.component';

@Component({
selector: 'app-archive-preview',
templateUrl: './archive-preview.component.html',
styleUrls: ['./archive-preview.component.scss'],
standalone: false,
imports: [
VitamuiMenuButtonComponent,
MatMenuItem,
TooltipDirective,
MatTabGroup,
NgClass,
MatTab,
ArchiveUnitDescriptionTabComponent,
ArchiveUnitHistoryTabComponent,
ArchiveUnitInformationTabComponent,
ClickOutsideDirective,
ArchiveUnitRulesDetailsTabComponent,
ArchiveUnitObjectsDetailsTabComponent,
PipesModule,
TranslatePipe,
CommonModule,
MatProgressSpinnerModule,
ReactiveFormsModule,
VitamuiSidenavHeaderComponent,
],
})
export class ArchivePreviewComponent implements OnChanges, OnInit, AfterViewInit {
private route = inject(ActivatedRoute);
Expand Down
Loading
Loading