Browse Source

feat(admin-ui): Manual triggering of scheduled tasks

Relates to #1425
Michael Bromley 9 months ago
parent
commit
76d74e141e
26 changed files with 195 additions and 73 deletions
  1. 28 28
      packages/admin-ui/i18n-coverage.json
  2. 14 0
      packages/admin-ui/src/lib/core/src/common/generated-types.ts
  3. 5 2
      packages/admin-ui/src/lib/static/i18n-messages/ar.json
  4. 5 2
      packages/admin-ui/src/lib/static/i18n-messages/cs.json
  5. 5 2
      packages/admin-ui/src/lib/static/i18n-messages/de.json
  6. 5 2
      packages/admin-ui/src/lib/static/i18n-messages/en.json
  7. 5 2
      packages/admin-ui/src/lib/static/i18n-messages/es.json
  8. 5 2
      packages/admin-ui/src/lib/static/i18n-messages/fa.json
  9. 5 2
      packages/admin-ui/src/lib/static/i18n-messages/fr.json
  10. 5 2
      packages/admin-ui/src/lib/static/i18n-messages/he.json
  11. 5 2
      packages/admin-ui/src/lib/static/i18n-messages/hr.json
  12. 5 2
      packages/admin-ui/src/lib/static/i18n-messages/it.json
  13. 5 2
      packages/admin-ui/src/lib/static/i18n-messages/ja.json
  14. 5 2
      packages/admin-ui/src/lib/static/i18n-messages/nb.json
  15. 5 2
      packages/admin-ui/src/lib/static/i18n-messages/ne.json
  16. 5 2
      packages/admin-ui/src/lib/static/i18n-messages/pl.json
  17. 5 2
      packages/admin-ui/src/lib/static/i18n-messages/pt_BR.json
  18. 5 2
      packages/admin-ui/src/lib/static/i18n-messages/pt_PT.json
  19. 5 2
      packages/admin-ui/src/lib/static/i18n-messages/ru.json
  20. 5 2
      packages/admin-ui/src/lib/static/i18n-messages/sv.json
  21. 5 2
      packages/admin-ui/src/lib/static/i18n-messages/tr.json
  22. 5 2
      packages/admin-ui/src/lib/static/i18n-messages/uk.json
  23. 5 2
      packages/admin-ui/src/lib/static/i18n-messages/zh_Hans.json
  24. 5 2
      packages/admin-ui/src/lib/static/i18n-messages/zh_Hant.json
  25. 13 0
      packages/admin-ui/src/lib/system/src/components/scheduled-tasks/scheduled-task-list.component.html
  26. 30 1
      packages/admin-ui/src/lib/system/src/components/scheduled-tasks/scheduled-task-list.component.ts

+ 28 - 28
packages/admin-ui/i18n-coverage.json

@@ -1,116 +1,116 @@
 {
-  "generatedOn": "2025-04-08T07:15:55.418Z",
-  "lastCommit": "6243ab84efd87ea325ecc4042db6df71476e1c82",
+  "generatedOn": "2025-04-22T08:51:01.619Z",
+  "lastCommit": "8278fc53498b7147d20d0b6b9babed25389b30a2",
   "translationStatus": {
     "ar": {
-      "tokenCount": 793,
+      "tokenCount": 796,
       "translatedCount": 793,
       "percentage": 100
     },
     "cs": {
-      "tokenCount": 793,
-      "translatedCount": 793,
+      "tokenCount": 796,
+      "translatedCount": 794,
       "percentage": 100
     },
     "de": {
-      "tokenCount": 793,
+      "tokenCount": 796,
       "translatedCount": 793,
       "percentage": 100
     },
     "en": {
-      "tokenCount": 793,
-      "translatedCount": 793,
+      "tokenCount": 796,
+      "translatedCount": 794,
       "percentage": 100
     },
     "es": {
-      "tokenCount": 793,
+      "tokenCount": 796,
       "translatedCount": 793,
       "percentage": 100
     },
     "fa": {
-      "tokenCount": 793,
+      "tokenCount": 796,
       "translatedCount": 793,
       "percentage": 100
     },
     "fr": {
-      "tokenCount": 793,
+      "tokenCount": 796,
       "translatedCount": 793,
       "percentage": 100
     },
     "he": {
-      "tokenCount": 793,
+      "tokenCount": 796,
       "translatedCount": 793,
       "percentage": 100
     },
     "hr": {
-      "tokenCount": 793,
+      "tokenCount": 796,
       "translatedCount": 792,
-      "percentage": 100
+      "percentage": 99
     },
     "it": {
-      "tokenCount": 793,
+      "tokenCount": 796,
       "translatedCount": 793,
       "percentage": 100
     },
     "ja": {
-      "tokenCount": 793,
+      "tokenCount": 796,
       "translatedCount": 793,
       "percentage": 100
     },
     "nb": {
-      "tokenCount": 793,
+      "tokenCount": 796,
       "translatedCount": 793,
       "percentage": 100
     },
     "ne": {
-      "tokenCount": 793,
+      "tokenCount": 796,
       "translatedCount": 793,
       "percentage": 100
     },
     "pl": {
-      "tokenCount": 793,
+      "tokenCount": 796,
       "translatedCount": 793,
       "percentage": 100
     },
     "pt_BR": {
-      "tokenCount": 793,
+      "tokenCount": 796,
       "translatedCount": 793,
       "percentage": 100
     },
     "pt_PT": {
-      "tokenCount": 793,
+      "tokenCount": 796,
       "translatedCount": 793,
       "percentage": 100
     },
     "ru": {
-      "tokenCount": 793,
+      "tokenCount": 796,
       "translatedCount": 793,
       "percentage": 100
     },
     "sv": {
-      "tokenCount": 793,
+      "tokenCount": 796,
       "translatedCount": 789,
       "percentage": 99
     },
     "tr": {
-      "tokenCount": 793,
+      "tokenCount": 796,
       "translatedCount": 793,
       "percentage": 100
     },
     "uk": {
-      "tokenCount": 793,
+      "tokenCount": 796,
       "translatedCount": 793,
       "percentage": 100
     },
     "zh_Hans": {
-      "tokenCount": 793,
+      "tokenCount": 796,
       "translatedCount": 793,
       "percentage": 100
     },
     "zh_Hant": {
-      "tokenCount": 793,
+      "tokenCount": 796,
       "translatedCount": 793,
       "percentage": 100
     }
   }
-}
+}

+ 14 - 0
packages/admin-ui/src/lib/core/src/common/generated-types.ts

@@ -2990,6 +2990,7 @@ export type Mutation = {
   requestCompleted: Scalars['Int']['output'];
   requestStarted: Scalars['Int']['output'];
   runPendingSearchIndexUpdates: Success;
+  runScheduledTask: Success;
   setActiveChannel: UserStatus;
   setAsLoggedIn: UserStatus;
   setAsLoggedOut: UserStatus;
@@ -3686,6 +3687,11 @@ export type MutationRemoveStockLocationsFromChannelArgs = {
 };
 
 
+export type MutationRunScheduledTaskArgs = {
+  id: Scalars['String']['input'];
+};
+
+
 export type MutationSetActiveChannelArgs = {
   channelId: Scalars['ID']['input'];
 };
@@ -9133,6 +9139,13 @@ export type ToggleScheduledTaskEnabledMutationVariables = Exact<{
 
 export type ToggleScheduledTaskEnabledMutation = { updateScheduledTask: { __typename?: 'ScheduledTask', id: string, enabled: boolean } };
 
+export type RunTaskMutationVariables = Exact<{
+  id: Scalars['String']['input'];
+}>;
+
+
+export type RunTaskMutation = { runScheduledTask: { __typename?: 'Success', success: boolean } };
+
 export const ProductListQueryProductFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProductListQueryProductFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Product"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}},{"kind":"Field","name":{"kind":"Name","value":"languageCode"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"featuredAsset"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"preview"}},{"kind":"Field","name":{"kind":"Name","value":"focalPoint"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"x"}},{"kind":"Field","name":{"kind":"Name","value":"y"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"variantList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalItems"}}]}}]}}]} as unknown as DocumentNode<ProductListQueryProductFragmentFragment, unknown>;
 export const ProductVariantPriceFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProductVariantPrice"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ProductVariantPrice"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"currencyCode"}}]}}]} as unknown as DocumentNode<ProductVariantPriceFragment, unknown>;
 export const ProductOptionFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProductOption"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ProductOption"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"languageCode"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"groupId"}},{"kind":"Field","name":{"kind":"Name","value":"translations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"languageCode"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode<ProductOptionFragment, unknown>;
@@ -9486,3 +9499,4 @@ export const GetZoneDetailDocument = {"kind":"Document","definitions":[{"kind":"
 export const GetZoneListDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetZoneList"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"options"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ZoneListOptions"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"zones"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"options"},"value":{"kind":"Variable","name":{"kind":"Name","value":"options"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ZoneListItem"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalItems"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ZoneListItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Zone"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]} as unknown as DocumentNode<GetZoneListQuery, GetZoneListQueryVariables>;
 export const GetAllScheduledTasksDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetAllScheduledTasks"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"scheduledTasks"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"schedule"}},{"kind":"Field","name":{"kind":"Name","value":"scheduleDescription"}},{"kind":"Field","name":{"kind":"Name","value":"lastExecutedAt"}},{"kind":"Field","name":{"kind":"Name","value":"nextExecutionAt"}},{"kind":"Field","name":{"kind":"Name","value":"isRunning"}},{"kind":"Field","name":{"kind":"Name","value":"lastResult"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}}]}}]}}]} as unknown as DocumentNode<GetAllScheduledTasksQuery, GetAllScheduledTasksQueryVariables>;
 export const ToggleScheduledTaskEnabledDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ToggleScheduledTaskEnabled"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateScheduledTaskInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateScheduledTask"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}}]}}]}}]} as unknown as DocumentNode<ToggleScheduledTaskEnabledMutation, ToggleScheduledTaskEnabledMutationVariables>;
+export const RunTaskDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"RunTask"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"runScheduledTask"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"success"}}]}}]}}]} as unknown as DocumentNode<RunTaskMutation, RunTaskMutationVariables>;

+ 5 - 2
packages/admin-ui/src/lib/static/i18n-messages/ar.json

@@ -798,6 +798,7 @@
   },
   "system": {
     "all-job-queues": "جميع قوائم انتظار الوظائف",
+    "could-not-trigger-task": "لم يتم تنفيذ المهمة",
     "health-all-systems-up": "جميع الأنظمة",
     "health-error": "خطأ: نظام واحد أو أكثر من الانخفاض!",
     "health-last-checked": "آخر فحص",
@@ -821,7 +822,9 @@
     "last-executed-at": "آخر تنفيذ",
     "last-result": "آخر نتيجة",
     "next-execution-at": "التالي",
+    "run-task": "تنفيذ المهمة",
     "schedule": "الجدول",
-    "task-id": "معرف المهمة"
+    "task-id": "معرف المهمة",
+    "task-will-be-triggered": "سيتم تنفيذ المهمة"
   }
-}
+}

+ 5 - 2
packages/admin-ui/src/lib/static/i18n-messages/cs.json

@@ -798,6 +798,7 @@
   },
   "system": {
     "all-job-queues": "Všechny fronty úloh",
+    "could-not-trigger-task": "Nelze spustit úlohu",
     "health-all-systems-up": "Všechny systémy běží",
     "health-error": "Chyba: jeden nebo více systému neběží!",
     "health-last-checked": "Poslední kontrola",
@@ -821,7 +822,9 @@
     "last-executed-at": "Poslední spuštění",
     "last-result": "Poslední výsledek",
     "next-execution-at": "Další spuštění",
+    "run-task": "Spustit úlohu",
     "schedule": "Plán",
-    "task-id": "ID úlohy"
+    "task-id": "ID úlohy",
+    "task-will-be-triggered": "Úloha bude spuštěna"
   }
-}
+}

+ 5 - 2
packages/admin-ui/src/lib/static/i18n-messages/de.json

