Repository: kestra-io/kestra
Issue: Add a link to select latest revision, when replaying

### Feature description

When replaying in the UI, could we have a simple button or link to select the latest revision ?

Or maybe order the revisions list by the newest ?

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/ui/src/components/executions/Restart.vue b/ui/src/components/executions/Restart.vue
index 48b0a00a7b..cdb871f4c5 100644
--- a/ui/src/components/executions/Restart.vue
+++ b/ui/src/components/executions/Restart.vue
@@ -19,6 +19,9 @@
             <el-button @click="isOpen = false">
                 Cancel
             </el-button>
+            <el-button @click="restartLastRevision()">
+                {{ $t('replay latest revision') }}
+            </el-button>
             <el-button type="primary" @click="restart()">
                 OK
             </el-button>
@@ -26,23 +29,16 @@
 
         <p v-html="$t(replayOrRestart + ' confirm', {id: execution.id})" />
 
-        <el-form class="text-muted">
-            <p>{{ $t("restart change revision") }}</p>
+        <el-form>
+            <p  class="text-muted">{{ $t("restart change revision") }}</p>
             <el-form-item :label="$t('revisions')">
-                <el-select
-                    v-model="revisionsSelected"
-                    filterable
-                    :persistent="false"
-                    :placeholder="$t('revisions')"
-                >
+                <el-select v-model="revisionsSelected">
                     <el-option
                         v-for="item in revisionsOptions"
                         :key="item.value"
                         :label="item.text"
                         :value="item.value"
-                    >
-                        {{ item.value }}
-                    </el-option>
+                    />
                 </el-select>
             </el-form-item>
         </el-form>
@@ -107,6 +103,10 @@
                         id: this.execution.flowId
                     })
             },
+            restartLastRevision() {
+                this.revisionsSelected = this.revisions[this.revisions.length - 1].revision;
+                this.restart();
+            },
             restart() {
                 this.isOpen = false
 
@@ -145,12 +145,14 @@
                 return this.isReplay ? "replay" : "restart";
             },
             revisionsOptions() {
-                return (this.revisions || []).map((revision) => {
-                    return {
-                        value: revision.revision,
-                        text: revision.revision + (this.sameRevision(revision.revision) ? " (" + this.$t("current") + ")" : ""),
-                    };
-                });
+                return (this.revisions || [])
+                    .map((revision) => {
+                        return {
+                            value: revision.revision,
+                            text: revision.revision + (this.sameRevision(revision.revision) ? " (" + this.$t("current") + ")" : ""),
+                        };
+                    })
+                    .reverse();
             },
             enabled() {
                 if (this.isReplay && !(this.user && this.user.isAllowed(permission.EXECUTION, action.CREATE, this.execution.namespace))) {
diff --git a/ui/src/translations.json b/ui/src/translations.json
index c85cdfb8b4..518518f5cb 100644
--- a/ui/src/translations.json
+++ b/ui/src/translations.json
@@ -101,6 +101,7 @@
     "restart confirm": "Are you sure to restart execution <code>{id}</code>?",
     "restart change revision": "You can change the revision that will be used for the new execution.",
     "replay": "Replay",
+    "replay latest revision": "Replay using latest revision",
     "replayed": "Execution is replayed",
     "replay confirm": "Are you sure to replay this execution <code>{id}</code> and create a new one?",
     "current": "current",
@@ -371,6 +372,7 @@
     "restart confirm": "Êtes-vous sur de vouloir relancer <code>{id}</code> ?",
     "restart change revision": "Vous pouvez changer la révision qui sera utilisé pour la nouvelle execution relancée.",
     "replay": "Rejouer",
+    "replay latest revision": "Rejouer avec la dernière révision",
     "replayed": "Execution est rejouée",
     "replay confirm": "Êtes-vous sur de vouloir relancer l'exécution <code>{-id}</code> et créer une nouvelle execution ?",
     "current": "actuel",
@@ -642,6 +644,7 @@
     "restart confirm": "Möchten Sie die Ausführung <code>{id}</code> wirklich neu starten?",
     "restart change revision": "Sie können die Revision ändern, diese wird für die neue Ausführung verwendet werden.",
     "replay": "Wiederholen",
+    "replay latest revision": "Replay using latest revision",
     "replayed": "Ausführung wurde wiederholt",
     "replay confirm": "Möchten Sie diese Ausführung <code>{id}</code> wirklich wiederholen und eine neue erstellen?",
     "current": "aktuell",


Test patch: