forked from TouK/nussknacker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: prepare * feat: changed node test counts style * feat: user settings debug panel
- Loading branch information
1 parent
bf23caf
commit 169e342
Showing
22 changed files
with
273 additions
and
69 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
import {UserSettings} from "../../reducers/userSettings" | ||
|
||
type ToggleSettingsAction = {type: "TOGGLE_SETTINGS", settings: Array<keyof UserSettings>} | ||
type SetSettingsAction = {type: "SET_SETTINGS", settings: UserSettings} | ||
|
||
export function toggleSettings(settings: Array<keyof UserSettings>): ToggleSettingsAction { | ||
return { | ||
type: "TOGGLE_SETTINGS", | ||
settings, | ||
} | ||
} | ||
export function setSettings(settings: UserSettings): SetSettingsAction { | ||
return { | ||
type: "SET_SETTINGS", | ||
settings, | ||
} | ||
} | ||
|
||
export type UserSettingsActions = | ||
| ToggleSettingsAction | ||
| SetSettingsAction |
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 |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import {useDispatch, useSelector} from "react-redux" | ||
import {toggleSettings} from "../actions/nk/userSettings" | ||
import {userSettings} from "../reducers/selectors/userSettings" | ||
import {setSettings, toggleSettings} from "../actions/nk/userSettings" | ||
import {getUserSettings} from "../reducers/selectors/userSettings" | ||
import {UserSettings} from "../reducers/userSettings" | ||
|
||
export const useUserSettings: () => [UserSettings, (keys: Array<keyof UserSettings>) => void] = () => { | ||
export const useUserSettings: () => [UserSettings, (keys: Array<keyof UserSettings>) => void, (value: UserSettings) => void] = () => { | ||
const dispatch = useDispatch() | ||
const current = useSelector(userSettings) | ||
const current = useSelector(getUserSettings) | ||
const toggle = (keys: Array<keyof UserSettings>) => { dispatch(toggleSettings(keys)) } | ||
return [current, toggle] | ||
const reset = (value: UserSettings) => { dispatch(setSettings(value)) } | ||
return [current, toggle, reset] | ||
} |
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
5 changes: 3 additions & 2 deletions
5
ui/client/components/graph/node-modal/editors/expression/ace.ts
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
3 changes: 2 additions & 1 deletion
3
ui/client/components/graph/node-modal/editors/expression/types.ts
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
Oops, something went wrong.