Skip to content

Commit

Permalink
story: task data source for dashboard (#1305)
Browse files Browse the repository at this point in the history
* wip

* fix fe helper text

* pr comments
  • Loading branch information
mbritense authored Jan 2, 2025
1 parent 8d6a256 commit 9d8c5a6
Show file tree
Hide file tree
Showing 18 changed files with 456 additions and 19 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
ListModule,
RenderInPageHeaderDirectiveModule,
SpinnerModule,
ValtimoCdsModalDirectiveModule,
} from '@valtimo/components';
import {
ButtonModule,
Expand Down Expand Up @@ -67,6 +68,7 @@ import {WidgetConfigurationContainerComponent} from './components/widget-configu
WidgetTranslatePipeModule,
CarbonListModule,
LayerModule,
ValtimoCdsModalDirectiveModule,
],
exports: [],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const caseCountDataSourceSpecification: DataSourceSpecification = {
operator: 'Operator',
value: 'Wert',
conditions: 'Bedingungen',
conditionsHelperText: `Geben Sie optionale Bedingungen zum Abrufen der Anzahl der Fälle für den ausgewählten Falltyp an. ${CONDITIONS_HELPER_TEXTS.DE}`,
conditionsHelperText: `Geben Sie optionale Bedingungen zum Abrufen der Anzahl der Fälle für den ausgewählten Falltyp an. ${CONDITIONS_HELPER_TEXTS.DE()}`,
addCondition: 'Bedingung hinzufügen',
},
en: {
Expand All @@ -53,7 +53,7 @@ export const caseCountDataSourceSpecification: DataSourceSpecification = {
operator: 'Operator',
value: 'Value',
conditions: 'Conditions',
conditionsHelperText: `Specify optional conditions for retrieving the number of cases for the selected case type. ${CONDITIONS_HELPER_TEXTS.EN}`,
conditionsHelperText: `Specify optional conditions for retrieving the number of cases for the selected case type. ${CONDITIONS_HELPER_TEXTS.EN()}`,
addCondition: 'Add condition',
},
nl: {
Expand All @@ -70,7 +70,7 @@ export const caseCountDataSourceSpecification: DataSourceSpecification = {
operator: 'Operator',
value: 'Waarde',
conditions: 'Condities',
conditionsHelperText: `Geef optionele condities op voor het ophalen van het aantal zaken voor het geselecteerde dossiertype. ${CONDITIONS_HELPER_TEXTS.NL}}`,
conditionsHelperText: `Geef optionele condities op voor het ophalen van het aantal zaken voor het geselecteerde dossiertype. ${CONDITIONS_HELPER_TEXTS.NL()}}`,
addCondition: 'Conditie toevoegen',
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const caseCountsDataSourceSpecification: DataSourceSpecification = {
operator: 'Operator',
value: 'Wert',
counts: 'Anzahllen',
countsHelperText: `Geben Sie eine oder mehrere Bedingungen für jede anzuzeigende Zählung an. Konfigurieren Sie mindestens zwei Zählungen und mindestens eine Bedingung pro Zählung. ${CONDITIONS_HELPER_TEXTS.DE}`,
countsHelperText: `Geben Sie eine oder mehrere Bedingungen für jede anzuzeigende Zählung an. Konfigurieren Sie mindestens zwei Zählungen und mindestens eine Bedingung pro Zählung. ${CONDITIONS_HELPER_TEXTS.DE()}`,
addCondition: 'Bedingung hinzufügen',
countTitle: 'Anzahltitel',
},
Expand All @@ -54,7 +54,7 @@ export const caseCountsDataSourceSpecification: DataSourceSpecification = {
operator: 'Operator',
value: 'Value',
counts: 'Counts',
countsHelperText: `Specify one or more conditions for each count that should be displayed. Configure at least two counts and at least one condition per count. ${CONDITIONS_HELPER_TEXTS.EN}`,
countsHelperText: `Specify one or more conditions for each count that should be displayed. Configure at least two counts and at least one condition per count. ${CONDITIONS_HELPER_TEXTS.EN()}`,
addCondition: 'Add condition',
countTitle: 'Count title',
},
Expand All @@ -72,7 +72,7 @@ export const caseCountsDataSourceSpecification: DataSourceSpecification = {
operator: 'Operator',
value: 'Waarde',
counts: 'Aantallen',
countsHelperText: `Geef een of meer condities op voor elk aantal dat moet worden weergegeven. Configureer minimaal twee aantallen en minimaal één conditie per aantal. ${CONDITIONS_HELPER_TEXTS.NL}`,
countsHelperText: `Geef een of meer condities op voor elk aantal dat moet worden weergegeven. Configureer minimaal twee aantallen en minimaal één conditie per aantal. ${CONDITIONS_HELPER_TEXTS.NL()}`,
addCondition: 'Conditie toevoegen',
countTitle: 'Aantaltitel',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const caseGroupByDataSourceSpecification: DataSourceSpecification = {
operator: 'Operator',
value: 'Wert',
conditions: 'Bedingungen',
conditionsHelperText: `Geben Sie optionale Bedingungen an, um die Gruppierung für den ausgewählten Falltyp abzurufen. ${CONDITIONS_HELPER_TEXTS.DE}`,
conditionsHelperText: `Geben Sie optionale Bedingungen an, um die Gruppierung für den ausgewählten Falltyp abzurufen. ${CONDITIONS_HELPER_TEXTS.DE()}`,
addCondition: 'Bedingung hinzufügen',
enum: 'Anzeige der Werte',
enumHelperText:
Expand All @@ -60,7 +60,7 @@ export const caseGroupByDataSourceSpecification: DataSourceSpecification = {
operator: 'Operator',
value: 'Value',
conditions: 'Conditions',
conditionsHelperText: `Specify optional conditions for retrieving the grouping for the selected case type. ${CONDITIONS_HELPER_TEXTS.EN}`,
conditionsHelperText: `Specify optional conditions for retrieving the grouping for the selected case type. ${CONDITIONS_HELPER_TEXTS.EN()}`,
addCondition: 'Add condition',
enum: 'Display of values',
enumHelperText:
Expand All @@ -83,7 +83,7 @@ export const caseGroupByDataSourceSpecification: DataSourceSpecification = {
operator: 'Operator',
value: 'Waarde',
conditions: 'Condities',
conditionsHelperText: `Geef optionele condities op voor het ophalen van de groepering voor het geselecteerde dossiertype. ${CONDITIONS_HELPER_TEXTS.NL}`,
conditionsHelperText: `Geef optionele condities op voor het ophalen van de groepering voor het geselecteerde dossiertype. ${CONDITIONS_HELPER_TEXTS.NL()}`,
addCondition: 'Conditie toevoegen',
enum: 'Weergave van waardes',
enumHelperText:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ import {NgModule} from '@angular/core';
import {CaseCountDataSourceModule} from './case-count';
import {CaseCountsDataSourceModule} from './case-counts';
import {CaseGroupByDataSourceModule} from './case-group-by';
import {TaskCountDataSourceModule} from './task-count';

@NgModule({
imports: [CaseCountDataSourceModule, CaseCountsDataSourceModule, CaseGroupByDataSourceModule],
imports: [
CaseCountDataSourceModule,
CaseCountsDataSourceModule,
CaseGroupByDataSourceModule,
TaskCountDataSourceModule,
],
})
export class DataSourcesModule {}
1 change: 1 addition & 0 deletions projects/valtimo/dashboard/src/lib/data-sources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
export * from './case-count';
export * from './case-counts';
export * from './case-group-by';
export * from './task-count';
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
*/

const CONDITIONS_HELPER_TEXTS = {
EN: "For example: 'case:createdBy', 'Not equal to', '[email protected]'. To compare against empty values, you can use '${null}' as a value. To compare with the current date, use '${localDateTimeNow}' as a value. Additionally, logic such as '${localDateTimeNow.minusWeeks(2)}' is supported. The placeholders '${currentUserId}', '${currentUserEmail}', and '${currentUserIdentifier}' enable the display of personalized information for the current dashboard user.",
NL: 'Bijvoorbeeld: ‘case:createdBy’, ‘Not equal to’, ‘[email protected]’. Om te vergelijken met lege waarden, kun je ‘${null}’ gebruiken als waarde. Om te vergelijken met de huidige datum, gebruik je ‘${localDateTimeNow}’ als waarde. Hier wordt logica zoals ‘${localDateTimeNow.minusWeeks(2)}’ ondersteund. De placeholders ‘${currentUserId}’, ‘${currentUserEmail}’ en ‘${currentUserIdentifier}’ maken het mogelijk om gepersonaliseerde informatie weer te geven voor de huidige dashboardgebruiker.',
DE: 'Zum Beispiel: ‘case:createdBy’, ‘Not equal to’, ‘[email protected]’. Um mit leeren Werten zu vergleichen, kann ‘${null}’ als Wert verwendet werden. Um mit dem aktuellen Datum zu vergleichen, kann ‘${localDateTimeNow}’ als Wert verwendet werden. Zusätzlich wird Logik wie ‘${localDateTimeNow.minusWeeks(2)}’ unterstützt. Die Platzhalter ‘${currentUserId}’, ‘${currentUserEmail}’ und ‘${currentUserIdentifier}’ ermöglichen die Anzeige personalisierter Informationen für den aktuellen Dashboard-Benutzer.',
DE: (example = 'case:createdBy') =>
`Zum Beispiel: ‘${example}’, ‘Not equal to’, ‘[email protected]’. Um mit leeren Werten zu vergleichen, kann ‘\${null}’ als Wert verwendet werden. Um mit dem aktuellen Datum zu vergleichen, kann ‘\${localDateTimeNow}’ als Wert verwendet werden. Zusätzlich wird Logik wie ‘\${localDateTimeNow.minusWeeks(2)}’ unterstützt. Die Platzhalter ‘\${currentUserId}’, ‘\${currentUserEmail}’ und ‘\${currentUserIdentifier}’ ermöglichen die Anzeige personalisierter Informationen für den aktuellen Dashboard-Benutzer.`,
NL: (example = 'case:createdBy') =>
`Bijvoorbeeld: ‘${example}’, ‘Not equal to’, ‘[email protected]’. Om te vergelijken met lege waarden, kun je ‘\${null}’ gebruiken als waarde. Om te vergelijken met de huidige datum, gebruik je ‘\${localDateTimeNow}’ als waarde. Hier wordt logica zoals ‘\${localDateTimeNow.minusWeeks(2)}’ ondersteund. De placeholders ‘\${currentUserId}’, ‘\${currentUserEmail}’ en ‘\${currentUserIdentifier}’ maken het mogelijk om gepersonaliseerde informatie weer te geven voor de huidige dashboardgebruiker.`,
EN: (example = 'case:createdBy') =>
`For example: '${example}', 'Not equal to', '[email protected]'. To compare against empty values, you can use '\${null}' as a value. To compare with the current date, use '\${localDateTimeNow}' as a value. Additionally, logic such as '\${localDateTimeNow.minusWeeks(2)}' is supported. The placeholders '\${currentUserId}', '\${currentUserEmail}', and '\${currentUserIdentifier}' enable the display of personalized information for the current dashboard user.`,
};

export {CONDITIONS_HELPER_TEXTS};
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright 2015-2024 Ritense BV, the Netherlands.
*
* Licensed under EUPL, Version 1.2 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export * from './task-count-configuration';
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright 2015-2024 Ritense BV, the Netherlands.
*
* Licensed under EUPL, Version 1.2 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export * from './task-count-configuration.component';
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!--
~ Copyright 2015-2024 Ritense BV, the Netherlands.
~
~ Licensed under EUPL, Version 1.2 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" basis,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<form
class="task-count-configuration-form"
*ngIf="{operatorItems: operatorItems$} as obs"
[formGroup]="form"
>
<div class="form__element conditions-multi-input">
<cds-label
[helperText]="'conditionsHelperText' | widgetTranslate: dataSourceKey | async"
class="conditions-label"
>{{ 'conditions' | widgetTranslate: dataSourceKey | async }}</cds-label
>
<valtimo-carbon-multi-input
[addRowText]="'addCondition' | widgetTranslate: dataSourceKey | async"
[defaultValues]="defaultConditionValues$ | async"
[dropdownColumnTitle]="'operator' | widgetTranslate: dataSourceKey | async"
[dropdownItems]="operatorItems$ | async"
[fullWidth]="true"
[initialAmountOfRows]="0"
[keyColumnTitle]="'path' | widgetTranslate: dataSourceKey | async"
[minimumAmountOfRows]="0"
[valueColumnTitle]="'value' | widgetTranslate: dataSourceKey | async"
type="keyDropdownValue"
(allValuesValidEvent)="onAllConditionsValid($event)"
(valueChange)="conditionsValueChange($event)"
></valtimo-carbon-multi-input>
</div>
</form>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*!
* Copyright 2015-2024 Ritense BV, the Netherlands.
*
* Licensed under EUPL, Version 1.2 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

::ng-deep .task-count-configuration-form {
.conditions-label {
margin-bottom: 16px;
}

.conditions-multi-input .cds--form__helper-text {
font-style: italic;
}
}
Loading

0 comments on commit 9d8c5a6

Please sign in to comment.