@@ -798,6 +798,7 @@
   },
   "system": {
     "all-job-queues": "Alle Job-Warteschlangen",
+    "could-not-trigger-task": "Konnte Aufgabe nicht ausführen",
     "health-all-systems-up": "Alle Systeme betriebsbereit",
     "health-error": "Fehler: Ein oder mehrere Systeme sind ausgefallen!",
     "health-last-checked": "Zuletzt überprüft",
@@ -821,7 +822,9 @@
     "last-executed-at": "Letzte Ausführung",
     "last-result": "Letztes Ergebnis",
     "next-execution-at": "Nächste Ausführung",
+    "run-task": "Aufgabe ausführen",
     "schedule": "Plan",
-    "task-id": "Aufgaben-ID"
+    "task-id": "Aufgaben-ID",
+    "task-will-be-triggered": "Aufgabe wird ausgeführt"
   }
-}
+}

+ 5 - 2
packages/admin-ui/src/lib/static/i18n-messages/en.json

@@ -798,6 +798,7 @@
   },
   "system": {
     "all-job-queues": "All job queues",
+    "could-not-trigger-task": "Could not trigger task",
     "health-all-systems-up": "All systems up",
     "health-error": "Error: one or more systems are down!",
     "health-last-checked": "Last checked",
@@ -821,7 +822,9 @@
     "last-executed-at": "Last executed",
     "last-result": "Last result",
     "next-execution-at": "Next execution",
+    "run-task": "Run task",
     "schedule": "Schedule",
-    "task-id": "Task ID"
+    "task-id": "Task ID",
+    "task-will-be-triggered": "Task will be triggered"
   }
-}
+}

+ 5 - 2
packages/admin-ui/src/lib/static/i18n-messages/es.json

@@ -798,6 +798,7 @@
   },
   "system": {
     "all-job-queues": "Todas las colas de trabajo",
+    "could-not-trigger-task": "No se pudo activar la tarea",
     "health-all-systems-up": "Todos los sistemas activos",
     "health-error": "Error: uno o más sistemas inactivos",
     "health-last-checked": "Última revisión",
@@ -821,7 +822,9 @@
     "last-executed-at": "Última ejecución",
     "last-result": "Último resultado",
     "next-execution-at": "Próxima ejecución",
+    "run-task": "Ejecutar tarea",
     "schedule": "Programación",
-    "task-id": "ID de la tarea"
+    "task-id": "ID de la tarea",
+    "task-will-be-triggered": "Se ejecutará la tarea"
   }
-}
+}

+ 5 - 2
packages/admin-ui/src/lib/static/i18n-messages/fa.json

@@ -798,6 +798,7 @@
   },
   "system": {
     "all-job-queues": "صف صف های وظایف",
+    "could-not-trigger-task": "نمی تواند وظیفه را اجرا کند",
     "health-all-systems-up": "همه بخش ها بدرستی کار میکند.",
     "health-error": "خطا! یک بخش یا بیشتر از سیستم از دسترس خارج شده است.",
     "health-last-checked": "زمان آخرین بررسی",
@@ -821,7 +822,9 @@
     "last-executed-at": "آخرین اجرا",
     "last-result": "آخرین نتیجه",
     "next-execution-at": "تالی",
+    "run-task": "اجرا کار",
     "schedule": "جدول",
-    "task-id": "شناسه کار"
+    "task-id": "شناسه کار",
+    "task-will-be-triggered": "کار اجرا خواهد شد"
   }
-}
+}

+ 5 - 2
packages/admin-ui/src/lib/static/i18n-messages/fr.json

@@ -798,6 +798,7 @@
   },
   "system": {
     "all-job-queues": "Toute la file de tâches",
+    "could-not-trigger-task": "Impossible de déclencher la tâche",
     "health-all-systems-up": "Tous les système en route",
     "health-error": "Erreur: un ou plusieurs systèmes sont en pannes!",
     "health-last-checked": "Dernière vérification",
@@ -821,7 +822,9 @@
     "last-executed-at": "Dernière exécution",
     "last-result": "Dernier résultat",
     "next-execution-at": "Prochaine exécution",
+    "run-task": "Exécuter la tâche",
     "schedule": "Programmation",
-    "task-id": "ID de la tâche"
+    "task-id": "ID de la tâche",
+    "task-will-be-triggered": "La tâche sera exécutée"
   }
