+
+
+ {t('talk-plugin-featured-comments.featured_comments')}:
+
+
+ {t('talk-plugin-featured-comments.tooltip_description')}
+
+
+);
diff --git a/plugins/talk-plugin-featured-comments/client/constants.js b/plugins/talk-plugin-featured-comments/client/constants.js
new file mode 100644
index 000000000..7aad99014
--- /dev/null
+++ b/plugins/talk-plugin-featured-comments/client/constants.js
@@ -0,0 +1,2 @@
+export const SHOW_TOOLTIP = 'SHOW_TOOLTIP';
+export const HIDE_TOOLTIP = 'HIDE_TOOLTIP';
diff --git a/plugins/talk-plugin-featured-comments/client/containers/Comment.js b/plugins/talk-plugin-featured-comments/client/containers/Comment.js
index bba764a1d..2b3de19b5 100644
--- a/plugins/talk-plugin-featured-comments/client/containers/Comment.js
+++ b/plugins/talk-plugin-featured-comments/client/containers/Comment.js
@@ -31,6 +31,20 @@ export default withFragments({
name
}
}
+
+ ##
+ # TODO: Remove this when we have the IntrospectionFragmentMatcher.
+ # Currently without this loading more featured comments
+ # brings apollo into an inconsistent state.
+ action_summaries {
+ __typename
+ count
+ current_user {
+ id
+ }
+ }
+ ##
+
user {
id
username
diff --git a/plugins/talk-plugin-featured-comments/client/containers/Tab.js b/plugins/talk-plugin-featured-comments/client/containers/Tab.js
index 5d92387d6..f28a63566 100644
--- a/plugins/talk-plugin-featured-comments/client/containers/Tab.js
+++ b/plugins/talk-plugin-featured-comments/client/containers/Tab.js
@@ -1,8 +1,19 @@
-import {compose, gql} from 'react-apollo';
-import {withFragments, excludeIf} from 'plugin-api/beta/client/hocs';
import Tab from '../components/Tab';
+import {bindActionCreators} from 'redux';
+import {showTooltip, hideTooltip} from '../actions';
+import {compose, gql} from 'react-apollo';
+import {withFragments, excludeIf, connect} from 'plugin-api/beta/client/hocs';
+
+const mapStateToProps = ({talkPluginFeaturedComments: state}) => state;
+
+const mapDispatchToProps = (dispatch) =>
+ bindActionCreators({
+ showTooltip,
+ hideTooltip,
+ }, dispatch);
const enhance = compose(
+ connect(mapStateToProps, mapDispatchToProps),
withFragments({
asset: gql`
fragment TalkFeaturedComments_Tab_asset on Asset {
diff --git a/plugins/talk-plugin-featured-comments/client/containers/TabPane.js b/plugins/talk-plugin-featured-comments/client/containers/TabPane.js
index e9d466061..3a082e732 100644
--- a/plugins/talk-plugin-featured-comments/client/containers/TabPane.js
+++ b/plugins/talk-plugin-featured-comments/client/containers/TabPane.js
@@ -47,7 +47,7 @@ class TabPaneContainer extends React.Component {
}
const LOAD_MORE_QUERY = gql`
- query CoralEmbedStream_LoadMoreComments($limit: Int = 5, $cursor: Date, $asset_id: ID, $sort: SORT_ORDER, $excludeIgnored: Boolean) {
+ query TalkFeaturedComments_LoadMoreComments($limit: Int = 5, $cursor: Date, $asset_id: ID, $sort: SORT_ORDER, $excludeIgnored: Boolean) {
comments(query: {limit: $limit, cursor: $cursor, tags: ["FEATURED"], asset_id: $asset_id, sort: $sort, excludeIgnored: $excludeIgnored}) {
nodes {
...${getDefinitionName(Comment.fragments.comment)}
diff --git a/plugins/talk-plugin-featured-comments/client/index.js b/plugins/talk-plugin-featured-comments/client/index.js
index d804e2b55..8e4d18058 100644
--- a/plugins/talk-plugin-featured-comments/client/index.js
+++ b/plugins/talk-plugin-featured-comments/client/index.js
@@ -1,14 +1,16 @@
import Tab from './containers/Tab';
-import TabPane from './containers/TabPane';
import Tag from './components/Tag';
import Button from './components/Button';
+import TabPane from './containers/TabPane';
import translations from './translations.yml';
import update from 'immutability-helper';
+import reducer from './reducer';
import {findCommentInEmbedQuery} from 'coral-embed-stream/src/graphql/utils';
import {insertCommentsSorted} from 'plugin-api/beta/client/utils';
export default {
+ reducer,
translations,
slots: {
streamTabs: [Tab],
diff --git a/plugins/talk-plugin-featured-comments/client/reducer.js b/plugins/talk-plugin-featured-comments/client/reducer.js
new file mode 100644
index 000000000..2fd9b82e0
--- /dev/null
+++ b/plugins/talk-plugin-featured-comments/client/reducer.js
@@ -0,0 +1,22 @@
+import {SHOW_TOOLTIP, HIDE_TOOLTIP} from './constants';
+
+const initialState = {
+ tooltip: false
+};
+
+export default function featured (state = initialState, action) {
+ switch (action.type) {
+ case SHOW_TOOLTIP:
+ return {
+ ...state,
+ tooltip: true
+ };
+ case HIDE_TOOLTIP:
+ return {
+ ...state,
+ tooltip: false
+ };
+ default :
+ return state;
+ }
+}
diff --git a/plugins/talk-plugin-featured-comments/client/translations.yml b/plugins/talk-plugin-featured-comments/client/translations.yml
index 7f6db9370..50e51d586 100644
--- a/plugins/talk-plugin-featured-comments/client/translations.yml
+++ b/plugins/talk-plugin-featured-comments/client/translations.yml
@@ -1,8 +1,12 @@
en:
talk-plugin-featured-comments:
featured: Featured
+ featured_comments: Featured Comments
go_to_conversation: Go to conversation
+ tooltip_description: Comments selected by our team as worth reading
es:
talk-plugin-featured-comments:
featured: Remarcado
+ featured_comments: Comentarios Remarcados
go_to_conversation: Ir al comentario
+ tooltip_description: Comentarios seleccionados por nuestro equipo que valen la pena ser leidos
\ No newline at end of file