diff --git a/libs/shared/src/i18n/en.json b/libs/shared/src/i18n/en.json index fd18d84f8f..deef2d5599 100644 --- a/libs/shared/src/i18n/en.json +++ b/libs/shared/src/i18n/en.json @@ -905,7 +905,8 @@ "originalValue": "Old value", "person": "User", "time": "Time", - "variable": "Field" + "variable": "Field", + "incrementalId": "Incremental Id" }, "download": "Download history", "empty": "No activity detected", diff --git a/libs/shared/src/i18n/fr.json b/libs/shared/src/i18n/fr.json index 93d69072ae..11da84fda5 100644 --- a/libs/shared/src/i18n/fr.json +++ b/libs/shared/src/i18n/fr.json @@ -916,7 +916,8 @@ "originalValue": "Nouvelle valeur", "person": "Utilisateur", "time": "Heure", - "variable": "Champ" + "variable": "Champ", + "incrementalId": "Incrémental Id" }, "download": "Télécharger l'historique", "empty": "Aucune activité détectée", diff --git a/libs/shared/src/lib/components/record-history/graphql/queries.ts b/libs/shared/src/lib/components/record-history/graphql/queries.ts index 3ff21785c9..ffd3eac131 100644 --- a/libs/shared/src/lib/components/record-history/graphql/queries.ts +++ b/libs/shared/src/lib/components/record-history/graphql/queries.ts @@ -24,6 +24,7 @@ export const GET_RECORD_HISTORY_BY_ID = gql` recordHistory(id: $id, lang: $lang) { createdAt createdBy + incrementalId changes { type field diff --git a/libs/shared/src/lib/components/record-history/record-history.component.html b/libs/shared/src/lib/components/record-history/record-history.component.html index 79e3f10e26..f636162a03 100644 --- a/libs/shared/src/lib/components/record-history/record-history.component.html +++ b/libs/shared/src/lib/components/record-history/record-history.component.html @@ -107,7 +107,7 @@

{{ 'common.history' | translate }}

-
ID : {{ record?.incrementalId }}
+ @@ -143,6 +143,18 @@

{{ 'common.history' | translate }}

+ + + +
+ {{ 'components.history.columns.incrementalId' | translate }} + + {{ element.incrementalId }} + {{ 'components.history.columns.variable' | translate }} diff --git a/libs/shared/src/lib/components/record-history/record-history.component.ts b/libs/shared/src/lib/components/record-history/record-history.component.ts index 7111eab7e4..d0d3a619f5 100644 --- a/libs/shared/src/lib/components/record-history/record-history.component.ts +++ b/libs/shared/src/lib/components/record-history/record-history.component.ts @@ -101,6 +101,7 @@ export class RecordHistoryComponent public sortedFields: any[] = []; /** Table columns */ public displayedColumnsHistory: string[] = [ + 'incrementalId', 'variable', 'date', 'time', @@ -328,6 +329,7 @@ export class RecordHistoryComponent type: change.type, createdAt: filterHistoryElement.createdAt, createdBy: filterHistoryElement.createdBy, + incrementalId: filterHistoryElement.incrementalId, }); } diff --git a/libs/shared/src/lib/models/records-history.model.ts b/libs/shared/src/lib/models/records-history.model.ts index 61eb6ea931..10763d16c5 100644 --- a/libs/shared/src/lib/models/records-history.model.ts +++ b/libs/shared/src/lib/models/records-history.model.ts @@ -19,6 +19,7 @@ export type RecordHistory = { createdBy: string; changes: Change[]; version?: Version; + incrementalId?: string; }[]; /** Get record history query response interface */ diff --git a/libs/ui/src/lib/cron-editor/cron-editor.component.spec.ts b/libs/ui/src/lib/cron-editor/cron-editor.component.spec.ts index 5d5b0b210c..22e15f5e7d 100644 --- a/libs/ui/src/lib/cron-editor/cron-editor.component.spec.ts +++ b/libs/ui/src/lib/cron-editor/cron-editor.component.spec.ts @@ -1,6 +1,10 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { CronEditorComponent } from './cron-editor.component'; +import { TranslateTestingModule } from 'ngx-translate-testing'; +import { TabsModule } from '../tabs/tabs.module'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { ReactiveFormsModule } from '@angular/forms'; describe('CronEditorComponent', () => { let component: CronEditorComponent; @@ -9,6 +13,30 @@ describe('CronEditorComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ declarations: [CronEditorComponent], + imports: [ + ReactiveFormsModule, + BrowserAnimationsModule, + TabsModule, + TranslateTestingModule.withTranslations('en', { + common: { + cronEditor: { + minutely: 'Minutely', + every: { + femenine: 'Every', + masculine: 'Every', + }, + minutes: 'Minute(s)', + atTime: 'At', + hourly: 'hourly', + hours: 'Hour(s)', + daily: 'Daily', + days: 'Day(s)', + weekDay: 'WeekDay', + weekly: 'Weekly', + }, + }, + }), + ], }).compileComponents(); fixture = TestBed.createComponent(CronEditorComponent); diff --git a/libs/ui/src/lib/cron-editor/time-picker/time-picker.component.spec.ts b/libs/ui/src/lib/cron-editor/time-picker/time-picker.component.spec.ts index 81d73e9092..7a9f3b7f15 100644 --- a/libs/ui/src/lib/cron-editor/time-picker/time-picker.component.spec.ts +++ b/libs/ui/src/lib/cron-editor/time-picker/time-picker.component.spec.ts @@ -1,14 +1,50 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { TimePickerComponent } from './time-picker.component'; +import { + ControlContainer, + FormControl, + FormGroup, + FormGroupDirective, + ReactiveFormsModule, +} from '@angular/forms'; +import { TranslateTestingModule } from 'ngx-translate-testing'; +import { SelectMenuModule } from '../../select-menu/select-menu.module'; describe('TimePickerComponent', () => { let component: TimePickerComponent; let fixture: ComponentFixture; + const formGroupDirective: FormGroupDirective = new FormGroupDirective([], []); + formGroupDirective.form = new FormGroup({ + seconds: new FormControl(), + minutes: new FormControl(), + hours: new FormControl(), + hoursType: new FormControl(), + }); + beforeEach(async () => { await TestBed.configureTestingModule({ declarations: [TimePickerComponent], + providers: [ + { + provide: ControlContainer, + useValue: formGroupDirective, + }, + ], + imports: [ + ReactiveFormsModule, + SelectMenuModule, + TranslateTestingModule.withTranslations('en', { + common: { + cronEditor: { + hours: 'Hour(s)', + minutes: 'Minute(s)', + seconds: 'Second(s)', + }, + }, + }), + ], }).compileComponents(); fixture = TestBed.createComponent(TimePickerComponent); diff --git a/libs/ui/src/lib/dialog/dialog-close.directive.spec.ts b/libs/ui/src/lib/dialog/dialog-close.directive.spec.ts index 16917f99be..56e6b3b13c 100644 --- a/libs/ui/src/lib/dialog/dialog-close.directive.spec.ts +++ b/libs/ui/src/lib/dialog/dialog-close.directive.spec.ts @@ -6,6 +6,7 @@ import { DialogCloseDirective } from './dialog-close.directive'; import { DialogRef } from '@angular/cdk/dialog'; import { ButtonModule } from '../button/button.module'; import { By } from '@angular/platform-browser'; +import { TranslateTestingModule } from 'ngx-translate-testing'; /** * Component for testing purposes @@ -37,7 +38,14 @@ describe('DialogCloseDirective', () => { let fixture!: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [TestingComponent], + imports: [ + TestingComponent, + TranslateTestingModule.withTranslations('en', { + common: { + close: 'Close', + }, + }), + ], providers: [ // eslint-disable-next-line @typescript-eslint/no-empty-function { provide: DialogRef, useValue: { removePanelClass: () => {} } }, diff --git a/libs/ui/src/lib/dialog/dialog.component.spec.ts b/libs/ui/src/lib/dialog/dialog.component.spec.ts index f74584e915..3daf0cfae3 100644 --- a/libs/ui/src/lib/dialog/dialog.component.spec.ts +++ b/libs/ui/src/lib/dialog/dialog.component.spec.ts @@ -2,6 +2,9 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { DialogComponent } from './dialog.component'; import { DialogRef } from '@angular/cdk/dialog'; +import { ButtonModule } from '../button/button.module'; +import { TranslateTestingModule } from 'ngx-translate-testing'; +import { TooltipModule } from '../tooltip/tooltip.module'; describe('DialogComponent', () => { let component: DialogComponent; @@ -14,6 +17,15 @@ describe('DialogComponent', () => { // eslint-disable-next-line @typescript-eslint/no-empty-function { provide: DialogRef, useValue: { removePanelClass: () => {} } }, ], + imports: [ + ButtonModule, + TooltipModule, + TranslateTestingModule.withTranslations('en', { + common: { + close: 'Close', + }, + }), + ], }).compileComponents(); fixture = TestBed.createComponent(DialogComponent); diff --git a/libs/ui/src/lib/graphql-select/graphql-select.component.spec.ts b/libs/ui/src/lib/graphql-select/graphql-select.component.spec.ts index 5310e285de..cf12bef7a9 100644 --- a/libs/ui/src/lib/graphql-select/graphql-select.component.spec.ts +++ b/libs/ui/src/lib/graphql-select/graphql-select.component.spec.ts @@ -16,16 +16,16 @@ import { FormWrapperModule } from '../form-wrapper/form-wrapper.module'; */ @Component({ template: `
-
- - -
+ + +
`, }) class TestingComponent { diff --git a/libs/ui/src/lib/snackbar/snackbar.component.spec.ts b/libs/ui/src/lib/snackbar/snackbar.component.spec.ts index 3be8b9476f..97f3a56179 100644 --- a/libs/ui/src/lib/snackbar/snackbar.component.spec.ts +++ b/libs/ui/src/lib/snackbar/snackbar.component.spec.ts @@ -12,7 +12,14 @@ describe('SnackbarComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ declarations: [SnackbarComponent], - imports: [SnackbarModule, TranslateTestingModule], + imports: [ + SnackbarModule, + TranslateTestingModule.withTranslations('en', { + common: { + close: 'Close', + }, + }), + ], providers: [ { provide: SNACKBAR_DATA, diff --git a/libs/ui/src/lib/spinner/spinner.component.spec.ts b/libs/ui/src/lib/spinner/spinner.component.spec.ts index 3361317e9c..1e468e726d 100644 --- a/libs/ui/src/lib/spinner/spinner.component.spec.ts +++ b/libs/ui/src/lib/spinner/spinner.component.spec.ts @@ -1,6 +1,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { SpinnerComponent } from './spinner.component'; +import { TranslateTestingModule } from 'ngx-translate-testing'; describe('SpinnerComponent', () => { let component: SpinnerComponent; @@ -9,6 +10,15 @@ describe('SpinnerComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ declarations: [SpinnerComponent], + imports: [ + TranslateTestingModule.withTranslations('en', { + kendo: { + grid: { + loading: 'loading', + }, + }, + }), + ], }).compileComponents(); fixture = TestBed.createComponent(SpinnerComponent); diff --git a/libs/ui/src/lib/textarea/textarea.component.spec.ts b/libs/ui/src/lib/textarea/textarea.component.spec.ts index c9a829bb75..2103db892b 100644 --- a/libs/ui/src/lib/textarea/textarea.component.spec.ts +++ b/libs/ui/src/lib/textarea/textarea.component.spec.ts @@ -2,6 +2,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { TextareaComponent } from './textarea.component'; import { TextFieldModule } from '@angular/cdk/text-field'; +import { NG_VALUE_ACCESSOR } from '@angular/forms'; +import { forwardRef } from '@angular/core'; describe('TextareaComponent', () => { let component: TextareaComponent; @@ -11,6 +13,13 @@ describe('TextareaComponent', () => { await TestBed.configureTestingModule({ declarations: [TextareaComponent], imports: [TextFieldModule], + providers: [ + { + provide: NG_VALUE_ACCESSOR, + useExisting: forwardRef(() => TextareaComponent), + multi: true, + }, + ], }).compileComponents(); fixture = TestBed.createComponent(TextareaComponent);