-}
+}

+ 5 - 2
packages/admin-ui/src/lib/static/i18n-messages/he.json

@@ -798,6 +798,7 @@
   },
   "system": {
     "all-job-queues": "כל התורים של משימות",
+    "could-not-trigger-task": "לא ניתן להפעיל את המשימה",
     "health-all-systems-up": "כל המערכות פועלות",
     "health-error": "שגיאה: יש תקלות באחת או יותר מהמערכות!",
     "health-last-checked": "נבדק לאחרונה בתאריך",
@@ -821,7 +822,9 @@
     "last-executed-at": "התבצע לאחרונה בתאריך",
     "last-result": "תוצאה אחרונה",
     "next-execution-at": "התבצע הבא בתאריך",
+    "run-task": "הפעל משימה",
     "schedule": "תיקון",
-    "task-id": "מזהה משימה"
+    "task-id": "מזהה משימה",
+    "task-will-be-triggered": "המשימה תתבצע"
   }
-}
+}

+ 5 - 2
packages/admin-ui/src/lib/static/i18n-messages/hr.json

@@ -798,6 +798,7 @@
   },
   "system": {
     "all-job-queues": "Sve redove zadataka",
+    "could-not-trigger-task": "Nije moguće aktivirati zadatak",
     "health-all-systems-up": "Svi sistemi su dostupni",
     "health-error": "Greška: jedan ili više sistema je nedostupno!",
     "health-last-checked": "Poslednja provera",
@@ -821,7 +822,9 @@
     "last-executed-at": "Poslednja izvršenja",
     "last-result": "Poslednji rezultat",
     "next-execution-at": "Sljedeće izvršenje",
+    "run-task": "Izvrši zadatak",
     "schedule": "Planiranje",
-    "task-id": "ID zadatka"
+    "task-id": "ID zadatka",
+    "task-will-be-triggered": "Zadatak će biti izvršen"
   }
-}
+}

+ 5 - 2
packages/admin-ui/src/lib/static/i18n-messages/it.json

@@ -798,6 +798,7 @@
   },
   "system": {
     "all-job-queues": "Tutte le operazioni",
+    "could-not-trigger-task": "Non è stato possibile attivare la task",
     "health-all-systems-up": "I sistemi sono attivi",
     "health-error": "Errore: uno o più sistemi sono inattivi!",
     "health-last-checked": "Ultimo controllo",
@@ -821,7 +822,9 @@
     "last-executed-at": "Ultimo esecuzione",
     "last-result": "Ultimo risultato",
     "next-execution-at": "Prossima esecuzione",
+    "run-task": "Esegui task",
     "schedule": "Programmazione",
-    "task-id": "ID attività"
+    "task-id": "ID attività",
+    "task-will-be-triggered": "La task sarà eseguita"
   }
-}
+}

+ 5 - 2
packages/admin-ui/src/lib/static/i18n-messages/ja.json

@@ -798,6 +798,7 @@
   },
   "system": {
     "all-job-queues": "全てのジョブキュー",
+    "could-not-trigger-task": "タスクを実行できませんでした",
     "health-all-systems-up": "全システム稼働中",
     "health-error": "エラー: 1つ以上のシステムがダウンしています!",
     "health-last-checked": "最終チェック日時",
@@ -821,7 +822,9 @@
     "last-executed-at": "最後の実行日時",
     "last-result": "最後の結果",
     "next-execution-at": "次回の実行日時",
+    "run-task": "タスクを実行",
     "schedule": "スケジュール",
-    "task-id": "タスクID"
+    "task-id": "タスクID",
+    "task-will-be-triggered": "タスクが実行されます"
   }
-}
+}

+ 5 - 2
packages/admin-ui/src/lib/static/i18n-messages/nb.json

