Skip to content

Commit

Permalink
Merge branch 'develop' into condition-examples-2
Browse files Browse the repository at this point in the history
  • Loading branch information
aj-emerich authored Feb 27, 2025
2 parents bd3ffcf + 3dc8e98 commit 7410bf8
Show file tree
Hide file tree
Showing 21 changed files with 347 additions and 121 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/generate-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@ name: Auto-Translate UI keys and create PR

on:
schedule:
- cron: "0 9-21 * * *" # Every day
workflow_dispatch: {}
- cron: "0 9-21 * * *" # Every hour from 9 AM to 9 PM
workflow_dispatch:
inputs:
retranslate_modified_keys:
description: "Whether to re-translate modified keys even if they already have translations."
type: choice
options:
- "false"
- "true"
default: "false"
required: false

jobs:
translations:
Expand All @@ -25,7 +34,7 @@ jobs:
run: pip install gitpython openai

- name: Generate translations
run: python ui/src/translations/generate_translations.py
run: python ui/src/translations/generate_translations.py ${{ github.event.inputs.retranslate_modified_keys }}
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

Expand Down
2 changes: 2 additions & 0 deletions platform/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ dependencies {

constraints {
// Forced dependencies
// Temporal force to include https://github.com/micronaut-projects/micronaut-core/commit/9bb43ce55ea3fca97c12cb50c5f1baea28557729 as a potential fix for https://github.com/kestra-io/kestra/issues/3402
api("io.micronaut:micronaut-core:4.7.15")
api("org.slf4j:slf4j-api:$slf4jVersion")
// need to force this dep as mysql-connector brings a version incompatible with the Google Cloud libs
api("com.google.protobuf:protobuf-java:$protobufVersion")
Expand Down
4 changes: 4 additions & 0 deletions ui/src/components/code/segments/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@

<Task
v-else
:key="taskIdentifier"
:identifier="taskIdentifier"
:flow
:creation
@update-task="(yaml) => emits('updateTask', yaml)"
Expand Down Expand Up @@ -74,6 +76,8 @@
import {useRoute} from "vue-router";
const route = useRoute();
const taskIdentifier = computed(() => route.query.identifier?.toString() ?? "new");
watch(
() => route.query,
async (newQuery) => {
Expand Down
9 changes: 5 additions & 4 deletions ui/src/components/code/segments/Task.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
const emits = defineEmits(["updateTask", "updateDocumentation"]);
const props = defineProps({
identifier: {type: String, required: true},
flow: {type: String, required: true},
creation: {type: Boolean, default: false},
});
Expand Down Expand Up @@ -60,7 +61,7 @@
});
const yaml = ref(
YamlUtils.extractTask(props.flow, route.query.identifier)?.toString() || "",
YamlUtils.extractTask(props.flow, props.identifier)?.toString() || "",
);
onBeforeMount(() => {
Expand All @@ -77,7 +78,7 @@
);
watch(
() => route.query.identifier,
() => props.identifier,
(value) => {
if (value === "new") {
yaml.value = "";
Expand Down Expand Up @@ -128,7 +129,7 @@
const currentSection = route.query.section;
const isCreation =
props.creation &&
(!route.query.identifier || route.query.identifier === "new");
(!props.identifier || props.identifier === "new");
let result;
Expand Down Expand Up @@ -164,7 +165,7 @@
} else {
result = YamlUtils.replaceTaskInDocument(
source,
route.query.identifier,
props.identifier,
task,
);
}
Expand Down
3 changes: 3 additions & 0 deletions ui/src/components/executions/Overview.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<template>
<Timeline :histories="execution.state.histories" />
<div v-if="execution" class="execution-overview">
<div v-if="isFailed()">
<el-alert type="error" :closable="false" class="mb-4 main-error">
Expand Down Expand Up @@ -182,6 +183,7 @@
import DateAgo from "../layout/DateAgo.vue";
import Crud from "override/components/auth/Crud.vue";
import Duration from "../layout/Duration.vue";
import Timeline from "../layout/Timeline.vue";
import Labels from "../layout/Labels.vue"
import {toRaw} from "vue";
import ChangeExecutionStatus from "./ChangeExecutionStatus.vue";
Expand All @@ -197,6 +199,7 @@
components: {
ChangeExecutionStatus,
Duration,
Timeline,
Status,
SetLabels,
Restart,
Expand Down
24 changes: 23 additions & 1 deletion ui/src/components/filter/KestraFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@
:show-arrow="false"
fit-input-width
:popper-class="!!props.searchCallback ? 'd-none' : 'filters-select'"
:popper-options="{
modifiers: [
{
name: 'offset',
options: {
offset: [dropdownOffset, 12],
},
},
],
}"
@change="(value) => changeCallback(value)"
@keyup="(e) => handleInputChange(e.key)"
@keyup.enter="() => handleEnterKey(select?.hoverOption?.value)"
Expand Down Expand Up @@ -310,7 +320,9 @@
};
const handleClear = () => {
currentFilters.value = currentFilters.value.filter((item) => item.persistent);
currentFilters.value = currentFilters.value.filter(
(item) => item.persistent,
);
triggerSearch();
};
Expand Down Expand Up @@ -384,6 +396,10 @@
updateHoveringIndex(0);
};
let dropdownOffset = ref(0);
const calculateDropdownOffset = (left: number = 0, halfWidth: number = 0) => {
return left > halfWidth ? Math.abs(halfWidth - left) : -(halfWidth - left);
};
const dropdownToggleCallback = (visible) => {
if (!visible) {
dropdowns.value = {...INITIAL_DROPDOWNS};
Expand All @@ -394,6 +410,12 @@
if (currentFilters.value?.at(-1)?.value?.length === 0)
currentFilters.value.pop();
} else {
const {selectRef, inputRef} = select.value || {};
dropdownOffset.value = calculateDropdownOffset(
inputRef?.offsetLeft,
selectRef?.offsetWidth / 2,
);
updateHoveringIndex(0);
}
};
Expand Down
11 changes: 6 additions & 5 deletions ui/src/components/layout/Duration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<el-tooltip v-if="histories" popper-class="duration-tt" :persistent="false" transition="" :hide-after="0" effect="light">
<template #content>
<span v-for="(history, index) in histories" :key="'tt-' + index">
<span class="square" :class="squareClass(history.state)" />
<span class="square" :style="squareClass(history.state)" />
<strong>{{ history.state }}:</strong> {{ $filters.date(history.date, 'iso') }} <br>
</span>
</template>
Expand Down Expand Up @@ -81,10 +81,11 @@
this.duration = Utils.humanDuration(this.delta() / 1000)
},
squareClass(state) {
return [
"bg-" + State.colorClass()[state]
]
}
const statusVarname = state.toLowerCase();
return {
backgroundColor: `var(--ks-chart-${statusVarname})`
};
},
},
beforeUnmount() {
this.cancel();
Expand Down
Loading

0 comments on commit 7410bf8

Please sign in to comment.