Skip to content

Commit

Permalink
fix(ui): don't display max displayable since not relevant
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Jan 27, 2025
1 parent f1c5555 commit bcaa613
Show file tree
Hide file tree
Showing 21 changed files with 8 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ ArrayListTotal<TaskRun> findTaskRun(

Integer purge(Execution execution);

Integer maxTaskRunSetting();

List<DailyExecutionStatistics> dailyStatisticsForAllTenants(
@Nullable String query,
@Nullable String namespace,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,6 @@ public ArrayListTotal<TaskRun> findTaskRun(
throw new UnsupportedOperationException();
}

@Override
public Integer maxTaskRunSetting() {
throw new UnsupportedOperationException();
}

@Override
public List<DailyExecutionStatistics> dailyStatisticsForAllTenants(
@Nullable String query,
Expand Down
6 changes: 3 additions & 3 deletions ui/src/components/dashboard/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ $spacing: 20px;
.dashboard-filters,
.dashboard {
padding: 0 32px;
padding: 0 2rem;
& .el-row {
width: 100%;
Expand Down Expand Up @@ -558,13 +558,13 @@ $spacing: 20px;
}
.description {
padding: 0px 32px;
padding: 0 2rem 1rem 2rem;
margin: 0;
color: var(--ks-content-secondary);
}
.custom {
padding: 24px 32px;
padding: 0 2rem 1rem 2rem;
&.el-row {
width: 100%;
Expand Down
5 changes: 2 additions & 3 deletions ui/src/components/layout/DataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
<el-container data-component="FILENAME_PLACEHOLDER#container" direction="vertical" v-loading="isLoading">
<slot name="top" data-component="FILENAME_PLACEHOLDER#top" />

<pagination v-if="!embed" :size="size" :top="true" :page="page" :total="total" :max="max" @page-changed="onPageChanged">
<pagination v-if="!embed" :size="size" :top="true" :page="page" :total="total" @page-changed="onPageChanged">
<template #search>
<slot name="search" />
</template>
</pagination>

<slot name="table" data-component="FILENAME_PLACEHOLDER#table" />

<pagination v-if="total > 0" :size="size" :page="page" :total="total" :max="max" @page-changed="onPageChanged" />
<pagination v-if="total > 0" :size="size" :page="page" :total="total" @page-changed="onPageChanged" />
</el-container>
</div>
</template>
Expand All @@ -41,7 +41,6 @@
},
props: {
total: {type: Number, required: true},
max: {type: Number, required: false, default: undefined},
size: {type: Number, default: 25},
page: {type: Number, default: 1},
embed: {type: Boolean, default: false},
Expand Down
7 changes: 1 addition & 6 deletions ui/src/components/layout/Pagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,12 @@
size="small"
layout="prev, pager, next"
:pager-count="5"
:total="Math.min((max || total ),total)"
:total="total"
@current-change="pageChanged"
class="my-0"
/>
</div>

<small v-if="max" class="d-md-none d-lg-block total ms-2">
{{ $t('Max displayable') }}: {{ max }}
</small>

<small class="total text-total ms-2">
{{ $t('Total') }}: {{ total }}
</small>
Expand All @@ -45,7 +41,6 @@
export default {
props: {
total: {type: Number, default: 0},
max: {type: Number, default: undefined},
size: {type: Number, required: true, default: 25},
page: {type: Number, required: true},
top: {type: Boolean, required: false, default: false}
Expand Down
7 changes: 2 additions & 5 deletions ui/src/components/taskruns/TaskRuns.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<top-nav-bar :title="routeInfo.title" />
<section class="container" v-if="ready">
<data-table @page-changed="onPageChanged" ref="dataTable" :total="total" :max="maxTaskRunSetting">
<data-table @page-changed="onPageChanged" ref="dataTable" :total="total">
<template #navbar>
<KestraFilter
prefix="taskruns"
Expand Down Expand Up @@ -144,7 +144,7 @@
};
},
computed: {
...mapState("taskrun", ["taskruns", "total", "maxTaskRunSetting"]),
...mapState("taskrun", ["taskruns", "total"]),
...mapState("stat", ["taskRunDaily"]),
routeInfo() {
return {
Expand Down Expand Up @@ -178,9 +178,6 @@
}, 0);
},
},
created() {
this.$store.dispatch("taskrun/maxTaskRunSetting");
},
methods: {
onDateFilterTypeChange(event) {
this.canAutoRefresh = event;
Expand Down
9 changes: 0 additions & 9 deletions ui/src/stores/taskruns.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export default {
state: {
taskruns: undefined,
total: 0,
maxTaskRunSetting: 100
},
actions: {
findTaskRuns({commit}, options) {
Expand All @@ -14,11 +13,6 @@ export default {
commit("setTotal", response.data.total)
})
},
maxTaskRunSetting({commit}) {
return this.$http.get(`${apiUrl(this)}/taskruns/maxTaskRunSetting`).then(response => {
commit("setMaxTaskRunSetting", response.data)
})
}
},
mutations: {
setTaskruns(state, taskruns) {
Expand All @@ -27,9 +21,6 @@ export default {
setTotal(state, total) {
state.total = total
},
setMaxTaskRunSetting(state,maxTaskRunSetting){
state.maxTaskRunSetting = maxTaskRunSetting
}
},
getters: {}
}
1 change: 0 additions & 1 deletion ui/src/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@
"Fold auto": "Editor: Automatisches Falten von Mehrzeilen",
"Fold content lines": "Mehrzeilige Zeichenfolgen falten",
"Unfold content lines": "Mehrzeilige Zeichenfolgen entfalten",
"Max displayable": "Maximal anzeigbar",
"Total": "Gesamt",
"sub flow": "Subflow",
"execute": "Ausführen",
Expand Down
1 change: 0 additions & 1 deletion ui/src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@
"Fold auto": "Editor: automatic fold of multilines",
"Fold content lines": "Fold multiline strings",
"Unfold content lines": "Unfold multiline strings",
"Max displayable": "Max displayable",
"Total": "Total",
"sub flow": "Subflow",
"execute": "Execute",
Expand Down
1 change: 0 additions & 1 deletion ui/src/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@
"Fold auto": "Editor: plegado automático de multilíneas",
"Fold content lines": "Plegar cadenas multilínea",
"Unfold content lines": "Desplegar cadenas multilínea",
"Max displayable": "Máximo desplegable",
"Total": "Total",
"sub flow": "Subflow",
"execute": "Ejecutar",
Expand Down
1 change: 0 additions & 1 deletion ui/src/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@
"Fold auto": "Éditeur : Replier automatiquement le contenu multi-lignes",
"Fold content lines": "Replier les multilignes",
"Unfold content lines": "Déplier les multilignes",
"Max displayable": "Max affichables",
"Total": "Total",
"sub flow": "Sous-flow",
"execute": "Exécuter",
Expand Down
1 change: 0 additions & 1 deletion ui/src/translations/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@
"Fold auto": "संपादक: मल्टीलाइन का स्वचालित फोल्ड",
"Fold content lines": "मल्टीलाइन स्ट्रिंग्स फोल्ड करें",
"Unfold content lines": "मल्टीलाइन स्ट्रिंग्स अनफोल्ड करें",
"Max displayable": "अधिकतम प्रदर्शनीय",
"Total": "कुल",
"sub flow": "Subflow",
"execute": "निष्पादित करें",
Expand Down
1 change: 0 additions & 1 deletion ui/src/translations/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@
"Fold auto": "Editor: piegatura automatica delle righe multiple",
"Fold content lines": "Piega stringhe multilinea",
"Unfold content lines": "Spiega stringhe multilinea",
"Max displayable": "Max visualizzabile",
"Total": "Totale",
"sub flow": "Subflow",
"execute": "Esegui",
Expand Down
1 change: 0 additions & 1 deletion ui/src/translations/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@
"Fold auto": "エディター:複数行の自動折りたたみ",
"Fold content lines": "複数行文字列を折りたたむ",
"Unfold content lines": "複数行文字列を展開する",
"Max displayable": "最大表示可能",
"Total": "合計",
"sub flow": "Subflow",
"execute": "実行",
Expand Down
1 change: 0 additions & 1 deletion ui/src/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@
"Fold auto": "편집기: 다중 라인 자동 접기",
"Fold content lines": "다중 라인 문자열 접기",
"Unfold content lines": "다중 라인 문자열 펼치기",
"Max displayable": "최대 표시 가능",
"Total": "총계",
"sub flow": "Subflow",
"execute": "실행",
Expand Down
1 change: 0 additions & 1 deletion ui/src/translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@
"Fold auto": "Edytor: automatyczne składanie wieloliniowych",
"Fold content lines": "Złóż wieloliniowe ciągi",
"Unfold content lines": "Rozwiń wieloliniowe ciągi",
"Max displayable": "Maksymalna liczba wyświetlanych",
"Total": "Całkowity",
"sub flow": "Subflow",
"execute": "Wykonaj",
Expand Down
1 change: 0 additions & 1 deletion ui/src/translations/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@
"Fold auto": "Editor: dobra automática de multilinhas",
"Fold content lines": "Dobrar strings multilinhas",
"Unfold content lines": "Desdobrar strings multilinhas",
"Max displayable": "Máximo exibível",
"Total": "Total",
"sub flow": "Subflow",
"execute": "Executar",
Expand Down
1 change: 0 additions & 1 deletion ui/src/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@
"Fold auto": "Редактор: автоматическое сворачивание многострочных строк",
"Fold content lines": "Свернуть многострочные строки",
"Unfold content lines": "Развернуть многострочные строки",
"Max displayable": "Максимально отображаемое",
"Total": "Всего",
"sub flow": "Подпроцесс",
"execute": "Выполнить",
Expand Down
1 change: 0 additions & 1 deletion ui/src/translations/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@
"Fold auto": "编辑器:自动折叠多行",
"Fold content lines": "折叠多行字符串",
"Unfold content lines": "展开多行字符串",
"Max displayable": "最大可显示",
"Total": "总计",
"sub flow": "子流程",
"execute": "执行",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,4 @@ ZonedDateTime resolveAbsoluteDateTime(ZonedDateTime absoluteDateTime, Duration t

return absoluteDateTime;
}

@ExecuteOn(TaskExecutors.IO)
@Get(uri = "/maxTaskRunSetting")
@Hidden
public Integer maxTaskRunSetting() {
return executionRepository.maxTaskRunSetting();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,4 @@ void search() {

assertThat(e.getStatus(), is(HttpStatus.NOT_FOUND));
}

@Test
void maxTaskRunSetting() {
HttpClientResponseException e = assertThrows(
HttpClientResponseException.class,
() -> client.toBlocking().retrieve(HttpRequest.GET("/api/v1/taskruns/maxTaskRunSetting"))
);

assertThat(e.getStatus(), is(HttpStatus.NOT_FOUND));
}
}

0 comments on commit bcaa613

Please sign in to comment.