mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-23 22:25:09 -04:00
Secret Dev Settings Page
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
import { createAction } from 'redux-actions';
|
||||
import createFetchHandler from 'Store/Actions/Creators/createFetchHandler';
|
||||
import createSaveHandler from 'Store/Actions/Creators/createSaveHandler';
|
||||
import createSetSettingValueReducer from 'Store/Actions/Creators/Reducers/createSetSettingValueReducer';
|
||||
import { createThunk } from 'Store/thunks';
|
||||
|
||||
//
|
||||
// Variables
|
||||
|
||||
const section = 'settings.development';
|
||||
|
||||
//
|
||||
// Actions Types
|
||||
|
||||
export const FETCH_DEVELOPMENT_SETTINGS = 'settings/development/fetchDevelopmentSettings';
|
||||
export const SET_DEVELOPMENT_SETTINGS_VALUE = 'settings/development/setDevelopmentSettingsValue';
|
||||
export const SAVE_DEVELOPMENT_SETTINGS = 'settings/development/saveDevelopmentSettings';
|
||||
|
||||
//
|
||||
// Action Creators
|
||||
|
||||
export const fetchDevelopmentSettings = createThunk(FETCH_DEVELOPMENT_SETTINGS);
|
||||
export const saveDevelopmentSettings = createThunk(SAVE_DEVELOPMENT_SETTINGS);
|
||||
export const setDevelopmentSettingsValue = createAction(SET_DEVELOPMENT_SETTINGS_VALUE, (payload) => {
|
||||
return {
|
||||
section,
|
||||
...payload
|
||||
};
|
||||
});
|
||||
|
||||
//
|
||||
// Details
|
||||
|
||||
export default {
|
||||
|
||||
//
|
||||
// State
|
||||
|
||||
defaultState: {
|
||||
isFetching: false,
|
||||
isPopulated: false,
|
||||
error: null,
|
||||
pendingChanges: {},
|
||||
isSaving: false,
|
||||
saveError: null,
|
||||
item: {}
|
||||
},
|
||||
|
||||
//
|
||||
// Action Handlers
|
||||
|
||||
actionHandlers: {
|
||||
[FETCH_DEVELOPMENT_SETTINGS]: createFetchHandler(section, '/config/development'),
|
||||
[SAVE_DEVELOPMENT_SETTINGS]: createSaveHandler(section, '/config/development')
|
||||
},
|
||||
|
||||
//
|
||||
// Reducers
|
||||
|
||||
reducers: {
|
||||
[SET_DEVELOPMENT_SETTINGS_VALUE]: createSetSettingValueReducer(section)
|
||||
}
|
||||
|
||||
};
|
||||
@@ -2,6 +2,7 @@ import { createAction } from 'redux-actions';
|
||||
import { handleThunks } from 'Store/thunks';
|
||||
import createHandleActions from './Creators/createHandleActions';
|
||||
import delayProfiles from './Settings/delayProfiles';
|
||||
import development from './Settings/development';
|
||||
import downloadClientOptions from './Settings/downloadClientOptions';
|
||||
import downloadClients from './Settings/downloadClients';
|
||||
import general from './Settings/general';
|
||||
@@ -43,6 +44,7 @@ export * from './Settings/qualityProfiles';
|
||||
export * from './Settings/releaseProfiles';
|
||||
export * from './Settings/remotePathMappings';
|
||||
export * from './Settings/rootFolders';
|
||||
export * from './Settings/development';
|
||||
export * from './Settings/ui';
|
||||
|
||||
//
|
||||
@@ -76,6 +78,7 @@ export const defaultState = {
|
||||
releaseProfiles: releaseProfiles.defaultState,
|
||||
remotePathMappings: remotePathMappings.defaultState,
|
||||
rootFolders: rootFolders.defaultState,
|
||||
development: development.defaultState,
|
||||
ui: ui.defaultState
|
||||
};
|
||||
|
||||
@@ -117,6 +120,7 @@ export const actionHandlers = handleThunks({
|
||||
...releaseProfiles.actionHandlers,
|
||||
...remotePathMappings.actionHandlers,
|
||||
...rootFolders.actionHandlers,
|
||||
...development.actionHandlers,
|
||||
...ui.actionHandlers
|
||||
});
|
||||
|
||||
@@ -149,6 +153,7 @@ export const reducers = createHandleActions({
|
||||
...releaseProfiles.reducers,
|
||||
...remotePathMappings.reducers,
|
||||
...rootFolders.reducers,
|
||||
...development.reducers,
|
||||
...ui.reducers
|
||||
|
||||
}, defaultState, section);
|
||||
|
||||
Reference in New Issue
Block a user