-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: re-write actions to typescript and implement new analytics …
…API (#626) * refactor: re-write actions to typescript and implement new analytics API * fix: fix static accepter action naming
- Loading branch information
Showing
75 changed files
with
1,293 additions
and
1,255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import axios from 'axios'; | ||
import actionNames from '@/static/modules/action-names'; | ||
import {type Action, AppThunk} from '@/static/modules/actions/types'; | ||
import {createNotificationError} from '@/static/modules/actions/notifications'; | ||
import {CustomGuiActionPayload} from '@/adapters/tool/types'; | ||
|
||
export type RunCustomGuiAction = Action<typeof actionNames.RUN_CUSTOM_GUI_ACTION, CustomGuiActionPayload>; | ||
export const runCustomGui = (payload: RunCustomGuiAction['payload']): RunCustomGuiAction => ({type: actionNames.RUN_CUSTOM_GUI_ACTION, payload}); | ||
|
||
export const thunkRunCustomGuiAction = (payload: CustomGuiActionPayload): AppThunk => { | ||
return async (dispatch) => { | ||
try { | ||
const {sectionName, groupIndex, controlIndex} = payload; | ||
|
||
await axios.post('/run-custom-gui-action', {sectionName, groupIndex, controlIndex}); | ||
|
||
dispatch(runCustomGui(payload)); | ||
} catch (e: unknown) { | ||
dispatch(createNotificationError('runCustomGuiAction', e as Error)); | ||
} | ||
}; | ||
}; | ||
|
||
export type CustomGuiAction = | ||
| RunCustomGuiAction; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import actionNames from '@/static/modules/action-names'; | ||
import type {Action} from '@/static/modules/actions/types'; | ||
import {setFilteredBrowsers} from '@/static/modules/query-params'; | ||
import {BrowserItem} from '@/types'; | ||
import {ViewMode} from '@/constants'; | ||
|
||
export type UpdateTestNameFilterAction = Action<typeof actionNames.VIEW_UPDATE_FILTER_BY_NAME, string>; | ||
export const updateTestNameFilter = (testNameFilter: UpdateTestNameFilterAction['payload']): UpdateTestNameFilterAction => { | ||
return {type: actionNames.VIEW_UPDATE_FILTER_BY_NAME, payload: testNameFilter}; | ||
}; | ||
|
||
export type SetStrictMatchFilterAction = Action<typeof actionNames.VIEW_SET_STRICT_MATCH_FILTER, boolean>; | ||
export const setStrictMatchFilter = (strictMatchFilter: SetStrictMatchFilterAction['payload']): SetStrictMatchFilterAction => { | ||
return {type: actionNames.VIEW_SET_STRICT_MATCH_FILTER, payload: strictMatchFilter}; | ||
}; | ||
|
||
export type SelectBrowsersAction = Action<typeof actionNames.BROWSERS_SELECTED, { | ||
browsers: BrowserItem[]; | ||
}>; | ||
export const selectBrowsers = (browsers: BrowserItem[]): SelectBrowsersAction => { | ||
setFilteredBrowsers(browsers); | ||
|
||
return { | ||
type: actionNames.BROWSERS_SELECTED, | ||
payload: {browsers} | ||
}; | ||
}; | ||
|
||
export type ChangeViewModeAction = Action<typeof actionNames.CHANGE_VIEW_MODE, ViewMode>; | ||
export const changeViewMode = (payload: ChangeViewModeAction['payload']): ChangeViewModeAction => ({type: actionNames.CHANGE_VIEW_MODE, payload}); | ||
|
||
export type FilterTestsAction = | ||
| UpdateTestNameFilterAction | ||
| SetStrictMatchFilterAction | ||
| SelectBrowsersAction | ||
| ChangeViewModeAction; |
Oops, something went wrong.