@@ -798,6 +798,7 @@
   },
   "system": {
     "all-job-queues": "Alle jobbkøer",
+    "could-not-trigger-task": "Kunne ikke aktivere jobben",
     "health-all-systems-up": "Alle systemer er oppe",
     "health-error": "Feil: ett eller flere systemer er nede!",
     "health-last-checked": "Sist sjekket",
@@ -821,7 +822,9 @@
     "last-executed-at": "Sist kjørt",
     "last-result": "Siste resultat",
     "next-execution-at": "Neste kjøring",
+    "run-task": "Kjør jobb",
     "schedule": "Plan",
-    "task-id": "Jobb-ID"
+    "task-id": "Jobb-ID",
+    "task-will-be-triggered": "Jobben vil bli kjørt"
   }
-}
+}

+ 5 - 2
packages/admin-ui/src/lib/static/i18n-messages/ne.json

@@ -798,6 +798,7 @@
   },
   "system": {
     "all-job-queues": "सबै कामको कतारहरू",
+    "could-not-trigger-task": "काम चलाउन सकिन्छ नै",
     "health-all-systems-up": "सबै प्रणाली चलिरहेका छन्",
     "health-error": "त्रुटि: एक वा बढि प्रणाली डाउन छन्!",
     "health-last-checked": "सिसतम अन्तिम परिक्षण",
@@ -821,7 +822,9 @@
     "last-executed-at": "अन्तिम प्रयोग",
     "last-result": "अन्तिम परिणाम",
     "next-execution-at": "अर्को प्रयोग",
+    "run-task": "काम चलाउनुहोस्",
     "schedule": "निर्धारण",
-    "task-id": "काम ID"
+    "task-id": "काम ID",
+    "task-will-be-triggered": "काम चलाउनेछ"
   }
-}
+}

+ 5 - 2
packages/admin-ui/src/lib/static/i18n-messages/pl.json

@@ -798,6 +798,7 @@
   },
   "system": {
     "all-job-queues": "Kolejka wszystkich zadań",
+    "could-not-trigger-task": "Nie można uruchomić zadania",
     "health-all-systems-up": "Wszystkie systemy działają",
     "health-error": "Błąd: jeden lub więcej systemów nie działa!",
     "health-last-checked": "Ostatnio sprawdzono",
@@ -821,7 +822,9 @@
     "last-executed-at": "Ostatnio wykonano",
     "last-result": "Ostatni wynik",
     "next-execution-at": "Następne wykonanie",
+    "run-task": "Uruchom zadanie",
     "schedule": "Harmonogram",
-    "task-id": "ID zadania"
+    "task-id": "ID zadania",
+    "task-will-be-triggered": "Zadanie zostanie uruchomione"
   }
-}
+}

+ 5 - 2
packages/admin-ui/src/lib/static/i18n-messages/pt_BR.json

@@ -798,6 +798,7 @@
   },
   "system": {
     "all-job-queues": "Todas as filas de trabalhos",
+    "could-not-trigger-task": "Não foi possível ativar a tarefa",
     "health-all-systems-up": "Todos os sistemas ativos",
     "health-error": "Erro: um ou mais sistemas estão inoperantes!",
     "health-last-checked": "Última verificação",
@@ -821,7 +822,9 @@
     "last-executed-at": "Última execução",
     "last-result": "Último resultado",
     "next-execution-at": "Próxima execução",
+    "run-task": "Executar tarefa",
     "schedule": "Agendamento",
-    "task-id": "ID da tarefa"
+    "task-id": "ID da tarefa",
+    "task-will-be-triggered": "A tarefa será executada"
   }
-}
+}

+ 5 - 2
packages/admin-ui/src/lib/static/i18n-messages/pt_PT.json

@@ -798,6 +798,7 @@
   },
   "system": {
     "all-job-queues": "Todas as filas de trabalhos",
+    "could-not-trigger-task": "Não foi possível ativar a tarefa",
     "health-all-systems-up": "Todos os sistemas activos",
     "health-error": "Erro: um ou mais sistemas estão inoperantes!",
     "health-last-checked": "Última verificação",
@@ -821,7 +822,9 @@
     "last-executed-at": "Última execução",
     "last-result": "Último resultado",
     "next-execution-at": "Próxima execução",
+    "run-task": "Executar tarefa",
     "schedule": "Agendamento",
-    "task-id": "ID da tarefa"
+    "task-id": "ID da tarefa",
+    "task-will-be-triggered": "A tarefa será executada"
   }
