Giter Club home page Giter Club logo

twreporter-react's Introduction

CircleCI Tag Join the chat at https://gitter.im/twreporter/twreporter-react

TW Reporter

New Media foundation in Taiwan.

Contains

Environment

Install node(https://nodejs.org/en/) @7.9.0 above.

Installation

yarn install

Production start

make start

Development start

make dev

Build docker image

// install dependencies first
yarn install

// build the webpack bundles and transpile es6 to es5
make build

// build docker image
docker build -t twreporter-react:latest .

Testing

Run unit tests

make test

Run ui-test (It will take some time to compare screenshots)

// start dev servers for ui-test
make dev
// run ui-test
make ui-test

License

  • Copyright (C) 2015 - 2018 The Reporter 報導者. All rights reserved.
  • Distributed under the GNU AGPL v3.0

twreporter-react's People

Contributors

achinchen avatar afutseng avatar aqutw avatar audreyt avatar aylie-chou avatar babygoat avatar bobchao avatar c9s avatar choznerol avatar dependabot[bot] avatar duidae avatar han3zeng avatar hcchien avatar hsunpei avatar jessy1092 avatar kaddopur avatar kidwm avatar konekoya avatar liruchen32 avatar nickhsine avatar reporterdev avatar roth1002 avatar rudanzona avatar taylrj avatar teaualune avatar wtlin1228 avatar yanhsiah avatar yhsiang avatar yucj avatar yutin1987 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

twreporter-react's Issues

Combine `ThemeManager` and `LayoutManager`

Problem Description

We have a class ThemeManager in src/managers/theme-manager.js.
It provides src/containers/app-shell.js a way to choose the layout according to the route path.
However, the class name ThemeManager is kind of ambiguous since it does not decide the styles at all.

TO DO

Merge the functionality of class ThemeManager into class LayoutManager.

Article revamp requirements for Desktop

Features (DESKTOP)(PENDING, wait for spec)

  • BlockAlignmentWrapper
  • Title
  • HeadingAuthor
  • BottomAuthor (spec ready)
  • Image
  • ImageDiff (spec ready)
  • Slideshow (spec ready)
  • Introduction (include 前言, spec change)
  • LeadingImage
  • Body
  • Paragraph
  • Embedded (spec ready)
  • Audio (spec ready)
  • Annotation (註解, spec ready)
  • Quote (spec ready)
  • InfoBox (spec change)
  • Bottom Tags (spec #ready)
  • Bottom Related Stories
  • Footer
  • Image Lazy Load
  • Aside Related Stories
  • Reading Progress Bar
  • Set paragraph anchor to the url

Features (Mobile)

  • Title
  • HeadingAuthor
  • BottomAuthor (spec change, removed)
  • Image
  • ImageDiff (spec ready)
  • Slideshow (spec ready)
  • Introduction (include 前言)
  • LeadingImage
  • Body
  • Paragraph
  • Embedded video (spec ready)
  • Embedded graphics (spec not ready)
  • Audio (spec ready)
  • Audio without coverphoto (spec not ready)
  • Annotation (註解, spec not ready)
  • InfoBox (spec ready)
  • Bottom Tags (spec #ready)
  • Bottom Related Stories
  • Footer
  • Image Lazy Load
  • Reading Progress Bar
  • Set paragraph anchor to the url

Performance Tuning

  • remove properties we don't need in the api repsonse
  • add browser cache

GTM installation

請將以下程式碼複製並貼入您網站的每個網頁中。

請將這段程式碼放在網頁最上方的 <head> 中:

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-PRMXBBN');</script>
<!-- End Google Tag Manager -->

此外,請將這段程式碼複製到 <body> 開頭代碼正後方:

 <body> 
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-PRMXBBN"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

Change git pre-commit hook to pre-push

Hello there 👋

I was trying to improve the README.md today. And have noticed that this project has a pre-commit hook setup. While this is generally a good practice to run linting and testing before adding any new commits. This also slows down the pace of working on this project. The linting part is not that bad/slow but the testing part took me about 4 minutes to finish.

I think it would be great if we can change the git hook from pre-commit to pre-push. That way, we can still check these things before pushing onto GitHub, but also, make the overall dev experience a bit better and faster since we're not blocking them when creating new commits.

just my two cents :)
Joshua

apply eslint and editorconfig

@nickhsine

Maybe we could start from presets like

Editorconfig is a very useful tool to make the code style consistent
https://github.com/rackt/redux/blob/master/.editorconfig

# EditorConfig helps developers define and maintain
# consistent coding styles between different editors and IDEs.

root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2

請問 revamp 中的 api/config.js 的內容應為?

我想試跑出(或貢獻代碼) revamp 新版畫面。
npm run dev 後,遇到 Timeout issue 如下 --- 黃方框是我 debug 的 string :
image

[my dev env]

Windows OS
node v6.2.1
npm 3.9.3

個人猜測我本地 api/config.js 有誤,目前它是:

export default {
  API_PROTOCOL: 'http',
  API_HOST: 'localhost',
  API_PORT: '8080'
}

可提示 api/config.js 應為何?
Thanks!

Service worker client side error

讀者回報的情形如下:

  1. 點開報導者文章後,大約五秒左右後自動跳轉到 500 error page
  2. 在此之後,從 500 error page 點選左上角 logo,跳轉回首頁,同樣發生 500 error page 的問題
  3. 接著從 facebook 上點選任何報導者文章,皆會跳轉到 500 error page
  4. 請讀者使用無痕開網頁,沒有相同問題。
  5. 過一陣子後,讀者再次打開報導者網頁,問題也不復存在。

Desktop sidebar overlaps on the footer

Bug report

Browsing website and found sidebar layout issue.

Description

Found desktop sidebar overlaps on the footer.

Steps to reproduce

Using screen width wider than 768px, and scroll page to bottom.

Actual behavior

Sidebar overlays on the footer.

Expected behavior

Sidebar doesn't overlay on the footer.

Screenshots

Untitled

Possible solution

Update sidebar style.
If the behavior I referred above is accepted, I'm happy to make PR to update it.

nodemon won't run the webpack

every time when I modify the code, the nodemon will restart the node server. but it doesn't run the webpack to run the latest code changes.

Author Component

Data Structure

// Because we have different roles,
// I put type property in each element of array.
// type will be 'writter', 'photographer', 'designer' and 'engineer'
[{
  name: '何榮幸',
  email: '[email protected]',
  bio: {
    md: '25年資歷,50歲記者的逆襲。期待記者生涯另一次探險。',
    html: '<p>25年資歷,50歲記者的逆襲。期待記者生涯另一次探險。</p>'
  },
  id: '571de7b7dae62379576d7f38',
  type: 'writter'
}, {
  name: '余志偉',
  email: '[email protected]',
  bio: {
    md: '學習攝影、新聞、藝術與新媒體,喜歡天馬行空、嘗試與創新。自由、參與、共享,努力讓台灣攝影環境及發展更多元。',
    html: '<p>學習攝影、新聞、藝術與新媒體,喜歡天馬行空、嘗試與創新。自由、參與、共享,努力讓台灣攝影環境及發展更多元。</p>'
  },
  id: '571de7bbdae62379576d7f42',
  type: 'photographer'
}, {
  name: '殷子衿',
  email: '[email protected]',
  bio: {
    md: '子衿的簡介。',
    html: '<p>子衿的簡介。</p>'
  },
  id: '571de7bbdae6237957677722',
  type: 'designer'
}, {
  name: '簡信昌',
  email: '[email protected]',
  bio: {
    md: 'HC的簡介。',
    html: '<p>HC的簡介。</p>'
  },
  id: '571de7bbdae62379576222222',
  type: 'engineer'
}]

React Component

We may need two Author components,
one is for the beginning of the article, like '文/何榮幸 攝/余志偉 設計/殷子衿 工程師/簡信昌';
another is the block, including personal biography, for the end of the article.

// authors will be the object defined above.

// HeadingAuthor component is the beginning one. 
<HeadingAuthor // component name could be changed if this one is not proper.
  authors={authors}
/>

<Author
  authors={authors}
/>

twitter sharing with content not title

react CSS Modules

css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader
or
css-loader?modules&importLoaders=1&localIdentName=[name]__[local]!postcss-loader

webpack

module: {
  loaders: [
    {
      test: /\.css$/,
      loader: ExtractTextPlugin.extract('style-loader',
      'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]!postcss-loader')
    }
  ]
}

ref.

  1. https://github.com/gajus/react-css-modules
  2. https://github.com/webpack/css-loader
  3. https://css-modules.github.io/webpack-demo/

Production: TypeError: "e[n] is undefined" (2019/12/30 22:45)

Problem

Screen shot

圖片

Environment

  • OS: win7
  • Browser: Firefox 71.0 (64bit), both normal and private tab
    • chrome is fine

A real purpose about this issue

I just want to say GOOD JOB to the dev Team. Bcuz twreporter is

  • well performance
  • good design
  • PWA installable (I never saw any News/CMS website with PWA installable)

feel FREE to close this issue WITHOUT reason!

👍 👍 👍 👍 👍

Remove mobile-detect

mobile-detect pkg makes the bundle size too large.
We should use other way to replace it, since we are not really using it so much.

希望提供 RSS

希望網站能提供 RSS,讓使用者可以訂閱以即時接收最新報導。

upgrade react-flex-carousel to 1.0

Sorry, here comes breaking change, because I didn't notice there is a typo autoplayInteval in previous versions.

I already fixed it in 1.0 release with correct name autoPlayInterval, along with some markup and styling change, take this commit as reference:
kidwm/react-flex-carousel@9ba8ec1

Please let me know if you have any problem after upgrade.

Top-level navigation does not work in Firefox

On homepage, clicking any of the top-level categories results in:

TypeError: CSS2Properties doesn't have an indexed property setter for '0'
x.setValueForStyles()
 main.js:76
r.measure/a()
 main.js:1
b.Mixin._updateDOMProperties()
 main.js:78

Chrome and Safari works just fine.

Bookmark page is not auto-refreshed

Reproduce steps

  1. A user performs login.
  2. Bookmark an arbitrary page.
  3. Directly click the bookmark page.
  4. The bookmark page did not contain the newly booked one.
  5. The new one will emerge after the page is refreshed.

Maybe better box shadow

before

screen shot 2015-12-17 at 2 33 24 pm

box-shadow: rgba(0, 0, 0, 0.0901961) 0px 0px 15px;

after

screen shot 2015-12-17 at 2 33 38 pm

box-shadow: box-shadow: rgba(0, 0, 0, 0.0901961) 0px 30px 20px -20px, rgba(0, 0, 0, 0.0901961) 0px 0px 3px;

npm start leads to 500 and readme instruction issue

image

$ npm -v
2.14.7

$ node -v
v4.2.3

$ npm install
...

$ npm start

> [email protected] start /Users/muan/oss/twreporter-react
> webpack --progress && nodemon server

Hash: e548a46de06cae666cba  
Version: webpack 1.12.9
Time: 6269ms
   Asset     Size  Chunks             Chunk Names
 main.js  2.35 MB       0  [emitted]  main
main.css  20.7 kB       0  [emitted]  main
    + 611 hidden modules

WARNING in ./~/react-burger-menu/lib/menuFactory.js
Module not found: Error: Cannot resolve module 'imports' in /Users/muan/oss/twreporter-react/node_modules/react-burger-menu/lib
 @ ./~/react-burger-menu/lib/menuFactory.js 164:19-97
Child extract-text-webpack-plugin:
        + 2 hidden modules
Child extract-text-webpack-plugin:
        + 2 hidden modules
Child extract-text-webpack-plugin:
        + 2 hidden modules
Child extract-text-webpack-plugin:
        + 2 hidden modules
Child extract-text-webpack-plugin:
        + 2 hidden modules
Child extract-text-webpack-plugin:
        + 2 hidden modules
Child extract-text-webpack-plugin:
        + 2 hidden modules
Child extract-text-webpack-plugin:
        + 2 hidden modules
Child extract-text-webpack-plugin:
        + 2 hidden modules
Child extract-text-webpack-plugin:
        + 2 hidden modules
Child extract-text-webpack-plugin:
        + 2 hidden modules
[nodemon] 1.8.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node server`
Server is listening to port: 3000

WARNING in ./~/react-burger-menu/lib/menuFactory.js
Module not found: Error: Cannot resolve module 'imports' in /Users/muan/oss/twreporter-react/node_modules/react-burger-menu/lib
 @ ./~/react-burger-menu/lib/menuFactory.js 164:19-97

☝️ This is not related to the 500 and can be fixed by adding imports-loader, ref: negomi/react-burger-menu#13 (comment).


And I'm not sure how 549fe41#diff-04c6e90faac2675aa89e2176d2eec7d8R6 makes sense, doesn't that mean installing dev dependencies only? which I tried, but the dependencies couldn't resolve. cc @c9s

error peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.