Skip to content

Commit

Permalink
Merge pull request #535 from aneoconsulting/fix/update-api
Browse files Browse the repository at this point in the history
fix: update api version
  • Loading branch information
ngruelaneo authored Aug 28, 2023
2 parents 08bac5d + 12db3bd commit 9a467ad
Show file tree
Hide file tree
Showing 25 changed files with 959 additions and 364 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ <h1 i18n>Applications</h1>
</clr-dg-action-bar>

<clr-dg-column
[clrDgField]="OrderByField.APPLICATION_RAW_FIELD_NAME.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.APPLICATION_RAW_FIELD_NAME)"
[clrDgField]="OrderByField.APPLICATION_RAW_ENUM_FIELD_NAME.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.APPLICATION_RAW_ENUM_FIELD_NAME)"
>
<span i18n> Name </span>
<clr-dg-filter [clrDgFilter]="nameFilterComponent">
Expand All @@ -33,8 +33,8 @@ <h1 i18n>Applications</h1>
</clr-dg-filter>
</clr-dg-column>
<clr-dg-column
[clrDgField]="OrderByField.APPLICATION_RAW_FIELD_VERSION.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.APPLICATION_RAW_FIELD_VERSION)"
[clrDgField]="OrderByField.APPLICATION_RAW_ENUM_FIELD_VERSION.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.APPLICATION_RAW_ENUM_FIELD_VERSION)"
>
<span i18n> Version </span>
<clr-dg-filter [clrDgFilter]="versionFilterComponent">
Expand All @@ -47,8 +47,8 @@ <h1 i18n>Applications</h1>
</clr-dg-filter>
</clr-dg-column>
<clr-dg-column
[clrDgField]="OrderByField.APPLICATION_RAW_FIELD_NAMESPACE.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.APPLICATION_RAW_FIELD_NAMESPACE)"
[clrDgField]="OrderByField.APPLICATION_RAW_ENUM_FIELD_NAMESPACE.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.APPLICATION_RAW_ENUM_FIELD_NAMESPACE)"
>
<span i18n> Namespace </span>
<clr-dg-filter [clrDgFilter]="namespaceFilterComponent">
Expand All @@ -61,8 +61,8 @@ <h1 i18n>Applications</h1>
</clr-dg-filter>
</clr-dg-column>
<clr-dg-column
[clrDgField]="OrderByField.APPLICATION_RAW_FIELD_SERVICE.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.APPLICATION_RAW_FIELD_SERVICE)"
[clrDgField]="OrderByField.APPLICATION_RAW_ENUM_FIELD_SERVICE.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.APPLICATION_RAW_ENUM_FIELD_SERVICE)"
>
<span i18n> Service </span>
<clr-dg-filter [clrDgFilter]="serviceFilterComponent">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
ApplicationRaw,
ApplicationRawField,
ListApplicationsRequest,
ApplicationRawEnumField,
ListApplicationsResponse,
SortDirection,
} from '@aneoconsultingfr/armonik.api.angular';
Expand Down Expand Up @@ -32,6 +31,13 @@ import { SettingsService } from '../../../shared/util';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ApplicationsListComponent {
constructor(
private _router: Router,
private _activatedRoute: ActivatedRoute,
private _settingsService: SettingsService,
private _grpcApplicationsService: GrpcApplicationsService
) {}

private _state: ClrDatagridStateInterface = {};
private _intervalValue = this._settingsService.intervalQueryParam(
this._activatedRoute.snapshot.queryParams
Expand Down Expand Up @@ -97,13 +103,6 @@ export class ApplicationsListComponent {
'service'
);

constructor(
private _router: Router,
private _activatedRoute: ActivatedRoute,
private _settingsService: SettingsService,
private _grpcApplicationsService: GrpcApplicationsService
) {}

public get refreshIntervalValue() {
return this._intervalValue;
}
Expand All @@ -123,7 +122,7 @@ export class ApplicationsListComponent {
}

public get OrderByField() {
return ApplicationRawField;
return ApplicationRawEnumField;
}

public get intervals() {
Expand All @@ -142,7 +141,9 @@ export class ApplicationsListComponent {
this._subjectDatagrid.next(this._state);
}

public defaultSortOrder(field: ApplicationRawField): ClrDatagridSortOrder {
public defaultSortOrder(
field: ApplicationRawEnumField
): ClrDatagridSortOrder {
const orderBy = Number(
this._activatedRoute.snapshot.queryParamMap.get('orderBy')
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ <h1 i18n>Partitions</h1>
</app-action-bar>
</clr-dg-action-bar>
<clr-dg-column
[clrDgField]="OrderByField.PARTITION_RAW_FIELD_ID.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.PARTITION_RAW_FIELD_ID)"
[clrDgField]="OrderByField.PARTITION_RAW_ENUM_FIELD_ID.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.PARTITION_RAW_ENUM_FIELD_ID)"
>
<span i18n>Id</span>
<clr-dg-filter [clrDgFilter]="idFilter">
Expand All @@ -28,8 +28,8 @@ <h1 i18n>Partitions</h1>
</clr-dg-filter>
</clr-dg-column>
<clr-dg-column
[clrDgField]="OrderByField.PARTITION_RAW_FIELD_PARENT_PARTITION_IDS.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.PARTITION_RAW_FIELD_PARENT_PARTITION_IDS)"
[clrDgField]="OrderByField.PARTITION_RAW_ENUM_FIELD_PARENT_PARTITION_IDS.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.PARTITION_RAW_ENUM_FIELD_PARENT_PARTITION_IDS)"
>
<span i18n>Parent</span>
<clr-dg-filter [clrDgFilter]="idParentFilter">
Expand All @@ -42,8 +42,8 @@ <h1 i18n>Partitions</h1>
</clr-dg-filter>
</clr-dg-column>
<clr-dg-column
[clrDgField]="OrderByField.PARTITION_RAW_FIELD_POD_RESERVED.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.PARTITION_RAW_FIELD_POD_RESERVED)"
[clrDgField]="OrderByField.PARTITION_RAW_ENUM_FIELD_POD_RESERVED.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.PARTITION_RAW_ENUM_FIELD_POD_RESERVED)"
>
<span i18n>Reserved pods</span>
<clr-dg-filter [clrDgFilter]="reservedPodFilter">
Expand All @@ -56,8 +56,8 @@ <h1 i18n>Partitions</h1>
</clr-dg-filter>
</clr-dg-column>
<clr-dg-column
[clrDgField]="OrderByField.PARTITION_RAW_FIELD_POD_MAX.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.PARTITION_RAW_FIELD_POD_MAX)"
[clrDgField]="OrderByField.PARTITION_RAW_ENUM_FIELD_POD_MAX.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.PARTITION_RAW_ENUM_FIELD_POD_MAX)"
>
<span i18n>Maximum pods</span>
<clr-dg-filter [clrDgFilter]="maxPodFilter">
Expand All @@ -70,8 +70,8 @@ <h1 i18n>Partitions</h1>
</clr-dg-filter>
</clr-dg-column>
<clr-dg-column
[clrDgField]="OrderByField.PARTITION_RAW_FIELD_PREEMPTION_PERCENTAGE.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.PARTITION_RAW_FIELD_PREEMPTION_PERCENTAGE)"
[clrDgField]="OrderByField.PARTITION_RAW_ENUM_FIELD_PREEMPTION_PERCENTAGE.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.PARTITION_RAW_ENUM_FIELD_PREEMPTION_PERCENTAGE)"
>
<span i18n>Percentage</span>
<clr-dg-filter [clrDgFilter]="percentageFilter">
Expand All @@ -84,8 +84,8 @@ <h1 i18n>Partitions</h1>
</clr-dg-filter>
</clr-dg-column>
<clr-dg-column
[clrDgField]="OrderByField.PARTITION_RAW_FIELD_PRIORITY.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.PARTITION_RAW_FIELD_PRIORITY)"
[clrDgField]="OrderByField.PARTITION_RAW_ENUM_FIELD_PRIORITY.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.PARTITION_RAW_ENUM_FIELD_PRIORITY)"
>
<span i18n>Priority</span>
<clr-dg-filter [clrDgFilter]="priorityFilter">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {
GetPartitionResponse,
ListPartitionsRequest,
ListPartitionsResponse,
PartitionRaw,
PartitionRawField,
PartitionRawEnumField,
} from '@aneoconsultingfr/armonik.api.angular';
import { Component } from '@angular/core';
import { ActivatedRoute, Params, Router } from '@angular/router';
Expand Down Expand Up @@ -35,6 +34,13 @@ import {
styleUrls: ['./partitions-list.page.scss'],
})
export class PartitionsListComponent {
constructor(
private _settingsService: SettingsService,
private _activatedRoute: ActivatedRoute,
private _grpcPartitionsService: GrpcPartitionsService,
private _router: Router
) {}

private _state: ClrDatagridStateInterface = {};
private _intervalValue = this._settingsService.intervalQueryParam(
this._activatedRoute.snapshot.queryParams
Expand Down Expand Up @@ -131,13 +137,6 @@ export class PartitionsListComponent {
'priority'
);

constructor(
private _settingsService: SettingsService,
private _activatedRoute: ActivatedRoute,
private _grpcPartitionsService: GrpcPartitionsService,
private _router: Router
) {}

public get refreshIntervalValue() {
return this._intervalValue;
}
Expand All @@ -157,7 +156,7 @@ export class PartitionsListComponent {
}

public get OrderByField() {
return PartitionRawField;
return PartitionRawEnumField;
}

public get intervals(): number[] {
Expand Down Expand Up @@ -226,7 +225,7 @@ export class PartitionsListComponent {
return partition.id ?? '';
}

public defaultSortOrder(field: PartitionRawField): ClrDatagridSortOrder {
public defaultSortOrder(field: PartitionRawEnumField): ClrDatagridSortOrder {
const orderBy = Number(
this._activatedRoute.snapshot.queryParamMap.get('orderBy')
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ <h1 i18n>Results</h1>
</clr-dg-action-bar>

<clr-dg-column
[clrDgField]="OrderByField.RESULT_RAW_FIELD_NAME.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.RESULT_RAW_FIELD_NAME)"
[clrDgField]="OrderByField.RESULT_RAW_ENUM_FIELD_NAME.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.RESULT_RAW_ENUM_FIELD_NAME)"
>
<span i18n> Name </span>
<clr-dg-filter [clrDgFilter]="nameFilterComponent">
Expand All @@ -33,9 +33,9 @@ <h1 i18n>Results</h1>
</clr-dg-filter>
</clr-dg-column>
<clr-dg-column
[clrDgField]="OrderByField.RESULT_RAW_FIELD_OWNER_TASK_ID.toString()"
[clrDgField]="OrderByField.RESULT_RAW_ENUM_FIELD_OWNER_TASK_ID.toString()"
[clrDgSortOrder]="
defaultSortOrder(OrderByField.RESULT_RAW_FIELD_OWNER_TASK_ID)
defaultSortOrder(OrderByField.RESULT_RAW_ENUM_FIELD_OWNER_TASK_ID)
"
>
<span i18n> Task ID </span>
Expand All @@ -49,9 +49,9 @@ <h1 i18n>Results</h1>
</clr-dg-filter>
</clr-dg-column>
<clr-dg-column
[clrDgField]="OrderByField.RESULT_RAW_FIELD_SESSION_ID.toString()"
[clrDgField]="OrderByField.RESULT_RAW_ENUM_FIELD_SESSION_ID.toString()"
[clrDgSortOrder]="
defaultSortOrder(OrderByField.RESULT_RAW_FIELD_SESSION_ID)
defaultSortOrder(OrderByField.RESULT_RAW_ENUM_FIELD_SESSION_ID)
"
>
<span i18n> Session ID </span>
Expand All @@ -65,8 +65,8 @@ <h1 i18n>Results</h1>
</clr-dg-filter>
</clr-dg-column>
<clr-dg-column
[clrDgField]="OrderByField.RESULT_RAW_FIELD_STATUS.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.RESULT_RAW_FIELD_STATUS)"
[clrDgField]="OrderByField.RESULT_RAW_ENUM_FIELD_STATUS.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.RESULT_RAW_ENUM_FIELD_STATUS)"
>
<span i18n> Status </span>
<clr-dg-filter [clrDgFilter]="statusFilterComponent">
Expand All @@ -80,9 +80,9 @@ <h1 i18n>Results</h1>
</clr-dg-filter>
</clr-dg-column>
<clr-dg-column
[clrDgField]="OrderByField.RESULT_RAW_FIELD_CREATED_AT.toString()"
[clrDgField]="OrderByField.RESULT_RAW_ENUM_FIELD_CREATED_AT.toString()"
[clrDgSortOrder]="
defaultSortOrder(OrderByField.RESULT_RAW_FIELD_CREATED_AT)
defaultSortOrder(OrderByField.RESULT_RAW_ENUM_FIELD_CREATED_AT)
"
>
<span i18n> Created at </span>
Expand Down
19 changes: 10 additions & 9 deletions apps/app/src/app/results/feature/results-list/results-list.page.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
ListResultsResponse,
ResultRaw,
ResultRawEnumField,
ResultRawField,
ResultStatus,
SortDirection,
Expand Down Expand Up @@ -36,6 +37,13 @@ import { SettingsService } from '../../../shared/util';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ResultsListComponent implements OnInit {
constructor(
private _router: Router,
private _activatedRoute: ActivatedRoute,
private _settingsService: SettingsService,
private _grpcResultsService: GrpcResultsService
) {}

private _state: ClrDatagridStateInterface = {};
private _intervalValue = this._settingsService.intervalQueryParam(
this._activatedRoute.snapshot.queryParams
Expand Down Expand Up @@ -113,13 +121,6 @@ export class ResultsListComponent implements OnInit {
'createdAfter'
);

constructor(
private _router: Router,
private _activatedRoute: ActivatedRoute,
private _settingsService: SettingsService,
private _grpcResultsService: GrpcResultsService
) {}

ngOnInit(): void {
this.statusList = [
...Object.keys(ResultStatus)
Expand Down Expand Up @@ -152,7 +153,7 @@ export class ResultsListComponent implements OnInit {
}

public get OrderByField() {
return ResultRawField;
return ResultRawEnumField;
}

public get ResultsStatusEnum() {
Expand Down Expand Up @@ -192,7 +193,7 @@ export class ResultsListComponent implements OnInit {
this._subjectDatagrid.next(this._state);
}

public defaultSortOrder(field: ResultRawField): ClrDatagridSortOrder {
public defaultSortOrder(field: ResultRawEnumField): ClrDatagridSortOrder {
const orderBy = Number(
this._activatedRoute.snapshot.queryParamMap.get('orderBy')
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ <h1 i18n>Sessions</h1>
</clr-dg-action-bar>

<clr-dg-column
[clrDgField]="OrderByField.SESSION_RAW_FIELD_SESSION_ID.toString()"
[clrDgField]="OrderByField.SESSION_RAW_ENUM_FIELD_SESSION_ID.toString()"
[clrDgSortOrder]="
defaultSortOrder(OrderByField.SESSION_RAW_FIELD_SESSION_ID)
defaultSortOrder(OrderByField.SESSION_RAW_ENUM_FIELD_SESSION_ID)
"
>
<span i18n> Session ID </span>
Expand All @@ -78,8 +78,8 @@ <h1 i18n>Sessions</h1>
</clr-dg-filter>
</clr-dg-column>
<clr-dg-column
[clrDgField]="OrderByField.SESSION_RAW_FIELD_STATUS.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.SESSION_RAW_FIELD_STATUS)"
[clrDgField]="OrderByField.SESSION_RAW_ENUM_FIELD_STATUS.toString()"
[clrDgSortOrder]="defaultSortOrder(OrderByField.SESSION_RAW_ENUM_FIELD_STATUS)"
>
<span i18n> Status </span>
<clr-dg-filter [clrDgFilter]="statusFilterComponent">
Expand All @@ -93,9 +93,9 @@ <h1 i18n>Sessions</h1>
</clr-dg-filter>
</clr-dg-column>
<clr-dg-column
[clrDgField]="OrderByField.SESSION_RAW_FIELD_CREATED_AT.toString()"
[clrDgField]="OrderByField.SESSION_RAW_ENUM_FIELD_CREATED_AT.toString()"
[clrDgSortOrder]="
defaultSortOrder(OrderByField.SESSION_RAW_FIELD_CREATED_AT)
defaultSortOrder(OrderByField.SESSION_RAW_ENUM_FIELD_CREATED_AT)
"
>
<span i18n> Created at </span>
Expand All @@ -110,9 +110,9 @@ <h1 i18n>Sessions</h1>
</clr-dg-filter>
</clr-dg-column>
<clr-dg-column
[clrDgField]="OrderByField.SESSION_RAW_FIELD_CANCELLED_AT.toString()"
[clrDgField]="OrderByField.SESSION_RAW_ENUM_FIELD_CANCELLED_AT.toString()"
[clrDgSortOrder]="
defaultSortOrder(OrderByField.SESSION_RAW_FIELD_CANCELLED_AT)
defaultSortOrder(OrderByField.SESSION_RAW_ENUM_FIELD_CANCELLED_AT)
"
>
<span i18n> Closed at </span>
Expand Down
Loading

0 comments on commit 9a467ad

Please sign in to comment.