Skip to content

Commit

Permalink
fix JENKINS, lint code, a11y fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nileshgulia1 committed May 7, 2021
1 parent e720add commit 2739b74
Show file tree
Hide file tree
Showing 21 changed files with 108 additions and 176 deletions.
5 changes: 0 additions & 5 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,13 @@ export function getLocalnavigation(folder) {
}

export function setFolderTabs(payload) {
console.log('in action', 'setting folder tabs', payload);
return {
type: SET_FOLDER_TABS,
payload: payload,
};
}

export function getParentFolderData(url) {
console.log('in action', 'getparentfolderdata', url);

return {
type: GET_PARENT_FOLDER_DATA,
request: {
Expand All @@ -78,8 +75,6 @@ export function getParentFolderData(url) {
}

export function quickSearchContent(url, options, subrequest = null) {
console.log('in action - quicksearch');

let queryArray = [];
const arrayOptions = pickBy(options, (item) => isArray(item));

Expand Down
12 changes: 0 additions & 12 deletions src/client.js

This file was deleted.

4 changes: 3 additions & 1 deletion src/components/theme/Header/PageNavigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { flattenToAppURL } from '@plone/volto/helpers';
import config from '@plone/volto/registry';
import rightCircle from '@plone/volto/icons/circle-right.svg';
import MenuPosition from './MenuPosition';
import { getBasePath } from '~/helpers';
import { getBasePath } from '../../../helpers';
import { BodyClass } from '@plone/volto/helpers';

const messages = defineMessages({
Expand Down Expand Up @@ -237,6 +237,7 @@ class PageNavigation extends Component {
this.setSubmenu(item.title, item.items, ev)
}
onKeyPress={() => {}}
tabIndex={0}
>
{this.state.subMenu.type === item.title && (
<Icon
Expand Down Expand Up @@ -461,6 +462,7 @@ class PageNavigation extends Component {
this.setSubtopics(item.title, item.items, ev)
}
onKeyPress={() => {}}
tabIndex={0}
>
{this.state.subTopics.type === item.title && (
<Icon
Expand Down
149 changes: 72 additions & 77 deletions src/components/theme/View/TopicsView.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Helmet } from '@plone/volto/helpers';
import { Redirect } from 'react-router-dom';
import { Container } from 'semantic-ui-react';
// import { connect } from 'react-redux';
// import { Portal } from 'react-portal';
// import { flattenToAppURL } from '@plone/volto/helpers';
Expand All @@ -24,7 +22,6 @@ class TopicsView extends Component {
// tabs: null,
redirect: false,
};
console.log('topicsView');
}
static propTypes = {
content: PropTypes.shape({
Expand All @@ -49,7 +46,6 @@ class TopicsView extends Component {
// this.props.getLocalnavigation(flattenToAppURL(this.props.content['@id']));
const mainItem = this.props.content.items[0];
const mainUrl = mainItem && mainItem.url;
console.log('mainitem,mainurl', mainItem, mainUrl);
if (__CLIENT__ && mainUrl && window) {
this.setState({ redirect: mainUrl });
} else {
Expand Down Expand Up @@ -95,85 +91,84 @@ class TopicsView extends Component {
// }

render() {
console.log('redirect state', this.state.redirect);
if (this.state.redirect) {
return <Redirect to={{ pathname: this.state.redirect }} />;
} else {
return '';
}
const content = this.props.content;
// const localNavigation =
// (this.props.localNavigation.items &&
// this.props.localNavigation.items.filter(
// item => item.title !== 'Home',
// )) ||
// [];
// console.log('pathname', this.props.content['@id'] + '/manage_interfaces');
return (
<Container className="view-wrapper">
{this.state.tabs}
<Helmet title={content.title} />
<article id="content">
<header>
<h1 className="documentFirstHeading">{content.title}</h1>
{content.description && (
<p className="documentDescription">{content.description}</p>
)}
</header>
<section id="content-core">
{/* {content.items.map(item => (
<article key={item.url}>
<h2>
<Link to={item.url} title={item['@type']}>
{item.title}
</Link>
</h2>
{item.image && (
<Image
clearing
floated="right"
alt={item.image_caption ? item.image_caption : item.title}
src={item.image.scales.thumb.download}
/>
)}
{item.description && <p>{item.description}</p>}
<p>
<Link to={item.url}>
<FormattedMessage
id="Read More…"
defaultMessage="Read More…"
/>
</Link>
</p>
</article>
))} */}
</section>
</article>
// const content = this.props.content;
// // const localNavigation =
// // (this.props.localNavigation.items &&
// // this.props.localNavigation.items.filter(
// // item => item.title !== 'Home',
// // )) ||
// // [];
// // console.log('pathname', this.props.content['@id'] + '/manage_interfaces');
// return (
// <Container className="view-wrapper">
// {this.state.tabs}
// <Helmet title={content.title} />
// <article id="content">
// <header>
// <h1 className="documentFirstHeading">{content.title}</h1>
// {content.description && (
// <p className="documentDescription">{content.description}</p>
// )}
// </header>
// <section id="content-core">
// {/* {content.items.map(item => (
// <article key={item.url}>
// <h2>
// <Link to={item.url} title={item['@type']}>
// {item.title}
// </Link>
// </h2>
// {item.image && (
// <Image
// clearing
// floated="right"
// alt={item.image_caption ? item.image_caption : item.title}
// src={item.image.scales.thumb.download}
// />
// )}
// {item.description && <p>{item.description}</p>}
// <p>
// <Link to={item.url}>
// <FormattedMessage
// id="Read More…"
// defaultMessage="Read More…"
// />
// </Link>
// </p>
// </article>
// ))} */}
// </section>
// </article>

{/* <Portal node={__CLIENT__ && document.getElementById('menuExpanded')}>
<ul className="localNavigation">
{localNavigation.map(item => (
<li key={`localnav-${item['@id']}`}>
<Link to={flattenToAppURL(item['@id'])} key={item['@id']}>
{item.title}
</Link>
</li>s
))}
</ul>
</Portal> */}
{/*
<Portal node={__CLIENT__ && document.querySelector('.toolbar-actions')}>
<a
href={this.props.content['@id'] + '/manage_interfaces'}
key={this.props.content['@id']}
target="_blank"
rel="noreferrer noopener"
>
Manage
</a>
</Portal> */}
</Container>
);
// {/* <Portal node={__CLIENT__ && document.getElementById('menuExpanded')}>
// <ul className="localNavigation">
// {localNavigation.map(item => (
// <li key={`localnav-${item['@id']}`}>
// <Link to={flattenToAppURL(item['@id'])} key={item['@id']}>
// {item.title}
// </Link>
// </li>s
// ))}
// </ul>
// </Portal> */}
// {/*
// <Portal node={__CLIENT__ && document.querySelector('.toolbar-actions')}>
// <a
// href={this.props.content['@id'] + '/manage_interfaces'}
// key={this.props.content['@id']}
// target="_blank"
// rel="noreferrer noopener"
// >
// Manage
// </a>
// </Portal> */}
// </Container>
//);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import TokenWidget from '@plone/volto/components/manage/Widgets/TokenWidget';
import chartIcon from '@plone/volto/icons/world.svg';
import TopicsView from '~/components/theme/View/TopicsView';
import TopicsTabView from '~/components/theme/View/TopicsTabView';
import TopicsView from './components/theme/View/TopicsView';
import TopicsTabView from './components/theme/View/TopicsTabView';
import FolderListingBlockView from 'volto-addons/FolderListing/BlockView';
import FolderListingBlockEdit from 'volto-addons/FolderListing/BlockEdit';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import { FormattedMessage } from 'react-intl';
import { Icon } from '@plone/volto/components';
import { getBasePath } from '~/helpers';
import { getBasePath } from '../../../../../helpers';

import config from '@plone/volto/registry';
import user from '@plone/volto/icons/user.svg';
Expand Down
4 changes: 1 addition & 3 deletions src/customizations/volto/components/theme/App/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ import config from '@plone/volto/registry';
import Error from '@plone/volto/error';

import {
Breadcrumbs,
Footer,
Header,
Icon,
OutdatedBrowser,
AppExtras,
SkipLinks,
} from '@plone/volto/components';
import { BodyClass, getBaseUrl, getView, isCmsUi } from '@plone/volto/helpers';
import {
Expand All @@ -43,7 +41,7 @@ import MultilingualRedirector from '@plone/volto/components/theme/MultilingualRe

import * as Sentry from '@sentry/browser';

import PageHeader from '~/components/theme/Header/PageHeader';
import PageHeader from '../../../../../components/theme/Header/PageHeader';
// import PageHeaderBg from '~/components/theme/Header/PageHeaderBg';

/**
Expand Down
20 changes: 10 additions & 10 deletions src/customizations/volto/components/theme/Footer/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
*/

import React from 'react';
import { Container, List, Segment, Grid } from 'semantic-ui-react';
import { Segment, Grid } from 'semantic-ui-react';
import { Link } from 'react-router-dom';
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
import eeaLogo from '~/components/theme/Footer/ec.svg.png';
import ecLogo from '~/components/theme/Footer/eea.png';
import { FormattedMessage, injectIntl } from 'react-intl';
import eeaLogo from '../../../../../components/theme/Footer/ec.svg.png';
import ecLogo from '../../../../../components/theme/Footer/eea.png';
import { connect } from 'react-redux';

import { Anontools } from '@plone/volto/components';

const messages = defineMessages({
copyright: {
id: 'Copyright',
defaultMessage: 'Copyright',
},
});
// const messages = defineMessages({
// copyright: {
// id: 'Copyright',
// defaultMessage: 'Copyright',
// },
// });

/**
* 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 @@ -3,16 +3,16 @@ import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { BodyClass } from '@plone/volto/helpers';

import ecLogo from '~/components/theme/Header/ec_white_negative_color.png';
import eeaLogo from '~/components/theme/Header/eea_white.png';
import ecLogo from '../../../../../components/theme/Header/ec_white_negative_color.png';
import eeaLogo from '../../../../../components/theme/Header/eea_white.png';

import {
Logo,
Navigation,
SearchWidget,
Breadcrumbs,
} from '@plone/volto/components';
import PageNavigation from '~/components/theme/Header/PageNavigation';
import PageNavigation from '../../../../../components/theme/Header/PageNavigation';

// import { Container, Segment } from 'semantic-ui-react';
// import { Portal } from 'react-portal';
Expand Down
6 changes: 3 additions & 3 deletions src/customizations/volto/components/theme/Logo/Logo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

import React from 'react';
import { Link } from 'react-router-dom';
import { defineMessages, injectIntl, intlShape } from 'react-intl';
import { defineMessages, injectIntl } from 'react-intl';
import { Image } from 'semantic-ui-react';

import LogoImage from '~/components/theme/Logo/logo.svg';
import LogoImagePage from '~/components/theme/Logo/logo-page.svg';
import LogoImage from '../../../../../components/theme/Logo/logo.svg';
import LogoImagePage from '../../../../../components/theme/Logo/logo-page.svg';

const messages = defineMessages({
site: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ import { isMatch } from 'lodash';
import { compose } from 'redux';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import { defineMessages, injectIntl, intlShape } from 'react-intl';
import { defineMessages, injectIntl } from 'react-intl';
import cx from 'classnames';
import { getBaseUrl } from '@plone/volto/helpers';
import { BodyClass } from '@plone/volto/helpers';
import rightKey from '@plone/volto/icons/right-key.svg';
import backIcon from '@plone/volto/icons/back.svg';
import { Icon } from '@plone/volto/components';
import config from '@plone/volto/registry';
import { getBasePath } from '~/helpers';
import { getBasePath } from '../../../../../helpers';

import { getNavigation } from '@plone/volto/actions';

import bgimage from '~/components/theme/Navigation/home.jpg';
import bgimage from '../../../../../components/theme/Navigation/home.jpg';

const messages = defineMessages({
closeMobileMenu: {
Expand Down Expand Up @@ -254,6 +254,7 @@ class Navigation extends Component {
this.setSubmenu(item.title, item.items, ev)
}
onKeyPress={() => {}}
tabIndex={0}
>
{this.state.subMenu.type === item.title && (
<Icon
Expand Down Expand Up @@ -297,6 +298,7 @@ class Navigation extends Component {
this.setSubtopics(item.title, item.items, ev)
}
onKeyPress={() => {}}
tabIndex={0}
>
{this.state.subTopics.type === item.title && (
<Icon
Expand Down
Loading

0 comments on commit 2739b74

Please sign in to comment.