Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
normalize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
nileshgulia1 committed Aug 20, 2021
1 parent 6523575 commit 36ce0ce
Show file tree
Hide file tree
Showing 25 changed files with 111 additions and 111 deletions.
2 changes: 1 addition & 1 deletion src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
GET_CHART_DATA_FROM_VISUALIZATION,
GET_NAVSITEMAP,
SET_CURRENT_VERSION,
} from '~/constants/ActionTypes';
} from '@eeacms/volto-forests-theme/constants/ActionTypes';

export function setCurrentVersion(payload) {
return {
Expand Down
5 changes: 4 additions & 1 deletion src/components/theme/CatalogueViews/AppHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ import {
getWorkflow,
purgeMessages,
} from '@plone/volto/actions';
import { getFrontpageSlides, getDefaultHeaderImage } from '~/actions';
import {
getFrontpageSlides,
getDefaultHeaderImage,
} from '@eeacms/volto-forests-theme/actions';
import { getPortlets } from '@eeacms/volto-addons-forest/actions';

class App extends Component {
Expand Down
2 changes: 1 addition & 1 deletion src/components/theme/CountryPageView/CountryPageView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
// setFolderHeader,
setFolderTabs,
getParentFolderData,
} from '~/actions';
} from '@eeacms/volto-forests-theme/actions';

import config from '@plone/volto/registry';

Expand Down
11 changes: 4 additions & 7 deletions src/components/theme/CountryView/CountryView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Helmet } from '@plone/volto/helpers';
import { Link } from 'react-router-dom';
import { Container } from 'semantic-ui-react';
import { connect } from 'react-redux';
import { setFolderTabs } from '~/actions';
import { setFolderTabs } from '@eeacms/volto-forests-theme/actions';

/**
* Full view component class.
Expand Down Expand Up @@ -105,14 +105,14 @@ class FullView extends Component {

renderTabs(nextContent) {
const items = nextContent ? nextContent.items : this.props.content.items;
const content = items.filter(i => i.title !== 'folder_info');
const content = items.filter((i) => i.title !== 'folder_info');
const tabs = (
<div
className={
'ui item stackable tabs menu ' + numberToWord[content.length]
}
>
{content.map(item => (
{content.map((item) => (
<Link
key={item.url}
className="item"
Expand Down Expand Up @@ -161,7 +161,4 @@ class FullView extends Component {
}
}

export default connect(
null,
mapDispatchToProps,
)(FullView);
export default connect(null, mapDispatchToProps)(FullView);
2 changes: 1 addition & 1 deletion src/components/theme/Header/HomepageSlider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import ImageGallery from 'react-image-gallery';
// import HomepageSliderPlaceholder from './HomepageSliderPlaceholder';
import { LazyLoadImage } from 'react-lazy-load-image-component';
import { Placeholder } from 'semantic-ui-react';
import { getBasePath } from '~/helpers';
import { getBasePath } from '@eeacms/volto-forests-theme/helpers';
// function SampleNextArrow(props) {
// const { onClick } = props;
// return (
Expand Down
10 changes: 5 additions & 5 deletions src/components/theme/HomepageView/HomepageView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import {
getBaseUrl,
getLayoutFieldname,
} from '@plone/volto/helpers';
import BasicForestIMG from '~/components/theme/HomepageView/images/1.jpg';
import ForestCarbonIMG from '~/components/theme/HomepageView/images/2.jpg';
import ForestIMG from '~/components/theme/HomepageView/images/3.jpg';
import NatureIMG from '~/components/theme/HomepageView/images/4.jpg';
import ForestHealthIMG from '~/components/theme/HomepageView/images/5.jpg';
import BasicForestIMG from '@eeacms/volto-forests-theme/components/theme/HomepageView/images/1.jpg';
import ForestCarbonIMG from '@eeacms/volto-forests-theme/components/theme/HomepageView/images/2.jpg';
import ForestIMG from '@eeacms/volto-forests-theme/components/theme/HomepageView/images/3.jpg';
import NatureIMG from '@eeacms/volto-forests-theme/components/theme/HomepageView/images/4.jpg';
import ForestHealthIMG from '@eeacms/volto-forests-theme/components/theme/HomepageView/images/5.jpg';

import MosaicView from 'volto-mosaic/components/theme/View';

Expand Down
2 changes: 1 addition & 1 deletion src/components/theme/NewsView/NewsItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
hasBlocksData,
} from '@plone/volto/helpers';
import config from '@plone/volto/registry';
import { getBasePath } from '~/helpers';
import { getBasePath } from '@eeacms/volto-forests-theme/helpers';

const NewsItem = ({ item }) => {
const blocksFieldname = getBlocksFieldname(item);
Expand Down
115 changes: 56 additions & 59 deletions src/components/theme/SiteMap/SiteMap.jsx
Original file line number Diff line number Diff line change
@@ -1,84 +1,81 @@

import React, { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { compose } from 'redux';
import { asyncConnect } from 'redux-connect';
import { Link } from 'react-router-dom'
import { Link } from 'react-router-dom';

import { getBaseUrl } from '@plone/volto/helpers';
import {
getNavigation,
} from '@plone/volto/actions';
import { getNavSiteMap } from '~/actions';
import { getNavigation } from '@plone/volto/actions';
import { getNavSiteMap } from '@eeacms/volto-forests-theme/actions';

/**
* @export
* @class SiteMap
* @extends {Component}
*/
class SiteMap extends Component {
/**
* Property types.
* @property {Object} propTypes Property types.
* @static
*/
static propTypes = {
pathname: PropTypes.string.isRequired,
getNavSiteMap: PropTypes.func.isRequired,
};
/**
* Property types.
* @property {Object} propTypes Property types.
* @static
*/
static propTypes = {
pathname: PropTypes.string.isRequired,
getNavSiteMap: PropTypes.func.isRequired,
};

componentDidMount() {
this.props.getNavSiteMap(getBaseUrl(this.props.location.pathname), 100);
}
/**
* Render method.
* @method render
* @returns {string} Markup for the component.
*/
render() {
const { navigation } = this.props;
componentDidMount() {
this.props.getNavSiteMap(getBaseUrl(this.props.location.pathname), 100);
}
/**
* Render method.
* @method render
* @returns {string} Markup for the component.
*/
render() {
const { navigation } = this.props;

const TreeMap = ({ data }) => {
const TreeMap = ({ data }) => {
return (
<ul>
{data.map((m, i) => {
return (
<ul>
{data.map((m, i) => {
return (
<li key={i}>
<Link to="/">
{m.title}
</Link>
{m.items && !!m.items.length && <TreeMap data={m.items} />}
</li>
);
})}
</ul>
<li key={i}>
<Link to="/">{m.title}</Link>
{m.items && !!m.items.length && <TreeMap data={m.items} />}
</li>
);
};
})}
</ul>
);
};

return (
<Fragment>
<TreeMap data={navigation.items} />
</Fragment>
);
}
return (
<Fragment>
<TreeMap data={navigation.items} />
</Fragment>
);
}
}