-}
+}

+ 5 - 2
packages/admin-ui/src/lib/static/i18n-messages/ru.json

@@ -798,6 +798,7 @@
   },
   "system": {
     "all-job-queues": "Все очереди заданий",
+    "could-not-trigger-task": "Не удалось активировать задачу",
     "health-all-systems-up": "Все системы включены",
     "health-error": "Ошибка: одна или несколько систем не работают!",
     "health-last-checked": "Последний раз проверено",
@@ -821,7 +822,9 @@
     "last-executed-at": "Последнее выполнение",
     "last-result": "Последний результат",
     "next-execution-at": "Следующее выполнение",
+    "run-task": "Выполнить задачу",
     "schedule": "Расписание",
-    "task-id": "ID задачи"
+    "task-id": "ID задачи",
+    "task-will-be-triggered": "Задача будет выполнена"
   }
-}
+}

+ 5 - 2
packages/admin-ui/src/lib/static/i18n-messages/sv.json

@@ -798,6 +798,7 @@
   },
   "system": {
     "all-job-queues": "Alla köer",
+    "could-not-trigger-task": "Kunde inte aktivera uppgiften",
     "health-all-systems-up": "Alla system är uppe",
     "health-error": "Fel: Ett eller flera system är nere!",
     "health-last-checked": "Senast kontrollerad",
@@ -821,7 +822,9 @@
     "last-executed-at": "Senast körd",
     "last-result": "Senaste resultat",
     "next-execution-at": "Nästa körning",
+    "run-task": "Kör uppgift",
     "schedule": "Schema",
-    "task-id": "Jobb-ID"
+    "task-id": "Jobb-ID",
+    "task-will-be-triggered": "Uppgiften kommer att köras"
   }
-}
+}

+ 5 - 2
packages/admin-ui/src/lib/static/i18n-messages/tr.json

@@ -798,6 +798,7 @@
   },
   "system": {
     "all-job-queues": "Tüm görev kuyrukları",
+    "could-not-trigger-task": "Görevi tetikleyemedik",
     "health-all-systems-up": "Tüm sistemler çalışıyor",
     "health-error": "Hata: bir veya daha fazla sistem arızalı!",
     "health-last-checked": "Son kontrol",
@@ -821,7 +822,9 @@
     "last-executed-at": "Son çalıştırma",
     "last-result": "Son sonuç",
     "next-execution-at": "Sonraki çalıştırma",
+    "run-task": "Görevi çalıştır",
     "schedule": "Plan",
-    "task-id": "Görev ID"
+    "task-id": "Görev ID",
+    "task-will-be-triggered": "Görev çalıştırılacak"
   }
-}
+}

+ 5 - 2
packages/admin-ui/src/lib/static/i18n-messages/uk.json

@@ -798,6 +798,7 @@
   },
   "system": {
     "all-job-queues": "Всі черги завдань",
+    "could-not-trigger-task": "Не вдалося активувати завдання",
     "health-all-systems-up": "Всі системи включені",
     "health-error": "Помилка: одна або кілька систем не працюють!",
     "health-last-checked": "Останній раз перевірено",
@@ -821,7 +822,9 @@
     "last-executed-at": "Останнє виконання",
     "last-result": "Останній результат",
     "next-execution-at": "Наступне виконання",
+    "run-task": "Виконати завдання",
     "schedule": "Розклад",
-    "task-id": "ID завдання"
+    "task-id": "ID завдання",
+    "task-will-be-triggered": "Завдання буде виконано"
   }
-}
+}

+ 5 - 2
packages/admin-ui/src/lib/static/i18n-messages/zh_Hans.json

