Skip to content

Commit

Permalink
feat/cb2-13727 - Folder structure refactor (#1573)
Browse files Browse the repository at this point in the history
* feat(cb2-13727): start refactor of folder structure

* feat(cb2-13727): move shared components to top level

* feat(cb2-13727): move pipes to top level and add shortened url paths

* feat(cb2-13727): add additional shortened url paths

* feat(cb2-13727): add test folders for top level components

* feat(cb2-13727): add test folders to core components

* feat(cb2-13727): unit testing

* feat(cb2-13727): fix lint
  • Loading branch information
tomcrawleyy authored Sep 6, 2024
1 parent 2579d48 commit f839808
Show file tree
Hide file tree
Showing 394 changed files with 937 additions and 773 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { provideMockStore } from '@ngrx/store/testing';
import { initialAppState } from '@store/index';
import { AccordionComponent } from '../accordion/accordion.component';
import { AccordionControlComponent } from './accordion-control.component';
import { AccordionComponent } from '../../accordion/accordion.component';
import { AccordionControlComponent } from '../accordion-control.component';

@Component({
selector: 'app-host',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { MockStore, provideMockStore } from '@ngrx/store/testing';
import { State, initialAppState } from '@store/.';
import { State, initialAppState } from '@store/index';
import { addSectionState, removeSectionState } from '@store/technical-records';
import { AccordionComponent } from './accordion.component';
import { AccordionComponent } from '../accordion.component';

@Component({
selector: 'app-host',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { BannerComponent } from './banner.component';
import { BannerComponent } from '../banner.component';

describe('BannerComponent', () => {
let component: BannerComponent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { BaseDialogComponent } from './base-dialog.component';
import { BaseDialogComponent } from '../base-dialog.component';

describe('BaseDialogComponent', () => {
let component: BaseDialogComponent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ButtonGroupComponent } from './button-group.component';
import { ButtonGroupComponent } from '../button-group.component';

describe('ButtonGroupComponent', () => {
let component: ButtonGroupComponent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { ButtonComponent } from './button.component';
import { ButtonComponent } from '../button.component';

describe('ButtonComponent', () => {
let component: ButtonComponent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { CollapsibleTextComponent } from './collapsible-text.component';
import { CollapsibleTextComponent } from '../collapsible-text.component';

describe('CollapsibleTextComponent', () => {
let component: CollapsibleTextComponent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { IconComponent } from './icon.component';
import { IconComponent } from '../icon.component';

describe('IconComponent', () => {
let component: IconComponent;
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { InputSpinnerComponent } from './input-spinner.component';
import { InputSpinnerComponent } from '../input-spinner.component';

describe('InputSpinnerComponent', () => {
let component: InputSpinnerComponent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { DefaultNullOrEmpty } from '@shared/pipes/default-null-or-empty/default-null-or-empty.pipe';
import { NumberPlateComponent } from './number-plate.component';
import { DefaultNullOrEmpty } from '@pipes/default-null-or-empty/default-null-or-empty.pipe';
import { NumberPlateComponent } from '../number-plate.component';

describe('NumberPlateComponent', () => {
let component: NumberPlateComponent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { By } from '@angular/platform-browser';
import { ActivatedRoute, Router } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';
import { Observable, map } from 'rxjs';
import { PaginationComponent } from './pagination.component';
import { PaginationComponent } from '../pagination.component';

@Component({
selector: 'app-host',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { RouterOutletComponent } from './router-outlet.component';
import { RouterOutletComponent } from '../router-outlet.component';

describe('RouterOutletComponent', () => {
let component: RouterOutletComponent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { TagComponent } from './tag.component';
import { TagComponent } from '../tag.component';

describe('TagComponent', () => {
let component: TagComponent;
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { FeatureToggleService } from '@services/feature-toggle-service/feature-t
import { RetrieveDocumentDirective } from '@shared/directives/retrieve-document/retrieve-document.directive';
import { State, initialAppState } from '@store/index';
import { isTestTypeOldIvaOrMsva, toEditOrNotToEdit } from '@store/test-records';
import { TestCertificateComponent } from './test-certificate.component';
import { TestCertificateComponent } from '../test-certificate.component';

describe('TestCertificateComponent', () => {
let component: TestCertificateComponent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ChangeDetectionStrategy, Component, Input, OnDestroy, OnInit, inject } from '@angular/core';
import { TEST_TYPES_GROUP1_SPEC_TEST, TEST_TYPES_GROUP5_SPEC_TEST } from '@forms/models/testTypeId.enum';
import { resultOfTestEnum } from '@models/test-types/test-type.model';
import { TEST_TYPES_GROUP1_SPEC_TEST, TEST_TYPES_GROUP5_SPEC_TEST } from '@models/testTypeId.enum';
import { Store, select } from '@ngrx/store';
import { FeatureToggleService } from '@services/feature-toggle-service/feature-toggle-service';
import { State } from '@store/index';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { RouterTestingModule } from '@angular/router/testing';
import { RouterReducerState } from '@ngrx/router-store';
import { MockStore, provideMockStore } from '@ngrx/store/testing';
import { RouterService } from '@services/router/router.service';
import { State, initialAppState } from '@store/.';
import { State, initialAppState } from '@store/index';
import { routerState } from '@store/router/selectors/router.selectors';
import { firstValueFrom } from 'rxjs';
import { BreadcrumbsComponent } from './breadcrumbs.component';
import { BreadcrumbsComponent } from '../breadcrumbs.component';

describe('BreadcrumbsComponent', () => {
let component: BreadcrumbsComponent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { FooterComponent } from './footer.component';
import { FooterComponent } from '../footer.component';

describe('FooterComponent', () => {
let component: FooterComponent;
Expand Down
12 changes: 0 additions & 12 deletions src/app/core/components/footer/footer.stories.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { provideMockStore } from '@ngrx/store/testing';
import { initialAppState } from '@store/.';
import { GlobalErrorComponent } from './global-error.component';
import { GlobalErrorService } from './global-error.service';
import { initialAppState } from '@store/index';
import { GlobalErrorComponent } from '../global-error.component';
import { GlobalErrorService } from '../global-error.service';

@Component({
selector: 'app-mock-component',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { TestBed } from '@angular/core/testing';
import { MockStore, provideMockStore } from '@ngrx/store/testing';
import { State, initialAppState } from '@store/.';
import { addError, clearError, patchErrors, setErrors } from '@store/global-error/actions/global-error.actions';
import { GlobalError } from './global-error.interface';
import { GlobalErrorService } from './global-error.service';
import { State, initialAppState } from '@store/index';
import { GlobalError } from '../global-error.interface';
import { GlobalErrorService } from '../global-error.service';

describe('GlobalErrorService', () => {
let service: GlobalErrorService;
Expand Down
15 changes: 0 additions & 15 deletions src/app/core/components/global-error/global-error.stories.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { provideMockStore } from '@ngrx/store/testing';
import { initialAppState } from '@store/.';
import { GlobalWarningComponent } from './global-warning.component';
import { GlobalWarningService } from './global-warning.service';
import { initialAppState } from '@store/index';
import { GlobalWarningComponent } from '../global-warning.component';
import { GlobalWarningService } from '../global-warning.service';

@Component({
selector: 'app-mock-component',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { TestBed } from '@angular/core/testing';
import { MockStore, provideMockStore } from '@ngrx/store/testing';
import { State, initialAppState } from '@store/.';
import { clearWarning, setWarnings } from '@store/global-warning/actions/global-warning.actions';
import { GlobalWarning } from './global-warning.interface';
import { GlobalWarningService } from './global-warning.service';
import { State, initialAppState } from '@store/index';
import { GlobalWarning } from '../global-warning.interface';
import { GlobalWarningService } from '../global-warning.service';

describe('GlobalWarningService', () => {
let service: GlobalWarningService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DebugElement } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { HeaderComponent } from './header.component';
import { HeaderComponent } from '../header.component';

describe('HeaderComponent', () => {
let component: HeaderComponent;
Expand Down
19 changes: 0 additions & 19 deletions src/app/core/components/header/header.stories.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { PageNotFoundComponent } from './page-not-found.component';
import { PageNotFoundComponent } from '../page-not-found.component';

describe('PageNotFoundComponent', () => {
let component: PageNotFoundComponent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { PhaseBannerComponent } from './phase-banner.component';
import { PhaseBannerComponent } from '../phase-banner.component';

describe('PhaseBannerComponent', () => {
let component: PhaseBannerComponent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ServerErrorComponent } from './server-error.component';
import { ServerErrorComponent } from '../server-error.component';

describe('ServerErrorComponent', () => {
let component: ServerErrorComponent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { SpinnerComponent } from './spinner.component';
import { SpinnerComponent } from '../spinner.component';

describe('SpinnerComponent', () => {
let component: SpinnerComponent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { By } from '@angular/platform-browser';
import { NoSpaceDirective } from './app-no-space.directive';
import { NoSpaceDirective } from '../app-no-space.directive';

@Component({
template: ` <form [formGroup]="form"><input id="bar" appNoSpace formControlName="foo" /></form>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { NumberOnlyDirective } from './app-number-only.directive';
import { NumberOnlyDirective } from '../app-number-only.directive';

@Component({
template: ' <input type="number" appNumberOnly />',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { By } from '@angular/platform-browser';
import { Roles } from '@models/roles.enum';
import { provideMockStore } from '@ngrx/store/testing';
import { UserService } from '@services/user-service/user-service';
import { initialAppState } from '@store/.';
import { initialAppState } from '@store/index';
import { of } from 'rxjs';
import { RoleRequiredDirective } from './app-role-required.directive';
import { RoleRequiredDirective } from '../app-role-required.directive';

@Component({
template: `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { By } from '@angular/platform-browser';
import { ToUppercaseDirective } from './app-to-uppercase.directive';
import { ToUppercaseDirective } from '../app-to-uppercase.directive';

@Component({
template: ' <form [formGroup]="form"><input appToUppercase formControlName="foo" /></form>',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { By } from '@angular/platform-browser';
import { TrimWhitespaceDirective } from './app-trim-whitespace.directive';
import { TrimWhitespaceDirective } from '../app-trim-whitespace.directive';

@Component({
template: ` <form [formGroup]="form"><input id="bar" appTrimWhitespace formControlName="foo" /></form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { FeatureToggleService } from '@services/feature-toggle-service/feature-toggle-service';
import { FeatureToggleDirective } from './feature-toggle.directive';
import { FeatureToggleDirective } from '../feature-toggle.directive';

@Component({
template: `
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, TemplateRef } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { PrefixDirective } from './prefix.directive';
import { PrefixDirective } from '../prefix.directive';

@Component({
template: '<ng-template appPrefix></ng-template>',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, TemplateRef } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { SuffixDirective } from './suffix.directive';
import { SuffixDirective } from '../suffix.directive';

@Component({
template: '<ng-template appSuffix></ng-template>',
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/home/home.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { HttpClientModule } from '@angular/common/http';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FormBuilder } from '@angular/forms';
import { RouterTestingModule } from '@angular/router/testing';
import { RoleRequiredDirective } from '@directives/app-role-required.directive';
import { RoleRequiredDirective } from '@directives/app-role-required/app-role-required.directive';
import { provideMockActions } from '@ngrx/effects/testing';
import { Action } from '@ngrx/store';
import { UserService } from '@services/user-service/user-service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { GlobalErrorService } from '@core/components/global-error/global-error.s
import { MockStore, provideMockStore } from '@ngrx/store/testing';
import { ReferenceDataService } from '@services/reference-data/reference-data.service';
import { UserService } from '@services/user-service/user-service';
import { State, initialAppState } from '@store/.';
import { State, initialAppState } from '@store/index';
import { of } from 'rxjs';
import { ReferenceDataCreateComponent } from './reference-data-add.component';
import { ReferenceDataCreateComponent } from '../reference-data-add.component';

const mockRefDataService = {
loadReferenceData: jest.fn(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { ActivatedRoute, Router } from '@angular/router';
import { GlobalError } from '@core/components/global-error/global-error.interface';
import { GlobalErrorService } from '@core/components/global-error/global-error.service';
import { DynamicFormGroupComponent } from '@forms/components/dynamic-form-group/dynamic-form-group.component';
import { DynamicFormService } from '@forms/services/dynamic-form.service';
import { CustomFormGroup, FormNodeWidth } from '@forms/services/dynamic-form.types';
import { ReferenceDataResourceType } from '@models/reference-data.model';
import { Roles } from '@models/roles.enum';
import { Store, select } from '@ngrx/store';
import { DynamicFormService } from '@services/dynamic-forms/dynamic-form.service';
import { CustomFormGroup, FormNodeWidth } from '@services/dynamic-forms/dynamic-form.types';
import { ReferenceDataService } from '@services/reference-data/reference-data.service';
import { ReferenceDataState, createReferenceDataItem, selectReferenceDataByResourceKey } from '@store/reference-data';
import { Observable, catchError, filter, of, switchMap, take, throwError } from 'rxjs';
Expand Down
Loading

0 comments on commit f839808

Please sign in to comment.