Replace the default dashboard with custom dashboard (#8769)

* feat:
- Implement width property
- Replace custom dashboard
- Started to integrate the KPI chart

* feat(ui): introduce dashboard chart layout system

* feat(ui): introduce dashboard chart kpi card

* chore(ui): amend layout widths for sm screen size

* chore(ui): prevent editing of default dashboard

* chore(ui): centering the KPI text inside the box

* chore(ui): dashboard edit preview to respect set layouts

* chore(ui): initial work on setting the default flow & namespace dashboards

* fix(ui): make sure there is no naming clashes

* feat: KPI chart backend implementation

* feat: validation annotations

* chore(ui): make chart legend align to right side

* chore(ui): properly show chart labels

* chore(ui): improve state and ID components inside custom tabels

* chore(ui): add proper link to execution in tables

* feat: implemented Triggers as Datasource for custom dashboards

close kestra-io/kestra-ee#3740

* feat: modified the Markdown chart so now it accept different sources

* feat: rename KPI property to numerator & where

close #3739

* chore(ui): improve markdown component

* chore(ui): markdown charts

* chore(ui): markdown charts

* chore(ui): markdown charts remove padding

* chore(ui): markdown charts

* feat: fixes + define custom dashboard equivalent to current default dashboard with some modification

* fix: round double value

* chore(ui): improve  flows and ns charts

* chore(ui): make sure that table shows execution links only if namespace and flowId exist

* chore(ui): make sure markdown is properly shown on dashboard edititng

* fix: correctly do preview instead of load on homepage

* fix: correctly preview markdown chart and add description in default flow dashboard

* fix: apply review changes

* fix: modify test following classes modifications on charts

* tests: restore package-lock

* remove chromatic tools and a warning

---------

Co-authored-by: MilosPaunovic <paun992@hotmail.com>
Co-authored-by: Bart Ledoux <bledoux@kestra.io>
This commit is contained in:
YannC
2025-05-27 08:02:11 +02:00
committed by GitHub
parent 57bafd1240
commit ea402261d5
73 changed files with 2507 additions and 1115 deletions

View File

@@ -1,16 +1,41 @@
package io.kestra.repository.h2;
import io.kestra.core.models.triggers.Trigger;
import io.kestra.core.utils.DateUtils;
import io.kestra.jdbc.repository.AbstractJdbcTriggerRepository;
import io.kestra.jdbc.services.JdbcFilterService;
import jakarta.inject.Inject;
import jakarta.inject.Named;
import jakarta.inject.Singleton;
import org.jooq.Field;
import org.jooq.impl.DSL;
import java.util.Date;
@Singleton
@H2RepositoryEnabled
public class H2TriggerRepository extends AbstractJdbcTriggerRepository {
@Inject
public H2TriggerRepository(@Named("triggers") H2Repository<Trigger> repository) {
super(repository);
public H2TriggerRepository(@Named("triggers") H2Repository<Trigger> repository,
JdbcFilterService filterService) {
super(repository, filterService);
}
@Override
protected Field<Date> formatDateField(String dateField, DateUtils.GroupType groupType) {
switch (groupType) {
case MONTH:
return DSL.field("FORMATDATETIME(\"" + dateField + "\", 'yyyy-MM')", Date.class);
case WEEK:
return DSL.field("FORMATDATETIME(\"" + dateField + "\", 'YYYY-ww')", Date.class);
case DAY:
return DSL.field("FORMATDATETIME(\"" + dateField + "\", 'yyyy-MM-dd')", Date.class);
case HOUR:
return DSL.field("FORMATDATETIME(\"" + dateField + "\", 'yyyy-MM-dd HH:00:00')", Date.class);
case MINUTE:
return DSL.field("FORMATDATETIME(\"" + dateField + "\", 'yyyy-MM-dd HH:mm:00')", Date.class);
default:
throw new IllegalArgumentException("Unsupported GroupType: " + groupType);
}
}
}