@@ -798,6 +798,7 @@
   },
   "system": {
     "all-job-queues": "所有任务",
+    "could-not-trigger-task": "无法触发任务",
     "health-all-systems-up": "所以系统正常运行",
     "health-error": "错误:一个或多个系统启动失败!",
     "health-last-checked": "上次检查",
@@ -821,7 +822,9 @@
     "last-executed-at": "最后执行时间",
     "last-result": "最后结果",
     "next-execution-at": "下次执行时间",
+    "run-task": "运行任务",
     "schedule": "计划",
-    "task-id": "任务ID"
+    "task-id": "任务ID",
+    "task-will-be-triggered": "任务将被触发"
   }
-}
+}

+ 5 - 2
packages/admin-ui/src/lib/static/i18n-messages/zh_Hant.json

@@ -798,6 +798,7 @@
   },
   "system": {
     "all-job-queues": "所有任務隊列",
+    "could-not-trigger-task": "無法觸發任務",
     "health-all-systems-up": "所有系統正常運行",
     "health-error": "系統錯誤",
     "health-last-checked": "上次檢查",
@@ -821,7 +822,9 @@
     "last-executed-at": "上次執行",
     "last-result": "上次結果",
     "next-execution-at": "下次執行",
+    "run-task": "執行任務",
     "schedule": "計劃",
-    "task-id": "任務ID"
+    "task-id": "任務ID",
+    "task-will-be-triggered": "任務將被觸發"
   }
-}
+}

+ 13 - 0
packages/admin-ui/src/lib/system/src/components/scheduled-tasks/scheduled-task-list.component.html

@@ -73,6 +73,19 @@
                         <clr-icon shape="ellipsis-vertical" size="12"></clr-icon>
                     </button>
                     <vdr-dropdown-menu vdrPosition="bottom-right">
+                        <button
+                            type="button"
+                            *ngIf="task.enabled"
+                            class=""
+                            (click)="runTask(task)"
+                            [disabled]="!(['UpdateSettings', 'UpdateSystem'] | hasPermission)"
+                            vdrDropdownItem
+                        >
+                            <clr-icon shape="play" class=""></clr-icon>
+                            <div>
+                                {{ 'system.run-task' | translate }}
+                            </div>
+                        </button>
                         <button
                             type="button"
                             class="delete-button"

+ 30 - 1
packages/admin-ui/src/lib/system/src/components/scheduled-tasks/scheduled-task-list.component.ts

@@ -1,8 +1,12 @@
 import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
 import { FormControl } from '@angular/forms';
+import { _ } from '@ngx-translate/core';
 import {
     DataService,
     GetAllScheduledTasksQuery,
+    NotificationService,
+    RunTaskMutation,
+    RunTaskMutationVariables,
     ToggleScheduledTaskEnabledMutation,
     ToggleScheduledTaskEnabledMutationVariables,
 } from '@vendure/admin-ui/core';
@@ -34,6 +38,14 @@ const TOGGLE_SCHEDULED_TASK_ENABLED = gql`
     }
 `;
 
+const RUN_TASK = gql`
+    mutation RunTask($id: String!) {
+        runScheduledTask(id: $id) {
+            success
+        }
+    }
+`;
+
 @Component({
     selector: 'vdr-scheduled-task-list',
     templateUrl: './scheduled-task-list.component.html',
@@ -45,7 +57,10 @@ export class ScheduledTaskListComponent implements OnInit {
     tasks$: Observable<GetAllScheduledTasksQuery['scheduledTasks']>;
     liveUpdate = new FormControl(true);
 
-    constructor(private dataService: DataService) {}
+    constructor(
+        private dataService: DataService,
+        private notificationService: NotificationService,
+    ) {}
 
     ngOnInit(): void {
         this.tasks$ = this.dataService
@@ -69,4 +84,18 @@ export class ScheduledTaskListComponent implements OnInit {
             )
             .subscribe();
     }
+
+    runTask(task: GetAllScheduledTasksQuery['scheduledTasks'][0]) {
+        this.dataService
+            .mutate<RunTaskMutation, RunTaskMutationVariables>(RUN_TASK, {
+                id: task.id,
+            })
+            .subscribe(result => {
+                if (result.runScheduledTask.success) {
+                    this.notificationService.success(_('system.task-will-be-triggered'));
+                } else {
+                    this.notificationService.error(_('system.could-not-trigger-task'));
+                }
+            });
+    }
 }