export const __test__ = connect(
(state, props) => ({
pathname: props.location.pathname,
content: state.content.data,
}),
{},
(state, props) => ({
pathname: props.location.pathname,
content: state.content.data,
}),
{},
)(SiteMap);

export default compose(
asyncConnect([
{
key: 'navigation',
promise: ({ location, store: { dispatch } }) =>
dispatch(getNavSiteMap(getBaseUrl(location.pathname), 100)),
},
]),
connect((state, props) => ({ pathname: props.location.pathname }), { getNavSiteMap }),
)(SiteMap);
asyncConnect([
{
key: 'navigation',
promise: ({ location, store: { dispatch } }) =>
dispatch(getNavSiteMap(getBaseUrl(location.pathname), 100)),
},
]),
connect((state, props) => ({ pathname: props.location.pathname }), {
getNavSiteMap,
}),
)(SiteMap);
5 changes: 4 additions & 1 deletion src/customizations/volto/components/theme/App/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ import {
getWorkflow,
purgeMessages,
} from '@plone/volto/actions';
import { getFrontpageSlides, getDefaultHeaderImage } from '~/actions';
import {
getFrontpageSlides,
getDefaultHeaderImage,
} from '@eeacms/volto-forests-theme/actions';
import { getPortlets } from '@eeacms/volto-addons-forest/actions';

import clearSVG from '@plone/volto/icons/clear.svg';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import ccsLogo from './climateChange.svg';
import { compose } from 'redux';
import { connect } from 'react-redux';
import config from '@plone/volto/registry';
import { setCurrentVersion } from '~/actions';
import { setCurrentVersion } from '@eeacms/volto-forests-theme/actions';

