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,25 +1,48 @@
package io.kestra.repository.mysql;
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.Condition;
import org.jooq.Field;
import org.jooq.impl.DSL;
import java.util.Date;
import java.util.List;
@Singleton
@MysqlRepositoryEnabled
public class MysqlTriggerRepository extends AbstractJdbcTriggerRepository {
@Inject
public MysqlTriggerRepository(@Named("triggers") MysqlRepository<Trigger> repository) {
super(repository);
public MysqlTriggerRepository(@Named("triggers") MysqlRepository<Trigger> repository,
JdbcFilterService filterService) {
super(repository, filterService);
}
@Override
protected Condition fullTextCondition(String query) {
return query == null ? DSL.trueCondition() : jdbcRepository.fullTextCondition(List.of("namespace", "flow_id", "trigger_id", "execution_id"), query);
}
@Override
protected Field<Date> formatDateField(String dateField, DateUtils.GroupType groupType) {
switch (groupType) {
case MONTH:
return DSL.field("DATE_FORMAT({0}, '%Y-%m')", Date.class, DSL.field(dateField));
case WEEK:
return DSL.field("DATE_FORMAT({0}, '%x-%v')", Date.class, DSL.field(dateField));
case DAY:
return DSL.field("DATE({0})", Date.class, DSL.field(dateField));
case HOUR:
return DSL.field("DATE_FORMAT({0}, '%Y-%m-%d %H:00:00')", Date.class, DSL.field(dateField));
case MINUTE:
return DSL.field("DATE_FORMAT({0}, '%Y-%m-%d %H:%i:00')", Date.class, DSL.field(dateField));
default:
throw new IllegalArgumentException("Unsupported GroupType: " + groupType);
}
}
}