Additional Replies Increment (#2203)

* added ADDTL_REPLIES_ON_LOAD_MORE variable

* feat: added docs and onbuild ref
This commit is contained in:
David Burke
2019-02-26 16:18:55 +00:00
committed by Wyatt Johnson
parent 0ff20bed5e
commit 14f1343930
5 changed files with 19 additions and 1 deletions
+1
View File
@@ -4,6 +4,7 @@ FROM coralproject/talk:latest
ONBUILD ARG TALK_ADDTL_COMMENTS_ON_LOAD_MORE=10
ONBUILD ARG TALK_ASSET_COMMENTS_LOAD_DEPTH=10
ONBUILD ARG TALK_REPLY_COMMENTS_LOAD_DEPTH=3
ONBUILD ARG TALK_ADDTL_REPLIES_ON_LOAD_MORE=999999
ONBUILD ARG TALK_THREADING_LEVEL=3
ONBUILD ARG TALK_DEFAULT_STREAM_TAB=all
ONBUILD ARG TALK_DISABLE_EMBED_POLYFILL=FALSE
@@ -5,6 +5,9 @@ const prefix = 'TALK_EMBED_STREAM';
export const ADDTL_COMMENTS_ON_LOAD_MORE = parseInt(
defaultTo(process.env.TALK_ADDTL_COMMENTS_ON_LOAD_MORE, '10')
);
export const ADDTL_REPLIES_ON_LOAD_MORE = parseInt(
defaultTo(process.env.TALK_ADDTL_REPLIES_ON_LOAD_MORE, '999999')
);
export const ASSET_COMMENTS_LOAD_DEPTH = parseInt(
defaultTo(process.env.TALK_ASSET_COMMENTS_LOAD_DEPTH, '10')
);
@@ -6,6 +6,7 @@ import { bindActionCreators } from 'redux';
import {
ADDTL_COMMENTS_ON_LOAD_MORE,
ASSET_COMMENTS_LOAD_DEPTH,
ADDTL_REPLIES_ON_LOAD_MORE,
THREADING_LEVEL,
} from '../../../constants/stream';
import {
@@ -152,7 +153,9 @@ class StreamContainer extends React.Component {
return this.props.data.fetchMore({
query: LOAD_MORE_QUERY,
variables: {
limit: parent_id ? 999999 : ADDTL_COMMENTS_ON_LOAD_MORE,
limit: parent_id
? ADDTL_REPLIES_ON_LOAD_MORE
: ADDTL_COMMENTS_ON_LOAD_MORE,
cursor: comment.replies.endCursor,
parent_id,
asset_id: this.props.asset.id,
@@ -593,3 +593,13 @@ can be used to set an authorization header, or change the user agent. (Default
## TALK_SCRAPER_PROXY_URL
Sets a specific HTTP/S proxy to be used by the Asset Scraper using [https-proxy-agent](https://www.npmjs.com/package/https-proxy-agent). (Default `null`)
## TALK_ADDTL_REPLIES_ON_LOAD_MORE
This is a **Build Variable** and must be consumed during build. If using the
[Docker-onbuild](/talk/installation-from-docker/#onbuild)
image you can specify it with `--build-arg TALK_ADDTL_REPLIES_ON_LOAD_MORE=3`.
Specifies the number of replies to load for a comment when clicking "Load More".
It is defaulted quite high to sort of support "loading the rest of the replies".
(Default `999999`)
+1
View File
@@ -169,6 +169,7 @@ const config = {
TALK_THREADING_LEVEL: '3',
TALK_ADDTL_COMMENTS_ON_LOAD_MORE: '10',
TALK_ASSET_COMMENTS_LOAD_DEPTH: '10',
TALK_ADDTL_REPLIES_ON_LOAD_MORE: '999999',
TALK_REPLY_COMMENTS_LOAD_DEPTH: '3',
TALK_DEFAULT_STREAM_TAB: 'all',
TALK_DEFAULT_LANG: 'en',