/**
* Component to display the footer.
Expand Down
6 changes: 3 additions & 3 deletions src/customizations/volto/components/theme/Header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { connect } from 'react-redux';

import { Logo, Navigation, Breadcrumbs } from '@plone/volto/components';

import HeaderImage from '~/components/theme/Header/HeaderImage';
import HomepageSlider from '~/components/theme/Header/HomepageSlider';
import MobileSearchWidget from '~/components/theme/MobileSearchWidget/MobileSearchWidget';
import HeaderImage from '@eeacms/volto-forests-theme/components/theme/Header/HeaderImage';
import HomepageSlider from '@eeacms/volto-forests-theme/components/theme/Header/HomepageSlider';
import MobileSearchWidget from '@eeacms/volto-forests-theme/components/theme/MobileSearchWidget/MobileSearchWidget';
import Sticky from 'react-stickynode';
import HeaderBackground from './header-bg.png';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Link } from 'react-router-dom';
import { defineMessages, injectIntl } from 'react-intl';
import { Menu, Dropdown } from 'semantic-ui-react';
import cx from 'classnames';
import { getBasePath } from '~/helpers';
import { getBasePath } from '@eeacms/volto-forests-theme/helpers';
import SearchBlock from '@eeacms/volto-addons-forest/SearchBlock/View';
import { Icon } from '@plone/volto/components';
import zoomSVG from '@plone/volto/icons/zoom.svg';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Helmet } from '@plone/volto/helpers';
// import { Link } from 'react-router-dom';
import { getLocalnavigation } from '~/actions';
import { getLocalnavigation } from '@eeacms/volto-forests-theme/actions';
import { connect } from 'react-redux';
import { compose } from 'redux';
import { getBaseUrl } from '@plone/volto/helpers'; // , flattenToAppURL
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { installBlocks } from '@eeacms/volto-plotlycharts';
import { applyConfig as installFiseFrontend } from './localconfig';

import ObjectListInlineWidget from './components/manage/Widgets/ObjectListInlineWidget';
import reducers from '~/reducers';
import reducers from '@eeacms/volto-forests-theme/reducers';

import '@plone/volto/config';

Expand Down
18 changes: 9 additions & 9 deletions src/localconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ import { defineMessages } from 'react-intl';

import TokenWidget from '@plone/volto/components/manage/Widgets/TokenWidget';

import CountryView from '~/components/theme/CountryView/CountryView';
import CountryView from '@eeacms/volto-forests-theme/components/theme/CountryView/CountryView';
// import CountryPageView from '~/components/theme/CountryPageView/CountryPageView';
//import HomepageView from '~/components/theme/HomepageView/HomepageView';
import NewsView from '~/components/theme/NewsView/NewsView';
import RefreshView from '~/components/theme/RefreshView/RefreshView';
import NewsView from '@eeacms/volto-forests-theme/components/theme/NewsView/NewsView';
import RefreshView from '@eeacms/volto-forests-theme/components/theme/RefreshView/RefreshView';

import chartIcon from '@plone/volto/icons/world.svg';

import DefaultViewWide from '~/components/theme/DefaultViewWide/DefaultViewWide';
import DefaultView from '~/customizations/volto/components/theme/View/DefaultView';
import DefaultViewWide from '@eeacms/volto-forests-theme/components/theme/DefaultViewWide/DefaultViewWide';
import DefaultView from '@eeacms/volto-forests-theme/customizations/volto/components/theme/View/DefaultView';

import ForestMetadata from '~/components/theme/Viewlets/ForestMetadata';
import ForestMetadata from '@eeacms/volto-forests-theme/components/theme/Viewlets/ForestMetadata';

import NavigationBlockEdit from '~/components/manage/Blocks/NavigationBlock/Edit';
import NavigationBlockView from '~/components/manage/Blocks/NavigationBlock/View';
import NavigationBlockEdit from '@eeacms/volto-forests-theme/components/manage/Blocks/NavigationBlock/Edit';
import NavigationBlockView from '@eeacms/volto-forests-theme/components/manage/Blocks/NavigationBlock/View';

import RedirectView from '~/components/theme/View/RedirectView';
import RedirectView from '@eeacms/volto-forests-theme/components/theme/View/RedirectView';
import { uniqBy } from 'lodash';

defineMessages({
Expand Down
2 changes: 1 addition & 1 deletion src/reducers/current_version.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @module reducers/frontpage_slides
*/

import { SET_CURRENT_VERSION } from '~/constants/ActionTypes';
import { SET_CURRENT_VERSION } from '@eeacms/volto-forests-theme/constants/ActionTypes';

const initialState = {
error: null,
Expand Down
2 changes: 1 addition & 1 deletion src/reducers/default_header_image.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { map } from 'lodash';

import { GET_DEFAULT_HEADER_IMAGE } from '~/constants/ActionTypes';
import { GET_DEFAULT_HEADER_IMAGE } from '@eeacms/volto-forests-theme/constants/ActionTypes';

const initialState = {
error: null,
Expand Down
2 changes: 1 addition & 1 deletion src/reducers/folder_header.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @module reducers/frontpage_slides
*/

import { SET_FOLDER_HEADER } from '~/constants/ActionTypes';
import { SET_FOLDER_HEADER } from '@eeacms/volto-forests-theme/constants/ActionTypes';

const initialState = {
error: null,
Expand Down
2 changes: 1 addition & 1 deletion src/reducers/folder_tabs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SET_FOLDER_TABS } from '~/constants/ActionTypes';
import { SET_FOLDER_TABS } from '@eeacms/volto-forests-theme/constants/ActionTypes';

const initialState = {
error: null,
Expand Down
2 changes: 1 addition & 1 deletion src/reducers/frontpage_slides.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { map } from 'lodash';

import { GET_FRONTPAGESLIDES } from '~/constants/ActionTypes';
import { GET_FRONTPAGESLIDES } from '@eeacms/volto-forests-theme/constants/ActionTypes';

const initialState = {
error: null,
Expand Down
Loading

0 comments on commit 36ce0ce

Please sign in to comment.