Skip to content

Commit

Permalink
fix: apply settings default tab on failed status as well.
Browse files Browse the repository at this point in the history
feat: add default option as default tab selection
  • Loading branch information
felixmosh committed Jan 19, 2025
1 parent 7893a60 commit 11cf428
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/ui/src/components/SettingsModal/SettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const SettingsModal = ({ open, onClose }: SettingsModalProps) => {
<SelectField
label={t('SETTINGS.DEFAULT_JOB_TAB')}
id="default-job-tab"
options={availableJobTabs.map((tab) => ({
options={['default'].concat(availableJobTabs).map((tab) => ({
text: t(`JOB.TABS.${tab.toUpperCase()}`),
value: tab,
}))}
Expand Down
6 changes: 1 addition & 5 deletions packages/ui/src/hooks/useDetailsTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ export function useDetailsTabs(currentStatus: Status) {
}, [currentStatus]);

useEffect(() => {
if (!tabs.includes(defaultJobTab) || currentStatus === STATUSES.failed) {
setSelectedTab(tabs[0]);
} else {
setSelectedTab(defaultJobTab);
}
setSelectedTab(tabs.includes(defaultJobTab) ? defaultJobTab : tabs[0]);
}, [defaultJobTab, tabs]);

return {
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/static/locales/en-US/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
}
},
"TABS": {
"DEFAULT": "Default",
"DATA": "Data",
"OPTIONS": "Options",
"LOGS": "Logs",
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/static/locales/es-ES/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
}
},
"TABS": {
"DEFAULT": "Predeterminado",
"DATA": "Datos",
"OPTIONS": "Opciones",
"LOGS": "Registros",
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/static/locales/fr-FR/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
}
},
"TABS": {
"DEFAULT": "Par défaut",
"DATA": "Données",
"OPTIONS": "Options",
"LOGS": "Journaux",
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/static/locales/pt-BR/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
}
},
"TABS": {
"DEFAULT": "Padrão",
"DATA": "Dados",
"OPTIONS": "Opções",
"LOGS": "Logs",
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/static/locales/zh-CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
}
},
"TABS": {
"DEFAULT": "默认",
"DATA": "数据",
"OPTIONS": "选项",
"LOGS": "日志",
Expand Down

0 comments on commit 11cf428

Please sign in to comment.