- @if ((showEnergySupplierDropdown$ | push) && form.controls.energySupplier) {
-
-
-
- }
-
- @if (hasMoreThanOneGridAreaOption()) {
-
-
- @if (miltipleGridAreasSelected$ | push) {
-
- {{ t("gridAreaHint", { count: form.controls.gridAreas.value?.length }) }}
-
- }
-
-
- @if (miltipleGridAreasSelected$ | push) {
-
- {{ t("combineResultsInOneFile") }}
-
- }
-
- }
-
;
}>;
+type SettlementReportRequestedBy = {
+ isFas: boolean;
+ actorId: string;
+ marketRole: EicFunction;
+};
+
@Component({
selector: 'dh-request-settlement-report-modal',
standalone: true,
@@ -132,16 +135,14 @@ type DhFormType = FormGroup<{
`,
templateUrl: './dh-request-settlement-report-modal.component.html',
})
-export class DhRequestSettlementReportModalComponent extends WattTypedModal {
+export class DhRequestSettlementReportModalComponent extends WattTypedModal {
private readonly formBuilder = inject(NonNullableFormBuilder);
private readonly environmentInjector = inject(EnvironmentInjector);
private readonly destroyRef = inject(DestroyRef);
private readonly apollo = inject(Apollo);
- private readonly permissionService = inject(PermissionService);
private readonly toastService = inject(WattToastService);
private readonly modalService = inject(WattModalService);
- private readonly actorStorage = inject(DhActorStorage);
private modal = viewChild.required(WattModalComponent);
@@ -170,16 +171,13 @@ export class DhRequestSettlementReportModalComponent extends WattTypedModal {
useApi: new FormControl(false, { nonNullable: true }),
});
- showEnergySupplierDropdown$ = this.permissionService.isFas().pipe(
- map(
- (isFas) =>
- isFas || this.actorStorage.getSelectedActor().marketRole === EicFunction.SystemOperator
- ),
+ showEnergySupplierDropdown$ = of(this.modalData.isFas).pipe(
+ map((isFas) => isFas || this.modalData.marketRole === EicFunction.SystemOperator),
tap((showEnergySupplierDropdown) => {
if (showEnergySupplierDropdown) {
this.form.addControl(
'energySupplier',
- new FormControl(null, Validators.required)
+ new FormControl(ALL_ENERGY_SUPPLIERS, Validators.required)
);
}
})
@@ -201,7 +199,7 @@ export class DhRequestSettlementReportModalComponent extends WattTypedModal {
showMonthlySumCheckbox$ = this.shouldShowMonthlySumCheckbox();
- miltipleGridAreasSelected$: Observable = this.form.controls.gridAreas.valueChanges.pipe(
+ multipleGridAreasSelected$: Observable = this.form.controls.gridAreas.valueChanges.pipe(
map((gridAreas) => (gridAreas?.length ? gridAreas.length > 1 : false)),
tap((moreThanOneGridAreas) => {
if (!moreThanOneGridAreas) {
@@ -295,6 +293,26 @@ export class DhRequestSettlementReportModalComponent extends WattTypedModal {
return;
}
+ let marketRole: SettlementReportMarketRole;
+
+ switch (this.modalData.marketRole) {
+ case EicFunction.DataHubAdministrator:
+ marketRole = SettlementReportMarketRole.DataHubAdministrator;
+ break;
+ case EicFunction.EnergySupplier:
+ marketRole = SettlementReportMarketRole.EnergySupplier;
+ break;
+ case EicFunction.GridAccessProvider:
+ marketRole = SettlementReportMarketRole.GridAccessProvider;
+ break;
+ case EicFunction.SystemOperator:
+ marketRole = SettlementReportMarketRole.SystemOperator;
+ break;
+ default:
+ marketRole = SettlementReportMarketRole.Other;
+ break;
+ }
+
this.apollo
.mutate({
mutation: RequestSettlementReportDocument,
@@ -316,6 +334,8 @@ export class DhRequestSettlementReportModalComponent extends WattTypedModal {
energySupplier: energySupplier == ALL_ENERGY_SUPPLIERS ? null : energySupplier,
csvLanguage: translate('selectedLanguageIso'),
useApi,
+ requestAsActorId: this.modalData.actorId,
+ requestAsMarketRole: marketRole,
},
},
refetchQueries: (result) => {
@@ -350,11 +370,9 @@ export class DhRequestSettlementReportModalComponent extends WattTypedModal {
}
private getCalculationTypeOptions(): WattDropdownOptions {
- const selectedUser = this.actorStorage.getSelectedActor();
-
return dhEnumToWattDropdownOptions(CalculationType, null, [
CalculationType.Aggregation,
- selectedUser?.marketRole === EicFunction.SystemOperator ? CalculationType.BalanceFixing : '',
+ this.modalData.marketRole === EicFunction.SystemOperator ? CalculationType.BalanceFixing : '',
]);
}
@@ -387,16 +405,15 @@ export class DhRequestSettlementReportModalComponent extends WattTypedModal {
}
private showAllGridAres(): Observable {
- const isFas$ = this.permissionService.isFas();
const canSeeAllGridAreas = [EicFunction.EnergySupplier, EicFunction.SystemOperator].includes(
- this.actorStorage.getSelectedActor().marketRole
+ this.modalData.marketRole
);
- return isFas$.pipe(map((isFas) => isFas || canSeeAllGridAreas));
+ return of(this.modalData.isFas || canSeeAllGridAreas);
}
private getGridAreaOptionsForActor(): Observable {
- const actorId = this.actorStorage.getSelectedActorId();
+ const actorId = this.modalData.actorId;
return this.apollo
.query({
query: GetActorByIdDocument,
diff --git a/libs/eo/core/globalization/configuration-watt-translation/src/lib/eo-watt-translation.providers.ts b/libs/eo/core/globalization/configuration-watt-translation/src/lib/eo-watt-translation.providers.ts
index 9ee84880c3..2bcfc2f35b 100644
--- a/libs/eo/core/globalization/configuration-watt-translation/src/lib/eo-watt-translation.providers.ts
+++ b/libs/eo/core/globalization/configuration-watt-translation/src/lib/eo-watt-translation.providers.ts
@@ -42,9 +42,9 @@ export class EoDataIntlService extends WattDataIntlService {
transloco.selectTranslateObject('shared').subscribe((translations) => {
this.search = translations.search;
this.emptyTitle = translations.empty.title;
- this.emptyMessage = translations.empty.message;
+ this.emptyText = translations.empty.message;
this.errorTitle = translations.error.title;
- this.errorMessage = translations.error.message;
+ this.errorText = translations.error.message;
this.changes.next();
});
}
diff --git a/libs/watt/src/lib/components/data/watt-data-intl.service.ts b/libs/watt/src/lib/components/data/watt-data-intl.service.ts
index 9bf7f06962..01cbbe2472 100644
--- a/libs/watt/src/lib/components/data/watt-data-intl.service.ts
+++ b/libs/watt/src/lib/components/data/watt-data-intl.service.ts
@@ -22,7 +22,9 @@ export class WattDataIntlService {
readonly changes: Subject = new Subject();
search = 'Search';
emptyTitle = 'No results found';
- emptyMessage = 'Try changing the search criteria.';
+ emptyText = 'Try changing the search criteria.';
errorTitle = 'An unexpected error occured';
- errorMessage = 'Unfortunately, an error occurred while retrieving the necessary information.';
+ errorText = 'Unfortunately, an error occurred while retrieving the necessary information.';
+ defaultTitle = 'An unexpected error occured';
+ defaultText = 'Unfortunately, an error occurred while retrieving the necessary information.';
}
diff --git a/libs/watt/src/lib/components/data/watt-data-table.component.ts b/libs/watt/src/lib/components/data/watt-data-table.component.ts
index 00d69e188f..e4abdd44e4 100644
--- a/libs/watt/src/lib/components/data/watt-data-table.component.ts
+++ b/libs/watt/src/lib/components/data/watt-data-table.component.ts
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import { Component, ContentChild, Input, ViewEncapsulation, inject } from '@angular/core';
+import { Component, ViewEncapsulation, contentChild, inject, input, output } from '@angular/core';
import {
VaterFlexComponent,
@@ -78,54 +78,57 @@ import { WattDataIntlService } from './watt-data-intl.service';
`,
],
template: `
-
+
- {{ count ?? table.dataSource.totalCount }}
+ {{ count() ?? table().dataSource.totalCount }}
- @if (enableSearch) {
-
+ @if (enableSearch()) {
+
}
- @if (!table.loading && table.dataSource.filteredData.length === 0) {
+ @if (!table().loading && table().dataSource.filteredData.length === 0) {
}
- @if (enablePaginator) {
-
+ @if (enablePaginator()) {
+
}
`,
})
export class WattDataTableComponent {
- @Input() error: unknown;
- @Input() enableSearch = true;
- @Input() searchLabel?: string;
- @Input() enablePaginator = true;
- @Input() count?: number;
- @Input() variant: WATT_CARD_VARIANT = 'elevation';
+ intl = inject(WattDataIntlService);
- @ContentChild(WattTableComponent, { descendants: true })
- table!: WattTableComponent;
+ error = input();
+ ready = input(true);
+ enableSearch = input(true);
+ searchLabel = input();
+ enablePaginator = input(true);
+ count = input();
+ variant = input('elevation');
- intl = inject(WattDataIntlService);
+ clear = output();
+
+ table = contentChild.required(WattTableComponent, { descendants: true });
onSearch(value: string) {
- this.table.dataSource.filter = value;
+ this.table().dataSource.filter = value;
+ if (!value) this.clear.emit();
}
}
diff --git a/libs/watt/src/lib/components/field/watt-field.component.scss b/libs/watt/src/lib/components/field/watt-field.component.scss
index 0e29c64e99..68ed3de4da 100644
--- a/libs/watt/src/lib/components/field/watt-field.component.scss
+++ b/libs/watt/src/lib/components/field/watt-field.component.scss
@@ -72,7 +72,7 @@ watt-field {
display: block;
&:not(.watt-field--chip) {
- min-height: 100px;
+ min-height: 93px;
}
&:not(.watt-field--chip).watt-field--unlabelled {
diff --git a/libs/watt/src/lib/components/picker/datetimepicker/watt-datetimepicker.component.ts b/libs/watt/src/lib/components/picker/datetimepicker/watt-datetimepicker.component.ts
index 0bc889a758..eedec79251 100644
--- a/libs/watt/src/lib/components/picker/datetimepicker/watt-datetimepicker.component.ts
+++ b/libs/watt/src/lib/components/picker/datetimepicker/watt-datetimepicker.component.ts
@@ -32,6 +32,13 @@ import dayjs from 'dayjs';
WattTimepickerComponent,
VaterFlexComponent,
],
+ styles: [
+ `
+ watt-datetimepicker {
+ width: 100%;
+ }
+ `,
+ ],
template: `
-{{ icon }}
+@if (customIcon) {
+
+} @else {
+ {{ icon }}
+}
diff --git a/libs/watt/src/lib/foundations/icon/icon.component.ts b/libs/watt/src/lib/foundations/icon/icon.component.ts
index f9aa1888d1..b3b31d6af8 100644
--- a/libs/watt/src/lib/foundations/icon/icon.component.ts
+++ b/libs/watt/src/lib/foundations/icon/icon.component.ts
@@ -74,6 +74,9 @@ export class WattIconComponent {
* @returns
*/
private setIcon(name?: WattIcon) {
+ this.icon = '';
+ this.customIcon = '';
+
if (!name) {
console.warn('No icon was provided!');
return;
diff --git a/tsconfig.base.json b/tsconfig.base.json
index d825965bda..a3af77f13e 100644
--- a/tsconfig.base.json
+++ b/tsconfig.base.json
@@ -125,6 +125,9 @@
"@energinet-datahub/dh/message-archive/feature-log-search": [
"libs/dh/message-archive/feature-log-search/src/index.ts"
],
+ "@energinet-datahub/dh/message-archive/feature-search": [
+ "libs/dh/message-archive/feature-search/src/index.ts"
+ ],
"@energinet-datahub/dh/message-archive/shell": [
"libs/dh/message-archive/shell/src/index.ts"
],