Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion libs/shared/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion libs/shared/src/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const GET_RECORD_HISTORY_BY_ID = gql`
recordHistory(id: $id, lang: $lang) {
createdAt
createdBy
incrementalId
changes {
type
field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ <h2 class="float-left mb-0">{{ 'common.history' | translate }}</h2>
</div>
</div>
<ng-container *ngIf="!loading; else loadingTmpl">
<div class="text-sm my-4">ID : {{ record?.incrementalId }}</div>
<!-- <div class="text-sm my-4">ID : {{ record?.incrementalId }}</div> -->
<ng-container *ngIf="filterHistory.length; else emptyTmpl">
<!-- HISTORY CHANGES -->
<ng-container *ngIf="viewAsTable.value; else cardsTmpl">
Expand Down Expand Up @@ -143,6 +143,18 @@ <h2 class="float-left mb-0">{{ 'common.history' | translate }}</h2>
<ng-template #tableTmpl>
<div class="overflow-x-auto">
<table cdk-table uiTableWrapper [dataSource]="historyForTable">
<ng-container cdkColumnDef="incrementalId">
<th uiCellHeader *cdkHeaderCellDef scope="col">
{{ 'components.history.columns.incrementalId' | translate }}
</th>
<td
uiCell
*cdkCellDef="let element"
class="!text-gray-900 !font-medium max-w-[30vw]"
>
{{ element.incrementalId }}
</td>
</ng-container>
<ng-container cdkColumnDef="variable">
<th uiCellHeader *cdkHeaderCellDef scope="col">
{{ 'components.history.columns.variable' | translate }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export class RecordHistoryComponent
public sortedFields: any[] = [];
/** Table columns */
public displayedColumnsHistory: string[] = [
'incrementalId',
'variable',
'date',
'time',
Expand Down Expand Up @@ -328,6 +329,7 @@ export class RecordHistoryComponent
type: change.type,
createdAt: filterHistoryElement.createdAt,
createdBy: filterHistoryElement.createdBy,
incrementalId: filterHistoryElement.incrementalId,
});
}

Expand Down
1 change: 1 addition & 0 deletions libs/shared/src/lib/models/records-history.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export type RecordHistory = {
createdBy: string;
changes: Change[];
version?: Version;
incrementalId?: string;
}[];

/** Get record history query response interface */
Expand Down
28 changes: 28 additions & 0 deletions libs/ui/src/lib/cron-editor/cron-editor.component.spec.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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<TimePickerComponent>;

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);
Expand Down
10 changes: 9 additions & 1 deletion libs/ui/src/lib/dialog/dialog-close.directive.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -37,7 +38,14 @@ describe('DialogCloseDirective', () => {
let fixture!: ComponentFixture<TestingComponent>;
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: () => {} } },
Expand Down
12 changes: 12 additions & 0 deletions libs/ui/src/lib/dialog/dialog.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
20 changes: 10 additions & 10 deletions libs/ui/src/lib/graphql-select/graphql-select.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ import { FormWrapperModule } from '../form-wrapper/form-wrapper.module';
*/
@Component({
template: ` <form [formGroup]="form">
<div uiFormFieldDirective>
<label>{{ 'components.record.convert.select' | translate }}</label>
<ui-graphql-select
valueField="id"
textField="name"
[query]="null"
formControlName="formControl"
[filterable]="true"
></ui-graphql-select>
</div>
<!-- <div uiFormFieldDirective>
<label>{{ 'components.record.convert.select' | translate }}</label> -->
<ui-graphql-select
valueField="id"
textField="name"
[query]="null"
formControlName="formControl"
[filterable]="true"
></ui-graphql-select>
<!-- </div> -->
</form>`,
})
class TestingComponent {
Expand Down
9 changes: 8 additions & 1 deletion libs/ui/src/lib/snackbar/snackbar.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 10 additions & 0 deletions libs/ui/src/lib/spinner/spinner.component.spec.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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);
Expand Down
9 changes: 9 additions & 0 deletions libs/ui/src/lib/textarea/textarea.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down