From 0f70fde172198e9e033f2d192ed1525b61455cf5 Mon Sep 17 00:00:00 2001 From: crockwave Date: Tue, 11 Aug 2020 18:41:03 -0500 Subject: [PATCH] action_bar had a poor merge conflict correction fixed. Still experimenting with updating nested state --- .../features/compose/components/action_bar.js | 2 +- app/soapbox/features/configuration/index.js | 70 +++++++++++-------- 2 files changed, 41 insertions(+), 31 deletions(-) diff --git a/app/soapbox/features/compose/components/action_bar.js b/app/soapbox/features/compose/components/action_bar.js index 70c04e251..3419aed78 100644 --- a/app/soapbox/features/compose/components/action_bar.js +++ b/app/soapbox/features/compose/components/action_bar.js @@ -81,8 +81,8 @@ class ActionBar extends React.PureComponent { menu.push(null); menu.push({ text: intl.formatMessage(messages.keyboard_shortcuts), action: this.handleHotkeyClick }); if (isStaff) { - menu.push({ text: intl.formatMessage(messages.admin_settings), href: '/pleroma/admin/' }); menu.push({ text: intl.formatMessage(messages.admin_settings), href: '/pleroma/admin/', newTab: true }); + menu.push({ text: intl.formatMessage(messages.soapbox_settings), href: '/admin/' }); } menu.push({ text: intl.formatMessage(messages.preferences), to: '/settings/preferences' }); menu.push({ text: intl.formatMessage(messages.security), to: '/auth/edit' }); diff --git a/app/soapbox/features/configuration/index.js b/app/soapbox/features/configuration/index.js index 295429bbd..4cdcdeded 100644 --- a/app/soapbox/features/configuration/index.js +++ b/app/soapbox/features/configuration/index.js @@ -19,7 +19,6 @@ import { Map as ImmutableMap, List as ImmutableList, getIn, - mergeDeep, } from 'immutable'; import { postSoapbox } from 'soapbox/actions/soapbox'; @@ -63,23 +62,30 @@ class ConfigSoapbox extends ImmutablePureComponent { // this.state = ImmutableMap(props.soapbox); console.log(JSON.stringify(this.state, null, 2)); if (!this.state.logo) { - this.state.logo = ''; + this.state.concat({ logo: '' }); } if (!this.state.banner) { - this.state.banner = ''; + this.state.concat({ banner: '' }); } if (getIn(this.state, ['defaultSettings', 'autoPlayGif'], 'notSet') === 'notSet') { - this.state.defaultSettings.autoPlayGif = false; + this.state.concat({ defaultSettings: { autoPlayGif: false } }); }; if (getIn(this.state, ['extensions', 'patron'], 'notSet') === 'notSet') { - this.state.extensions.patron = false; + this.state.concat({ extensions: { patron: false } }); + // this.state.extensions.patron = false; }; if (getIn(this.state, ['promoPanel', 'items', 'icon'], 'notSet') === 'notSet') { - mergeDeep(this.state, { promoPanel: { items: [ { - icon: '', - text: '', - url: '', - } ] } }); + this.state = { + promoPanel: { + items: [ + { + icon: '', + text: '', + url: '', + }, + ], + }, + }; // this.state.promoPanel.items = ImmutableList([ // ImmutableMap({ // icon: '', @@ -120,7 +126,7 @@ class ConfigSoapbox extends ImmutablePureComponent { } getParams = () => { - const { state } = this; + // const { state } = this; var obj = { configs: [{ group: ':pleroma', @@ -128,23 +134,23 @@ class ConfigSoapbox extends ImmutablePureComponent { value: [{ tuple: [':soapbox_fe', { - logo: '', - banner: '', - brandColor: '', - customCss: [], - promoPanel: { - items: [], - }, - extensions: { - patron: false, - }, - defaultSettings: { - autoPlayGif: false, - }, - copyright: '', - navlinks: { - homeFooter: [], - }, + // logo: '', + // banner: '', + // brandColor: '', + // customCss: [], + // promoPanel: { + // items: [], + // }, + // extensions: { + // patron: false, + // }, + // defaultSettings: { + // autoPlayGif: false, + // }, + // copyright: '', + // navlinks: { + // homeFooter: [], + // }, }, ], }], @@ -292,10 +298,14 @@ class ConfigSoapbox extends ImmutablePureComponent { render() { const { intl } = this.props; - const { logo, banner, brandColor, extensions, defaultSettings, copyright, - promoPanel, navlinks, customCss } = this.state; + // const { logo, banner, brandColor, extensions, defaultSettings, copyright, + // promoPanel, navlinks, customCss } = this.state; const patron = false; const autoPlayGif = false; + const logo = ''; + const banner = ''; + const brandColor = '#3b5998'; + const copyright = ''; // const patron = (extensions.patron === 'true'); // const autoPlayGif = (defaultSettings.autoPlayGif === 'true'); // console.log(navlinks.homeFooter);