SB settings Save works and brandcolor renders. Logo/banner paths are issues, and adding new homefooter/customCSS are issues
This commit is contained in:
parent
43f28a30ba
commit
ba18c3a643
|
@ -4,8 +4,8 @@ export const SOAPBOX_CONFIG_REQUEST_SUCCESS = 'SOAPBOX_CONFIG_REQUEST_SUCCESS';
|
||||||
export const SOAPBOX_CONFIG_REQUEST_FAIL = 'SOAPBOX_CONFIG_REQUEST_FAIL';
|
export const SOAPBOX_CONFIG_REQUEST_FAIL = 'SOAPBOX_CONFIG_REQUEST_FAIL';
|
||||||
|
|
||||||
export const SOAPBOX_POST_REQUEST = 'SOAPBOX_POST_REQUEST';
|
export const SOAPBOX_POST_REQUEST = 'SOAPBOX_POST_REQUEST';
|
||||||
export const SOAPBOX_POST_SUCCESS = 'SOAPBOX_POST_REQUEST';
|
export const SOAPBOX_POST_SUCCESS = 'SOAPBOX_POST_SUCCESS';
|
||||||
export const SOAPBOX_POST_FAIL = 'SOAPBOX_POST_REQUEST';
|
export const SOAPBOX_POST_FAIL = 'SOAPBOX_POST_FAIL';
|
||||||
|
|
||||||
export function fetchSoapboxConfig() {
|
export function fetchSoapboxConfig() {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
|
|
|
@ -113,7 +113,7 @@ class ConfigSoapbox extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
getParams = () => {
|
getParams = () => {
|
||||||
// const { state } = this;
|
const { state } = this;
|
||||||
var obj = {
|
var obj = {
|
||||||
configs: [{
|
configs: [{
|
||||||
group: ':pleroma',
|
group: ':pleroma',
|
||||||
|
@ -121,46 +121,44 @@ class ConfigSoapbox extends ImmutablePureComponent {
|
||||||
value: [{
|
value: [{
|
||||||
tuple: [':soapbox_fe',
|
tuple: [':soapbox_fe',
|
||||||
{
|
{
|
||||||
// logo: '',
|
logo: '',
|
||||||
// banner: '',
|
banner: '',
|
||||||
// brandColor: '',
|
brandColor: '',
|
||||||
// customCss: [],
|
customCss: [],
|
||||||
// promoPanel: {
|
promoPanel: {
|
||||||
// items: [],
|
items: [],
|
||||||
// },
|
},
|
||||||
// extensions: {
|
extensions: {
|
||||||
// patron: false,
|
patron: false,
|
||||||
// },
|
},
|
||||||
// defaultSettings: {
|
defaultSettings: {
|
||||||
// autoPlayGif: false,
|
autoPlayGif: false,
|
||||||
// },
|
},
|
||||||
// copyright: '',
|
copyright: '',
|
||||||
// navlinks: {
|
navlinks: {
|
||||||
// homeFooter: [],
|
homeFooter: [],
|
||||||
// },
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}],
|
}],
|
||||||
}],
|
}],
|
||||||
};
|
};
|
||||||
// obj.configs[0].value[0].tuple[1].logo = state.logo;
|
obj.configs[0].value[0].tuple[1].logo = state.logo;
|
||||||
// obj.configs[0].value[0].tuple[1].banner = state.banner;
|
obj.configs[0].value[0].tuple[1].banner = state.banner;
|
||||||
// obj.configs[0].value[0].tuple[1].brandColor = state.brandColor;
|
obj.configs[0].value[0].tuple[1].brandColor = state.brandColor;
|
||||||
// obj.configs[0].value[0].tuple[1].extensions.patron = state.patronEnabled;
|
obj.configs[0].value[0].tuple[1].extensions.patron = state.patronEnabled;
|
||||||
// obj.configs[0].value[0].tuple[1].defaultSettings.autoPlayGif = state.autoPlayGif;
|
obj.configs[0].value[0].tuple[1].defaultSettings.autoPlayGif = state.autoPlayGif;
|
||||||
// obj.configs[0].value[0].tuple[1].copyright = state.copyright;
|
obj.configs[0].value[0].tuple[1].copyright = state.copyright;
|
||||||
// this.state.homeFooterItems.forEach((f) =>
|
this.state.homeFooterItems.forEach((f) =>
|
||||||
// obj.configs[0].value[0].tuple[1].navlinks.homeFooter.push({ title: f.get('title'), url: f.get('url') })
|
obj.configs[0].value[0].tuple[1].navlinks.homeFooter.push({ title: f.get('title'), url: f.get('url') })
|
||||||
// );
|
);
|
||||||
// this.state.promoItems.forEach((f) =>
|
this.state.promoItems.forEach((f) =>
|
||||||
// obj.configs[0].value[0].tuple[1].promoPanel.items.push({ icon: f.get('icon'), text: f.get('text'), url: f.get('url') })
|
obj.configs[0].value[0].tuple[1].promoPanel.items.push({ icon: f.get('icon'), text: f.get('text'), url: f.get('url') })
|
||||||
// );
|
);
|
||||||
// this.state.customCssItems.forEach((f) =>
|
this.state.customCssItems.forEach((f) =>
|
||||||
// obj.configs[0].value[0].tuple[1].customCss.push(f)
|
obj.configs[0].value[0].tuple[1].customCss.push(f)
|
||||||
// );
|
);
|
||||||
console.log(JSON.stringify(obj, null, 2));
|
return obj;
|
||||||
// console.log(JSON.stringify(obj.configs[0].value[0].tuple[1], null, 2));
|
|
||||||
return JSON.stringify(obj);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSubmit = (event) => {
|
handleSubmit = (event) => {
|
||||||
|
|
|
@ -2,7 +2,6 @@ import {
|
||||||
SOAPBOX_CONFIG_REQUEST_SUCCESS,
|
SOAPBOX_CONFIG_REQUEST_SUCCESS,
|
||||||
SOAPBOX_CONFIG_REQUEST_FAIL,
|
SOAPBOX_CONFIG_REQUEST_FAIL,
|
||||||
SOAPBOX_POST_SUCCESS,
|
SOAPBOX_POST_SUCCESS,
|
||||||
SOAPBOX_POST_REQUEST,
|
|
||||||
} from '../actions/soapbox';
|
} from '../actions/soapbox';
|
||||||
import { Map as ImmutableMap, fromJS } from 'immutable';
|
import { Map as ImmutableMap, fromJS } from 'immutable';
|
||||||
|
|
||||||
|
@ -18,11 +17,8 @@ export default function soapbox(state = initialState, action) {
|
||||||
return defaultState.merge(ImmutableMap(fromJS(action.soapboxConfig)));
|
return defaultState.merge(ImmutableMap(fromJS(action.soapboxConfig)));
|
||||||
case SOAPBOX_CONFIG_REQUEST_FAIL:
|
case SOAPBOX_CONFIG_REQUEST_FAIL:
|
||||||
return defaultState;
|
return defaultState;
|
||||||
case SOAPBOX_POST_REQUEST:
|
|
||||||
case SOAPBOX_POST_SUCCESS:
|
case SOAPBOX_POST_SUCCESS:
|
||||||
// const soapbox = ImmutableMap(fromJS(action.soapboxConfig)).configs[0].value[0].tuple[1];
|
return defaultState.merge(ImmutableMap(fromJS(action.soapboxConfig.configs[0].value[0].tuple[1])));
|
||||||
// return soapbox;
|
|
||||||
return defaultState;
|
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue