Skip to content
This repository has been archived by the owner on Jun 28, 2021. It is now read-only.

Merge master into production #470

Merged
merged 70 commits into from
Aug 30, 2016
Merged
Changes from 14 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
5007d5d
Mobile landing page (#419)
mmahalwy Jul 31, 2016
2f3c32c
Fix build issue with babel-preset-es2015
ahmedre Aug 6, 2016
6865cda
Merge pull request #421 from quran/fix_build
ahmedre Aug 6, 2016
223fe89
guide updated
Aug 6, 2016
8f92662
Merge pull request #422 from mahboob-awan/fix/contributing_guide
ahmedre Aug 6, 2016
663d46c
Feature/refactor redux (#414)
thabti Aug 6, 2016
73a471a
Babel fixes
Aug 6, 2016
b991953
extract problem
mmahalwy Aug 6, 2016
291dd62
fix this time
mmahalwy Aug 6, 2016
e3b5340
Okay now.
mmahalwy Aug 6, 2016
79dc129
Merge pull request #423 from quran/babel-presets
ahmedre Aug 6, 2016
a705e29
Mobile page updates (#424)
mmahalwy Aug 6, 2016
834de9f
Fixes #411 - Repeat range bug (#425)
mmahalwy Aug 6, 2016
7487f12
Fixes #400 Developer page (#426)
mmahalwy Aug 6, 2016
3aad967
Upgrade express to the stable version (#433)
ahmedre Aug 7, 2016
dda7f09
https all the things (#434)
ahmedre Aug 8, 2016
33396b5
Bump node version (#431)
mmahalwy Aug 8, 2016
08d46c0
Remove svg fonts (#432)
ahmedre Aug 8, 2016
30b86db
Update README.md
thabti Aug 9, 2016
5b9105c
Merge pull request #441 from quran/readme-spelling
thabti Aug 10, 2016
9a2f0b1
duplicate declaration
infacq Aug 10, 2016
e0820ac
Merge pull request #442 from infacq/patch-1
thabti Aug 10, 2016
8e703f1
Let pm2 automagically choose the number of workers (#446)
ahmedre Aug 13, 2016
3c40c6d
Fixes 438 (#448)
mmahalwy Aug 14, 2016
a1d6d7a
Fix bootstrap.config
mmahalwy Aug 15, 2016
35ede18
Simplify audio and segments building (#451)
ahmedre Aug 17, 2016
219920b
Formatting issue corrected and tiny typo (#452)
UmanShahzad Aug 17, 2016
0715e53
Remove supported check for audio (#453)
ahmedre Aug 18, 2016
c20c5ec
Fix formatting of code blocks (#454)
ahmedelgabri Aug 20, 2016
cbc85c2
pure-components + tests
thabti Aug 13, 2016
fddac56
pure-components + tests
thabti Aug 14, 2016
4c40801
moved components to components folder.
thabti Aug 14, 2016
fe05b5d
folder level + merge with master
thabti Aug 16, 2016
3ac5cd8
ensure error routes give a 404 status.
thabti Aug 20, 2016
2ce60fe
renderTopOption as a component + tests
thabti Aug 21, 2016
eaf69f3
pure-components + tests
thabti Aug 13, 2016
b24c9ac
pure-components + tests
thabti Aug 14, 2016
36e661c
moved components to components folder.
thabti Aug 14, 2016
69f9413
folder level + merge with master
thabti Aug 16, 2016
ae9cb74
remove decorators for search
thabti Aug 21, 2016
015b72f
fixes #458 (#459)
thabti Aug 21, 2016
61edf3c
fix some of the suggestions
thabti Aug 21, 2016
61d999d
fix some of the suggestions
thabti Aug 21, 2016
dd11270
Merge pull request #450 from sabeurthabti/feature/pure-components
thabti Aug 22, 2016
b58ad51
Sort language in dropdown alphabetically (#462)
haritsE Aug 26, 2016
661f5ab
Get rid of Bootstrap tooltip & use a CSS tooltip
ahmedelgabri Aug 27, 2016
85980d6
Fix path for config
ahmedelgabri Aug 27, 2016
e37284f
Remove ranges & cleanup excutable paths
ahmedelgabri Aug 27, 2016
7d54e6b
fix indentation
ahmedelgabri Aug 27, 2016
53abaae
Linter fixes for webpack folder & bootstrap config
ahmedelgabri Aug 27, 2016
bdea549
Merge pull request #464 from ahmedelgabri/remove-bootstrap-tooltips
thabti Aug 27, 2016
2c53a21
make sure new npm isntallations will not use ranges
ahmedelgabri Aug 27, 2016
1c66231
tooltip content is always ltr
ahmedelgabri Aug 27, 2016
31bac53
Merge pull request #465 from ahmedelgabri/remove-bootstrap-tooltips
thabti Aug 27, 2016
a36cd79
Update node-sass
ahmedelgabri Aug 27, 2016
5675c6f
Update travis Node version
ahmedelgabri Aug 27, 2016
16f59c8
normalize paths in package.json
ahmedelgabri Aug 28, 2016
83caa1c
make test.sh executable & update env shebang
ahmedelgabri Aug 28, 2016
361c042
Remove npm install noise on CI, etc...
ahmedelgabri Aug 28, 2016
6f0b28d
remove duplicate phantomjs package 😱
ahmedelgabri Aug 28, 2016
54e4373
add comment in .travis.yml for .nvmrc usage
ahmedelgabri Aug 28, 2016
2d311a6
Update Karma & Karma-webpack to fix jenkins error
ahmedelgabri Aug 28, 2016
d06fdd3
missing segment fix (#467)
thabti Aug 29, 2016
3d65508
Merge master & fix conflict
ahmedelgabri Aug 29, 2016
1ec1a9b
Update packages to match production & remove old babel package
ahmedelgabri Aug 29, 2016
5e39c87
multi-purpose function
thabti Aug 27, 2016
f852044
fix unit tests
thabti Aug 28, 2016
67b932f
fix Sentry issues:
thabti Aug 29, 2016
7f57ba1
Merge pull request #466 from ahmedelgabri/code-cleanup
thabti Aug 29, 2016
7094284
Merge pull request #469 from sabeurthabti/feature/sentry-bugs
thabti Aug 29, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions src/components/Home/LastVisit/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import React, { PropTypes } from 'react';
import debug from '../../../helpers/debug';
const styles = require('./style.scss');

const LastVisit = (props) => {

debug('component:Index', 'LastVisit');

const {lastVisit, surahs} = props;

if (lastVisit) {

const surah = surahs[lastVisit.surah - 1];

if (surah) {

const lastVisitedAyah = parseInt(lastVisit.ayah, 10);

return (
<div className="col-md-10 col-md-offset-1">
<div className={`row ${styles.lastVisit}`}>
<div className="col-md-4">
<h4 className={`text-muted text-center ${styles.title}`}>LAST VISITED:</h4>
</div>
<ul className="col-md-4 list-unstyled">
<li className={`row ${styles.link}`}>
<Link
to={`/${this.props.lastVisit.surah}/${lastVisitedAyah}-${lastVisitedAyah + 10}`}
>
<div className="col-xs-2 text-muted">
{surah.id}:{this.props.lastVisit.ayah}
</div>
<div className="col-xs-7">
{surah.name.simple}
<br />
<span className={`text-uppercase ${styles.english}`}>
{surah.name.english}
</span>
</div>
<div className={`col-xs-3 text-right ${styles.arabic}`}>
{surah.name.arabic}
</div>
</Link>
</li>
</ul>
</div>
</div>
);
}
}
};

LastVisit.propTypes = {
lastVisit: PropTypes.any,
surahs: PropTypes.object
};

export default LastVisit;
12 changes: 12 additions & 0 deletions src/components/Home/LastVisit/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@import '../../../styles/variables.scss';

.list{

.lastVisit{
padding-top: 50px;

.title{
padding: 25px 0px;
}
}
}
66 changes: 66 additions & 0 deletions src/components/Home/QuickSurahs/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import React from 'react';
import debug from '../../../helpers/debug';
import Link from 'react-router/lib/Link';

export default () => {
debug('component:Index', 'QuickSurahs');

const isFriday = new Date().getDay() === 5;

return (
<span className="pull-right">
<ul className="list-inline">
<li>Quick links:</li>
{
isFriday &&
<li>
<Link
to="/18"
data-metrics-event-name="QuickLinks:Click"
data-metrics-surah-id="18"
>
Surah Al-Kahf
</Link>
{' '}|
</li>
}
<li>
<Link
to="/36"
data-metrics-event-name="QuickLinks:Click"
data-metrics-surah-id="36"
>
Surah Yasin (Yaseen)
</Link>{' '}|
</li>
<li>
<Link
to="/55"
data-metrics-event-name="QuickLinks:Click"
data-metrics-surah-id="55"
>
Surah Ar-Rahman
</Link>{' '}|
</li>

<li>
<Link
to="/67"
data-metrics-event-name="QuickLinks:Click"
data-metrics-surah-id="67"
>
Surah Al Mulk
</Link>{' '}|
</li>
<li>
<Link
to="/2/255"
data-metrics-event-name="QuickLinks:Click"
data-metrics-surah-id="2/255"
>
Ayat Al-Kursi
</Link>
</li>
</ul>
</span>);
};
21 changes: 21 additions & 0 deletions src/components/Home/QuickSurahs/spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import { shallow } from 'enzyme';

import QuickSurahs from './index.js';

describe("<QuickSurahs />", () => {

it("Should render QuickSurahs component", () => {
let component = shallow(<QuickSurahs />);
expect(component).to.be.ok;
expect(component.find('.list-inline li').length).to.equal(5);
});

it("Should render QuickSurahs component with Surah Al-Kahf", () => {
sinon.useFakeTimers(1470956400000);
let component = shallow(<QuickSurahs />);
expect(component).to.be.ok;
expect(component.find('.list-inline li').length).to.equal(6);
})

});
35 changes: 35 additions & 0 deletions src/components/Home/SurahsList/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React, { PropTypes } from 'react';
import debug from '../../../helpers/debug';
import Link from 'react-router/lib/Link';
const styles = require('./style.scss');

const SurahsList = (props) => {
debug('component:Index', 'SurahsList');

return (
<ul className="col-md-4 list-unstyled">
{props.surahs.map((surah) => (
<li className={`${styles.item}`} key={surah.id}>
<Link to={`/${surah.id}`} className={`${styles.link} row`}>
<div className="col-xs-2 text-muted">
{surah.id}
</div>
<div className="col-xs-7">
{surah.name.simple}
<br />
<span className={`text-uppercase ${styles.english}`}>{surah.name.english}</span>
</div>
<div className={`col-xs-3 text-right ${styles.arabic}`}>
{surah.name.arabic}
</div>
</Link>
</li>
))}
</ul>);
};

SurahsList.propTypes = {
surahs: PropTypes.array.isRequired
};

export default SurahsList;
15 changes: 15 additions & 0 deletions src/components/Home/SurahsList/spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import { shallow } from 'enzyme';
import getSurahs from '../../../../tests/fixtures/getSurahs.js';

import SurahsList from './index.js';

describe("<SurahsList />", () => {

it("Should render SurahList component", () => {
let component = shallow(<SurahsList surahs={getSurahs.default.slice(0, 4)}/>);
expect(component).to.be.ok;
expect(component.find('.col-md-4 li').length).to.equal(4);
});

});
21 changes: 21 additions & 0 deletions src/components/Home/SurahsList/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@import '../../../styles/variables.scss';

.item {
color: $brand-primary;

&:hover {
background: #f1f1f1;
}

.link {
display: block;
padding: 10px 10px;
}

.english {
font-size: 10px;
}
.arabic {
font-size: 14px;
}
}
2 changes: 1 addition & 1 deletion src/components/InformationToggle/index.js
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ export default class InformationToggle extends Component {
event.preventDefault();

this.props.onToggle({isShowingSurahInfo: !isShowingSurahInfo});
}
};

render() {
const { isShowingSurahInfo } = this.props;
56 changes: 29 additions & 27 deletions src/components/SearchAutocomplete/index.js
Original file line number Diff line number Diff line change
@@ -7,33 +7,7 @@ const client = new ApiClient();

const styles = require('./style.scss');

@connect(
state => {
const surahs = state.surahs.entities;
const surahId = state.surahs.current;
let lang = 'en';

if (state.ayahs && state.ayahs.entities && state.ayahs.entities[surahId]) {
const ayahs = state.ayahs.entities[surahId];
const ayahKey = Object.keys(ayahs)[0];

if (ayahKey) {
const ayah = ayahs[ayahKey];

if (ayah.content && ayah.content[0] && ayah.content[0].lang) {
lang = ayah.content[0].lang;
}
}
}

return {
surahs,
lang
};
},
{ push }
)
export default class SearchAutocomplete extends Component {
class SearchAutocomplete extends Component {
static propTypes = {
surahs: PropTypes.object.isRequired,
value: PropTypes.string,
@@ -174,6 +148,7 @@ export default class SearchAutocomplete extends Component {
case 9: // tab
return;
case 13: // enter
console.log(this.props);
this.props.push(item.href); // change url
break;
case 27: // escape
@@ -225,3 +200,30 @@ export default class SearchAutocomplete extends Component {
);
}
}


function mapStateToProps(state) {
const surahs = state.surahs.entities;
const surahId = state.surahs.current;
let lang = 'en';

if (state.ayahs && state.ayahs.entities && state.ayahs.entities[surahId]) {
const ayahs = state.ayahs.entities[surahId];
const ayahKey = Object.keys(ayahs)[0];

if (ayahKey) {
const ayah = ayahs[ayahKey];

if (ayah.content && ayah.content[0] && ayah.content[0].lang) {
lang = ayah.content[0].lang;
}
}
}

return {
surahs,
lang
};
}

export default connect(mapStateToProps, {push})(SearchAutocomplete);
54 changes: 54 additions & 0 deletions src/components/TopOptions/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import React, { PropTypes } from 'react';

import {Row, Col} from 'react-bootstrap/lib';

import InformationToggle from 'components/InformationToggle';
import FontSizeDropdown from 'components/FontSizeDropdown';
import TooltipDropdown from 'components/TooltipDropdown';
import ReadingModeToggle from 'components/ReadingModeToggle';
import Share from 'components/Share';

const TopOptions = ({options, surah, actions}) => (
<Row>
<Col md={6} mdOffset={6} className="text-right">
<ul className="list-inline">
<li>
<InformationToggle
onToggle={actions.options.setOption}
isShowingSurahInfo={options.isShowingSurahInfo}
/>
</li>
<li>|</li>
<li>
<FontSizeDropdown
options={options}
onOptionChange={actions.options.setOption}
/>
</li>
<li>|</li>
<li>
<TooltipDropdown
options={options}
onOptionChange={actions.options.setOption}
/>
</li>
<li>|</li>
<li>
<ReadingModeToggle
isToggled={options.isReadingMode}
onReadingModeToggle={actions.options.toggleReadingMode}
/>
</li>
<li><Share surah={surah} /></li>
</ul>
</Col>
</Row>
);

TopOptions.propTypes = {
options: PropTypes.object.isRequired,
surah: PropTypes.object.isRequired,
actions: PropTypes.object.isRequired
};

export default TopOptions;
Loading