Compare commits

..
993 Commits
Author SHA1 Message Date
Wyatt Johnson 85e2bbc089 fix: fixed CI pipeline for releases (#2297) 2019-05-02 20:22:28 +00:00
Wyatt Johnson 59aaec48fc [next] Release (#2296)
* feat: added release process

* fix: removed debug echo's

* fix: fixed typo and bug

- replaced // with /# to remove "v" prefix only, not all "v" in string

* fix: updated docs
2019-05-02 19:35:48 +00:00
Kiwi 60c8f9a0d5 [next] Tests for new story filter and combo box (#2288)
* test: add tests for changes in stories page

* test: search box and moderate specific story

* fix: remaining snapshot

* fix: test
2019-04-27 01:04:16 +02:00
Kiwi b1efdad981 [CORL-249] Mod queues empty states (#2289)
* feat: mod queues empty states

* fix: test
2019-04-26 22:39:46 +00:00
Kiwi ab938985e4 [CORL-294] Moderate a single story + quick search (#2286)
* feat: allow passing a `storyID` to `Query.moderationQueues`

* feat: moderate by story

* feat: implement search story combobox

* feat: add translations

* fix: tests

* fix: duplicate id

* fix: rename file

* chore: add more comments

* fix: add missing translation

* review: use query parameter "q" instead of url path

* chore: move placeholder logic inside, maybe this makes it clearer :-D
2019-04-26 14:23:46 +00:00
Wyatt Johnson a91de05af9 fix: modified uri parsing for mongodb (#2282) 2019-04-25 15:16:36 +00:00
Wyatt Johnson 205e6fcd08 [next] Reaction Sort (#2260)
* feat: stream sort description to use reaction conf

* feat: use full custom translation string for the sort label
2019-04-23 20:50:02 +00:00
Kiwi a92dcd6224 [next] Bugfixes (#2272)
* feat: suspending, banning, now propogation

* feat: new mutation api with hooks support

* [CORL-343] Center Spinner in Stream

* [CORL-344] Fix moderation card styling

* [CORL-338] Fix permalink reply bug

* [CORL-337] Fix community guidelines box width

* [CORL-341] Toggle reply form view when clicking on reply

* test: add tests

* [CORL-333] Fix bug: removing message box icon; [CORL-336] Fix bug: allow resetting custom css
2019-04-23 20:29:58 +00:00
Kiwi 5150cdf60e [CORL-331] Better tests with types (#2270)
* feat: suspending, banning, now propogation

* feat: new mutation api with hooks support

* feat: better types in tests and refactor

* fix: lint
2019-04-23 19:46:14 +00:00
Wyatt Johnson dbbc1af42e [CORL-155] User Suspending and Banning (#2247)
* feat: suspending, banning, now propogation

* feat: adapting to `now`

* feat: support auth for suspension/banned

* feat: added trace-id to requests

* feat: new mutation api with hooks support

* feat: added user status filtering, current field

* feat: Implement filter by status, adapt to new USER_STATUS type, add lookup helper <3

* fix: typo

* fix: tests

* chore: rename banned status to ban status

* test: feature test + lots of test helper improvements e.g. types

* fix: add translation to ban user modal

* fix: translation

* fix: test
2019-04-22 22:57:32 +00:00
Wyatt Johnson b63c00f26f [next] Auth (#2257)
* feat: improved auth features + performance

* fix: auth check logic

* fix: tests
2019-04-15 19:46:55 +02:00
Wyatt Johnson 3b31e3b02d feat: added markdown to closed messages (#2255) 2019-04-12 00:06:01 +02:00
Wyatt Johnson 08e8e61e88 [next] Search (#2251)
* feat: added text indexes, query param to edges

* fix: cleaned up, added createdAt index

* fix: improved indexing support

* feat: integrate search into community and stories

* feat: adorn with search button

* test: add tests
2019-04-02 18:09:15 +02:00
Kiwi 5e90f028a9 feat: Modal support (#2252) 2019-04-02 01:14:27 +02:00
Kiwi d217fedf9c [CORL-171] Comment Tags (#2248)
* feat: staff badge

* feat: added tag support on the server

* feat: use tags

* fix: server tests
2019-03-29 22:29:17 +00:00
Kiwi f9114ef4be [CORL-318] Overhaul Permissions Checks on the Client (#2246)
* feat: overhaul admin permission checks

* feat: overhaul stream permission checks
2019-03-29 18:55:32 +00:00
Kiwi 618646e71c [CORL-138] Stories (#2242)
* feat: implement stories

* test: add feature test

* fix: id name

* fix: improve word breaks, column widths

* fix: snapshots

* feat: add min width to status dropdown button

* fix: polishing
2019-03-22 23:13:05 +00:00
Wyatt Johnson e0627925fb [next] Heroku Support (#2240)
* feat: added env-rewrite support

* feat: added heroku support via app.json

* fix: fixed readme linting error

* fix: fixed error in app.json

* fix: improved environment variables exposed by app.json
2019-03-22 20:29:02 +00:00
Kiwi 538e1fca9d [CORL-139, CORL-140] Community (#2239)
* feat: Add table ui component

* feat: community user table

* feat: filters and role change

* fix: add some comments

* fix: user viewer

* fix: snapshots

* test: add tests

* fix: better popover experience

* fix: test

* chore: use enum

* feat: prevent server side setting your own role

* fix: cleanup
2019-03-22 20:13:11 +00:00
Wyatt Johnson e70f6f5c7f [CORL-144, CORL-143] Nudging (#2236)
* feat: added nudging beheviour to server

* fix: review fixes

* fix: fixed missed change

* fix: fixed sitewide permission error

* feat: implement client side nudging

* test: add feature tests
2019-03-22 18:09:22 +01:00
Wyatt Johnson 647227e66c feat: renamed me -> viewer (#2238) 2019-03-21 19:37:35 +01:00
Kiwi 7ce02620e9 [CORL 131] User Menu Dropdown (#2225)
* chore: simplify popover

* feat: add dropdown component

* feat: user menu

* chore: add comment

* chore: refactor i18n name

* fix: linting

* fix: test

* fix: address review comments

* fix: update snapshot
2019-03-20 21:26:05 +01:00
Kiwi 41db413bea [CORL-158] Open/Close stream inside of configure tab (#2223)
* feat: Open or Close stream inside of configure tab

* feat: default disable/close commenting message

* fix: adjusted tests
2019-03-19 18:30:44 +01:00
Kiwi 5a7340ac3a fix: improve development instructions (#2233) 2019-03-19 18:09:43 +01:00
Kiwi 18127ee72a [next] Remove margin (#2231)
* fix: remove undesired margin

* fix: tests
2019-03-18 17:22:19 -06:00
Kiwiandwyattjoh 7501155078 [CORL-161, CORL-240] Message Box (#2222)
* feat: Message Box

* test: do all the testing stuff

* fix: removed old messageBox

* Update src/core/client/stream/tabs/configure/components/MessageBoxConfig.tsx

Co-Authored-By: wyattjoh <wyattjoh@gmail.com>

* fix: addressed space error
2019-03-19 00:08:22 +01:00
Kiwi 9eb5afbb2b [CORL-159, CORL-160] Stream Config Tab (#2219)
* feat: Implement stream configuration tab

* feat: split profile & configure into separate bundles

* chore: better role logic

* fix+chore: add test cases, implement expectAndFail, refactor tests

* chore: add some comments

* chore: Update src/core/client/framework/lib/form/helpers.tsx

Co-Authored-By: cvle <vinh@wikiwi.io>

* feat: support new graphql mutations/schema

* fix: ci fixes

* fix: improvement to revision loading

* fix: updated some tests

* fix: adapt client to changes

* fix: remove obsolote isClosed in UpdateStory

* ci: increase no_output_timeout for build
2019-03-18 22:07:52 +01:00
Kim Gardner c738d9a355 Merge pull request #2226 from coralproject/next-readme
[next] README
2019-03-18 20:19:48 +00:00
Kiwi 3bdb9e645d fix: add docz address 2019-03-18 16:48:43 +01:00
Chi Vinh Le 547e73f0ae fix: update toc 2019-03-18 11:41:31 +01:00
Kiwi d05bece722 feat: add note that building might take a while 2019-03-18 10:58:06 +01:00
Kiwi d9d6403cda feat: add word about linters 2019-03-18 10:52:51 +01:00
Kiwi ff6cb22c25 feat: add some words about testing and docz 2019-03-18 10:50:26 +01:00
Wyatt Johnson 20b6e6b3ff feat: improved developer documentation 2019-03-15 13:15:31 -06:00
Kiwi 1bf63285bc [CORL-132] Show version info (#2224)
* feat: show version info

* fix: use version from talk-common/version
2019-03-14 22:09:16 +00:00
Wyatt Johnson d37333be89 [CORL 133] API Review (#2197)
* refactor: removed unused subscription code

* refactor: removed management api's

* refactor: cleanup of connections

* refactor: refactored comments edge

* refactor: simplified connection resolving

* feat: added story connection edge

* fix: added story index

* feat: added user pagination and user edge

* fix: added filter to comment query

* fix: removed unused resolvers

* fix: creating a comment reply should require auth

* refactor: cleanup of graph files

* feat: removed display name, made username non-unique

* fix: fixed tests

* fix: fixed tests

* fix: added more api docs

* fix: fixed bug with installer

* refactor: fixes and updates

* fix: added linting for graphql, fixed schema

* feat: added docker build tests

* fix: upped output timeout

* fix: fixed stacktraces in production builds

* fix: removed `git add`

- `git add` was causing issues with
    partial staged changs on files

* feat: improved error messaging for auth

* refactor: cleaned up queue names

* fix: merge error
2019-03-12 15:12:21 +01:00
Kiwi 37959f9398 [CORL-130] Handle non-visible comment status (#2213)
* feat: support blue color in message

* feat: Show message when comment is in review

* feat: handle non-visible comment status

* test: add feature test for handling invisible comment status

* fix: apply review

* chore: better comment :-)

* Update isVisible.ts
2019-03-05 19:15:33 +01:00
Kiwi 4e043638f6 [CORL-239, CORL-128] Support disabled commenting and closed stories in Stream (#2205)
* feat: closed story + disabled commenting

* test: add feature test and fix bugs

* fix: snapshot

* fix: isClosed can't be null

* fix: remove duplicate DeepPartial type

* fix: border color
2019-03-04 23:27:46 +01:00
Kiwi 625809b42c [CORL 212] Implement CharCount Restriction feature (#2204)
* feat: adhere to char count settings for posting top level comments

* fix: remove bidi characters during test

* test: add feature tests for charCount

* test: update snapshots

* test: add feature test for updating settings

* feat: use red color and warn icon (from review)

* feat: Implement charCount for reply

* feat: charCount for edit comment

* test: update snapshots
2019-03-04 22:49:04 +01:00
Kiwi 60f5b7e3c0 [CORL-282] Handle server errors in client (#2196)
* feat: Handle server errors in client

* refactor: use enum ERROR_TYPES

* chore: better comment

* fix: lint

* fix: also look in queries for custom errors
2019-03-01 21:37:02 +01:00
Wyatt Johnson 7ad724e576 fix: applied visibility status to replies (#2195) 2019-03-01 17:21:27 +01:00
Wyatt Johnson aa2346b715 [CORL-127] Custom CSS (#2194)
* feat: moved html-webpack-plugin to custom server templates in production

* fix: fixed templates

* fix: removed sri for the time being

* fix: fixed up tests for new field name
2019-02-13 20:45:11 +00:00
Kiwi c91a0fafa5 [CORL-116] Configure sitewide commenting (#2193)
* feat: configure sitewide commenting

* fix: repaired snapshots

* fix: updated snapshots

* test: update snapshots
2019-02-13 18:36:37 +01:00
Kiwi 51880bcfc9 [CORL-129] Render Community Guidelines (#2191)
* chore: Rename InnerProps to Props

* feat: Render community guidelines

* chore: refactor schema communityGuidelines* settings into it's own type

* test: update snapshots
2019-02-13 18:06:42 +01:00
Kiwi f4037ce6fb [CORL-260] Bring back sorting (#2186)
* feat: sort stream

* feat: add FieldSet component to ui

* feat: make accessible and add feature test

* test: fix snapshots
2019-02-13 16:11:13 +00:00
Kiwi 68839c721c [CORL-125] change wording for showing hidden comments (#2180)
* chore: change wording for showing hidden comments

* test: update snapshots
2019-02-13 16:01:18 +00:00
Wyatt Johnson 3d7cb42434 [CORL-264] Fixes bug with purify (#2187)
* fix: fixed bug with purify

* refactor: changed variable assignment default

* refactor: fixed default variable assignment

* fix: repaired tests for <strong> -> <b>
2019-02-11 18:22:43 +00:00
Kiwi 710de07fa6 chore: harmonize authToken to accessToken (#2184) 2019-02-08 23:40:20 +01:00
Kiwi 7ec6780ee1 chore: upgrade react (#2183) 2019-02-08 23:18:39 +01:00
Wyatt Johnson b6aa1da817 [next] Production Fixes + Initial Documentation (#2185)
* feat: added README, LICENSE, fixed bugs with package.json

* refactor: remove test as valid suggested option
2019-02-08 18:07:09 +00:00
Wyatt Johnson a9431cd4d8 fix: repairs bug with user on request (#2181)
- fixes CORL-210
2019-02-08 00:00:05 +01:00
Kiwi 53e168ae93 [next] Implement configuration panes (#2173)
* feat: moderation config

* feat: configure banned and suspect words

* chore: upgrade react and test libs to the newest version <3

* chore: upgrade typescript + some refactor

* feat: general, organization and advanced configuration panes

* fix: translation

* feat: speedup fetching markdown editor

* feat: localize markdown editor

* chore: refactor container names

* chore: rename infobox to communityGuidelines

* feat: closing comment streams duration config

* test: add feature tests for configurations

* fix: mock only console.error

* chore: upgrade node

* chore: require node >= 10

* fix: better validation and default values

* feat: Make DurationField a general purpose component and reuse for Edit Comment Timeframe

* test: add unit test for duration field

* fix: patch for bug when built in production

* chore: bump npm version to latest

* fix: adapted Dockerfile to new version of node

* refactor: harmonized seconds/milliseconds to seconds

* fix: resolve bug from merge conflict
2019-02-07 01:10:51 +01:00
Wyatt Johnson 9fa5900acc [next] Error and Logging Improvements (#2152)
* feat: added locale support for Tenant

* feat: added secret scrubbing to logs

* chore: cleanup logger

* chore: logger improvements

* feat: re-introduce scoped pretty logger

* feat: added initial error support

* refactor: replace trace-error.TraceError with talk.InternalError

* fix: fixed error logging

* refactor: replaced Error with VError

* fix: repaired issue with error management on api

* fix: patched bug with not found handler

* feat: added translations

* feat: added location path to invalid entries

* refactor: refactored error handling on graph

* fix: moved indexing operations to master node

* refactor: added throw for when the message isn't found in testing

* fix: removed duplicate log

* fix: fixed naming on environment variable
2019-02-06 23:42:17 +00:00
Wyatt Johnson 9b0e6ed53b [next] MongoDB Indexes (#2142)
* feat: added mongo indexing support

* fix: fixed typescript issue

* chore: better types

* fix: revert debug stuff

* fix: addressed ts error

* feat: added config option to disable auto-indexing

* chore: reordered imports

* refactor: cleaned up some filepaths
2019-02-06 17:53:34 +00:00
Kiwi 7e8ef2189d [next] Admin Authentication (#2155)
* feat: Support sign in via E-Mail, and social logins + permission check

* feat: no permission info

* test: unit test

* test: fix remaining tests

* test: add integration tests

* feat: add admin account completion

* test: auth completion feature tests

* fix: translation

* fix: comment marker design

* fix: linting issues

* chore: address pr review comments

* chore: add comment
2019-02-04 21:26:41 +00:00
Kiwi 939152ee81 [next] Report Comment + Stream Refactor & Test Improvements (#2144)
* fix: stabilize mutations

* feat: Refactor Stream + Implement Report Comment

* test: add unit tests

* chore: Improve stream integration tests

* test: add integration test for reaction

* test: add feature/integration tests for report comment

* fix: order import

* fix: performance issues + keep active button styling until clicked away
2019-01-16 22:31:43 +00:00
Wyatt Johnson 94eb72a9bf [next] Auth Callback + Chunking (#2139)
* feat: added new auth-callback

* fix: removed unused polyfill code

* fix: fixed missed intersection observer

* feat: enabled vendor chunks

* fix: fix some issues with chunk splitting

* fix: added intersection-observer to app polyfill

* fix: fixed test

* fix: removed lodash plugin which caused issue in prod

* chore: access_token -> accessToken

* feat: Show social login errors

* fix: lint + add test

* fix: restore width after facebook social login
2019-01-11 15:31:24 +01:00
Wyatt Johnson 0e941222c5 [next] Email Login (#2138)
* feat: added email scope to google login

* feat: enabled email for facebook

* fix: added fallback
2018-12-21 16:26:01 +00:00
Wyatt Johnson 98a8c8dc71 [next] User Mutations (#2133)
* feat: added support for Token's

* feat: added mutations

- updateUserUsername
- updateUserDisplayName
- updateUserAvatar
- updateUserEmail
- updateUserRole

* lint: removed old commented out code

* fix: linting
2018-12-20 22:42:44 +00:00
Wyatt Johnson 01a2ace3f0 [next] User Input Validation (#2125)
* feat: added user validation

* fix: adapt client validation to match servers

* fix: snapshots

* feat: moved validation code to common

* chore: renamed utils/validate to helpers/validate
2018-12-20 23:33:23 +01:00
Kiwi 065cb4b03a [next] Auth Popup v2 (#2101)
* feat: Implement new Sign In view

* feat: Move forgot + resetPassword to new design

* feat: Implement sign up with new design

* fix: narrow gutter

* test: add unit tests

* test: integration tests

* feat: support show / hide password

* feat: support oauth2 flow

* feat: add views for user completion

* feat: implement oauth2 sign up

* test: fix snapshots

* fix: lint

* fix: get more complete mutation response

* fix: removed array of OIDC integrations

* fix: renamed resolver function

* fix: adapt oidc client implementation

* fix: targetFilter should be stream on signup

* fix: removed unneeded message

* fix: moved password into local profile

* fix: made username optional, removed valid null value

* fix: linting

* fix: respect targetFilter

* feat: support user registration mutations

- Added `setUsername`
- Added `setEmail`
- Added `setPassword`
- Added `permit` to `@auth`
- Added `email` to `User`

* fix: fixed issue with query

* feat: added user password update

* feat: complete sign in mutation

* fix: adapt some rebasing gitches

* test: improve tests

* test: unittest for setting auth token

* fix: failing tests

* test: move most tests from enzyme to react-test-renderer

* fix: remove schema warnings in tests

* test: improve window mock

* test: test different social login configurations

* test: test social logins for sign up

* fix: use htmlFor instead of for

* test: more feature tests

* feat: always go through account completion

* test: feature test account completion

* feat: addtional account completion test

* Update start.ts

* chore: refactor auth token retrieval logic
2018-12-20 22:32:04 +01:00
Wyatt Johnson 326a10dc5d [next] Concurrency (#2136)
* feat: added concurrency options

* fix: Default CONCURRENCY to 2 for development
2018-12-20 17:01:10 +00:00
Kiwi 1fc49f8e50 [next] Moderate (#2118)
* fix: load .env before building / watching

* feat: Implement AppBar, Brand, and SubBar

* feat: add card ui component

* feat: add modqueue components

* feat: implement modqueue

* feat: add translations

* test: add unit tests

* feat: single comment view

* test: feature / integration tests for modqueue

* test: fix remaining tests

* feature: support TextMatchOptions

* fix: remove body count marker

* fix: remove accidently added package

* feat: testHelper toJSON

* chore: cleanup + comments

* chore: better types

* test: fix test

* chore: refactor decision history test

* chore: tiny fix

* fix: adjust to recent server changes

* fix: marking suspect and banned words

* feat: added moderation queue edge to accept/reject comment payloads

- Simplified moderationQueue returns
- Simplified resolvers

* feat: update counts

* feat: added id's to moderation queue and settings

* fix+test: test count changes, apply fix

* chore: adapt to server change, and remove custom mutation handlers

* fix: use common utils

* fix: purify fix, babel fix

* fix: workaround css treeshake issue and upgrade css plugins

* fix: fixed snapshot

* fix: support empty word lists

* feat: separate client config
2018-12-18 18:00:39 +00:00
Kiwi 90e67ca479 [next] improve tree shaking + update webpack & babel (#2132)
* feat: improve tree shaking + update webpack & babel

* fix: tests
2018-12-17 16:56:48 +00:00
Wyatt Johnson 779c0292f3 feat: added bundle size ci check (#2127) 2018-12-17 16:39:56 +00:00
Kiwi 097294909b [next] Embed: Defer login/logout until ready (#2123)
* feat: Embed defer login/-out until ready

* fix: make remove work with lazy render

* fix: typo

* fix: another typo

* fix: test

* chore: replace query-string for querystringify

* fix: types

* chore: small refactor

* feat: added webpack analzyer

* chore: rename compile -> generate

* fix: fix scripts and improve bundle size

* fix: lodash webpack plugin
2018-12-15 00:07:09 +00:00
Wyatt Johnson 6f538d3235 [next] DOM Purification (#2115)
* feat: added purify + linkify + better link detection

* fix: linting + tests

* chore: refactor RequireProperty Type
2018-12-13 00:14:29 +01:00
Wyatt Johnson e134b4de04 [next] Flag Improvements (#2114)
* fix: applied fix for reaction mutation

* fix: removed comment length flag

* feat: added additionalDetails field to flags

* feat: added other flag type
2018-12-12 22:49:51 +01:00
Wyatt Johnson 8a64e6f62d fix: resolved race loading issues with dataloader (#2117) 2018-12-12 21:54:43 +01:00
Wyatt Johnson 4584c3d4fb [next] Moderation Queues (#2098)
* fix: edit comment fix for reactions

* feat: Comment Queue Counts

- Removed "remove flag"
- Rearranged moderation services
- Rearranged comment counts on stories
- Added moderation queue counts to stories
- Added comments edge
- Improved Cursor/Connection types
- Improved count updators for stories

* feat: added shared comment counts and queues

- Added new AugmentedRedis type
- Added more log calls
- Update counts in shared counter as well
- Return a Query level Moderation Queue

* fix: fixed test
2018-12-07 00:37:33 +01:00
Kiwi 5b62082693 [next] Decision History (#2103)
* feat: decision history components

* feat: implement decision history container

* test: add unit tests

* test: integration test

* test: fix remaining snapshots

* test: add more concepts from react-testing-library

* fix: wrap long username into the next line

* fix: fallback to word-break: break-all;
2018-11-30 20:51:45 +01:00
Wyatt Johnson a5c98cd587 [next] Comment Reply Revisions (#2072)
* feat: added revision id support for replies

* feat: use createCommentReply
2018-11-27 21:56:12 +00:00
Kiwi 71ce74e1d1 feat: batch admin configure mutations (#2089) 2018-11-27 21:49:40 +00:00
Kiwi 3fcb9a179a [next] Support external config (#2088)
* fix: correctly determine expired token

* feat: support external config

* fix: lint

* fix: npm audit fix
2018-11-27 18:54:55 +00:00
Kiwi 50cb46a053 [next] Delay showing loading spinner (#2090)
* feat: delay showing loading spinner

* fix: snapshots

* fix: lint

* fix: make delay duration shorter
2018-11-21 23:14:15 +01:00
Wyatt Johnson f160eae500 fix: allowed client router to take over routing past the mount point (#2086) 2018-11-21 17:56:50 +01:00
Wyatt Johnson 21e1a5cbef [next] Comment Moderation Actions (#2068)
* fix: renamed snake case to camel case

* fix: changed case for mutators

* fix: renamed all snake case to camel case for db

* feat: added support for comment revisions + split comment actions

* fix: updated tests

* feat: implemented CommentModerationAction

* fix: fixed case issues

* feat: enabled WeakMap for wordList processsing

* chore: npm audit
2018-11-21 17:42:47 +01:00
Kiwi 13147c4ba4 [next] UserBox with respect to auth settings (#2079)
* feat: adapt userbox according to settings in embed stream

* fix: lint and test

* feat: respect allowRegistration
2018-11-20 17:56:02 +01:00
Kiwi 6fa0c7f538 [next] Support login and logout for TalkStreamEmbed (#2081)
* feat: Support login and logout for TalkStreamEmbed

* fix: better test names

* fix: remove obsolete line
2018-11-20 17:48:57 +01:00
Kiwi 9af523318c [next] Prevent accidental lock out from admin or stream (#2084)
* feat: prevent auth lockout by accident

* test: add integration tests

* test: update snapshots
2018-11-20 17:41:35 +01:00
Kiwi ecdb4e1307 [next] Broadcast mutation events (#2083)
* feat: Implement mutation events

* fix: correct testcase name
2018-11-20 15:44:07 +01:00
Kiwi 1a65b734d3 feat: don't use expired token (#2082) 2018-11-20 15:36:01 +01:00
Kiwi 05350d651f [next] Admin Configure (#2076)
* feat: Add RadioButton and CheckBox

* feat: configure facebook and google auth

* feat: configure sso, localAuth and displayName + some tests

* test: add integration tests for configure auth

* test: more integration tests

* feat: add oidc support

* test: add oidc integration test

* feat: generate sso key initially

* fix: import fetchQuery from correct package

* fix: admin url

* fix: set timezone to utc when testing

* refactor: improve route config

* fix: remove obsolete line

* fix: clientMutationId increment

* fix: oidc only create when enabled

* fix: copy

* test: update snapshots

* feat: fixed graphql logging extension

* Update src/locales/en-US/admin.ftl

Co-Authored-By: cvle <vinh@wikiwi.io>

* Apply suggestions from code review

Co-Authored-By: cvle <vinh@wikiwi.io>

* test: update snapshots

* fix: change Local Auth to Email Authentication

* fix: copy updates
2018-11-19 22:47:32 +00:00
Wyatt Johnson 3f949b3712 fix: fixed install route (#2064) 2018-11-06 16:28:04 +00:00
Wyatt Johnson ca12b73b55 [next] Story Mutations (#2055)
*  feat: added mutations for removing + scraping stories

- added mutation for removing stories
- added mutation for scraping stories
- renamed all delete* to remove* to avoid reserved keyword collision

* fix: linting

* feat: implemented createStory

* feat: added support for createStory

* feat: improved Story deletion

- Deletes comments on the deleted Story
- Deletes actions of comments that were deleted via new
  `root_item_id` parameter for Comment Action's
- Added logging around critical components of the remove
  process

* feat: implemented mergeStory

- Added new merge function for root actions
- Added new merge function for story comments
- Added new merge function for comment status counts
- Added new remove stories function

* fix: fixed story creation method

* fix: added action count merging

* fix: removed outdated file

* fix: removed queue that got duplicated via rebase

* fix: prevent error when action counts are empty
2018-11-02 23:18:12 +00:00
Wyatt Johnson 7aa9a6b4f7 feat: upgraded apollo-server-express, logging extension (#2058) 2018-11-01 22:05:04 +00:00
Wyatt Johnson b3cfe32631 [next] Story Improvements (#2054)
* feat: improved logs

* feat: improved scraper

- added scraper debug graph call

* feat: improved story closing

* fix: fixed tests
2018-11-01 21:34:48 +01:00
Kiwi 6597658734 Merge pull request #2052 from coralproject/next-common
[next] Move common functions to talk-common
2018-11-01 20:42:39 +01:00
Chi Vinh Le 625ef9cbee refactor: deduplicate embed utils 2018-11-01 20:28:09 +01:00
Wyatt Johnson c81d612c70 feat: moved some useful tools to common 2018-11-01 18:15:42 +01:00
Kiwi 3c64bb0240 Merge pull request #2013 from coralproject/next-auth
[next] Authentication Improvements
2018-11-01 16:42:25 +01:00
Wyatt Johnson 8435ccaee6 Merge branch 'next' into next-auth 2018-11-01 00:00:54 +00:00
Wyatt Johnson f0753214e1 review: upgraded merged upstream @types/mongodb 2018-10-31 18:00:30 -06:00
Wyatt Johnson f39da1f76b review: fixed function name 2018-10-31 17:57:21 -06:00
Kiwi bc5db7b599 [next] Admin auth + design (#2056)
* feat: extract jwt information

* feat: login status dependent auto redirect

* feat: Sign Out button

* feat: add a 404 page

* feat: improve loading state and use auth token info

* feat: redirect to previous destination

* feat: implement new design

* fix: change asset to story

* feat: add translations

* feat: more compact design

* test: add unit tests

* chore: refactor NavigationLink

* test: add integration tests

* chore: refactor replaceHistoryLocation

* fix: typo

* fix: property name typo
2018-10-31 23:11:32 +00:00
Wyatt Johnson 092e707785 Merge branch 'next' into next-auth 2018-10-29 17:39:06 -06:00
Wyatt Johnson 93b91a0573 feat: added google support 2018-10-29 17:36:15 -06:00
Wyatt Johnson 1dc400ba58 [next] Rename Asset to Story (#2044)
* feat: rename asset -> story in server

* feat: renamed asset -> story for client code and tests

* feat: renamed article -> story
2018-10-29 22:49:35 +00:00
Wyatt Johnson 58e51b299d feat: created oauth2 abstract class 2018-10-29 15:13:10 -06:00
Wyatt Johnson c47032f257 feat: support facebook auth 2018-10-29 14:31:47 -06:00
Wyatt Johnson 2571f048ad feat: support development url's 2018-10-29 14:31:35 -06:00
Wyatt Johnson 6fc2eabc88 Merge branch 'next' into next-auth 2018-10-26 18:17:46 +00:00
Wyatt Johnson 33ecbaecda fix: linting 2018-10-26 12:17:24 -06:00
Kiwi 38fba52839 [next] Show reply information (#2020)
* feat: Implement replyTo

* feat: use full size buttons on small screens

* feat: show full size buttons in edit form on small screens
2018-10-26 17:56:35 +00:00
Wyatt Johnson 3c613754f0 feat: added allowRegistration option 2018-10-25 12:57:20 -06:00
Wyatt Johnson d1e6d297f3 fix: fixed linting 2018-10-25 12:03:28 -06:00
Wyatt Johnson 6dab5836c3 review: adapted graph responses for OIDC mutations 2018-10-25 11:51:28 -06:00
Wyatt Johnson ffd0f90965 fix: documentation + moved discover into query 2018-10-25 11:29:10 -06:00
Wyatt Johnson eadf7bde43 feat: added memoization to the regexp generation 2018-10-25 10:55:22 -06:00
Wyatt Johnson e7131e1567 fix: adjusted to include the openID 2018-10-25 10:31:43 -06:00
Wyatt Johnson 977161db0a fix: linting 2018-10-25 08:58:58 -06:00
Wyatt Johnson 45cbac7972 feat: added OIDC management mutations 2018-10-24 16:54:07 -06:00
Wyatt Johnson 0bb64f1d97 feat: added OIDC discovery 2018-10-23 15:27:23 -06:00
Wyatt Johnson 3b6f3c9ea8 fix: rename wordlist to wordList 2018-10-22 15:52:17 -06:00
Wyatt Johnson fa72d5deda feat: support new auth methods for Tenants
- New Time scalar type is implemented on the Server
- Single Sign-On keys can now be generated
- Single Sign-On keys can be regenerated
- Single Sign-On keys now store the date they were generated on.
- Initial implementation of `AuthenticationTargetFilter`'s
2018-10-19 16:05:58 -06:00
Kiwi 9436600e31 Merge pull request #2004 from coralproject/next-ui-select
[next] SelectField
2018-10-19 20:48:45 +02:00
Kiwi cd2ccf8792 Merge branch 'next' into next-ui-select 2018-10-19 20:42:56 +02:00
Kiwi b5e98d1025 Merge pull request #2010 from coralproject/next-inReplyTo
[next] Implement InReplyTo
2018-10-19 20:42:45 +02:00
Chi Vinh Le d3f6762458 test: adapt snapshot 2018-10-19 20:33:35 +02:00
Kiwi f5324f65bb Merge branch 'next' into next-ui-select 2018-10-19 20:22:53 +02:00
Chi Vinh Le 544c21440b fix: select not propagating value in ff 2018-10-19 20:20:38 +02:00
Chi Vinh Le a3aca825e3 feat: upgrade react and enzyme 2018-10-19 20:19:27 +02:00
Wyatt Johnson 917fffc292 Merge branch 'next' into next-inReplyTo 2018-10-19 17:54:57 +00:00
Kiwi 2e6237b9d9 [next] Implement Comment History Pagination (#2008)
* refactor: profile

* feat: add pagination to comment history

* feat: add getMeSourceID helper

* feat: update profile in CreateCommentMutation

* fix: clear query response cache on mutation

* test: add integration tests for profile

* test: add unit tests
2018-10-19 17:54:40 +00:00
Chi Vinh Le 1f0cba5657 fix: use correct value 2018-10-19 19:43:46 +02:00
Kiwi bc4d746291 fix: use asset url (#2005) 2018-10-19 17:32:12 +00:00
Wyatt Johnson ecc4bdc4bb Merge branch 'next' into next-ui-select 2018-10-19 17:07:04 +00:00
Kiwi df29c087df Merge branch 'next' into next-inReplyTo 2018-10-19 19:06:54 +02:00
Wyatt Johnson 9608198d86 [next] Content Security Policy (#1972)
* feat: initial csp support

* fix: strip non-frame directives

* review: added tests, fixed some edge cases
2018-10-19 17:06:40 +00:00
Kiwi dda4443ab4 Merge pull request #2012 from coralproject/next-disable-audit
[next] Disable `npm audit`
2018-10-19 18:45:53 +02:00
Wyatt Johnson 01b4094b4e fix: disable audit 2018-10-19 10:37:35 -06:00
Chi Vinh Le 1176080aee feat: Implement InReplyTo 2018-10-19 17:31:21 +02:00
Kiwi 4e0d578280 Merge branch 'next' into next-ui-select 2018-10-19 00:22:43 +02:00
Kim Gardner 9a129af21e Merge pull request #1984 from coralproject/profile-mobile
[next] Profile Mobile (new) Version
2018-10-18 17:05:24 +01:00
Chi Vinh Le ea5d907ff5 fix: remove 80% max-width 2018-10-17 17:26:30 +02:00
Chi Vinh Le a8d69a0c5d feat: add some padding to default demo site 2018-10-17 17:26:31 +02:00
Chi Vinh Le b74e8f3390 fix: only break words when necessary 2018-10-17 17:09:53 +02:00
Chi Vinh Le dcc4b4a892 fix: styles closer to design 2018-10-17 17:07:54 +02:00
Chi Vinh Le bee35c3865 fix: better types 2018-10-17 16:41:13 +02:00
Chi Vinh Le b6ee59eb91 fix: missing change 2018-10-17 16:00:33 +02:00
Chi Vinh Le aeb75666de Merge branch 'next-ui-select' of https://github.com/coralproject/talk into next-ui-select 2018-10-17 15:48:30 +02:00
Chi Vinh Le 6f51f68776 fix: improve types 2018-10-17 15:48:06 +02:00
Kiwi 2b5ef018d0 Merge branch 'next' into next-ui-select 2018-10-17 15:45:14 +02:00
Chi Vinh Le 847d5d0ea9 fix: types 2018-10-17 15:36:00 +02:00
Chi Vinh Le 70465ebd31 feat: Implement SelectField 2018-10-17 00:02:12 +02:00
Wyatt Johnson 3a9bcaa8b0 Merge branch 'next' into profile-mobile 2018-10-16 18:23:28 +00:00
Kiwi 50dd2e28b0 fix: ff focus styles (#1997) 2018-10-16 17:21:12 +00:00
Kiwi 80e6ccbc98 Merge pull request #1994 from coralproject/next-static-uri
[next] Static URI Support
2018-10-16 18:50:29 +02:00
Wyatt Johnson 9f37c3b3da Merge branch 'next' into next-static-uri 2018-10-15 22:47:04 +00:00
Wyatt Johnson e9c80fc02a [next] Relay GraphQL Batching (#1965)
* feat: added graphqlBatch

* refactor: cleanup of json serial

* refactor: cleanup of json serilization

* feat: use react network layer

* fix: adjusted broken user

* fix: temporarily disable cache for profile query

* test: temporarily use precompiled modules

* fix: bug when updating comment count on an asset

* fix: compile modules to commonjs for jest

* test: add react-relay-network-layer to transform whitelist

* fix: use react-relay-network-layer/es

* types: add react-relay-network-modern typescript types

* feat: integrate custom error middleware

* review: add todo
2018-10-15 22:46:21 +00:00
Wyatt Johnson 14658d3d5d review: suggested improvements 2018-10-15 16:43:20 -06:00
Wyatt Johnson 3633fd7afb feat: added static uri support 2018-10-15 14:56:43 -06:00
Kiwi 9347815276 fix: no precommit test (#1993) 2018-10-15 16:01:49 +00:00
Kiwi c2ffb30431 [next] i18n short number support (#1992)
* feat: Implement i18n short number

* test: fix failing tests
2018-10-12 23:16:13 +00:00
Wyatt Johnson 3636e47b16 feat: added husky + lint-staged (#1966) 2018-10-12 22:14:36 +00:00
Wyatt Johnson 5362a26976 fix: fix graphiql 2018-10-12 15:04:45 -06:00
Wyatt Johnson d25862e035 fix: docker login 2018-10-12 13:33:40 -06:00
Wyatt Johnson cda72ba249 [next] Docker + Revision Metadata (#1991)
* feat: added version metadata, release to Docker

* fix: fixed mistake with export

* fix: adjusted circle cache beheviour

* fix: removed node_modules from workspace

* fix: added version prefix to cache keys

* review: patched invalid job name

* fix: hardcode cache version prefix :(

* fix: improved cache keys
2018-10-12 19:13:55 +00:00
Belén Curcio ba15cbf23c [next] Pluralization for the comment count (#1983)
* Pluralization comment count

* Adding updated snapshots

* fix: snapshots
2018-10-12 17:28:59 +00:00
Kiwi cf2be96a13 [next] Permalink View (#1987)
* feat: Implement converation thread

* Update unit tests

* test: adapt integration tests

* test: refactor denormalization helpers

* test: Include multiple parents in permalink View

* test: add integration test for loading previous parent comments

* feat: use dashed & solid time line

* feat: use new conversation thread design

* feat: add header from new design

* test: update snapshots

* fix: better scrolling behavior

* feat: add user box

* fix: add translations

* fix: typo

* fix: plural translation

* fix: paddings

* feat: better styling for level 0 comments

* fix: gutter size

* fix: update iframe url with new comment id

* test: add unit tests
2018-10-12 16:41:58 +00:00
Kiwi ff5a94b91f fix: adapt translation keys to our convention (#1988) 2018-10-11 22:42:39 +00:00
Wyatt Johnson 8184c3932e [next] Install (#1957)
* Wip

* Adding Wizard and initial step <3

* Wip

* Adding more steps to the Install Wizard

* Mantaining state across steps

* Adding Steps

* Step Component

* wip

* feat: improved logging

* feat: added tenant install route

* Progress

* Refactor

* Adding rest install mutation

* Wip

* Done

* Addding snapshots

* URL validators

* Adding validation for url, and final step

* Header component and main variants

* fix: resolved router

* fix: corrected spec for prop

* fix: updated test snapshot

* Translations

* Translations

* Adding extra validation

* prefixing events with On - onSaveData

* prefixing events with On - onSaveData

* Adding translations, and colors from the palette

* Centering steps

* Ready

* feat: added production redirects

* fix: fixes during production

* fix: removed dead code

* Placeholder translations

* removing submit from cancel

* Adding a description for the URL field

* typo

* Refactor and renaming

* Using white as var

* Refactor and renaming

* feat: use new palette colors

* fix: extracted styles

* Adding await to avoid race condition with setState :)

* lint

* feat: added urls

* fix: wizard leaking styles

* fix: simplify icon style

* fix: adjust global body css to remove padding to allow seamless integration

* fix: types and small refactors

* fix: correctly filter wizard children

* refactor: simplify step containers

* fix: better typecheck

* test: remove obsolete snapshots

* fix: don't export FormProps
2018-10-11 22:13:02 +00:00
Wyatt Johnson 44e6d4b26a [next] GraphiQL Fixes (#1967)
* fix: fixed playground middleware

* fix: replaced express middleware with custom html based middleware
2018-10-10 16:25:26 +00:00
Belén Curcio 343784dcb1 Profile Mobile version 2018-10-10 10:39:33 -03:00
Belén Curcio 0d588f2f28 [next] Login prompt for not signed in users trying to react to comments. (#1979)
* Fixing the commentCount for 0 comments

* Show signIn when logged-off user reacts to a comment

* Snapshots updated

* removing graphiql

* Reaction: Icon - Label - Count
2018-10-09 16:33:13 +00:00
Kiwi 7c9b8e5377 Merge pull request #1968 from coralproject/next-comment-counts
[next] Comments Count
2018-10-08 21:50:41 +02:00
Belén Curcio 49ec2bf18e Merge branch 'next-comment-counts' of github.com:coralproject/talk into next-comment-counts
* 'next-comment-counts' of github.com:coralproject/talk: (53 commits)
  fix: Readd and fix App unittest
  fix: undesired margin
  Correct optimitic updates
  fix: correct typings
  fix: linting
  Optimistic Responses updated
  Adding optimisticresponse for deleteCommentReaction
  Changes
  test: use baseComment and baseAsset in fixtures
  fix: lint
  test: simplify tests
  fix: pass settings to deeper ReplyListContainer
  fix: remove debug
  fix: test updates
  feat: replaced respect with reaction and added some options!
  Adding spected
  More snapshots
  It was the optimistic response
  Adding actionCounts to the fixtures
  Updated snapshots
  ...
2018-10-08 16:44:24 -03:00
Belén Curcio ae63e9a975 tiny refactor 2018-10-08 16:43:54 -03:00
Chi Vinh Le 0feb7384b2 Merge branch 'next' into next-comment-counts 2018-10-08 21:07:08 +02:00
Chi Vinh Le b69313a01e fix: Readd and fix App unittest 2018-10-08 20:53:02 +02:00
Belén Curcio ec539c2dae Tests updated 2018-10-08 15:01:34 -03:00
Belén Curcio 51b7f5470e Refactor 2018-10-08 14:58:10 -03:00
Kiwi 64487728f4 Merge pull request #1864 from coralproject/next-respect
[next] Actions
2018-10-08 16:30:01 +02:00
Chi Vinh Le 11fb12a22a fix: undesired margin 2018-10-08 16:24:18 +02:00
Belén Curcio 7e7a5856c2 Revert "Revert "Using fragment and updated fixtures""
This reverts commit 333e1a6dac.
2018-10-08 08:41:40 -03:00
Belén Curcio 333e1a6dac Revert "Using fragment and updated fixtures"
This reverts commit 8dae12b5ab.
2018-10-05 10:05:28 -03:00
Belén Curcio 8dae12b5ab Using fragment and updated fixtures 2018-10-05 09:54:47 -03:00
Belén Curcio 7c7f7f2a19 Merge branch 'next-comment-counts' of github.com:coralproject/talk into next-comment-counts
* 'next-comment-counts' of github.com:coralproject/talk:
  fix: documentation
2018-10-04 20:27:25 -03:00
Belén Curcio bd7903fc53 Snapshots updated 2018-10-04 20:27:03 -03:00
Wyatt Johnson 945cdfc298 fix: documentation 2018-10-04 22:34:54 +00:00
Belén Curcio d3fb04225c Snapshots updated 2018-10-04 18:35:24 -03:00
Belén Curcio aa105061c9 Adding comment count 2018-10-04 18:31:16 -03:00
Belén Curcio 9d3363198a Merge branch 'next' of github.com:coralproject/talk into next-comment-counts
* 'next' of github.com:coralproject/talk: (53 commits)
  fix: localization keys
  fix: graphql schema not compiling
  Added translations
  test: fix snapshots
  feat: hide profile tab when not logged in
  fix: translations, typings, cleanup and fix view conversation
  fix: apply suggestions
  fix: improve typings
  feat: cleanup of router
  feat: simplified view
  Presentational components, events, tabs and more
  updated snapshots
  Updated Snapshots
  Adding Snapshots and translations
  Adding Snapshots and translations
  feat: added Asset edge on the Comment
  Setting COMMENTS as activeTab
  Setting CommentID
  deleting old snap
  No need for local state for now
  ...
2018-10-04 17:44:06 -03:00
Belén Curcio 44b589d04f Correct optimitic updates 2018-10-04 15:52:25 -03:00
Chi Vinh Le 5bf4c66b40 fix: correct typings 2018-10-04 19:48:56 +02:00
Chi Vinh Le 2a4dfdd3de fix: linting 2018-10-04 19:32:17 +02:00
Chi Vinh Le bd1d677b63 Merge branch 'next' into next-respect 2018-10-04 19:15:00 +02:00
Kiwi 929dfb9989 Merge pull request #1874 from coralproject/next-profile
[next] - Introducing Comment Tab, My Profile Tab, Comment History
2018-10-04 17:39:42 +02:00
Chi Vinh Le c9ba749c76 fix: localization keys 2018-10-04 17:29:26 +02:00
Chi Vinh Le 7f4d8d8b2f fix: graphql schema not compiling 2018-10-04 17:28:41 +02:00
Belén Curcio 66cc0752a4 Merge branch 'next-profile' of github.com:coralproject/talk into next-profile
* 'next-profile' of github.com:coralproject/talk: (21 commits)
  test: fix snapshots
  feat: hide profile tab when not logged in
  fix: translations, typings, cleanup and fix view conversation
  fix: apply suggestions
  fix: improve typings
  feat: cleanup of router
  feat: simplified view
  deleting old snap
  No need for local state for now
  Routing, Navigation, Styles
  using found withRouter
  Mapping /admin as /admin.html in devMode
  Adding found
  Adding Found Relay to the Admin side
  Add tests
  Adapt snapshots
  Add tests
  Implement Show Conversation Link
  First iteration of admin
  wip
  ...
2018-10-04 10:37:52 -03:00
Belén Curcio 84234f9ac6 Added translations 2018-10-04 10:33:50 -03:00
Chi Vinh Le a09b50a9e7 test: fix snapshots 2018-10-03 16:49:42 +02:00
Chi Vinh Le 5c77ed2c31 Merge branch 'next-profile' of https://github.com/coralproject/talk into next-profile 2018-10-03 15:51:52 +02:00
Chi Vinh Le fabe52a0a6 feat: hide profile tab when not logged in 2018-10-03 15:49:49 +02:00
Belén Curcio ef91eaab20 Optimistic Responses updated 2018-10-03 10:25:25 -03:00
Kiwi 13b039099f Merge branch 'next' into next-profile 2018-10-03 02:15:41 +02:00
Kiwi d22ba3ec89 Merge pull request #1910 from coralproject/admin
[next] First Iteration of Admin
2018-10-03 02:14:54 +02:00
Kiwi 7beb1a2fcd Merge branch 'next' into admin 2018-10-03 01:59:56 +02:00
Chi Vinh Le bfeab31c37 fix: translations, typings, cleanup and fix view conversation 2018-10-03 01:46:39 +02:00
Chi Vinh Le 9dc702d29e Merge branch 'next' into next-profile 2018-10-03 01:33:09 +02:00
Kiwi 0ec04aa561 Merge pull request #1911 from coralproject/next-readmore
[next] Implement "Read More of this Conversation"
2018-10-03 01:29:00 +02:00
Chi Vinh Le 9463fa8ec2 fix: apply suggestions 2018-10-03 00:52:55 +02:00
Chi Vinh Le 45b39c9a0f fix: improve typings 2018-10-03 00:41:51 +02:00
Wyatt Johnson 74fc0fab61 feat: cleanup of router 2018-10-02 15:13:01 -06:00
Wyatt Johnson 733ea936d6 feat: simplified view 2018-10-02 14:58:27 -06:00
Belén Curcio b53aa354ad Adding optimisticresponse for deleteCommentReaction 2018-10-02 13:22:22 -03:00
Belén Curcio 7948ed72ee Changes 2018-10-02 13:14:50 -03:00
Belén Curcio 0a17fc7e64 Presentational components, events, tabs and more 2018-10-01 17:04:16 -03:00
Belén Curcio 52cdec056b updated snapshots 2018-10-01 16:32:40 -03:00
Belén Curcio 52b35c53ab Updated Snapshots 2018-10-01 15:52:14 -03:00
Belén Curcio ede3951309 Adding Snapshots and translations 2018-10-01 15:38:06 -03:00
Belén Curcio 5aa3024921 Adding Snapshots and translations 2018-10-01 15:35:56 -03:00
Wyatt Johnson 41575303a1 feat: added Asset edge on the Comment 2018-10-01 12:20:17 -06:00
Belén Curcio 98f90e125d Merge branch 'next' into next-profile 2018-10-01 14:34:31 -03:00
Belén Curcio c462bcfe68 Setting COMMENTS as activeTab 2018-10-01 14:33:41 -03:00
Belén Curcio abb6f3aea6 Setting CommentID 2018-10-01 14:12:05 -03:00
Belén Curcio 639b439f02 deleting old snap 2018-09-28 11:41:28 -03:00
Chi Vinh Le ccb6f347ae test: use baseComment and baseAsset in fixtures 2018-09-27 17:48:10 +02:00
Belén Curcio 465603526e No need for local state for now 2018-09-27 11:47:55 -03:00
Belén Curcio 073036e24f Merge branch 'next' of github.com:coralproject/talk into admin
* 'next' of github.com:coralproject/talk:
  feat: initial comment count support (#1903)
2018-09-27 11:45:37 -03:00
Belén Curcio 2c66143d39 Routing, Navigation, Styles 2018-09-27 11:44:02 -03:00
Belén Curcio 708bfe17a3 using found withRouter 2018-09-27 11:20:34 -03:00
Belén Curcio adee5377c9 Mapping /admin as /admin.html in devMode 2018-09-27 10:50:25 -03:00
Belén Curcio 929fa8ca31 Adding found 2018-09-27 10:37:09 -03:00
Chi Vinh Le 3ffdb09afe fix: lint 2018-09-27 15:18:21 +02:00
Chi Vinh Le 2e9d0a21fe test: simplify tests 2018-09-27 15:02:53 +02:00
Chi Vinh Le d49a30c50a fix: pass settings to deeper ReplyListContainer 2018-09-27 14:56:28 +02:00
Kiwi c23708af14 Merge branch 'next' into next-readmore 2018-09-27 13:43:41 +02:00
Wyatt Johnson 9966d5a644 fix: remove debug 2018-09-26 17:49:01 -06:00
Wyatt Johnson bc447dbde0 fix: test updates 2018-09-26 17:48:24 -06:00
Wyatt Johnson 5acd19790a feat: replaced respect with reaction and added some options! 2018-09-26 16:06:35 -06:00
Belén Curcio 16cbbe8d2c Adding spected 2018-09-26 17:23:54 -03:00
Belén Curcio 210146e998 More snapshots 2018-09-26 17:13:28 -03:00
Belén Curcio 66c3a48668 It was the optimistic response 2018-09-26 17:07:38 -03:00
Belén Curcio fd01fec70b Adding actionCounts to the fixtures 2018-09-26 17:03:01 -03:00
Belén Curcio 06ed324393 Merge branch 'next-respect' of github.com:coralproject/talk into next-respect
* 'next-respect' of github.com:coralproject/talk:
  fix: linting
  feat: initial comment count support (#1903)
2018-09-26 16:37:51 -03:00
Belén Curcio 473e41cdc4 Updated snapshots 2018-09-26 16:37:30 -03:00
Belén Curcio 2f361d4437 Merge branch 'admin' of github.com:coralproject/talk into admin
* 'admin' of github.com:coralproject/talk: (23 commits)
  [next] SSO Refactor (#1912)
  Upgrade rte (#1906)
  review: fixes
  Simplify getLevelClassName
  Refactor indent level className
  Remove unused line
  Give last level a display name
  More comments
  More comments
  Add some comments
  More tests
  Implement local reply list for last threading level
  fix: test fixes
  fix: test patches
  fix: fixed issues with sorting
  fix: addressed cursor issue
  fix: removed dead code comment
  fix: updated comment
  feat: prime current user in user cache
  feat: added root parent edge
  ...
2018-09-26 16:33:07 -03:00
Belén Curcio 4dc46f7fee Adding Found Relay to the Admin side 2018-09-26 16:32:45 -03:00
Wyatt Johnson 3343605957 fix: linting 2018-09-26 13:31:15 -06:00
Wyatt Johnson fa240376b5 Merge branch 'next' into next-respect 2018-09-26 13:29:45 -06:00
Wyatt Johnson 20170333ed feat: initial comment count support (#1903) 2018-09-26 19:23:54 +00:00
Belén Curcio f5c8b455f1 Adding respect count 2018-09-26 15:18:12 -03:00
Belén Curcio 6dea28ba74 Merge branch 'next' of github.com:coralproject/talk into next-respect
* 'next' of github.com:coralproject/talk:
  [next] SSO Refactor (#1912)
2018-09-26 15:11:27 -03:00
Wyatt Johnson e127648a51 Merge branch 'next' into next-readmore 2018-09-26 16:27:40 +00:00
Wyatt Johnson 4b4b68b885 Merge branch 'next' into admin 2018-09-26 16:27:22 +00:00
Wyatt Johnson 5c284ba82b Merge branch 'next' into next-comment-counts 2018-09-26 16:27:17 +00:00
Wyatt Johnson 35787c15af Merge branch 'next' into next-profile 2018-09-26 16:27:10 +00:00
Wyatt Johnson b916914faa [next] SSO Refactor (#1912)
* feat: support dual sso/jwt auth

* feat: move verifier logic to seperate strategy

* fix: adjusted tests and removed aud claim

* fix: cleanup
2018-09-26 16:26:44 +00:00
Belén Curcio 1e8a8d306c Merge branch 'next' into admin 2018-09-26 13:15:41 -03:00
Wyatt Johnson 411f5bc302 Merge branch 'next' into next-respect 2018-09-26 10:15:37 -06:00
Belén Curcio 6e374aba8f Respect Button fully working 2018-09-25 20:05:26 -03:00
Belén Curcio 6475f0c0f6 Testing my actionPresence 2018-09-25 19:27:30 -03:00
Belén Curcio d03583df5e Adding Delete Reaction 2018-09-25 19:05:27 -03:00
Belén Curcio 7b85197174 Respect a comment 2018-09-25 18:58:09 -03:00
Belén Curcio f7f24a37dd Performing respect 2018-09-25 18:35:41 -03:00
Belén Curcio c2023672d3 Adding creating CreateCommentReactionMutation 2018-09-25 18:16:31 -03:00
Belén Curcio 05f7dbd115 Merge branch 'next-respect' of github.com:coralproject/talk into next-respect
* 'next-respect' of github.com:coralproject/talk:
  Upgrade rte (#1906)
  fix: patch for sort bug
  feat: added dontAgree create/delete mutations
  Simplify getLevelClassName
  Refactor indent level className
  fix: cleanup of comments service
  Remove unused line
  feat: added flag creation and deletion mutations
  fix: addressed test updates
  feat: support deleting comment reactions
  Give last level a display name
  More comments
  feat: added reaction adding mutation
  fix: renamed, middleware fixes
  More comments
  Add some comments
  More tests
  Implement local reply list for last threading level
  fix: restricted action counts on Asset's
  Implement LocalReplyListContainer
2018-09-25 18:04:30 -03:00
Belén Curcio b664b9abc9 Adding Respect Button UI 2018-09-25 18:03:56 -03:00
Chi Vinh Le e3a9f0f89b Add tests 2018-09-25 21:49:38 +02:00
Chi Vinh Le b9c3340026 Adapt snapshots 2018-09-25 21:46:38 +02:00
Chi Vinh Le b5b3c66d61 Add tests 2018-09-25 21:42:15 +02:00
Chi Vinh Le b6554b344c Implement Show Conversation Link 2018-09-25 21:42:15 +02:00
Belén Curcio bbf98d0b67 First iteration of admin 2018-09-25 15:09:43 -03:00
Belén Curcio 45802c651e Merge branch 'next' into next-profile 2018-09-25 14:15:14 -03:00
Belén Curcio 45e942a345 Adding styling 2018-09-25 14:13:54 -03:00
Belén Curcio 2f492c1f83 Merge branch 'next-profile' of github.com:coralproject/talk into next-profile
* 'next-profile' of github.com:coralproject/talk:
  Simplify getLevelClassName
  Refactor indent level className
  Remove unused line
  Give last level a display name
  More comments
  More comments
  Add some comments
  More tests
  Implement local reply list for last threading level
  Implement LocalReplyListContainer
2018-09-25 13:43:11 -03:00
Kiwi 122b9e9871 Merge pull request #1901 from coralproject/next-server-threading
[next] Parent Threading
2018-09-25 18:38:23 +02:00
Belén Curcio 3edaa6bf2d Changes 2018-09-25 13:37:22 -03:00
Wyatt Johnson 9326016e98 Merge branch 'next' into next-respect 2018-09-25 16:26:26 +00:00
Wyatt Johnson 1b75b46e64 Merge branch 'next' into next-comment-counts 2018-09-25 16:26:11 +00:00
Wyatt Johnson 192c8e63cf Merge branch 'next' into next-server-threading 2018-09-25 16:25:56 +00:00
Kiwi 04b4b7e715 Upgrade rte (#1906) 2018-09-25 16:25:42 +00:00
Belén Curcio 4c898e8825 Merge branch 'next' into next-profile 2018-09-25 13:08:30 -03:00
Wyatt Johnson bd56a39d73 review: fixes 2018-09-25 10:06:05 -06:00
Belén Curcio 303c7489e4 Changes 2018-09-25 11:29:07 -03:00
Belén Curcio 9852c4e62f Channges 2018-09-25 11:20:57 -03:00
Belén Curcio 72bdf5d40b Changes 2018-09-25 11:08:31 -03:00
Belén Curcio 5695bee776 wip 2018-09-25 10:59:41 -03:00
Belén Curcio ff0f00a486 initial work 2018-09-24 19:52:08 -03:00
Wyatt Johnson 3a91a89488 Merge branch 'next' into next-comment-counts 2018-09-24 21:45:17 +00:00
Wyatt Johnson 2ce955bc96 Merge branch 'next' into next-server-threading 2018-09-24 21:45:11 +00:00
Wyatt Johnson a318b56233 fix: patch for sort bug 2018-09-24 15:38:12 -06:00
Wyatt Johnson 8c192d283d Merge branch 'next' into next-respect 2018-09-24 20:47:46 +00:00
Kiwi c280ff9e21 Merge pull request #1904 from coralproject/local-reply-list
[next] Implement LocalReplyList for last level replies
2018-09-24 22:27:48 +02:00
Wyatt Johnson 7cce84b7f8 feat: added dontAgree create/delete mutations 2018-09-24 14:25:48 -06:00
Chi Vinh Le 02909fb399 Simplify getLevelClassName 2018-09-24 22:16:10 +02:00
Chi Vinh Le 460429d991 Refactor indent level className 2018-09-24 22:11:03 +02:00
Wyatt Johnson 3c640f87d3 fix: cleanup of comments service 2018-09-24 14:07:44 -06:00
Chi Vinh Le 8c2d811b55 Remove unused line 2018-09-24 22:04:03 +02:00
Wyatt Johnson 3cdaa284ed feat: added flag creation and deletion mutations 2018-09-24 13:46:13 -06:00
Wyatt Johnson a19ac4e2cc fix: addressed test updates 2018-09-24 13:08:16 -06:00
Wyatt Johnson 10748347b9 feat: support deleting comment reactions 2018-09-24 12:50:30 -06:00
Chi Vinh Le 526a3c634a Give last level a display name 2018-09-24 20:41:50 +02:00
Chi Vinh Le 7139563ceb More comments 2018-09-24 20:36:39 +02:00
Wyatt Johnson dee14709c8 feat: added reaction adding mutation 2018-09-24 12:34:27 -06:00
Wyatt Johnson 8c3b0071c2 fix: renamed, middleware fixes 2018-09-24 12:32:57 -06:00
Chi Vinh Le dc3ea366bc More comments 2018-09-24 20:24:24 +02:00
Chi Vinh Le acdcd16b4d Add some comments 2018-09-24 20:16:29 +02:00
Chi Vinh Le 6e743b9b75 More tests 2018-09-24 20:13:54 +02:00
Chi Vinh Le 62a1fc5901 Implement local reply list for last threading level 2018-09-24 20:08:11 +02:00
Wyatt Johnson 936347e8e4 fix: restricted action counts on Asset's 2018-09-24 11:36:44 -06:00
Belén Curcio 661f392281 Adding the difss 2018-09-24 10:58:40 -03:00
Belén Curcio 2502dfedd2 Show profile tab if user is signed in 2018-09-24 10:54:45 -03:00
Belén Curcio 0cea633b0b Merge branch 'next' of github.com:coralproject/talk into next-profile
* 'next' of github.com:coralproject/talk:
  [next] Embed plus (#1877)
  [next] Permit (#1899)
  Use upstream @types/recompose
  [next] Limited threading (#1894)
  More clarifying comments
  Improve cross browser support
  Don't use css capitalize
  Upgrade RTE to fix a paste issue
  [next] Resubscribe local state (#1884)
  Styling fixes
  WIP
  Update snapshots
  Namespace ids
  Move styles to button
2018-09-24 10:30:20 -03:00
Wyatt Johnson d8417eda2e feat: introduce asset action count caching 2018-09-23 20:43:43 -06:00
Wyatt Johnson 0e25c8d446 Merge branch 'next' into next-respect 2018-09-24 02:30:12 +00:00
Wyatt Johnson d072df8043 fix: test fixes 2018-09-23 18:16:47 -06:00
Wyatt Johnson a8f315db4b fix: test patches 2018-09-23 18:08:24 -06:00
Wyatt Johnson a8ccf29bea fix: fixed issues with sorting 2018-09-23 17:28:15 -06:00
Wyatt Johnson 5dd9d2d509 feat: initial comment count support 2018-09-23 15:20:11 -06:00
Wyatt Johnson 8589993401 fix: addressed cursor issue 2018-09-22 00:57:40 -06:00
Wyatt Johnson 50a691c1e5 fix: removed dead code comment 2018-09-22 00:50:55 -06:00
Wyatt Johnson 32fdc51506 fix: updated comment 2018-09-22 00:49:48 -06:00
Wyatt Johnson 2edd923b9e feat: prime current user in user cache 2018-09-22 00:45:58 -06:00
Wyatt Johnson ae60311e85 feat: added root parent edge 2018-09-22 00:45:48 -06:00
Wyatt Johnson 1702040537 feat: added parent/parents edges 2018-09-22 00:26:09 -06:00
Wyatt Johnson 0fbd27cdcb fix: fixes for comment counting 2018-09-21 23:52:28 -06:00
Chi Vinh Le 4107fd367f Implement LocalReplyListContainer 2018-09-22 01:05:25 +02:00
Kiwi 65156c0528 Merge pull request #1897 from coralproject/improve-cross-browser-support
[next] Improve cross browser support
2018-09-22 01:05:05 +02:00
Kiwi 30d0541c69 Merge branch 'next' into improve-cross-browser-support 2018-09-22 00:55:03 +02:00
Kiwi fa17582e93 Merge pull request #1900 from coralproject/update-types-recompose
[next] Use upstream @types/recompose
2018-09-22 00:54:51 +02:00
Kiwi 007e6f5e66 Merge branch 'next' into improve-cross-browser-support 2018-09-22 00:54:14 +02:00
Wyatt Johnson 6e8c0df9fe Merge branch 'next' into update-types-recompose 2018-09-21 22:44:05 +00:00
Kiwi 106a5d36ed [next] Embed plus (#1877)
* Implement StreamEmbed instance and rename library to coral

* Add article & articleButton.html, only show embed htmls in production

* Respect assetURL

* Add tests

* Add parseHashQuery

* Fix permalink query and integration tests

* Fix permalink URL

* Remove optionalparams from pym

* Scroll when showing permalink view

* Implement autoRender

* AutoRender immediately when render permalink

* Add test for `showPermalink` event

* Add comment
2018-09-21 22:43:28 +00:00
Wyatt Johnson 85af8d1bbf [next] Permit (#1899)
* feat: replaced custom auth extraction logic with permit

* fix: fixed tests
2018-09-21 22:06:46 +00:00
Wyatt Johnson daee96dc4c review: applied some review changes 2018-09-21 15:29:34 -06:00
Wyatt Johnson ce1002b16c fix: updated @types/mongodb 2018-09-21 14:55:00 -06:00
Wyatt Johnson ebe43a28e6 feat: presence and count improvements 2018-09-21 13:16:21 -06:00
Wyatt Johnson 6b814cee0d fix: patched issues with static 2018-09-21 12:50:21 -06:00
Chi Vinh Le a996c5da2b Use upstream @types/recompose 2018-09-21 19:02:27 +02:00
Wyatt Johnson 029f4641d0 Merge branch 'next' into improve-cross-browser-support 2018-09-21 15:58:33 +00:00
Kiwi 18e6638162 [next] Limited threading (#1894)
* Implement limited threading

* Adapt snapshots

* Test threading
2018-09-21 15:57:33 +00:00
Wyatt Johnson bc78efc428 fix: updated snapshots 2018-09-21 09:40:00 -06:00
Wyatt Johnson a14c0205aa Merge branch 'next' into next-respect 2018-09-20 23:36:24 -06:00
Wyatt Johnson aff29d7818 fix: removed unused types 2018-09-20 23:35:56 -06:00
Wyatt Johnson be3ef78875 feat: added action counts to graph 2018-09-20 23:35:56 -06:00
Wyatt Johnson af22b9808b feat: added action deletion 2018-09-20 15:14:02 -06:00
Wyatt Johnson 7eb1755c5e feat: expanded action counts 2018-09-20 15:13:46 -06:00
Kiwi 7ae3e4886a Merge branch 'next' into improve-cross-browser-support 2018-09-20 22:54:59 +02:00
Chi Vinh Le 6df0568378 More clarifying comments 2018-09-20 22:53:34 +02:00
Chi Vinh Le 8efeb3106f Improve cross browser support 2018-09-20 22:10:06 +02:00
Belén Curcio f87b2b05ba Merge branch 'next-profile' of github.com:coralproject/talk into next-profile
* 'next-profile' of github.com:coralproject/talk:
  fix: linting
  fix: server fixes
2018-09-20 16:00:00 -03:00
Kiwi 8b1aec5f24 Merge pull request #1895 from coralproject/rte-upgrade
[next] Upgrade RTE to fix a paste issue
2018-09-20 18:35:55 +02:00
Kiwi 7e10f4a7bb Merge branch 'next' into rte-upgrade 2018-09-20 18:15:03 +02:00
Kiwi 2f1c4fb9a3 Merge pull request #1896 from coralproject/no-capitalize-css
[next] Don't use css capitalize
2018-09-20 18:14:51 +02:00
Chi Vinh Le 2a640d2bbc Don't use css capitalize 2018-09-20 17:23:26 +02:00
Chi Vinh Le 6c75298b8c Upgrade RTE to fix a paste issue 2018-09-20 17:06:31 +02:00
Wyatt Johnson 8d86900376 feat: added support for action creation via edit 2018-09-18 16:59:32 -06:00
Wyatt Johnson 395cfe4ade feat: added reaction configuration 2018-09-18 16:59:21 -06:00
Wyatt Johnson 1d98bc78f2 Merge branch 'next' into next-respect 2018-09-18 15:56:38 -06:00
Kiwi dbd7f4f820 [next] Resubscribe local state (#1884)
* Resubscribe local state

* Don't pass context
2018-09-18 14:59:51 -06:00
Kiwi 4e9b00934d Merge pull request #1858 from coralproject/ui-tab
[next] Tabs Components - Tab, TabBar, TabPane, TabContent
2018-09-18 21:08:36 +02:00
Wyatt Johnson 8283932c29 fix: linting 2018-09-17 17:16:43 -06:00
Wyatt Johnson 9044fc2400 fix: server fixes 2018-09-17 17:16:10 -06:00
Chi Vinh Le 2af01e5f4b Styling fixes 2018-09-17 22:12:58 +02:00
Chi Vinh Le b00a7f9618 WIP 2018-09-17 21:12:27 +02:00
Chi Vinh Le 0983d31c10 Update snapshots 2018-09-17 21:01:20 +02:00
Chi Vinh Le 0b0aa7b1ee Namespace ids 2018-09-17 20:56:42 +02:00
Chi Vinh Le 3314bc3ba6 Move styles to button 2018-09-17 20:52:36 +02:00
Belén Curcio fa67da7183 Adding translations 2018-09-17 13:30:13 -03:00
Belén Curcio 5bf6161e46 Adding div as mapping, since div cannot be descendant of p 2018-09-17 11:04:47 -03:00
Belén Curcio 601436cf99 Updated snapshots 2018-09-14 17:56:32 -03:00
Belén Curcio cb2cfe1581 Adding View Conversation functionality and styling 2018-09-14 17:52:55 -03:00
Belén Curcio c199bede53 Merge branch 'next' of github.com:coralproject/talk into next-profile
* 'next' of github.com:coralproject/talk:
2018-09-14 13:11:05 -03:00
Kim Gardner 1bd31285a6 Merge branch 'next' into ui-tab 2018-09-14 12:04:58 -04:00
Belén Curcio 52c8c8a625 Styling 2018-09-14 13:03:26 -03:00
Belén Curcio f391d7b7ad Working comment history, styling in progress 2018-09-14 12:37:25 -03:00
Belén Curcio ced45a914c Comment History Working 2018-09-14 12:05:19 -03:00
Belén Curcio 60d61d40b6 Comment History 2018-09-14 11:35:01 -03:00
Kiwi 4f9e1ba535 Merge pull request #1873 from coralproject/reorganize2
[next] Reorganize 2
2018-09-14 16:21:16 +02:00
Kiwi b044b0f225 Merge branch 'next' into reorganize2 2018-09-14 16:03:48 +02:00
Belén Curcio 935c2ff629 WIP 2018-09-14 10:43:40 -03:00
Belén Curcio 1009045c4c Working tabs 2018-09-14 10:13:42 -03:00
Belén Curcio 05296d4802 Adding tabs to the stream <3 2018-09-14 10:03:25 -03:00
Belén Curcio a30e3ce526 Merge branch 'next-edit' of github.com:coralproject/talk into next-profile
* 'next-edit' of github.com:coralproject/talk:
  Implement SetActiveTabMutation
  Change translation strings
  Add activeTab to local state
  Move files into tab structure
2018-09-14 09:56:14 -03:00
Belén Curcio 2969dad58b Merge branch 'next' of github.com:coralproject/talk into ui-tab
* 'next' of github.com:coralproject/talk:
  Adapt snapshot
  Fix lint
  Only show edit button for the author
  Use Message Component
  Adapt integration test
  Fix integration test
  Add edited marker
  fix: remove assetID from client queries to edit comment
  feat: merge metadata during edit
  fix: remove assetID from EditCommentInput
  Fix linting
  Add integration tests
  Add integration test
  More unit tests
  Fix lint and test
  Implement edit
2018-09-14 09:50:23 -03:00
Belén Curcio a68ca34d62 Merge branch 'next' of github.com:coralproject/talk into next-profile
* 'next' of github.com:coralproject/talk:
  Adapt snapshot
  Fix lint
  Only show edit button for the author
  Use Message Component
  Adapt integration test
  Fix integration test
  Add edited marker
  fix: remove assetID from client queries to edit comment
  feat: merge metadata during edit
  fix: remove assetID from EditCommentInput
  Fix linting
  Add integration tests
  Add integration test
  More unit tests
  Fix lint and test
  Implement edit
2018-09-14 09:49:07 -03:00
Belén Curcio 7aaffdc887 Merge pull request #1869 from coralproject/reorganize
[next] Reorganize stream embed to tab oriented folder structure
2018-09-14 09:43:12 -03:00
Belén Curcio 8eeb9db48f Merge pull request #1862 from coralproject/next-edit
[next] Edit Comment
2018-09-14 09:42:06 -03:00
Belén Curcio 38f1068a77 Updates 2018-09-14 09:33:16 -03:00
Chi Vinh Le 4b1e2dd2fd Implement SetActiveTabMutation 2018-09-13 21:49:30 +02:00
Chi Vinh Le a3526ab241 Change translation strings 2018-09-13 21:45:49 +02:00
Belén Curcio 23a5243611 Merge branch 'next' of github.com:coralproject/talk into ui-tab
* 'next' of github.com:coralproject/talk:
  new snapshots after rebuilding the schema
  new snapshots after rebuilding the schema
  updated status
  changes
  Updated tests
  Updated tests
  Updated tests
  Adding MessageIcon
  Updated colors
  Updated snapshots
  Supporting icons with ValidationMessages
  Updated API
  Adding Message Matching the exact values
2018-09-13 14:27:42 -03:00
Chi Vinh Le ecc9eadc67 Add activeTab to local state 2018-09-13 18:29:22 +02:00
Chi Vinh Le db483849dd Move files into tab structure 2018-09-13 18:29:22 +02:00
Chi Vinh Le 72f5af9f3b Adapt snapshot 2018-09-13 18:29:05 +02:00
Chi Vinh Le ba2c2c32b2 Fix lint 2018-09-13 18:20:55 +02:00
Chi Vinh Le 3955c960bf Only show edit button for the author 2018-09-13 16:42:04 +02:00
Belén Curcio bb7007214d Adding button 2018-09-13 09:32:05 -03:00
Chi Vinh Le c8cd68c6b7 Use Message Component 2018-09-12 22:01:43 +02:00
Kiwi 185b3de8e1 Merge pull request #1852 from coralproject/ui-message
[next] Adding a Message component
2018-09-12 21:44:25 +02:00
Chi Vinh Le aa904ab0e2 Merge branch 'next' into next-edit 2018-09-12 21:44:16 +02:00
Belen Curcio 1ccb789b97 new snapshots after rebuilding the schema 2018-09-12 15:53:54 -03:00
Belen Curcio ed5ea3b759 new snapshots after rebuilding the schema 2018-09-12 15:53:07 -03:00
Belen Curcio 2c8bdc6c9a updated status 2018-09-12 15:40:04 -03:00
Chi Vinh Le 32e56e805c Adapt integration test 2018-09-12 20:35:07 +02:00
Chi Vinh Le 632c4b263e Merge branch 'next' into next-edit 2018-09-12 20:25:44 +02:00
Belén Curcio 55b65e6d6a Merge branch 'next' into ui-tab 2018-09-12 15:15:25 -03:00
Belen Curcio e6f8b7623b Adding docs and changes 2018-09-12 15:10:14 -03:00
Belen Curcio eedeef9617 Merge branch 'ui-message' of github.com:coralproject/talk into ui-message 2018-09-12 13:14:41 -03:00
Belen Curcio 6f367a0078 changes 2018-09-12 13:13:09 -03:00
Wyatt Johnson ff9c6af7c6 Merge branch 'next' into ui-message 2018-09-12 16:05:37 +00:00
Kiwi 8b09b52be8 [next] Start a clean session when user logs in / out (#1853)
* Clear user session after login / logout

* Filename cases

* Improve type checking

* Apply suggestions
2018-09-12 16:04:54 +00:00
Chi Vinh Le 2292e5d53f Fix integration test 2018-09-12 17:07:36 +02:00
Chi Vinh Le 0c045eff0a Merge branch 'next-edit' of https://github.com/coralproject/talk into next-edit 2018-09-12 17:05:40 +02:00
Chi Vinh Le b1e7c6d2d4 Add edited marker 2018-09-12 17:05:31 +02:00
Belén Curcio 4d7edd24b4 Merge branch 'ui-tab' of github.com:coralproject/talk into ui-tab
* 'ui-tab' of github.com:coralproject/talk:
  Adapt snapshot
  Fix types
  Pending comment blur
2018-09-12 09:22:14 -03:00
Belén Curcio 1f3523c7f3 Merge branch 'next' into ui-tab 2018-09-12 09:21:57 -03:00
Belén Curcio d04b9d818c Test added 2018-09-12 09:20:50 -03:00
Belén Curcio cc67f2f572 Changes 2018-09-12 09:00:38 -03:00
Belén Curcio 19b1a7882c Changes 2018-09-12 08:53:22 -03:00
Wyatt Johnson b1aac28eec fix: remove assetID from client queries to edit comment 2018-09-11 17:07:42 -06:00
Wyatt Johnson 8b83a0de41 Merge branch 'next' into next-respect 2018-09-11 22:50:37 +00:00
Wyatt Johnson 76c222dbed fix: linting 2018-09-11 16:50:10 -06:00
Wyatt Johnson 7a4bf847b0 feat: merge metadata during edit 2018-09-11 16:35:12 -06:00
Wyatt Johnson a794fe8cd7 fix: remove assetID from EditCommentInput 2018-09-11 16:35:00 -06:00
Wyatt Johnson 7dbd2fae91 feat: refactored group_id -> reason 2018-09-11 15:53:08 -06:00
Chi Vinh Le cf070ddb0f Merge branch 'next' into next-edit 2018-09-11 21:40:47 +02:00
Kiwi 26b59fc17c Merge pull request #1855 from coralproject/pending-blur
[next] Pending Comment Blur
2018-09-11 21:21:11 +02:00
Chi Vinh Le 7fa0132211 Fix linting 2018-09-11 21:20:36 +02:00
Chi Vinh Le 8a25e68266 Add integration tests 2018-09-11 21:16:22 +02:00
Belén Curcio 5a8ce7655c Updated tests 2018-09-11 13:09:49 -03:00
Chi Vinh Le 7b221c40a0 Add integration test 2018-09-11 18:03:54 +02:00
Chi Vinh Le 170fb47dae More unit tests 2018-09-11 17:32:46 +02:00
Chi Vinh Le 4e63858c66 Fix lint and test 2018-09-11 17:25:40 +02:00
Belén Curcio f7fa1dae23 Updated tests 2018-09-11 10:17:46 -03:00
Belén Curcio 91d421ad46 Updated tests 2018-09-11 10:01:14 -03:00
Belén Curcio 1ca2c5ec95 Merge branch 'ui-message' of github.com:coralproject/talk into ui-message
* 'ui-message' of github.com:coralproject/talk: (26 commits)
  Adapt snapshots
  Disable RTE when submitting
  Wrap long words
  Disable submit button when empty
  Fix test
  Fix types and tests
  Remove outdated workarounds
  Remove accidently commited files
  Move uuid generation to TalkContext
  Full PromisifiedStorage + Simplifications
  Update package-lock
  Return null cursor when creating comment
  Change commentEdge to edge
  Update snapshots
  Fix types
  Reply opens auth popup when not logged in
  Better tests
  Stream should work outside of iframe for debugging
  Add test
  Focus RTE when opening reply
  ...
2018-09-11 09:58:16 -03:00
Belén Curcio a35ee79098 Adding MessageIcon 2018-09-11 09:57:55 -03:00
Belén Curcio b5db80b1e1 Updated colors 2018-09-11 09:47:59 -03:00
Chi Vinh Le a36d944e4a Implement edit 2018-09-11 00:15:27 +02:00
Belén Curcio b608e8a521 Adding descriptions 2018-09-10 13:22:57 -03:00
Belén Curcio a8b24187cb change 2018-09-10 12:55:31 -03:00
Belén Curcio 49bfb6bcbf Merge branch 'next' of github.com:coralproject/talk into ui-tab
* 'next' of github.com:coralproject/talk: (26 commits)
  Adapt snapshots
  Disable RTE when submitting
  Wrap long words
  Disable submit button when empty
  Fix test
  Fix types and tests
  Remove outdated workarounds
  Remove accidently commited files
  Move uuid generation to TalkContext
  Full PromisifiedStorage + Simplifications
  Update package-lock
  Return null cursor when creating comment
  Change commentEdge to edge
  Update snapshots
  Fix types
  Reply opens auth popup when not logged in
  Better tests
  Stream should work outside of iframe for debugging
  Add test
  Focus RTE when opening reply
  ...
2018-09-10 12:40:29 -03:00
Belén Curcio 3b01af66b3 Two working examples, primary and secondary 2018-09-10 12:36:13 -03:00
Belén Curcio e9ab3d1d7f Working tab example 2018-09-10 12:27:00 -03:00
Kim Gardner 04d7ddf41a Merge branch 'next' into ui-message 2018-09-10 10:54:38 -04:00
Belén Curcio cb3a6b0533 Adding TabContent, TabPane 2018-09-10 11:35:56 -03:00
Belén Curcio 96515eac0c Added Color palette 2018-09-10 11:24:17 -03:00
Belén Curcio 71c5c7c64f Basic Tab usage 2018-09-10 11:13:13 -03:00
Kiwi 195d61d104 Merge pull request #1850 from coralproject/next-reply
[next] Implement Reply
2018-09-10 16:11:06 +02:00
Chi Vinh Le 89312e3d98 Adapt snapshot 2018-09-07 21:42:11 +02:00
Chi Vinh Le 7644f93e7c Fix types 2018-09-07 18:24:08 +02:00
Chi Vinh Le 5010e342df Pending comment blur 2018-09-07 18:18:39 +02:00
Belén Curcio dce2177dcd Updated snapshots 2018-09-07 13:03:56 -03:00
Belén Curcio b37ec2b944 Supporting icons with ValidationMessages 2018-09-07 12:54:22 -03:00
Chi Vinh Le 88e44b2baf Adapt snapshots 2018-09-07 17:32:15 +02:00
Chi Vinh Le a7e4af46d2 Disable RTE when submitting 2018-09-07 17:29:38 +02:00
Chi Vinh Le 8b938616c9 Wrap long words 2018-09-07 17:00:28 +02:00
Chi Vinh Le a33a1c47ab Disable submit button when empty 2018-09-07 16:29:46 +02:00
Belén Curcio 994b0f7fb3 Updated API 2018-09-07 10:56:03 -03:00
Belén Curcio e909d21039 Adding Message Matching the exact values 2018-09-07 10:23:29 -03:00
Chi Vinh Le fb1b9c51ee Fix test 2018-09-07 00:59:59 +02:00
Chi Vinh Le df664bdb73 Fix types and tests 2018-09-07 00:51:57 +02:00
Chi Vinh Le c1cefe52d0 Remove outdated workarounds 2018-09-07 00:38:19 +02:00
Chi Vinh Le b765a7c3e9 Remove accidently commited files 2018-09-07 00:36:43 +02:00
Chi Vinh Le 845fbc1b1b Move uuid generation to TalkContext 2018-09-07 00:34:17 +02:00
Wyatt Johnson 1bd841ec01 feat: initial action implementations 2018-09-06 16:24:34 -06:00
Chi Vinh Le e132087682 Full PromisifiedStorage + Simplifications 2018-09-06 23:53:29 +02:00
Chi Vinh Le 3a1b043eb7 Merge branch 'next' into next-reply 2018-09-06 21:38:20 +02:00
Kiwi 53e548d77a [next] Save Comment Draft + Pym Storage (#1843)
* Implement pym storage

* Save comment draft + test

* Apply suggestions

* Use class for PymStorage implementation

* Add some comments
2018-09-06 17:07:17 +00:00
Kiwi 0477d456a2 Integrate typescript-snapshots-plugin (#1847) 2018-09-05 22:50:01 +00:00
Chi Vinh Le 35b4040274 Update package-lock 2018-09-06 00:18:22 +02:00
Chi Vinh Le f5e0c6163d Return null cursor when creating comment 2018-09-06 00:14:47 +02:00
Chi Vinh Le 4d860ab71d Change commentEdge to edge 2018-09-06 00:09:38 +02:00
Chi Vinh Le 942bcba5a1 Update snapshots 2018-09-06 00:07:14 +02:00
Chi Vinh Le 2bf9b5f2c1 Fix types 2018-09-06 00:07:14 +02:00
Chi Vinh Le 46ff3dea89 Reply opens auth popup when not logged in 2018-09-06 00:07:14 +02:00
Chi Vinh Le 90a875f40e Better tests 2018-09-06 00:07:14 +02:00
Chi Vinh Le 441cc9d57b Stream should work outside of iframe for debugging 2018-09-06 00:06:58 +02:00
Chi Vinh Le 28c8252b63 Add test 2018-09-06 00:06:58 +02:00
Chi Vinh Le 444c86cb3c Focus RTE when opening reply 2018-09-06 00:06:58 +02:00
Chi Vinh Le 110becb075 Implement reply 2018-09-06 00:06:58 +02:00
Chi Vinh Le ee30003390 Indent comment only 2018-09-06 00:06:58 +02:00
Chi Vinh Le c96112fc8c Fix tests 2018-09-06 00:06:58 +02:00
Chi Vinh Le 31bc5fa913 WIP 2018-09-06 00:06:28 +02:00
Chi Vinh Le eb74162eef Merge branch 'next' into pym-storage 2018-09-05 23:27:59 +02:00
Wyatt Johnson 3897b06029 [next] Comment Editing (#1795)
* feat: initial impl of comment edits

* feat: added edit metadata

* review: switched out explcit null + nullable types

* fix: changed commentEdge -> edge, test comments

* [next] Tasks (#1777)

* feat: initial support for synced tenants

* fix: cleanup

* fix: logger now respects logging level

* fix: cache now ignores updates issued from itself

* feat: print subscriber count

* feat: initial moderation + validation for new comments

* fix: added Promiseable type

* feat: initial actions impl

* feat: more moderation phases

* fix: handle settings inheritence

* fix: moved settings into new file

* fix: defaults and documentation

* fix: replace merge with object spread

* feat: added integration with akismet

* fix: support tenant cache for oidc strategy

* fix: fixed compile

* fix: import ordering

* feat: added bull for queue support

* feat: support for scraping

* fix: fixes for scraper

- Implemented simple metascraper replacement (to resolve security advisory
  warning)
- Implemented simle dotize replacement (to resolve not
  working version that couldn't handle date objects)
- Plugged in asset scraping to asset creation process

* fix: handles array values

* feat: added initial scraper implementation

* feat: seperate queues but share config

* fix: simplified auth data access

* feat: moved more settings into the graph

* feat: improved mailer design

* fix: fixed issue with dotize

* fix: fixed some issues with adapter

* fix: queue cleanup

* feat: added organizationName to Tenant

* feat: email rendering

* review: support es6 imports

* fix: restore old ci step

* fix: adjusted logging messages

* fix: linting
2018-09-04 18:57:41 +00:00
Wyatt Johnson 59cf728681 [next] Tasks (#1777)
* feat: initial support for synced tenants

* fix: cleanup

* fix: logger now respects logging level

* fix: cache now ignores updates issued from itself

* feat: print subscriber count

* feat: initial moderation + validation for new comments

* fix: added Promiseable type

* feat: initial actions impl

* feat: more moderation phases

* fix: handle settings inheritence

* fix: moved settings into new file

* fix: defaults and documentation

* fix: replace merge with object spread

* feat: added integration with akismet

* fix: support tenant cache for oidc strategy

* fix: fixed compile

* fix: import ordering

* feat: added bull for queue support

* feat: support for scraping

* fix: fixes for scraper

- Implemented simple metascraper replacement (to resolve security advisory
  warning)
- Implemented simle dotize replacement (to resolve not
  working version that couldn't handle date objects)
- Plugged in asset scraping to asset creation process

* fix: handles array values

* feat: added initial scraper implementation

* feat: seperate queues but share config

* fix: simplified auth data access

* feat: moved more settings into the graph

* feat: improved mailer design

* fix: fixed issue with dotize

* fix: fixed some issues with adapter

* fix: queue cleanup

* feat: added organizationName to Tenant

* feat: email rendering

* review: support es6 imports

* fix: restore old ci step

* fix: adjusted logging messages
2018-09-04 18:47:20 +00:00
Wyatt Johnson 76d198f2a6 [next] Production Usage (#1808)
* feat: docker + compression support + headers

* fixed bug with dependancies
2018-09-04 18:36:17 +00:00
Chi Vinh Le aa2b70fd8c Save comment draft + test 2018-09-03 12:16:01 +02:00
Chi Vinh Le ccf91480da Implement pym storage 2018-09-03 09:28:09 +02:00
Kim Gardner bcf24cbb4b Merge pull request #1837 from coralproject/relay-1.7
[next] Implement PostComment Mutation, Upgrade Relay
2018-08-31 13:49:14 -04:00
Chi Vinh Le a4002b262b Keep time! 2018-08-31 18:34:00 +02:00
Chi Vinh Le 51e6d5b29e Test optimistic response 2018-08-31 18:14:25 +02:00
Chi Vinh Le 0135cb9cc3 Add todo 2018-08-31 17:40:38 +02:00
Chi Vinh Le 7001510049 Compile before lint 2018-08-31 17:34:52 +02:00
Chi Vinh Le 4c1f2e72cb Use createSinonStub 2018-08-31 17:24:42 +02:00
Chi Vinh Le 25e8cb517b Add integration test 2018-08-31 17:15:40 +02:00
Chi Vinh Le 428c35a931 Hide forward ref and fix tests 2018-08-31 16:11:25 +02:00
Chi Vinh Le 792ceed2ad No more patched packages! 2018-08-31 02:28:53 +02:00
Chi Vinh Le aeada424fa Use stock relay-runtime times 2018-08-31 02:15:41 +02:00
Chi Vinh Le 942ce366b8 Finish porting to relay-1.7 including types 2018-08-30 23:49:38 +02:00
Chi Vinh Le 0dcff65344 Upgrade react-relay types 2018-08-30 16:43:01 +02:00
Chi Vinh Le b83d965d6c Better naming 2018-08-30 16:15:56 +02:00
Chi Vinh Le 09caad7bdd Keep future added values 2018-08-30 16:08:42 +02:00
Chi Vinh Le 570bf4815d Make type checking part of the linting 2018-08-30 15:53:00 +02:00
Chi Vinh Le e2bcc4631c Fix remaining type issues 2018-08-30 15:51:06 +02:00
Chi Vinh Le 7ab70b8484 Update relay-runtime types 2018-08-30 15:41:08 +02:00
Chi Vinh Le 0497718764 WIP 2018-08-30 10:23:13 +02:00
Chi Vinh Le c66c5a1ade Implement post comment mutation 2018-08-30 10:23:03 +02:00
Kim Gardner 60afa5518a Merge pull request #1832 from coralproject/integration-tests-with-translations
[next] Use translations in integration tests
2018-08-29 17:08:03 -04:00
Chi Vinh Le a99fe3c0ff Integrate actual translations into integration tests 2018-08-29 22:55:13 +02:00
Kim Gardner 0b3a67601c Merge pull request #1829 from coralproject/rte-next
[next] Support for Rich Text
2018-08-29 16:01:11 -04:00
Chi Vinh Le 13c196983f Implement RTE and HTMLContent 2018-08-29 16:03:04 +02:00
Chi Vinh Le 885a724876 Make each test independent 2018-08-29 16:02:31 +02:00
Chi Vinh Le fbb194cdac Fix linter issue 2018-08-29 16:01:51 +02:00
Kim Gardner bacd09e5c7 Merge pull request #1793 from coralproject/auth-views
[next] Auth views
2018-08-28 13:50:59 -04:00
Chi Vinh Le 9c5dd285a3 Readd translations 2018-08-28 17:20:44 +02:00
Chi Vinh Le 9945c099a7 Add integration tests 2018-08-28 01:35:13 +02:00
Chi Vinh Le 99e34979d1 Add test 2018-08-27 21:58:28 +02:00
Chi Vinh Le dcb3c23f56 Test, Colorize TextFields, disable on submit 2018-08-27 21:36:36 +02:00
Chi Vinh Le 1684ed44ef Remove obsolete snapshot 2018-08-27 21:04:15 +02:00
Chi Vinh Le 334c8933c9 Update snapshots 2018-08-27 21:02:43 +02:00
Chi Vinh Le 5381b75a49 Update snapshots 2018-08-27 20:50:46 +02:00
Chi Vinh Le 17563824fd Use polling 2018-08-27 18:17:09 +02:00
Chi Vinh Le 123bbf6e65 Give more more time 2018-08-27 17:37:32 +02:00
Chi Vinh Le 5a87e6abc6 Give more time for render 2018-08-27 17:36:43 +02:00
Chi Vinh Le f57773393a Better popup size when loading fonts 2018-08-27 17:36:15 +02:00
Chi Vinh Le 9bea53911f Adapt Forgot and Reset Password 2018-08-27 17:15:20 +02:00
Chi Vinh Le 5a26b319d8 Adapt sign up plus validation and translations 2018-08-27 16:49:58 +02:00
Chi Vinh Le 39edec79cb Adapt SignIn 2018-08-27 15:51:59 +02:00
Chi Vinh Le b7208cfa44 Fix typography merge conflict 2018-08-27 14:39:18 +02:00
Chi Vinh Le d1d993d0b7 Updated fluent 2018-08-27 14:33:31 +02:00
Chi Vinh Le 9cef7044c7 Design improvements 2018-08-27 14:11:15 +02:00
Chi Vinh Le 3dc3e1435a Use HorizontalGutter component, simplify Flex 2018-08-24 19:11:56 +02:00
Chi Vinh Le 10df1de98e Pass rest of props 2018-08-24 15:41:20 +02:00
Chi Vinh Le eab8f0e18b Fix props 2018-08-24 15:40:34 +02:00
Chi Vinh Le b2b9b20efb Revert and fix props 2018-08-24 15:40:20 +02:00
Chi Vinh Le c419ee5ad1 Allo all htmlattribtues 2018-08-24 15:39:25 +02:00
Chi Vinh Le 130c7bac62 Fix formfield by using Flex 2018-08-24 15:38:12 +02:00
Chi Vinh Le 53cc69ac1f Fix formfield imports 2018-08-24 15:30:47 +02:00
Chi Vinh Le d8b5b00adc Fix fragments and queries 2018-08-24 14:11:09 +02:00
Chi Vinh Le 65a212b531 Fix UserBox 2018-08-24 11:17:09 +02:00
Chi Vinh Le 5501ee7832 Simplify signOff rest 2018-08-23 08:55:16 +02:00
Chi Vinh Le 0455293c0b Also add AutoHeightContainer to the password forms 2018-08-22 19:31:44 +02:00
Chi Vinh Le 89749926c6 Auto adapt height of popup 2018-08-22 19:29:25 +02:00
Belén Curcio 21cad87ffd Updated snapshots 2018-08-22 10:11:37 -03:00
Belén Curcio 6fa28d6410 Errors handled by the forms 2018-08-22 10:06:50 -03:00
Belén Curcio 7b5a87207b removing input from user signOff 2018-08-22 09:48:06 -03:00
Belén Curcio e9db68269b Adding styling in the main auth App 2018-08-22 09:41:41 -03:00
Belén Curcio 94a42fc57f changes 2018-08-22 09:23:02 -03:00
Belén Curcio bace76decc changes 2018-08-21 22:47:39 -03:00
Belén Curcio ec5cdb5681 Merge branch 'auth-views' of github.com:coralproject/talk into auth-views
* 'auth-views' of github.com:coralproject/talk: (27 commits)
  feat: added token blacklisting
  Compile schema when watching client (#1809)
  TSLint imports ordered
  Missing console.log
  Adding variable to the scope and contemplating undefined from the BE
  Tests updated
  Updated tests and latest changes
  User signedIn enters the stream
  Adding test for FormField, InputDescription and Spinner
  Updated docs
  Adding Spinner Component to UI and some corrections to the docs
  Working validation from the server using CallOuts
  Working validation from the server using CallOuts
  Handling error messages
  Working type submit for forms - Button Component
  Hitting the delete route and deleting the token
  SignOff Mutation
  Progress
  Working signin and comment
  Able to Sign In
  ...
2018-08-21 22:18:48 -03:00
Wyatt Johnson 5aad008261 feat: added token blacklisting 2018-08-21 14:22:04 -06:00
Wyatt Johnson 8e3c62c9db Merge branch 'next' into auth-views 2018-08-21 17:46:23 +00:00
Kiwi 059292e979 Compile schema when watching client (#1809) 2018-08-21 17:45:11 +00:00
Belen Curcio 348ce99828 TSLint imports ordered 2018-08-17 12:17:22 -03:00
Belen Curcio d58221fb5e Merge branch 'next' of github.com:coralproject/talk into auth-views 2018-08-17 12:11:15 -03:00
Belen Curcio fe3f6e8d41 Missing console.log 2018-08-17 12:10:09 -03:00
Belén Curcio 3f560231aa Merge pull request #1799 from coralproject/rest-next
[next] Support SignUp and SignIn
2018-08-17 12:02:54 -03:00
Belen Curcio 1c135a9ccb Adding variable to the scope and contemplating undefined from the BE 2018-08-17 12:02:07 -03:00
Belen Curcio fb2af720ed Tests updated 2018-08-17 11:45:57 -03:00
Belen Curcio 310f250212 Updated tests and latest changes 2018-08-17 11:40:31 -03:00
Belen Curcio 071cf1ce1d User signedIn enters the stream 2018-08-17 10:49:50 -03:00
Belen Curcio 63d43caa23 Adding test for FormField, InputDescription and Spinner 2018-08-17 09:25:13 -03:00
Belen Curcio e1dc50a494 Updated docs 2018-08-17 09:18:02 -03:00
Belen Curcio d1e938112e Adding Spinner Component to UI and some corrections to the docs 2018-08-17 09:06:00 -03:00
Belen Curcio 6e1b9c99ac Working validation from the server using CallOuts 2018-08-16 16:24:49 -03:00
Belen Curcio 94ad23ce9b Working validation from the server using CallOuts 2018-08-16 16:21:52 -03:00
Belen Curcio e4ebb2553f Handling error messages 2018-08-16 13:14:47 -03:00
Belen Curcio ecb82cf9a9 Working type submit for forms - Button Component 2018-08-16 12:41:21 -03:00
Belen Curcio a48bcc3076 Hitting the delete route and deleting the token 2018-08-16 12:20:56 -03:00
Belen Curcio e704c6d968 SignOff Mutation 2018-08-16 12:02:09 -03:00
Belen Curcio 551ce1521c Progress 2018-08-15 13:12:19 -03:00
Belen Curcio 8e9ac0748e Working signin and comment 2018-08-15 12:05:38 -03:00
Belen Curcio 4d7702c0e3 Merge branch 'auth-views' of github.com:coralproject/talk into auth-views 2018-08-14 13:11:55 -03:00
Belen Curcio 7c5ff1bcb1 Able to Sign In 2018-08-14 13:11:35 -03:00
Kim Gardner a41dd703eb Merge branch 'next' into auth-views 2018-08-14 10:52:57 -04:00
Kim Gardner c955fbd22f Merge branch 'next' into rest-next 2018-08-14 10:52:45 -04:00
Wyatt Johnson 0b3aead1d2 [next] Perspective API Integration (#1797)
* feat: initial toxic comments impl

* feat: improved logging

* feat: tenant cache adapter

* feat: move more types into graphql
2018-08-14 14:37:00 +00:00
Belen Curcio c40e5c58b2 Adding inner routing between views 2018-08-13 13:52:18 -03:00
Belen Curcio a94e56d45f Adding form validations for Forgot Password, ResetPassword, and more 2018-08-13 13:37:18 -03:00
Belen Curcio b4480f4bf7 Adding SignUp Form Functionality 2018-08-13 13:25:51 -03:00
Belen Curcio 6648dfe492 Adding InputDescription Component 2018-08-13 12:59:53 -03:00
Belen Curcio 4688f170e4 updated snapshots 2018-08-13 12:13:00 -03:00
Belen Curcio f19ada431d Merge branch 'auth-views' of github.com:coralproject/talk into auth-views 2018-08-13 11:58:22 -03:00
Belén Curcio 4c86d842dd Validations for all forms: SIGN UP, SIGN IN, FORGOT PASSWORD, RESET PASSWORD 2018-08-13 00:20:15 -03:00
Belén Curcio 7e081bbf07 Sign Up Form, Cross Validations for Username, Email, Password, and more added. 2018-08-12 23:48:49 -03:00
Belén Curcio 8a7ea9cdef First integration of forms 2018-08-12 23:08:23 -03:00
Belén Curcio ab4ca7f24c Adding PoweredBy and more 2018-08-12 22:52:03 -03:00
Belén Curcio 5c2ac9ee75 Using correct properties for the Flex Component to support nexting Flex components 2018-08-12 22:17:05 -03:00
Belén Curcio 9e39a093fd Adding UserBoxAuthenticated and using correct properties for the Flex Component 2018-08-12 22:12:23 -03:00
Belén Curcio b30404699b Merge branch 'rest-next' of github.com:coralproject/talk into auth-views
* 'rest-next' of github.com:coralproject/talk:
  Support rest and implement SignIn and SignUp Rest + Mutations
  Add rest endpoints
  Add rest client
  Use setAuthToken mutation
  Add post message listeners
  Add complex value test
  Add PostMessage Service
  Fix linter
  Support authentication
2018-08-12 21:54:35 -03:00
Belén Curcio 443ccd61ce Merge branch 'next' of github.com:coralproject/talk into auth-views
* 'next' of github.com:coralproject/talk:
  [next] Templates (#1760)
  Adapt typography
  NO NORMALS
2018-08-12 19:23:47 -03:00
Belén Curcio de5c37ebcf Stream Styling 2018-08-12 19:22:50 -03:00
Kiwi 78fa0b270f Merge branch 'next' into rest-next 2018-08-10 19:13:05 +02:00
Chi Vinh Le 1dec622e64 Support rest and implement SignIn and SignUp Rest + Mutations 2018-08-10 19:07:41 +02:00
Wyatt Johnson d2106b3de5 [next] Templates (#1760)
* feat: initial support for synced tenants

* fix: cleanup

* fix: logger now respects logging level

* fix: cache now ignores updates issued from itself

* feat: print subscriber count

* feat: initial nunjucks support

* fix: support tenant cache for oidc strategy

* fix: replace some constructor initializers with property initializers

* fix: audit

* [next] Comments and Moderation (#1759)

* feat: initial moderation + validation for new comments

* fix: added Promiseable type

* feat: initial actions impl

* feat: more moderation phases

* fix: handle settings inheritence

* fix: moved settings into new file

* fix: defaults and documentation

* fix: replace merge with object spread

* feat: added integration with akismet

* fix: fixed compile

* fix: import ordering

* fix: merge issue causing build to fail

* feat: added gulp, static templates

* fix: added compile step back

* Fix extract css + remove cross-env
2018-08-10 16:17:39 +00:00
Chi Vinh Le 7cb5ab37a7 Merge branch 'postMessage' into rest-next 2018-08-10 17:20:31 +02:00
Chi Vinh Le 505bb48f8b Add rest endpoints 2018-08-10 17:19:07 +02:00
Chi Vinh Le bb39b4e8fa Add rest client 2018-08-10 17:19:01 +02:00
Belen Curcio 22fa940ddb Adding PoweredBy Component 2018-08-10 12:11:32 -03:00
Belen Curcio 06f9c0a212 Merge branch 'auth-views' of github.com:coralproject/talk into auth-views 2018-08-10 11:52:09 -03:00
Chi Vinh Le e1c60bc18d Use setAuthToken mutation 2018-08-10 16:18:29 +02:00
Chi Vinh Le bf8549c811 Merge branch 'authentication-support' into postMessage 2018-08-10 16:16:47 +02:00
Chi Vinh Le 37f733dfa0 Add post message listeners 2018-08-10 16:12:08 +02:00
Chi Vinh Le 9510fbed57 Add complex value test 2018-08-10 16:05:50 +02:00
Chi Vinh Le ea02e47241 Add PostMessage Service 2018-08-10 15:57:07 +02:00
Kiwi 4e493ad1da Merge pull request #1776 from coralproject/ui-components
[next] UI Components
2018-08-10 13:21:59 +02:00
Chi Vinh Le c2f6095868 Adapt typography 2018-08-10 13:10:37 +02:00
Kiwi 3d11335100 Merge branch 'next' into ui-components 2018-08-10 12:19:36 +02:00
Chi Vinh Le dbcf3c5756 Fix linter 2018-08-10 12:07:46 +02:00
Kiwi 32264fbc5f Merge branch 'next' into authentication-support 2018-08-10 10:37:57 +02:00
Belén Curcio 2a0f9cd935 NO NORMALS 2018-08-09 15:46:56 -03:00
Belén Curcio 594c74c8c1 Merge branch 'next' of github.com:coralproject/talk into auth-views
* 'next' of github.com:coralproject/talk:
  Make UserBoxUnauthenticated responsive
  Support double itemGutters
  Put ref and root className to first div
2018-08-09 15:42:45 -03:00
Belén Curcio 797a02b2a3 Merge pull request #1794 from coralproject/flex-improvments
[next] Flex improvements
2018-08-09 15:38:10 -03:00
Kiwi 3eceb22198 Merge branch 'next' into flex-improvments 2018-08-09 20:12:23 +02:00
Belén Curcio 60843f2322 Merge pull request #1796 from coralproject/user-box-responsive
Make UserBoxUnauthenticated responsive
2018-08-09 15:09:26 -03:00
Belén Curcio 5f4fbfc209 latests 2018-08-09 15:03:27 -03:00
Kiwi d3da5abd5c Merge branch 'next' into user-box-responsive 2018-08-09 20:00:55 +02:00
Chi Vinh Le 92a266363a Make UserBoxUnauthenticated responsive 2018-08-09 19:40:45 +02:00
Kiwi 15038fc8ab Merge branch 'next' into flex-improvments 2018-08-09 18:43:32 +02:00
Chi Vinh Le 3f64a0d1a6 Support double itemGutters 2018-08-09 18:42:16 +02:00
Chi Vinh Le 04f03b7f3b Put ref and root className to first div 2018-08-09 18:42:10 +02:00
Belén Curcio 0dfdea0e4e Auth Views 2018-08-09 13:17:45 -03:00
Kiwi e63137f302 Merge branch 'next' into authentication-support 2018-08-09 18:08:18 +02:00
Belén Curcio 52ab434740 Adding SignIn View 2018-08-09 12:01:27 -03:00
Belén Curcio 361aab7085 Adding Formfield 2018-08-09 11:43:32 -03:00
Chi Vinh Le d140e2449f Support authentication 2018-08-09 16:14:35 +02:00
Belén Curcio f3403d4223 sign in view 2018-08-09 11:03:13 -03:00
Belén Curcio 7483414981 Normal view 2018-08-09 10:40:59 -03:00
Belén Curcio e696479592 Merge branch 'ui-components' of github.com:coralproject/talk into auth-views
* 'ui-components' of github.com:coralproject/talk:
  Updated code, and snapshots
  Changes added
  updated snapshots
2018-08-09 10:26:00 -03:00
Belén Curcio 639fa4f721 Merge branch 'next' of github.com:coralproject/talk into auth-views
* 'next' of github.com:coralproject/talk:
  Readd comments not found
  Make readonly and add translations
  Add localization
  Change text
  Add SetViewMutation
  Get view from query + tests
  Styling, refactor + tests
  Add UserBox
  Add auth target
2018-08-09 10:24:34 -03:00
Belén Curcio a99f907a7d updated webpack config 2018-08-09 10:16:27 -03:00
Belén Curcio 31835d2b7c Adding Button Underlined 2018-08-09 10:04:12 -03:00
Belén Curcio 699b07ad08 Ordering code, alerts 2018-08-09 09:50:17 -03:00
Belén Curcio b5d626ad8c Updated code, and snapshots 2018-08-09 09:45:29 -03:00
Belén Curcio c926d6b721 Merge pull request #1787 from coralproject/permalink-i18n-readOnly
[next] Make permalink readonly and add translations
2018-08-09 09:25:27 -03:00
Kiwi 1235cc7aad Merge branch 'next' into permalink-i18n-readOnly 2018-08-08 19:48:44 +02:00
Belen Curcio 8634647c9f Changes added 2018-08-08 13:23:20 -03:00
Belen Curcio bec5b85039 Merge branch 'ui-components' of github.com:coralproject/talk into auth-views 2018-08-08 13:15:38 -03:00
Belen Curcio dd45b345b7 Merge branch 'next' of github.com:coralproject/talk into auth-views 2018-08-08 13:12:29 -03:00
Belén Curcio ff62dc4ecc Merge pull request #1788 from coralproject/auth-skeleton
[next] Initial support for Auth popup
2018-08-08 13:08:01 -03:00
Chi Vinh Le 606bcb6393 Merge branch 'next' into auth-skeleton 2018-08-08 17:20:24 +02:00
Chi Vinh Le 22a0e80c66 Readd comments not found 2018-08-08 17:14:41 +02:00
Belen Curcio 0ab3ba2a7b updated snapshots 2018-08-08 12:11:53 -03:00
Belen Curcio 2e6d326eb2 First view - Join the conversation 2018-08-08 12:04:37 -03:00
Chi Vinh Le 781519956a Merge branch 'next' into permalink-i18n-readOnly 2018-08-08 17:03:57 +02:00
Belen Curcio 2fb3ab2e8f Adding target config for auth 2018-08-08 11:42:09 -03:00
Belen Curcio 229569256e wio 2018-08-08 11:37:58 -03:00
Chi Vinh Le c1956a307d Make readonly and add translations 2018-08-08 16:30:43 +02:00
Chi Vinh Le ab292cd4a4 Add localization 2018-08-08 16:23:18 +02:00
Belen Curcio 577629c65b Adding auth target 2018-08-08 11:13:44 -03:00
Belen Curcio 6df52aadbb Adding auth to the watcher 2018-08-08 11:13:23 -03:00
Chi Vinh Le f75a2ac81c Change text 2018-08-08 15:07:37 +02:00
Chi Vinh Le ac4b431d71 Add SetViewMutation 2018-08-08 15:03:51 +02:00
Chi Vinh Le 245b8648d1 Get view from query + tests 2018-08-08 14:54:29 +02:00
Chi Vinh Le b21f3560ff Styling, refactor + tests 2018-08-08 14:18:27 +02:00
Belen Curcio d6ff25dd10 Adding popper 2018-08-08 08:41:10 -03:00
Belen Curcio 5d58681daa Merge branch 'next' of github.com:coralproject/talk into ui-components 2018-08-08 08:31:08 -03:00
Belén Curcio 685dbfd7be Merge pull request #1784 from coralproject/use-anchor-in-permalink
[next] Use anchor for better accessibility and restore history
2018-08-08 08:22:24 -03:00
Chi Vinh Le fe7b734b2c Add UserBox 2018-08-08 01:04:25 +02:00
Chi Vinh Le 34fb53b3b0 Add auth target 2018-08-08 01:03:49 +02:00
Chi Vinh Le 52b36e2db0 Use anchor for better accessibility and restore history 2018-08-07 17:37:02 +02:00
Kiwi dff3e40005 Merge pull request #1741 from coralproject/permalink
[next] Permalink
2018-08-06 22:40:50 +02:00
Chi Vinh Le 8a97ed162c Fix types 2018-08-06 22:35:14 +02:00
Chi Vinh Le 3166478ec3 Add and refactor tests 2018-08-06 22:21:44 +02:00
Chi Vinh Le 95716da133 Remove unused dependency 2018-08-06 20:58:24 +02:00
Chi Vinh Le 1879edbf58 Add margin on both sides 2018-08-06 20:20:51 +02:00
Chi Vinh Le 8ecae1b9dd Merge branch 'permalink' of https://github.com/coralproject/talk into permalink 2018-08-06 20:14:03 +02:00
Chi Vinh Le 77eb538082 Add more integration tests 2018-08-06 20:13:50 +02:00
Kiwi c792dd4e7e Merge branch 'next' into permalink 2018-08-06 20:02:57 +02:00
Kiwi d0bcd53695 Merge pull request #1783 from coralproject/popup-next
Add popup component
2018-08-06 20:01:39 +02:00
Chi Vinh Le 820ee12485 Fix types 2018-08-06 19:56:09 +02:00
Belen Curcio 7c99dcf8df updates 2018-08-06 13:55:51 -03:00
Kiwi 59ce08e8b1 Merge branch 'next' into permalink 2018-08-06 17:47:52 +02:00
Chi Vinh Le a63da509a3 Merge branch 'next' into popup-next 2018-08-06 17:46:04 +02:00
Chi Vinh Le 7c91df5103 Add popup component 2018-08-06 17:43:52 +02:00
Belen Curcio 6c284feea7 Updated 2018-08-06 11:53:46 -03:00
Belen Curcio 608534b2d0 Updated 2018-08-06 11:51:32 -03:00
Belen Curcio 11ba91c20e Changes added 2018-08-06 11:49:45 -03:00
Belen Curcio b32553ef00 removing xs size 2018-08-06 11:40:50 -03:00
Belen Curcio 797b8cacc8 Merge branch 'next' of github.com:coralproject/talk into ui-components 2018-08-06 11:38:10 -03:00
Belén Curcio ef4637cf7e Merge pull request #1782 from coralproject/fix-docz
[next] Make docz work again
2018-08-06 11:36:35 -03:00
Chi Vinh Le 9ddc02fff5 Tweak mdx files 2018-08-06 07:36:08 +02:00
Chi Vinh Le 4fd735bc04 Restore docz 2018-08-05 22:35:02 +02:00
Chi Vinh Le 41f92b2144 Don't show icon on xs screens 2018-08-04 08:54:16 +02:00
Chi Vinh Le c7a96cc0f1 More style 2018-08-04 08:40:01 +02:00
Chi Vinh Le be1e5a2f7f Add margin, move elevation to theme, use colors from theme 2018-08-04 00:32:26 +02:00
Chi Vinh Le 0a5e6f7250 Styling improvements and responsibility 2018-08-04 00:16:00 +02:00
Chi Vinh Le 66d8244acc Refactor stream + some tests 2018-08-03 23:49:00 +02:00
Chi Vinh Le 7dedf2c129 Update tests 2018-08-03 18:24:44 +02:00
Chi Vinh Le b3fa5e1e73 Integrate with embed 2018-08-03 18:19:37 +02:00
Belen Curcio 8594b82d90 console.log 2018-08-03 13:09:08 -03:00
Belen Curcio 2a87fb83f7 rolling back docz 2018-08-03 12:58:00 -03:00
Belen Curcio dd546c227d rolling back docz 2018-08-03 12:57:49 -03:00
Belen Curcio 085723435b lock 2018-08-03 12:51:57 -03:00
Chi Vinh Le 09cc76a973 Merge branch 'next' into permalink 2018-08-03 16:05:43 +02:00
Chi Vinh Le 41d4c67728 Merge branch 'next' into permalink 2018-08-03 15:59:48 +02:00
Chi Vinh Le 1376ed255b Improve styling, accessebility, usability and use mutation 2018-08-03 15:57:14 +02:00
Chi Vinh Le d05508d574 Adapt Icon sizes 2018-08-03 15:33:04 +02:00
Belen Curcio fbdc10e577 Merge branch 'ui-components' of github.com:coralproject/talk into ui-components 2018-08-03 09:25:11 -03:00
Belen Curcio 15865d1db2 Adding CallOut Component and tests 2018-08-03 09:24:48 -03:00
Belén Curcio c6b8840b47 Merge branch 'next' into ui-components 2018-08-03 08:33:04 -03:00
Belen Curcio c21b8a044e updated tests 2018-08-03 08:24:42 -03:00
Belen Curcio 051cb9885b removing old 2018-08-03 08:21:18 -03:00
Belen Curcio 5fb23c7634 Adding a new doc file on how to build forms :D! 2018-08-02 20:15:47 -03:00
Belen Curcio 0c9dd07f1f Adding InputLabel 2018-08-02 20:01:15 -03:00
Belen Curcio ba01263731 Adding TextField 2018-08-02 19:46:05 -03:00
Wyatt Johnson 4606626ec4 [next] Settings/Tenant (#1758)
* feat: initial support for synced tenants

* fix: cleanup

* fix: logger now respects logging level

* fix: cache now ignores updates issued from itself

* feat: print subscriber count

* fix: support tenant cache for oidc strategy

* fix: replace some constructor initializers with property initializers

* fix: audit

* [next] Comments and Moderation (#1759)

* feat: initial moderation + validation for new comments

* fix: added Promiseable type

* feat: initial actions impl

* feat: more moderation phases

* fix: handle settings inheritence

* fix: moved settings into new file

* fix: defaults and documentation

* fix: replace merge with object spread

* feat: added integration with akismet

* fix: fixed compile

* fix: import ordering

* fix: merge issue causing build to fail
2018-08-02 20:09:55 +00:00
Belen Curcio 18d95b603b wip 2018-08-02 12:52:16 -03:00
Kiwi 6d7056d831 [next] Add support for embed (#1762)
* Move talk-server/config to talk-common/config

* Refactor build into /src/core/build and use common config

* Add embed webpack config

* Start implementing embed

* Implement embed

* Add pym types

* Add event emitter to Talk Context

* Add MatchMedia test for passing values from the context

* Add support for click far away

* Integrate pym click events to registerClickFarAway

* Add tests

* Resolve merge issues

* Apply PR review
2018-08-02 15:29:18 +00:00
Belen Curcio 93044b3c6a Adds test 2018-08-02 09:01:54 -03:00
Belen Curcio 9e2b1aa9e3 Adding regular and full with 2018-08-02 09:00:18 -03:00
Belen Curcio 5c7f4b461d docz 2018-08-02 08:56:58 -03:00
Belen Curcio 64da3f02f9 Extending Icon for extra small 2018-08-02 08:37:48 -03:00
Belen Curcio 67c8ca9d57 Validation Message 2018-08-02 07:43:12 -03:00
Kim Gardner cf3b706bbc Merge pull request #1743 from coralproject/next-passport
[next] Passport Integration
2018-08-02 11:41:01 +01:00
Wyatt Johnson 201e5fbcb1 fix: rename wrapAuthz with wrapAuthn 2018-08-01 15:56:04 -06:00
Wyatt Johnson c221f827b4 fix: resolved schema error 2018-08-01 15:52:56 -06:00
Wyatt Johnson 2ac6883737 Merge branch 'next' into next-passport 2018-08-01 13:13:54 -06:00
Kiwi 5fd7062a3a [next] Support development on windows (#1769)
* Support windows

* Fix error when loading locales
2018-07-31 18:24:01 +00:00
Belén Curcio 64b579695e Let`s only cover english and then cover all the languagues with Pontoon later 2018-07-31 11:23:30 -03:00
Belén Curcio 7c446bc9d8 Changes 2018-07-31 11:20:16 -03:00
Belén Curcio bf959691eb Changes 2018-07-31 11:18:13 -03:00
Belén Curcio 466cecda5f Adding the mutation 2018-07-31 11:11:54 -03:00
Belén Curcio 45e25581f7 docz 2018-07-30 06:58:13 -03:00
Belén Curcio 387e53e4e6 docz 2018-07-30 06:53:17 -03:00
Belén Curcio e1d534391c More Changes 2018-07-30 06:50:47 -03:00
Belén Curcio 2aa725d61c Changes 2018-07-30 06:30:11 -03:00
Belén Curcio d7c3796c9f Added missing dependency and test updated 2018-07-26 12:11:31 -03:00
Belén Curcio 2c4ce9169d Added missing dependency and test updated 2018-07-26 11:45:20 -03:00
Belén Curcio 325f453476 Back to the stream if comment not found 2018-07-26 11:27:22 -03:00
Belén Curcio 1c60e2fdea Merge remote-tracking branch 'origin/permalink' into permalink 2018-07-26 11:22:10 -03:00
Belén Curcio ea44227519 Creating assetURL in localState
S
2018-07-26 11:21:57 -03:00
Belén Curcio f51f989021 S 2018-07-26 11:21:12 -03:00
Belén Curcio db09033367 Creating assetURL in localState 2018-07-26 11:13:39 -03:00
Belén Curcio 89472bfe9f Missing imports, redirects Back to the Stream, Share Button, Full func 2018-07-26 10:56:00 -03:00
Belén Curcio ceaa0599a1 Merge remote-tracking branch 'origin/permalink' into permalink 2018-07-25 19:44:38 -03:00
Belén Curcio 8b56e408f8 Removing old implementation of attachment
Tiny refactor

Merge branch 'next' of github.com:coralproject/talk into permalink

* 'next' of github.com:coralproject/talk:
  [next] ClickOutside Component (#1757)

Support for ClickOutside
2018-07-25 19:44:25 -03:00
Belén Curcio ad4fcfd002 Support for ClickOutside 2018-07-25 19:24:33 -03:00
Belén Curcio 57d80af2e7 Merge branch 'next' of github.com:coralproject/talk into permalink
* 'next' of github.com:coralproject/talk:
  [next] ClickOutside Component (#1757)
2018-07-25 19:16:24 -03:00
Wyatt Johnson 1923e929ee Merge branch 'next' into next-passport 2018-07-25 22:08:17 +00:00
Belén Curcio f0e0051c97 Tiny refactor 2018-07-25 18:57:43 -03:00
Belén Curcio b787f260f2 Removing old implementation of attachment 2018-07-25 17:33:49 -03:00
Belén Curcio e0a8f2e067 [next] ClickOutside Component (#1757)
* working on the tests

Merge branch 'next' of github.com:coralproject/talk into clickoutside

* 'next' of github.com:coralproject/talk: (36 commits)
  [next] Implement AriaInfo (#1756)
  e render props for TrapFocus (#1755)
  [ToggleShow] Fix typo and better description (#1753)
  Fix wrong hour pluralization
  Implement button active state
  Styling fixes
  Fix Playground
  Commit snapshots
  Harmonize typography
  Fix Flex margin bug and add examples
  Update package-lock.json
  Use explicit export
  Implement ButtonIcon component
  Remove wrong ref prop
  Implement new button api
  Read env in watchers.ts
  updated tests
  Update ToggleShow.spec.tsx
  ToggleShow Component
  Fix CI thanks to wyatt
  ...

docz added

Added simulant

Added simulant

unnused

Merge branch 'clickoutside' of github.com:coralproject/talk into clickoutside

* 'clickoutside' of github.com:coralproject/talk: (40 commits)
  Added simulant
  Added simulant
  docz added
  [next] Implement AriaInfo (#1756)
  e render props for TrapFocus (#1755)
  [ToggleShow] Fix typo and better description (#1753)
  Fix wrong hour pluralization
  Implement button active state
  Styling fixes
  Fix Playground
  Commit snapshots
  Harmonize typography
  Fix Flex margin bug and add examples
  Update package-lock.json
  Use explicit export
  Implement ButtonIcon component
  Remove wrong ref prop
  Implement new button api
  Read env in watchers.ts
  working on the tests
  ...

unnused

Merge branch 'clickoutside' of github.com:coralproject/talk into clickoutside

* 'clickoutside' of github.com:coralproject/talk: (42 commits)
  unnused
  working on the tests
  Added simulant
  Added simulant
  docz added
  [next] Implement AriaInfo (#1756)
  e render props for TrapFocus (#1755)
  [ToggleShow] Fix typo and better description (#1753)
  Fix wrong hour pluralization
  Implement button active state
  Styling fixes
  Fix Playground
  Commit snapshots
  Harmonize typography
  Fix Flex margin bug and add examples
  Update package-lock.json
  Use explicit export
  Implement ButtonIcon component
  Remove wrong ref prop
  Implement new button api
  ...

Merge branch 'clickoutside' of github.com:coralproject/talk into clickoutside

* 'clickoutside' of github.com:coralproject/talk: (42 commits)
  unnused
  working on the tests
  Added simulant
  Added simulant
  docz added
  [next] Implement AriaInfo (#1756)
  e render props for TrapFocus (#1755)
  [ToggleShow] Fix typo and better description (#1753)
  Fix wrong hour pluralization
  Implement button active state
  Styling fixes
  Fix Playground
  Commit snapshots
  Harmonize typography
  Fix Flex margin bug and add examples
  Update package-lock.json
  Use explicit export
  Implement ButtonIcon component
  Remove wrong ref prop
  Implement new button api
  ...

Merge branch 'clickoutside' of github.com:coralproject/talk into clickoutside

* 'clickoutside' of github.com:coralproject/talk: (43 commits)
  working on the tests
  unnused
  working on the tests
  Added simulant
  Added simulant
  docz added
  [next] Implement AriaInfo (#1756)
  e render props for TrapFocus (#1755)
  [ToggleShow] Fix typo and better description (#1753)
  Fix wrong hour pluralization
  Implement button active state
  Styling fixes
  Fix Playground
  Commit snapshots
  Harmonize typography
  Fix Flex margin bug and add examples
  Update package-lock.json
  Use explicit export
  Implement ButtonIcon component
  Remove wrong ref prop
  ...

* Implement passing tests

* Use html as snapshot

* Refactor and simplify test

* Remove unused import

* ts

* simulant moved to devdeps
2018-07-25 20:33:29 +00:00
Belén Curcio 906940f152 Working single comment view 2018-07-25 17:24:14 -03:00
Belén Curcio e519503129 Progress: 2018-07-25 14:06:25 -03:00
Belén Curcio 40ab723cf1 Server retrieve by single comment 2018-07-25 12:15:03 -03:00
Belén Curcio b421ea97b3 reordering package json 2018-07-24 16:20:15 -03:00
Belén Curcio 41791ebf79 Playground changes 2018-07-24 16:18:15 -03:00
Belén Curcio aee0fbf7ab Support for esc char 2018-07-24 16:09:56 -03:00
Belén Curcio 31e6735ddd Now body prop accepts a function or an element 2018-07-24 13:57:39 -03:00
Belén Curcio 21120bf760 Placement and docs added 2018-07-24 13:42:54 -03:00
Belén Curcio 96e7407d4c Working 2018-07-24 13:22:22 -03:00
Belén Curcio 50e46b4606 wip 2018-07-23 18:17:33 -03:00
Wyatt Johnson 1ec1572efb fix: updated client code to respect missing usernames 2018-07-23 13:33:44 -06:00
Wyatt Johnson 4b5c7c1c7b fix: move displayName into auth integrations 2018-07-23 13:14:34 -06:00
Belén Curcio 49400d116f Merge branch 'next' of github.com:coralproject/talk into permalink
* 'next' of github.com:coralproject/talk: (36 commits)
  [next] Implement AriaInfo (#1756)
  e render props for TrapFocus (#1755)
  [ToggleShow] Fix typo and better description (#1753)
  Fix wrong hour pluralization
  Implement button active state
  Styling fixes
  Fix Playground
  Commit snapshots
  Harmonize typography
  Fix Flex margin bug and add examples
  Update package-lock.json
  Use explicit export
  Implement ButtonIcon component
  Remove wrong ref prop
  Implement new button api
  Read env in watchers.ts
  updated tests
  Update ToggleShow.spec.tsx
  ToggleShow Component
  Fix CI thanks to wyatt
  ...
2018-07-23 16:00:08 -03:00
Wyatt Johnson 13d293b9aa Merge branch 'next' into next-passport 2018-07-23 16:09:24 +00:00
Wyatt Johnson 81e8f68e62 fix: upgrade @types/passport 2018-07-23 10:08:12 -06:00
Kiwi acb86f4b44 [next] Implement AriaInfo (#1756)
* Implement AriaInfo

* Fix build

* Default to div
2018-07-20 23:17:47 +00:00
Kiwi afe816ba41 e render props for TrapFocus (#1755) 2018-07-20 22:51:13 +00:00
Kiwi 6bbb645552 [ToggleShow] Fix typo and better description (#1753)
* Fix typo

* Improve desc

* Add layout

* Fix Flex layout

* Use ui kit button
2018-07-20 22:40:12 +00:00
Wyatt Johnson 558f81c9aa fix: sso strategy 2018-07-20 16:38:03 -06:00
Wyatt Johnson 0a0f7ce216 fix: marked username as nullable 2018-07-20 16:26:35 -06:00
Wyatt Johnson 2c1111109a fix: support not logged in users 2018-07-20 16:19:33 -06:00
Wyatt Johnson bdd4bfc272 feat: initial passport user auth impl 2018-07-20 14:30:07 -06:00
Wyatt Johnson 2e4d23e900 Merge branch 'next' into next-passport 2018-07-20 19:26:58 +00:00
Kiwi a015a474aa Merge pull request #1754 from coralproject/fix-hour-pluralization
[next] Fix wrong hour pluralization
2018-07-20 14:49:09 -03:00
Chi Vinh Le cb40f061be Fix wrong hour pluralization 2018-07-20 13:39:39 -03:00
Kiwi 4c6b2cfb84 Merge pull request #1752 from coralproject/ghost-button-next
[next] Button + UI Kit harmonization
2018-07-20 13:00:58 -03:00
Wyatt Johnson a6bfad0833 feat: more JWT tests 2018-07-20 09:58:40 -06:00
Kiwi c77d8739e7 Merge branch 'next' into ghost-button-next 2018-07-20 12:32:07 -03:00
Chi Vinh Le 0280d300f5 Implement button active state 2018-07-20 12:31:35 -03:00
Chi Vinh Le b2e2e3e75d Styling fixes 2018-07-20 12:24:03 -03:00
Kiwi e7c36c0b4c Merge pull request #1751 from coralproject/toggleshow
ToggleShow Component - A Component that provides utilities to display nested components
2018-07-20 11:34:42 -03:00
Chi Vinh Le 6eb82ed555 Merge branch 'toggleshow' of https://github.com/coralproject/talk into toggleshow 2018-07-20 11:05:59 -03:00
Chi Vinh Le c5951117c3 Fix Playground 2018-07-20 11:05:42 -03:00
Chi Vinh Le e33ea6d0aa Commit snapshots 2018-07-20 10:49:31 -03:00
Chi Vinh Le f8e9b5dd50 Harmonize typography 2018-07-20 10:46:48 -03:00
Chi Vinh Le 7f265a93c8 Fix Flex margin bug and add examples 2018-07-19 21:02:16 -03:00
Chi Vinh Le 5e64961347 Update package-lock.json 2018-07-19 20:26:18 -03:00
Chi Vinh Le 69b459d02b Use explicit export 2018-07-19 20:02:21 -03:00
Chi Vinh Le 521af6f0aa Implement ButtonIcon component 2018-07-19 19:58:55 -03:00
Chi Vinh Le 726f2f0d17 Remove wrong ref prop 2018-07-19 19:48:58 -03:00
Chi Vinh Le 05605d6d50 Implement new button api 2018-07-19 19:47:01 -03:00
Chi Vinh Le d31d8d94e2 Read env in watchers.ts 2018-07-19 19:26:50 -03:00
Belén Curcio 49d0296d5c updated tests 2018-07-19 15:47:00 -03:00
Kiwi 508d9618a2 Update ToggleShow.spec.tsx 2018-07-19 15:44:42 -03:00
Belén Curcio 212932486a Merge branch 'next' into toggleshow 2018-07-19 15:40:02 -03:00
Belén Curcio b87f984fd3 ToggleShow Component 2018-07-19 15:38:41 -03:00
Kiwi 6f11ec3338 Merge pull request #1749 from coralproject/ui-improvements
[next] UI improvements
2018-07-19 15:16:30 -03:00
Belén Curcio 49552e7772 New Components 2018-07-19 15:07:02 -03:00
Belén Curcio b0d8c1348b Merge branch 'permalink' of github.com:coralproject/talk into permalink
* 'permalink' of github.com:coralproject/talk: (102 commits)
  feat: added support for --only flag
  Ready
  Support for refs
  Working
  Any
  progress
  merge conflicts
  Make timeagoFormatter optional
  More colors
  Colors
  Short circuit endless respawn
  fix: new mongo parser
  Remove jest from watcher config, as it doesnt run well inside
  Add jest set
  Apply suggestions
  Move react-timeago to dev
  Upgrade docz
  Cleanup docz scripts
  Support watcher sets
  [next] Support server side jest testing (#1747)
  ...
2018-07-19 13:13:01 -03:00
Chi Vinh Le 78d00d69fe Fix CI thanks to wyatt 2018-07-18 19:36:43 -03:00
Chi Vinh Le 236a740497 Fix icons in firefox 2018-07-18 17:15:36 -03:00
Chi Vinh Le 0ee20febd2 Export TrapFocus Props 2018-07-18 16:11:08 -03:00
Chi Vinh Le 90cb56d92f Implement TrapFocus Component 2018-07-18 16:05:34 -03:00
Wyatt Johnson a2a0cebb06 feat: initial token issuing support 2018-07-17 16:57:36 -06:00
Chi Vinh Le a4104f8bd8 Add children to types 2018-07-17 19:38:58 -03:00
Chi Vinh Le d09835020d Rename WrappedComponent to BaseComponent 2018-07-17 19:22:06 -03:00
Chi Vinh Le 9c98330ea4 Self host fonts and fix font weights 2018-07-17 19:16:14 -03:00
Chi Vinh Le 5acd48c49f Support Material Icons + bugfixes 2018-07-17 18:45:20 -03:00
Wyatt Johnson 8487f22b8e feat: added test results 2018-07-17 14:09:00 -06:00
Wyatt Johnson c7feaa344f fix: runInBand for CI 2018-07-17 13:51:59 -06:00
Wyatt Johnson 189623a367 fix: move audit up 2018-07-17 12:51:24 -06:00
Wyatt Johnson 7c139a37b4 fix: sudo with global npm update 2018-07-17 12:50:21 -06:00
Wyatt Johnson 2cf7f1e2ef fix: update npm 2018-07-17 12:49:35 -06:00
Wyatt Johnson 54e99dec12 feat: added npm audit 2018-07-17 12:42:06 -06:00
Wyatt Johnson caec45a0c6 feat: passport impl 2018-07-17 12:32:43 -06:00
Chi Vinh Le e064ad49ae Add missing tests 2018-07-17 15:31:40 -03:00
Chi Vinh Le de739554c8 Forward Ref Stub 2018-07-17 15:23:16 -03:00
Belén Curcio b9a8fdb77b feat: added support for --only flag
Merge pull request #1731 from coralproject/next-watcher-flags

Watcher --only
Use JSDocs comments (#1727)


Merge branch 'next' into prevent-compile-loop-relay
Merge pull request #1726 from coralproject/prevent-compile-loop-relay

[next] Adapt relay watch config
[next] Remove nodemon (#1725)

* Remove old nodemon configs

* Remove nodemon

[next] Jest implementation for React Components (#1733)

* Make jest testing work with custom path and css modules

* Add first test

* feat: added unit tests to ci

* fix: updated package-lock.json

* Update cssTransform.js

* Update cssTransform.js

* Fix test in ci

Adapt files.exclude (#1736)


Permalink ui

Adding Copy to clipboard functionality

WIP

clean request

wip

progress

progress

work in progress

wip

ui functionality

Translations :/

wip

Merge branch 'permalink' of github.com:coralproject/talk into permalink

* 'permalink' of github.com:coralproject/talk: (42 commits)
  [next] Support server side jest testing (#1747)
  Update snapshots
  Add comments
  Remove precss
  Move react-responsive to dev deps
  Remove comment
  Mobile first approach
  Support standard css variables, dynamically set spacing-unit
  Add docs
  Fully implement Flex and MatchMedia
  Responsive Components <3
  fix: linting
  fix: adjusted pageInfo
  Remove obsoloe snapshot
  Move jsdom to dev deps
  Mark comments as always returning a value
  Add comment
  Fix unit tests
  Translate, concept for translation and id strings
  Add aria props
  ...

Adding Attachment and Popover Component

merge conflicts

progress

Any

Working

Support for refs

Ready

Merge branch 'permalink' of github.com:coralproject/talk into permalink

* 'permalink' of github.com:coralproject/talk: (101 commits)
  Ready
  Support for refs
  Working
  Any
  progress
  merge conflicts
  Make timeagoFormatter optional
  More colors
  Colors
  Short circuit endless respawn
  fix: new mongo parser
  Remove jest from watcher config, as it doesnt run well inside
  Add jest set
  Apply suggestions
  Move react-timeago to dev
  Upgrade docz
  Cleanup docz scripts
  Support watcher sets
  [next] Support server side jest testing (#1747)
  Make filter only a pure function
  ...
2018-07-16 18:36:21 -03:00
Belén Curcio cecb0b7da7 Merge branch 'permalink' of github.com:coralproject/talk into permalink
* 'permalink' of github.com:coralproject/talk: (101 commits)
  Ready
  Support for refs
  Working
  Any
  progress
  merge conflicts
  Make timeagoFormatter optional
  More colors
  Colors
  Short circuit endless respawn
  fix: new mongo parser
  Remove jest from watcher config, as it doesnt run well inside
  Add jest set
  Apply suggestions
  Move react-timeago to dev
  Upgrade docz
  Cleanup docz scripts
  Support watcher sets
  [next] Support server side jest testing (#1747)
  Make filter only a pure function
  ...
2018-07-16 18:32:30 -03:00
Belén Curcio b1cb624e4f feat: added support for --only flag
Merge pull request #1731 from coralproject/next-watcher-flags

Watcher --only
Use JSDocs comments (#1727)


Merge branch 'next' into prevent-compile-loop-relay
Merge pull request #1726 from coralproject/prevent-compile-loop-relay

[next] Adapt relay watch config
[next] Remove nodemon (#1725)

* Remove old nodemon configs

* Remove nodemon

[next] Jest implementation for React Components (#1733)

* Make jest testing work with custom path and css modules

* Add first test

* feat: added unit tests to ci

* fix: updated package-lock.json

* Update cssTransform.js

* Update cssTransform.js

* Fix test in ci

Adapt files.exclude (#1736)


Permalink ui

Adding Copy to clipboard functionality

WIP

clean request

wip

progress

progress

work in progress

wip

ui functionality

Translations :/

wip

Merge branch 'permalink' of github.com:coralproject/talk into permalink

* 'permalink' of github.com:coralproject/talk: (42 commits)
  [next] Support server side jest testing (#1747)
  Update snapshots
  Add comments
  Remove precss
  Move react-responsive to dev deps
  Remove comment
  Mobile first approach
  Support standard css variables, dynamically set spacing-unit
  Add docs
  Fully implement Flex and MatchMedia
  Responsive Components <3
  fix: linting
  fix: adjusted pageInfo
  Remove obsoloe snapshot
  Move jsdom to dev deps
  Mark comments as always returning a value
  Add comment
  Fix unit tests
  Translate, concept for translation and id strings
  Add aria props
  ...

Adding Attachment and Popover Component

merge conflicts

progress

Any

Working

Support for refs

Ready
2018-07-16 18:31:06 -03:00
Chi Vinh Le 7b929c356e Fix button styling 2018-07-16 18:26:41 -03:00
Belén Curcio 31113e7ecf Ready 2018-07-16 18:23:44 -03:00
Belén Curcio 4982d8d83e Support for refs 2018-07-16 18:19:21 -03:00
Belén Curcio 0cc705d71b Working 2018-07-16 18:10:57 -03:00
Chi Vinh Le f71d449079 Disable hover styling for touches 2018-07-16 18:05:19 -03:00
Chi Vinh Le 35ab62af92 Correct colors 2018-07-16 18:03:35 -03:00
Chi Vinh Le 2c2213893e Add withMouseHover HOC 2018-07-16 18:02:50 -03:00
Belén Curcio 22f9631cb8 Any 2018-07-16 16:42:24 -03:00
Wyatt Johnson 6f6bedb07a feat: production updates 2018-07-16 13:26:41 -06:00
Chi Vinh Le f24c21c94e Support wrapping, disable shrink by default 2018-07-16 16:25:32 -03:00
Chi Vinh Le b34b9e5986 Use readable css names in docz dev 2018-07-16 16:25:20 -03:00
Chi Vinh Le 524994d139 Use builtin types 2018-07-16 16:25:10 -03:00
Wyatt Johnson 34f42c2991 feat: support graphql schema type compilation for watcher 2018-07-16 13:24:02 -06:00
Belén Curcio 7c88c251ea progress 2018-07-16 16:14:56 -03:00
Wyatt Johnson b07073b882 review: tests 2018-07-16 13:14:38 -06:00
Wyatt Johnson 01dab3213a Merge branch 'next' into next-passport 2018-07-16 11:49:31 -06:00
Wyatt Johnson 7e98580264 review: changes for review 2018-07-16 11:38:28 -06:00
Belén Curcio 4db619d825 merge conflicts 2018-07-16 14:25:56 -03:00
Belén Curcio db3db21140 Adding Attachment and Popover Component 2018-07-16 14:04:51 -03:00
Wyatt Johnson f5ef551fb4 review: input.password -> hashedPassword 2018-07-16 10:49:16 -06:00
Belén Curcio f97cab79c8 Merge branch 'permalink' of github.com:coralproject/talk into permalink
* 'permalink' of github.com:coralproject/talk: (42 commits)
  [next] Support server side jest testing (#1747)
  Update snapshots
  Add comments
  Remove precss
  Move react-responsive to dev deps
  Remove comment
  Mobile first approach
  Support standard css variables, dynamically set spacing-unit
  Add docs
  Fully implement Flex and MatchMedia
  Responsive Components <3
  fix: linting
  fix: adjusted pageInfo
  Remove obsoloe snapshot
  Move jsdom to dev deps
  Mark comments as always returning a value
  Add comment
  Fix unit tests
  Translate, concept for translation and id strings
  Add aria props
  ...
2018-07-16 13:42:54 -03:00
Belén Curcio abfa39529f Merge pull request #1730 from coralproject/timestamp
[next] Timestamp - Reader can see relative time of when that comment was posted
2018-07-16 13:39:39 -03:00
Chi Vinh Le 0aa556d288 Make timeagoFormatter optional 2018-07-13 19:58:58 -03:00
Kiwi f693820244 Merge branch 'next' into timestamp 2018-07-13 19:53:34 -03:00
Kiwi 09c941a906 Merge pull request #1748 from coralproject/watch-fixes
[next] Watcher 2.0
2018-07-13 19:53:06 -03:00
Chi Vinh Le 5f756056b1 More colors 2018-07-13 19:49:39 -03:00
Chi Vinh Le 1cd4d537af Colors 2018-07-13 19:46:12 -03:00
Chi Vinh Le 70ccd646ff Short circuit endless respawn 2018-07-13 19:39:15 -03:00
Wyatt Johnson 34ddd2ea0b fix: new mongo parser 2018-07-13 16:33:00 -06:00
Wyatt Johnson 2a7fa08bd6 fix: renamed type file 2018-07-13 14:52:10 -06:00
Wyatt Johnson a2a49b8e45 feat: improved user creation 2018-07-13 14:36:54 -06:00
Chi Vinh Le b6305bec16 Remove jest from watcher config, as it doesnt run well inside 2018-07-13 16:23:36 -03:00
Chi Vinh Le b1a7cdb78f Add jest set 2018-07-13 16:21:31 -03:00
Chi Vinh Le bd4091e41b Merge branch 'watch-fixes' of ssh://github.com/coralproject/talk into watch-fixes 2018-07-13 16:08:18 -03:00
Chi Vinh Le 27334c7bd1 Apply suggestions 2018-07-13 16:07:51 -03:00
Wyatt Johnson 399e9fd59f Merge branch 'next' into watch-fixes 2018-07-13 18:42:56 +00:00
Chi Vinh Le 1c33490bb6 Merge branch 'timestamp' of ssh://github.com/coralproject/talk into timestamp 2018-07-13 15:34:33 -03:00
Chi Vinh Le 34b80165c7 Move react-timeago to dev 2018-07-13 15:34:11 -03:00
Chi Vinh Le 07b910d7a3 Upgrade docz 2018-07-13 15:24:25 -03:00
Chi Vinh Le 911a03ba3d Cleanup docz scripts 2018-07-13 15:03:43 -03:00
Chi Vinh Le 035d241a72 Support watcher sets 2018-07-13 14:56:36 -03:00
Belen Curcio d1d80544ba Merge branch 'next' of github.com:coralproject/talk into permalink 2018-07-13 14:46:41 -03:00
Wyatt Johnson 6ce5d8492f Merge branch 'next' into timestamp 2018-07-13 17:11:05 +00:00
Wyatt Johnson 42d30af27b Merge branch 'next' into next-passport 2018-07-13 16:57:35 +00:00
Kiwi cac0afa61e [next] Support server side jest testing (#1747)
* Support server side jest testing

* feat: more tests
2018-07-13 16:57:25 +00:00
Wyatt Johnson 9c6a06b2c0 Merge branch 'next' into next-passport 2018-07-13 16:51:43 +00:00
Chi Vinh Le e76740c31f Make filter only a pure function 2018-07-13 11:37:56 -03:00
Chi Vinh Le 9684b6046b Parallel cleanup, skip empty watches 2018-07-13 11:26:19 -03:00
Chi Vinh Le d8021f0f33 Support sane watcher + auto detect watchman 2018-07-13 03:13:55 -03:00
Chi Vinh Le 05552f7a84 Use different kill method for watcher 2018-07-13 02:00:23 -03:00
Chi Vinh Le 487a108624 Typography support error color 2018-07-12 21:30:21 -03:00
Chi Vinh Le 1a65aa7635 Fix remaining test 2018-07-12 21:11:24 -03:00
Chi Vinh Le 885e53c34d Remove unnused value 2018-07-12 21:04:08 -03:00
Chi Vinh Le 542df81387 Update tests 2018-07-12 21:01:00 -03:00
Chi Vinh Le ea115dd5ef Fix linting 2018-07-12 20:45:38 -03:00
Chi Vinh Le 057d4254fa Add tests 2018-07-12 20:41:15 -03:00
Chi Vinh Le 809b0d8530 Update snapshts 2018-07-12 20:06:50 -03:00
Chi Vinh Le c7fc6d4243 Organize 2018-07-12 20:00:52 -03:00
Chi Vinh Le ab2c9a2195 Turn on better font rendering 2018-07-12 18:43:03 -03:00
Chi Vinh Le c60c4b3ef8 Make design responsive 2018-07-12 18:38:49 -03:00
Chi Vinh Le ec0adf8492 Show meaningful css names in dev 2018-07-12 18:38:38 -03:00
Chi Vinh Le 067464104a Rename Timestamp to RelativeTime 2018-07-12 16:40:11 -03:00
Chi Vinh Le 6467348296 Merge branch 'next' into timestamp 2018-07-12 16:29:23 -03:00
Chi Vinh Le 11d667cfb8 Update snapshots 2018-07-12 16:23:27 -03:00
Kiwi cf1c5c58c2 Merge pull request #1745 from coralproject/responsive
[next] Responsive Support
2018-07-12 15:59:14 -03:00
Chi Vinh Le ecf9dae9ec Merge branch 'responsive' of ssh://github.com/coralproject/talk into responsive 2018-07-12 14:43:30 -03:00
Chi Vinh Le 01dc5cd47e Update snapshots 2018-07-12 14:42:39 -03:00
Kiwi 59f8c68153 Merge branch 'next' into responsive 2018-07-12 14:35:13 -03:00
Chi Vinh Le ea0456ac76 Add comments 2018-07-12 14:34:40 -03:00
Chi Vinh Le 9f5ce08952 Remove precss 2018-07-12 14:32:56 -03:00
Chi Vinh Le aac63bfd3c Move react-responsive to dev deps 2018-07-12 14:28:10 -03:00
Chi Vinh Le 4f8d016ac8 Remove comment 2018-07-12 14:26:17 -03:00
Chi Vinh Le 2d69982ebb Mobile first approach 2018-07-12 14:23:54 -03:00
Chi Vinh Le ff41fabb37 Support standard css variables, dynamically set spacing-unit 2018-07-12 03:19:14 -03:00
Chi Vinh Le 1a08aba969 Add docs 2018-07-12 02:02:47 -03:00
Chi Vinh Le a79e916a96 Fully implement Flex and MatchMedia 2018-07-12 01:13:23 -03:00
Wyatt Johnson 70ff49ec4f fix: missed users service 2018-07-11 16:49:54 -06:00
Wyatt Johnson 871206740f fix: cleanups for asset 2018-07-11 16:35:20 -06:00
Wyatt Johnson 35ba69c8ed fix: allow url to not be provided 2018-07-11 16:30:57 -06:00
Wyatt Johnson c90f6cbe53 Merge branch 'next' into next-passport 2018-07-11 15:42:52 -06:00
Kiwi 53190f75f1 Merge pull request #1744 from coralproject/comments-connection
[next] Stream comments and replies + pagination
2018-07-11 18:10:32 -03:00
Belén Curcio 43c13c0731 Responsive Components <3 2018-07-11 17:50:21 -03:00
Wyatt Johnson d2368f4cc5 fix: linting 2018-07-11 14:49:18 -06:00
Wyatt Johnson bfede26ddd fix: adjusted pageInfo 2018-07-11 14:24:51 -06:00
Chi Vinh Le 5118d5ae58 Remove obsoloe snapshot 2018-07-11 16:22:35 -03:00
Belén Curcio fc616d1753 wip 2018-07-11 16:14:36 -03:00
Chi Vinh Le 5f9e6b359a Move jsdom to dev deps 2018-07-10 19:17:16 -03:00
Chi Vinh Le ec1eff2b9d Mark comments as always returning a value 2018-07-10 19:14:42 -03:00
Chi Vinh Le 8e87cba52f Add comment 2018-07-10 19:00:22 -03:00
Wyatt Johnson 6efe36ceaa feat: signup enhancements; more extensions to schema 2018-07-10 15:54:52 -06:00
Chi Vinh Le 186f8e1987 Fix unit tests 2018-07-10 18:51:22 -03:00
Chi Vinh Le 358fe97069 Translate, concept for translation and id strings 2018-07-10 18:44:56 -03:00
Wyatt Johnson d46145f04c fix: linting 2018-07-10 13:58:31 -06:00
Wyatt Johnson c5dbe4659b feat: initial signup route 2018-07-10 13:56:20 -06:00
Chi Vinh Le 5e5b0a3888 Add aria props 2018-07-10 16:29:07 -03:00
Wyatt Johnson c0da4e97aa feat: asset url query 2018-07-10 13:11:36 -06:00
Kiwi 093e4fd736 Adapt files.exclude (#1736) 2018-07-10 13:11:36 -06:00
Chi Vinh Le 15cbb94756 Remove AssetList feature 2018-07-10 16:04:02 -03:00
Chi Vinh Le f7ef7ae2b0 Use correct gutter for username 2018-07-10 15:30:39 -03:00
Chi Vinh Le 3355400248 Disable load more and show all button during load 2018-07-10 15:25:36 -03:00
Belén Curcio 37338ceab9 Merge branch 'next' of github.com:coralproject/talk into timestamp
* 'next' of github.com:coralproject/talk:
  Adapt files.exclude (#1736)
  [next] Jest implementation for React Components (#1733)
  [next] Remove nodemon (#1725)
  Use JSDocs comments (#1727)
  feat: added support for --only flag
  Do not rerun relay compiler on its own changes
2018-07-10 13:52:56 -03:00
Belén Curcio 805492931b Implement Timestamp
Merge branch 'next' into timestamp

Fix test and translations

Merge branch 'timestamp' of github.com:coralproject/talk into timestamp

* 'timestamp' of github.com:coralproject/talk:
  Fix test and translations
  Implement Timestamp
2018-07-10 13:34:27 -03:00
okbel 6298a50bbe Translations :/ 2018-07-10 12:33:31 -03:00
Chi Vinh Le 8690646409 Better css classnames in snapshots 2018-07-10 12:29:42 -03:00
Chi Vinh Le d89d4c25b7 Extract Username, Add indent styles 2018-07-10 12:15:39 -03:00
Chi Vinh Le ca12ec652d Throw when wrong args are provided 2018-07-09 21:01:45 -03:00
Chi Vinh Le a18a9ab0c4 Narrow down arguments in stub 2018-07-09 20:55:36 -03:00
okbel 50fdabc0c0 ui functionality 2018-07-09 19:42:24 -03:00
okbel 37fb9ece66 wip 2018-07-09 18:57:41 -03:00
okbel 7ee9f23542 work in progress 2018-07-09 18:37:46 -03:00
Chi Vinh Le 11de453aac Fix showAllReplies test 2018-07-09 17:41:39 -03:00
Chi Vinh Le 25c931cc05 Implement Replies 2018-07-09 16:45:36 -03:00
okbel 99b06445c9 progress 2018-07-09 16:41:40 -03:00
okbel 155b8c7316 progress 2018-07-09 16:39:04 -03:00
okbel b15ea811e5 wip 2018-07-09 14:33:28 -03:00
okbel 6210ae6077 clean request 2018-07-09 11:44:52 -03:00
okbel 50de9a7f84 WIP 2018-07-09 11:37:08 -03:00
okbel 205ef6b4a4 Adding Copy to clipboard functionality 2018-07-09 11:04:16 -03:00
okbel b77f9b8eaf Permalink ui 2018-07-06 23:44:29 -03:00
okbel 89c697b18f Permalink ui 2018-07-06 23:44:29 -03:00
Chi Vinh Le 84dd673c2e Add integration tests! 2018-07-06 21:19:49 -03:00
Chi Vinh Le d7acd23884 Merge branch 'next' into comments-connection 2018-07-06 16:23:09 -03:00
Chi Vinh Le 041e2e9cda Update package-lock.json 2018-07-06 16:22:29 -03:00
Chi Vinh Le b83dabc616 Add unit tests 2018-07-06 16:11:05 -03:00
Chi Vinh Le f7a6b974a3 Support Enzyme and Relay in Jest 2018-07-06 16:10:20 -03:00
Kiwi 4fe85b8dbc Adapt files.exclude (#1736) 2018-07-06 13:08:10 -06:00
Kiwi 01e14cc110 Adapt files.exclude (#1736) 2018-07-06 13:08:10 -06:00
Chi Vinh Le 4a9e620eaf Adapt files.exclude 2018-07-06 15:38:20 -03:00
Chi Vinh Le 2c3e53e573 Make Jest work with Relay! 2018-07-05 19:11:32 -03:00
Wyatt Johnson 15478fe54f fix: linting 2018-07-05 16:03:34 -06:00
Wyatt Johnson b3f850724a Merge branch 'next' into next-passport 2018-07-05 16:01:44 -06:00
Wyatt Johnson 87ce65755c feat: initial local passport strategy 2018-07-05 15:58:19 -06:00
Chi Vinh Le 0fc57ab6a7 Merge branch 'next' into comments-connection 2018-07-05 15:10:37 -03:00
Kiwi 37cb23dd59 [next] Jest implementation for React Components (#1733)
* Make jest testing work with custom path and css modules

* Add first test

* feat: added unit tests to ci

* fix: updated package-lock.json

* Update cssTransform.js

* Update cssTransform.js

* Fix test in ci
2018-07-05 09:04:38 -06:00
Kiwi e4c0e16e1b [next] Jest implementation for React Components (#1733)
* Make jest testing work with custom path and css modules

* Add first test

* feat: added unit tests to ci

* fix: updated package-lock.json

* Update cssTransform.js

* Update cssTransform.js

* Fix test in ci
2018-07-05 09:04:38 -06:00
Chi Vinh Le e1cf3a06f3 Add first tests 2018-07-04 19:04:12 -03:00
Chi Vinh Le ea6eaee0d7 Make jest testing work with custom path and css modules 2018-07-04 19:02:03 -03:00
Wyatt Johnson 3e90877012 feat: added @auth directive 2018-07-04 14:44:26 -06:00
Kiwi e450fa05e0 Use JSDocs comments (#1727) 2018-07-04 14:39:54 -06:00
Wyatt Johnson 6a185e587e feat: added support for --only flag 2018-07-04 14:39:54 -06:00
Chi Vinh Le eb7ddd7310 Do not rerun relay compiler on its own changes 2018-07-04 14:39:54 -06:00
Chi Vinh Le bdd4702a8f Invert and full width 2018-07-04 17:26:37 -03:00
Chi Vinh Le 67790ac9e1 Strict typing for pagination container 2018-07-04 17:24:05 -03:00
Chi Vinh Le 94588951d3 Cleanup Relay Types 2018-07-04 17:16:51 -03:00
Chi Vinh Le 9f79ee1c6d Better relay types 2018-07-04 15:01:47 -03:00
Chi Vinh Le 95bf54366c Merge branch 'next' into comments-connection 2018-07-04 14:42:29 -03:00
Kiwi c9c99623bc [next] Remove nodemon (#1725)
* Remove old nodemon configs

* Remove nodemon
2018-07-04 11:12:43 -06:00
Kiwi 52594dc028 [next] Remove nodemon (#1725)
* Remove old nodemon configs

* Remove nodemon
2018-07-04 11:12:43 -06:00
Kiwi 85c06617e2 Merge pull request #1726 from coralproject/prevent-compile-loop-relay
[next] Adapt relay watch config
2018-07-04 14:07:29 -03:00
Kiwi e58e7c5cad Merge pull request #1726 from coralproject/prevent-compile-loop-relay
[next] Adapt relay watch config
2018-07-04 14:07:29 -03:00
Wyatt Johnson b43b8abede Merge branch 'next' into prevent-compile-loop-relay 2018-07-04 11:02:08 -06:00
Wyatt Johnson 6615dc0ac9 Merge branch 'next' into prevent-compile-loop-relay 2018-07-04 11:02:08 -06:00
Kiwi 1a14c13105 Use JSDocs comments (#1727) 2018-07-04 11:01:08 -06:00
Kiwi ed97f80a00 Use JSDocs comments (#1727) 2018-07-04 11:01:08 -06:00
Kiwi a1fc11a893 Merge pull request #1731 from coralproject/next-watcher-flags
Watcher --only
2018-07-04 13:56:33 -03:00
Kiwi c1ab0d96d8 Merge pull request #1731 from coralproject/next-watcher-flags
Watcher --only
2018-07-04 13:56:33 -03:00
Wyatt Johnson 9afc322314 feat: added support for --only flag 2018-07-04 10:50:10 -06:00
Wyatt Johnson ec6955715f fixed config 2018-07-04 10:21:29 -06:00
Wyatt Johnson 679ad01a7d feat: supported watcher 2018-07-04 10:17:48 -06:00
Wyatt Johnson eacdb7db59 Merge branch 'next' into next-passport 2018-07-04 09:57:07 -06:00
Chi Vinh Le 0784e7dd63 Do not rerun relay compiler on its own changes 2018-07-03 15:49:35 -03:00
Chi Vinh Le 70b88de51a Do not rerun relay compiler on its own changes 2018-07-03 15:49:35 -03:00
Chi Vinh Le 6ac94c8c2a Merge branch 'next' into comments-connection 2018-07-03 15:35:09 -03:00
Kiwi 044e1c2863 Watcher infrastructure (#1724)
* wip

* Adding chokidar and types

* specifiying build tasks

* new structure, new types, executor and watchers

* Adding log

* Fully implemented watchers

* adapt vscode launc

* Add .babelrc.js to toplevel tsconfig project

* Typo

* Get schema path from .graphqlconfig

* Use watcher binary

* Add joi validation to watcher

* Remove fb-watchman for now

* Use correct ignore path

* Fix dist folder

* Allow setting watcher

* Per default only spawn one process at a time

* Support runOnInit

* Rename RestartingExecutor to LongRunningExecutor

* Use debounce instead of throttle

* Remove console log

* Debounce command execution

* Simplify debounce

* Watcher name change

* Typos

* Rename "watcher" root level config to "backend"
2018-07-03 12:21:58 -06:00
Chi Vinh Le 796d24db3d Use pagination container 2018-07-02 19:13:13 -03:00
Wyatt Johnson 1236946312 initial oidc support 2018-06-29 16:11:32 -06:00
Wyatt Johnson ab8fd935e7 Merge branch 'next' into next-passport 2018-06-29 12:46:28 -06:00
Kiwi 9375f3ec23 Use workspace typescript version (#1717) 2018-06-29 12:38:45 -06:00
Kiwi 4494ac8900 Lint remaining js files (#1714)
* Lint remaining js files

* Fix tsconfig
2018-06-29 10:33:16 -06:00
Kiwi 986716b3c3 lint js files, cleanup scripts (#1713) 2018-06-29 15:25:40 +00:00
Wyatt Johnson 986c92598d feature: added generated graph types 2018-06-28 17:06:45 -06:00
Kiwi 65c8da0f34 Merge client into next (#1709)
* Merge client
* Add linting script
* Rename serve to start:development
* Move error harmonization and handling to network layer
* Show Comment Stream
* Added initial test
2018-06-27 22:06:30 +00:00
Wyatt Johnson 68794d5919 added different install 2018-06-27 12:19:54 -06:00
Wyatt Johnson b1f71a8b3e added initial test 2018-06-27 12:17:09 -06:00
Wyatt Johnson bcf5658c36 fix: type adjustments 2018-06-27 11:39:26 -06:00
Wyatt Johnson 3527d350da added blank circleci file 2018-06-26 14:59:03 -06:00
Wyatt Johnson b51e1c9867 fix: added support for strictNullChecks 2018-06-26 14:46:58 -06:00
Wyatt Johnson fa57c72842 linting + initial mutation
- added tslint
- mutation support
2018-06-25 14:32:01 -06:00
Wyatt Johnson 6f80a2458c linting 2018-06-21 10:44:36 -06:00
Wyatt Johnson a3e3d93607 initial subscription support 2018-06-20 15:56:15 -06:00
Wyatt Johnson 1917a17929 refactored design 2018-06-18 15:50:42 -06:00
Wyatt Johnson 7177988059 added mock tenant api 2018-06-16 17:59:21 -06:00
Wyatt Johnson 4318e1ddbe added tenant + graph support 2018-06-16 17:21:04 -06:00
Wyatt Johnson 02e1236792 initial commit 2018-06-16 17:20:51 -06:00
3445 changed files with 155178 additions and 117261 deletions
-21
View File
@@ -1,21 +0,0 @@
{
"presets": [
["es2015", {"modules": false}]
],
"plugins": [
"transform-class-properties",
"transform-decorators-legacy",
"transform-object-assign",
"transform-object-rest-spread",
"transform-async-to-generator",
"transform-react-jsx",
"syntax-dynamic-import"
],
"env": {
"test": {
"plugins": [
["transform-es2015-modules-commonjs", "dynamic-import-node"]
]
}
}
}
+101 -210
View File
@@ -1,60 +1,15 @@
# job_environment will setup the environment for any job being executed.
job_environment: &job_environment
NODE_ENV: test
DISABLE_CREATE_MONGO_INDEXES: TRUE
# job_defaults applies all the defaults for each job.
job_defaults: &job_defaults
working_directory: ~/coralproject/talk
docker:
- image: circleci/node:8
- image: circleci/node:10
environment:
<<: *job_environment
# create_indexes will create the mongo indexes and wait until they have been
# built.
create_indexes: &create_indexes
run:
name: Create the database indexes and wait until they are built
command: ./bin/cli db createIndexes
# integration_environment is the environment that configures the tests.
integration_environment: &integration_environment
<<: *job_environment
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
E2E_MAX_RETRIES: 3
# integration_job runs the integration tests and saves the test results.
integration_job: &integration_job
<<: *job_defaults
environment:
<<: *integration_environment
docker:
# TODO: replace with node:8-browsers when build issues are resolved.
# - image: circleci/node:8-browsers
- image: coralproject/ci
- image: circleci/mongo:3
- image: circleci/redis:4-alpine
steps:
- checkout
- attach_workspace:
at: ~/coralproject/talk
- <<: *create_indexes
# - run:
# name: Setup the database with defaults
# command: ./bin/cli setup --defaults
- run:
name: Run the integration tests
command: bash .circleci/e2e.sh
- store_test_results:
when: always
path: /tmp/circleci-test-results
- store_artifacts:
when: always
path: /tmp/circleci-test-results
version: 2
jobs:
# npm_dependencies will install the dependencies used by all other steps.
@@ -65,16 +20,30 @@ jobs:
- attach_workspace:
at: ~/coralproject/talk
- restore_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
keys:
# Find a cache corresponding to this specific package-lock.json
# checksum when this file is changed, this key will fail.
- v1-dependency-cache-{{ checksum "package-lock.json" }}
# Find the most recently generated cache used from any branch
- v1-dependency-cache-
- run:
name: Update NPM
command: sudo npm update -g npm
# Disabled until there's capabilities to ignore a specific vun. Related:
# https://npm.community/t/please-provide-option-to-ignore-packages-in-npm-audit/403/4
# https://github.com/npm/cli/pull/10
# https://github.com/npm/rfcs/pull/18
#
# - run:
# name: Audit dependencies
# command: npm audit
- run:
name: Install dependencies
command: |
yarn global add node-gyp &&
yarn install --frozen-lockfile
command: npm ci
- save_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
key: v1-dependency-cache-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
- ~/.npm
- persist_to_workspace:
root: .
paths: node_modules
@@ -87,11 +56,44 @@ jobs:
- attach_workspace:
at: ~/coralproject/talk
- run:
name: Perform linting
command: yarn lint
name: Generate schemas and types
command: npm run generate
- run:
name: Lint Source Code
command: npm run lint
- run:
name: Lint README.md
command: |
cp README.md README.md.orig
npm run doctoc
diff -q README.md README.md.orig
# build_assets will build the static assets.
build_assets:
# unit_tests will run the unit tests.
unit_tests:
<<: *job_defaults
environment:
<<: *job_environment
CI: true
JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml"
steps:
- checkout
- attach_workspace:
at: ~/coralproject/talk
- run:
name: Generate schemas and types
command: npm run generate
- run:
name: Perform testing
# We're running these tests in band to avoid errors where the circleci
# test runner runs out of RAM trying to run them all in parallel.
command: npm run test -- --ci --runInBand --testResultsProcessor="jest-junit"
- store_test_results:
path: reports/junit
- store_artifacts:
path: reports/junit
# build will build the static assets and server typescript files.
build:
<<: *job_defaults
steps:
- checkout
@@ -99,136 +101,60 @@ jobs:
at: ~/coralproject/talk
- restore_cache:
keys:
- build-cache-{{ .Branch }}-{{ .Revision }}
- build-cache-{{ .Branch }}-
- build-cache-
- v1-build-cache-{{ .Branch }}-{{ .Revision }}
- v1-build-cache-{{ .Branch }}-
- v1-build-cache-
- run:
name: Build static assets
command: yarn build
name: Build
command: npm run build
no_output_timeout: 30m
- run:
name: Verify Bundle Size
command: npx bundlesize
- save_cache:
key: build-cache-{{ .Branch }}-{{ .Revision }}
key: v1-build-cache-{{ .Branch }}-{{ .Revision }}
paths:
- ./node_modules/.cache/babel-loader
- ./dist
- persist_to_workspace:
root: .
paths: dist
# test_unit will run the unit tests.
test_unit:
<<: *job_defaults
# docker_tests will test that the docker build process completes.
docker_tests:
docker:
- image: circleci/node:8
- image: circleci/mongo:3
- image: circleci/redis:4-alpine
- image: node:10-alpine
environment:
NODE_ENV: development
steps:
- checkout
- attach_workspace:
at: ~/coralproject/talk
- run:
name: Setup the test results directory
command: mkdir -p /tmp/circleci-test-results
name: Update Image Dependencies
command: apk --no-cache add git python
- run:
name: Run the client unit tests
command: yarn test:client --ci
environment:
JEST_JUNIT_OUTPUT: /tmp/circleci-test-results/jest/test-results.xml
JEST_REPORTER: jest-junit
- <<: *create_indexes
- run:
name: Run the server unit tests
command: yarn test:server
environment:
MOCHA_FILE: /tmp/circleci-test-results/mocha/test-results.xml
MOCHA_REPORTER: mocha-junit-reporter
- store_test_results:
when: always
path: /tmp/circleci-test-results
name: Install NodeJS Dependencies
command: npm install
# test_integration_chrome_local will run the integration tests locally with
# chrome headless.
test_integration_chrome_local:
<<: *integration_job
environment:
<<: *integration_environment
E2E_BROWSERS: chrome
# test_integration_firefox_local will run the integration tests locally with
# firefox headless.
test_integration_firefox_local:
<<: *integration_job
environment:
<<: *integration_environment
E2E_BROWSERS: firefox
# test_integration_chrome will run the integration tests with chrome in
# browserstack.
test_integration_chrome:
<<: *integration_job
environment:
<<: *integration_environment
BROWSERSTACK: true
E2E_BROWSERS: chrome
# test_integration_firefox will run the integration tests with firefox in
# browserstack.
test_integration_firefox:
<<: *integration_job
environment:
<<: *integration_environment
BROWSERSTACK: true
E2E_BROWSERS: firefox
# test_integration_edge will run the integration tests with edge in
# browserstack.
test_integration_edge:
<<: *integration_job
environment:
<<: *integration_environment
BROWSERSTACK: true
E2E_BROWSERS: edge
# test_integration_ie will run the integration tests with ie in
# browserstack.
test_integration_ie:
<<: *integration_job
environment:
<<: *integration_environment
BROWSERSTACK: true
E2E_BROWSERS: ie
# TODO: remove when more reliable
E2E_MAX_RETRIES: 1
# test_integration_safari will run the integration tests with safari in
# browserstack.
test_integration_safari:
<<: *integration_job
environment:
<<: *integration_environment
BROWSERSTACK: true
E2E_BROWSERS: safari
# TODO: remove when more reliable
E2E_MAX_RETRIES: 1
# deploy will deploy the application as a docker image.
deploy:
# release_docker will build and push the Docker image.
release_docker:
<<: *job_defaults
steps:
- checkout
- setup_remote_docker
- run:
- deploy:
name: Deploy the code
command: bash ./scripts/docker.sh deploy
no_output_timeout: 30m
# filter_deploy will add the filters for a deploy job in a workflow to make it
# filter_release will add the filters for a deploy job in a workflow to make it
# only execute on a deploy related job.
filter_deploy: &filter_deploy
filter_release: &filter_release
filters:
branches:
only:
- master
- next
tags:
only: /v[0-9]+(\.[0-9]+)*/
only: /^v.*/
# filter_develop will add the filters for a development related commit.
filter_develop: &filter_develop
@@ -240,78 +166,43 @@ filter_develop: &filter_develop
workflows:
version: 2
# All PR's will hit this workflow.
build-and-test:
build-test:
jobs:
- docker_tests:
<<: *filter_develop
- npm_dependencies:
<<: *filter_develop
- lint:
<<: *filter_develop
requires:
- npm_dependencies
- test_unit:
- unit_tests:
<<: *filter_develop
requires:
- npm_dependencies
- build_assets:
- build:
<<: *filter_develop
requires:
- npm_dependencies
- test_integration_chrome_local:
<<: *filter_develop
requires:
- build_assets
# TODO: uncomment when more reliable
# - test_integration_firefox_local:
# <<: *filter_develop
# requires:
# - build_assets
deploy-tagged:
build-test-deploy:
jobs:
- npm_dependencies:
<<: *filter_deploy
<<: *filter_release
- lint:
<<: *filter_deploy
<<: *filter_release
requires:
- npm_dependencies
- test_unit:
<<: *filter_deploy
- unit_tests:
<<: *filter_release
requires:
- npm_dependencies
- build_assets:
<<: *filter_deploy
- build:
<<: *filter_release
requires:
- npm_dependencies
- test_integration_chrome:
<<: *filter_deploy
requires:
- build_assets
- test_integration_firefox:
<<: *filter_deploy
requires:
- build_assets
- test_integration_edge:
<<: *filter_deploy
requires:
- build_assets
# TODO: uncomment when more reliable
# - test_integration_ie:
# <<: *filter_deploy
# requires:
# - build_assets
# - test_integration_safari:
# <<: *filter_deploy
# requires:
# - build_assets
- deploy:
<<: *filter_deploy
- release_docker:
<<: *filter_release
requires:
- lint
- test_unit
- test_integration_chrome
- test_integration_firefox
- test_integration_edge
# TODO: uncomment when more reliable
# - test_integration_ie
# - test_integration_safari
- unit_tests
- build
-29
View File
@@ -1,29 +0,0 @@
#!/bin/bash
REPORTS_FOLDER=${CIRCLE_TEST_REPORTS:-./test/e2e/reports}
CIRCLE_BRANCH=${CIRCLE_BRANCH:-master}
E2E_DISABLE=${E2E_DISABLE:-false}
# Amount of retries before failure.
E2E_MAX_RETRIES=${E2E_MAX_RETRIES:-1}
# Timeout for WaitForConditions.
E2E_WAIT_FOR_TIMEOUT=${E2E_WAIT_FOR_TIMEOUT:-10000}
# Safari >= 8 has issues connecting to browserstack-local. Safari < 8 is too old.
# IE 64bit has issues with receiving keyboard input. Let's wait for them to fix it.
E2E_BROWSERS=${E2E_BROWSERS:-chrome,firefox,edge} #ie safari
if [[ "${E2E_DISABLE}" == "true" ]]; then
echo E2E is disabled.
exit
fi
if [[ "$BROWSERSTACK" == "true" && -n "$BROWSERSTACK_KEY" ]]; then
echo Testing on browserstack
node scripts/e2e.js --reports-folder "$REPORTS_FOLDER" --retries "$E2E_MAX_RETRIES" --timeout "$E2E_WAIT_FOR_TIMEOUT" --browsers "$E2E_BROWSERS" --browserstack
else
# When browserstack is not available test locally.
echo Testing locally
node scripts/e2e.js --reports-folder "$REPORTS_FOLDER" --retries "$E2E_MAX_RETRIES" --timeout "$E2E_WAIT_FOR_TIMEOUT" --browsers "$E2E_BROWSERS" --headless
fi
+25 -15
View File
@@ -1,20 +1,30 @@
# excluded because we'll likely need to rebuild this.
node_modules
# most scripts are used during development and testing, not
# production.
scripts
!scripts/generateIntrospectionResult.js
# documentation should not be visible in production.
docs
# static assets are rebuild in the docker container.
dist
# tests are not run in the docker container.
test
__tests__
coverage
# we won't use the .git folder in production.
.git
# don't include the dependancies
node_modules
# don't include any logs
npm-debug.log*
# don't include any yarn files
yarn-error.log
yarn.lock
# don't include any OS/editor files
.env
.idea/
.vs
.docz
*.swp
*.DS_STORE
# don't include any generated files
dist
*.css.d.ts
__generated__
README.md.orig
+5 -2
View File
@@ -8,5 +8,8 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
[*.json]
insert_final_newline = false
[*.ts]
max_line_length = 80
-5
View File
@@ -1,5 +0,0 @@
**/*.html
dist
node_modules
public
**/*.min.js
-11
View File
@@ -1,11 +0,0 @@
{
"env": {
"jest": true
},
"settings": {
"react": {
"version": "15.0"
}
},
"extends": "@coralproject/eslint-config-talk"
}
-34
View File
@@ -1,34 +0,0 @@
<!--
Thank you for filing an issue on Coral Talk!
Please fill out the questions below so we can take action on your issue as soon as we can.
If you're filing a feature request, you do not need to follow the outline below. Instead please include "Feature Idea" in your issue title and explain a specific example in which that feature would be useful.
-->
#### Do you want to request a **feature** or report a **bug**?
#### Intended outcome:
<!--
What you were trying to accomplish when the bug occurred?
-->
#### Actual outcome:
<!--
What happened instead?
Please provide as much detail as possible, including a screenshot or copy-paste of any related error messages, logs, or other output that might be related. Places to look for information include your browser console, server console, and network logs. The more information you can give the better.
-->
#### How to reproduce the issue:
<!--
Instructions for how the issue can be reproduced by someone from our team or by a contributor. Be as specific as possible, and only mention what is necessary to reproduce the bug. If possible, try to isolate the exact circumstances in which the bug occurs and avoid speculation over what the cause might be.
-->
#### Version and environment
<!--
List what version of Talk you're using, as well as any other relevant environment information, such as operating system or browser
-->
-7
View File
@@ -1,7 +0,0 @@
## What does this PR do?
## How do I test this PR?
- click a button
- view the cat
- see the cat meow
+13 -64
View File
@@ -1,74 +1,23 @@
# don't include the dependancies
node_modules
dist
# don't include any logs
npm-debug.log*
dump.rdb
client/coral-framework/graphql/introspection.json
docs/source/_data/introspection.json
# don't include any yarn files
yarn-error.log
yarn.lock
# don't include any OS/editor files
.env
*.cfg
.idea/
.vs
.docz
*.swp
*.DS_STORE
.prettierrc.json
.vscode
coverage/
test/e2e/reports/
test/e2e/bslocal.log
test/e2e/selenium-debug.log
browserstack.err
plugins.json
plugins/*
!plugins/talk-plugin-akismet
!plugins/talk-plugin-auth
!plugins/talk-plugin-author-menu
!plugins/talk-plugin-comment-content
!plugins/talk-plugin-deep-reply-count
!plugins/talk-plugin-downvote
!plugins/talk-plugin-facebook-auth
!plugins/talk-plugin-featured-comments
!plugins/talk-plugin-flag-details
!plugins/talk-plugin-google-auth
!plugins/talk-plugin-ignore-user
!plugins/talk-plugin-like
!plugins/talk-plugin-local-auth
!plugins/talk-plugin-love
!plugins/talk-plugin-member-since
!plugins/talk-plugin-mod
!plugins/talk-plugin-moderation-actions
!plugins/talk-plugin-notifications
!plugins/talk-plugin-notifications-category-featured
!plugins/talk-plugin-notifications-category-moderation-actions
!plugins/talk-plugin-notifications-category-reply
!plugins/talk-plugin-notifications-category-staff
!plugins/talk-plugin-notifications-digest-daily
!plugins/talk-plugin-notifications-digest-hourly
!plugins/talk-plugin-offtopic
!plugins/talk-plugin-permalink
!plugins/talk-plugin-profile-data
!plugins/talk-plugin-remember-sort
!plugins/talk-plugin-respect
!plugins/talk-plugin-rich-text
!plugins/talk-plugin-slack-notifications
!plugins/talk-plugin-sort-most-downvoted
!plugins/talk-plugin-sort-most-liked
!plugins/talk-plugin-sort-most-loved
!plugins/talk-plugin-sort-most-replied
!plugins/talk-plugin-sort-most-respected
!plugins/talk-plugin-sort-most-upvoted
!plugins/talk-plugin-sort-newest
!plugins/talk-plugin-sort-oldest
!plugins/talk-plugin-subscriber
!plugins/talk-plugin-toxic-comments
!plugins/talk-plugin-upvote
!plugins/talk-plugin-viewing-options
**/node_modules/*
yarn-error.log
# don't include any generated files
dist
*.css.d.ts
__generated__
README.md.orig
+7
View File
@@ -0,0 +1,7 @@
{
"projects": {
"tenant": {
"schemaPath": "src/core/server/graph/tenant/schema/schema.graphql"
}
}
}
-13
View File
@@ -1,13 +0,0 @@
{
"linters": {
"*.js": [
"git-exec-and-restage eslint --fix --"
],
"bin/cli*": [
"git-exec-and-restage eslint --fix --"
],
"*.yml": [
"yamllint"
]
}
}
-10
View File
@@ -1,10 +0,0 @@
{
"exec": "npm-run-all --parallel generate-introspection start:development",
"ignore": ["test/*", "client/*", "dist/*", "plugins/*/client", "docs/*"],
"ext": "js,json,graphql,yml",
"watch": [
".",
"bin/cli",
"bin/cli-serve"
]
}
-13
View File
@@ -1,13 +0,0 @@
{
"exceptions": [
"https://nodesecurity.io/advisories/531",
"https://nodesecurity.io/advisories/532",
"https://nodesecurity.io/advisories/566",
"https://nodesecurity.io/advisories/577",
"https://nodesecurity.io/advisories/594",
"https://nodesecurity.io/advisories/603",
"https://nodesecurity.io/advisories/611",
"https://nodesecurity.io/advisories/612",
"https://nodesecurity.io/advisories/654"
]
}
+1 -1
View File
@@ -1,2 +1,2 @@
8
10
+1
View File
@@ -0,0 +1 @@
node_modules
-4
View File
@@ -1,4 +0,0 @@
overrides:
- files: "bin/cli*"
options:
parser: babylon
+3
View File
@@ -0,0 +1,3 @@
{
"trailingComma": "es5"
}
+27
View File
@@ -0,0 +1,27 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"cwd": "${workspaceFolder}",
"args": [
"-r",
"ts-node/register",
"-r",
"tsconfig-paths/register",
"${workspaceFolder}/src/index.ts"
],
"env": {
"TS_NODE_PROJECT": "${workspaceFolder}/src/tsconfig.json",
// Set to 1 here beacuse clustering gets all weird with logging + output.
"CONCURRENCY": "1"
},
"outputCapture": "std"
}
]
}
+19
View File
@@ -0,0 +1,19 @@
{
"editor.formatOnSave": true,
"files.associations": {
"*.css": "postcss"
},
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
".vs": true
},
"tslint.exclude": "**/node_modules/**",
"tslint.autoFixOnSave": true,
"tslint.jsEnable": true,
"typescript.tsdk": "node_modules/typescript/lib",
"postcss.validate": false
}
-7
View File
@@ -1,7 +0,0 @@
# Vox Media Code of Conduct
## Introduction
This code of conduct governs the environment of the Vox Product team. We created it not because we anticipate bad behavior, but because we believe that articulating our values and obligations to one another reinforces the already exceptional level of respect among the team and because having a code provides us with clear avenues to correct our culture should it ever stray from that course. We make this code public in the hopes of contributing to the ongoing conversation about inclusion in the tech, design, and media communities and encourage other teams to fork it and make it their own. To our team, we commit to enforce and evolve this code as our team grows.
Read the rest here: http://code-of-conduct.voxmedia.com/
-73
View File
@@ -1,73 +0,0 @@
# Contributor's Guide
Welcome! We are very excited that you are interested in contributing to Talk.
This document is a companion to help you approach contributing. If it does not do so, please [let us know how we can improve it](https://github.com/coralproject/talk/issues)!
By contributing to this project you agree to the [Code of Conduct](CODE_OF_CONDUCT.md).
## What should I Contribute?
There are at least three ways to contribute to Talk:
* Writing Code
* Writing Docs
* Providing Translations
## Writing Code
Conversation surrounding contributions begins in [issues](https://github.com/coralproject/talk/issues).
### When should I create an issue?
File an issue as soon as you have an idea of something you'd like to contribute. We would love to hear what you're thinking and help refine the idea to make it into the Talk ecosystem.
Please file issues if:
* you would like to contribute to Talk Core.
* you are building a Plugin that the current Plugin API doesn't support.
* you are building a Plugin and want advice.
### What should I include?
Coral has adopted an iterative, agile development philosophy. All contributions that make it into the Talk repository should start with a user story in this form:
> As a [type of Coral user] I'd like to [do something] so that I can [get some result/value].
This exercise does two things:
* allows us to ground our technical choices in a clear, simple product need.
* expresses that product need in a way that doesn't imply a specific technical solution allowing for debate as to the best way to solve the problem.
Please feel free to provide as much detail as possible when filing the issue but please do keep the initial issue specific to one need and try to avoid including technical or design solutions.
If you have a specific technical or design solution in mind, please submit it as the first comment on the thread.
## Contributing Documentation
Clear docs are a prerequisite for a successful open source project. Contributing to the documentation is often more important than contributing to the code!
We are looking for _documentarians_ to:
* make clarity, grammar and completeness updates,
* create new / missing sections, and
* take the lead in making sections, or the over all structure better.
Our documentation is stored in markdown files in the [docs](docs) directory. We
use [Hexo](https://hexo.io/) to provide our docs. To preview:
```shell
cd docs
yarn
yarn start
```
Then visit http://127.0.0.1:4000/talk/.
If you'd like to discuss a contribution, please [file an issue](https://github.com/coralproject/talk/issues) describing the changes you would like to see.
## Contributing Translations
Talk's translations are stored in `.yml` files [here](https://github.com/coralproject/talk/tree/master/locales).
Translations can be submitted via pull request. If you do not use github, you can use 'en.yml' as a template and [email](https://coralproject.net/contact) the translations to us. We can import it into the repository.
+23 -18
View File
@@ -1,28 +1,33 @@
FROM node:8-alpine
FROM node:10-alpine
# Create app directory
# Install build dependancies.
RUN apk --no-cache add git python
# Create app directory.
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Setup the environment
ENV PATH /usr/src/app/bin:$PATH
ENV TALK_PORT 5000
EXPOSE 5000
# Bundle app source
COPY . /usr/src/app
# Ensure the runtime of the container is in production mode.
# Setup the environment for production.
ENV NODE_ENV production
# Bundle application source.
COPY . /usr/src/app
# Store the current git revision.
ARG REVISION_HASH
ENV REVISION_HASH=${REVISION_HASH}
RUN mkdir -p dist/core/common/__generated__ && \
echo "{\"revision\": \"${REVISION_HASH}\"}" > dist/core/common/__generated__/revision.json
# Install app dependencies and build static assets.
RUN yarn global add node-gyp && \
yarn install --frozen-lockfile && \
yarn build && \
yarn cache clean
# Install build static assets and clear caches.
RUN NODE_ENV=development npm install && \
npm run generate && \
npm run build && \
npm prune --production
CMD ["yarn", "start"]
# Setup the environment
ENV PATH /usr/src/app/bin:$PATH
ENV PORT 5000
EXPOSE 5000
ENV NODE_ENV production
CMD ["npm", "run", "start"]
-27
View File
@@ -1,27 +0,0 @@
FROM coralproject/talk:latest
# Setup the build arguments
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
ONBUILD ARG TALK_DEFAULT_LANG=en
ONBUILD ARG TALK_WHITELISTED_LANGUAGES
ONBUILD ARG TALK_PLUGINS_JSON
ONBUILD ARG TALK_WEBPACK_SOURCE_MAP
ONBUILD ARG TALK_DEFAULT_LAZY_RENDER
# Bundle app source
ONBUILD COPY . /usr/src/app
# At this stage, we need to install the development dependencies again because
# we need to have webpack available. We then build the new dependencies and
# clear out the development dependencies again. After this we of course need to
# clear out the yarn cache, this saves quite a lot of size.
ONBUILD RUN cli plugins reconcile && \
yarn && \
yarn build && \
yarn cache clean
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright 2018 Mozilla Foundation
Copyright 2019 Vox Media, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
+223 -20
View File
@@ -1,40 +1,243 @@
# Talk &middot; [![CircleCI](https://circleci.com/gh/coralproject/talk.svg?style=svg)](https://circleci.com/gh/coralproject/talk) &middot; [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md#pull-requests)
# talk ![CircleCI](https://img.shields.io/circleci/project/github/coralproject/talk/next.svg)
Online comments are broken. Our open-source commenting platform, Talk, rethinks how moderation, comment display, and conversation function, creating the opportunity for safer, smarter discussions around your work. [Read more about Talk here](https://coralproject.net/talk).
Online comments are broken. Our open-source commenting platform, Talk, rethinks
how moderation, comment display, and conversation function, creating the
opportunity for safer, smarter discussions around your work.
[Read more about Talk here](https://coralproject.net/talk).
Built with <3 by The Coral Project, a part of [Vox Media](https://www.voxmedia.com/).
Built with <3 by The Coral Project, a part of [Vox Media](https://product.voxmedia.com/).
## Getting Started
Preview Talk easily by running Talk via a Heroku App:
Check out our Quickstart and Install guides to get started with Talk in our [Technical Docs](https://docs.coralproject.net/talk/).
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/coralproject/talk/tree/next)
## Product Guide
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
## Table of Contents
Learn more about Talk, including a deep dive into features for commenters and moderators, and FAQs in our [Talk Product Guide](https://docs.coralproject.net/talk/how-talk-works).
- [Requirements](#requirements)
- [Running](#running)
- [Docker](#docker)
- [Source](#source)
- [Development](#development)
- [Design Language System (UI Components)](#design-language-system-ui-components)
- [Configuration](#configuration)
- [License](#license)
## Pre-Launch Guide
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
Youve installed Talk on your server, and youre preparing to launch it on your site. The real community work starts now, before you go live. You have a unique opportunity pre-launch to set your community up for success. Read our [Talk Community Guide](https://coralproject.net/blog/youve-installed-talk-now-what/).
## Requirements
## Advanced Usage
- MongoDB >=3.6
- Redis >=3.2
- NodeJS >=10
- NPM >=6.7
For advanced configuration and usage of Talk, check out our [Configuration](https://docs.coralproject.net/talk/advanced-configuration/) and [Integration](https://docs.coralproject.net/talk/integrating/authentication/) how-tos. This covers topics in which you will need dev support to fully customize and integrate Talk, such as SSO/authentication, creating and managing assets and articles, styling Talk with custom CSS, and setting up Notifications and SMTP support.
## Running
## Versions & Upgrading
You can install Talk using Docker or via Source. We recommend Docker, as it
provides the easiest deployment solution going forward, as all the dependencies
are baked and shipped with the provided
[coralproject/talk:next](https://hub.docker.com/r/coralproject/talk) image.
When v5 releases to master, you'll be able to select it using
`coralproject/talk:5`.
Check our Releases page for the latest recommended release version. [Releases](https://github.com/coralproject/talk/releases) All future even-numbered versions are considered stable LTS versions. We recommend the latest verified release for use in production environments.
### Docker
## More Resources
The easiest way to get started with Talk is through our published Docker image
and provided example `docker-compose.yml` file. The following assumes that you
have Docker and Docker Compose installed on your local machine:
- [Our Blog](https://coralproject.net/blog)
- [Community Guides for Journalism](https://guides.coralproject.net/)
- [More About Us](https://coralproject.net/)
- Install Docker: https://docs.docker.com/install/
- Install Docker Compose: https://docs.docker.com/compose/install/ (this is typically included in the Docker Desktop editions already)
## End-to-End Testing
```bash
# Create directories to persist the data in MongoDB and Redis.
mkdir -p data/{mongo,redis}
Talk uses [Nightwatch](http://nightwatchjs.org/) as our e2e testing framework. The testing infrastructure that allows us to run our tests in real browsers is provided with love by our friends at [Browserstack](https://browserstack.com).
# Create the `docker-compose.yml` file to get started.
cat > docker-compose.yml <<EOF
version: "2"
services:
talk:
image: coralproject/talk:next
restart: always
ports:
- "127.0.0.1:3000:5000"
depends_on:
- mongo
- redis
environment:
- MONGODB_URI=mongodb://mongo:27017/talk
- REDIS_URI=redis://redis:6379
- SIGNING_SECRET=<replace me with something secret>
mongo:
image: mongo:3.6
volumes:
- ./data/mongo:/data/db
redis:
image: redis:3.2
volumes:
- ./data/redis:/data
EOF
[![Browserstack](/public/img/browserstack_logo.png)](https://browserstack.com)
# Start up Talk using Docker.
docker-compose up -d
```
Then head on over to http://localhost:3000 to install Talk!
### Source
Talk requires NodeJS >=10, we recommend using `nvm` to help manage node
versions: https://github.com/creationix/nvm.
```bash
# Clone and cd into the Talk directory.
git clone https://github.com/coralproject/talk.git
cd talk
# Install dependencies.
npm install
# Build the application dependencies.
# This might take a while.
npm run build
```
This should output all the compiled application code to `./dist`.
Running Talk with default settings assumes that you have:
- MongoDB >=3.6 running on `127.0.0.1:27017`
- Redis >=3.2 running on `127.0.0.1:6379`
If you don't already have these databases running, you can execute the following
assuming you have Docker installed on your local machine:
```bash
docker run -d -p 27017:27017 --restart always --name mongo mongo:3.6
docker run -d -p 6379:6379 --restart always --name redis redis:3.2
```
Then start Talk with:
```bash
# Start the server in production mode.
npm run start
```
Then head on over to http://localhost:3000 to install Talk!
### Development
Running Talk for development is very similar to installing Talk via Source as
described above.
Talk requires NodeJS >=10, we recommend using `nvm` to help manage node
versions: https://github.com/creationix/nvm.
```bash
# Clone and cd into the Talk directory.
git clone https://github.com/coralproject/talk.git
cd talk
# Install dependencies.
npm install
```
Running Talk with default settings assumes that you have:
- MongoDB >=3.6 running on `127.0.0.1:27017`
- Redis >=3.2 running on `127.0.0.1:6379`
If you don't already have these databases running, you can execute the following
assuming you have Docker installed on your local machine:
```bash
docker run -d -p 27017:27017 --restart always --name mongo mongo:3.6
docker run -d -p 6379:6379 --restart always --name redis redis:3.2
```
Then start Talk with:
```bash
# Run the server in development mode in order to facilitate auto-restarting and
# rebuilding when file changes are detected. This might take a while to fully run.
npm run watch
```
When the client code has been built, navigate to http://localhost:8080/install.html
to start the installation wizard. **Note: Ensure `localhost:8080` is used in the permitted domains list.**
To see the comment stream goto http://localhost:8080/.
To run linting and tests use the following commands:
```bash
# Run the linters.
npm run lint
# Run our unit and integration tests.
npm run test
```
#### Design Language System (UI Components)
We use [docz](https://docz.site) to document and develop our Design Language System. To start docz run:
```bash
# Make sure CSS types are generated.
# This is not required when `npm run watch` is already running.
npm run generate:css-types
# Run docz in development.
npm run docz -- dev
```
After compilation has finished you can access docz at http://localhost:3030/.
## Configuration
The following environment variables can be set to configure the Talk Server. You
can expose them in your shell via `export NODE_ENV=development` or by placing
the variables in a `.env` file in the root of the project in a simple
`NODE_ENV=development` format delimited by newlines.
- `NODE_ENV` - Can be one of `production` or `development`. All production
deployments should use `production`. Defaults to `production` when ran with
`npm run start` and `development` when run with `npm run start:development`.
- `PORT` - The port to listen for HTTP and Websocket requests. (Default `3000`)
- `MONGODB_URI` - The MongoDB database URI to connect to.
(Default `mongodb://127.0.0.1:27017/talk`)
- `REDIS_URI` - The Redis database URI to connect to.
(Default `redis://127.0.0.1:6379`)
- `SIGNING_SECRET` - The shared secret to use to sign JSON Web Tokens (JWT) with
the selected signing algorithm. 🚨 **Don't forget to set this variable!** 🚨
(Default: `keyboard cat`)
- `SIGNING_ALGORITHM` - The signing algorithm to use for signing JWT's.
(Default `HS256`).
- `LOGGING_LEVEL` - The logging level that can be set to one of `fatal`,
`error`, `warn`, `info`, `debug`, or `trace`. (Default `info`)
- `STATIC_URI` - The URI that static assets can be accessed from. This URI can
be to a proxy that uses this Talk server on `PORT` as the upstream. Disabled
by default.
- `DISABLE_TENANT_CACHING` - When `true`, all tenants will be loaded from the
database when needed rather than keeping a in-memory copy in sync via
published events on Redis. (Default `false`)
- `DISABLE_MONGODB_AUTOINDEXING` - When `true`, Talk will not perform indexing
operations when it starts up. This can be desired when you've already
installed Talk on the target MongoDB, but want to improve start performance.
(Default `false`)
- `LOCALE` - Specify the default locale to use for all requests without a locale
specified. (Default `en-US`)
- `ENABLE_GRAPHIQL` - When `true`, it will enable the `/graphiql` even in
production, use with care. (Default `false`)
- `CONCURRENCY` - The number of worker nodes to spawn to handle web traffic,
this should be tied to the number of CPU's available. (Default
`os.cpus().length`)
- `DEV_PORT` - The port where the Webpack Development server is running on.
(Default `8080`)
## License
-108
View File
@@ -1,108 +0,0 @@
const express = require('express');
const nunjucks = require('nunjucks');
const cons = require('consolidate');
const trace = require('./middleware/trace');
const logging = require('./middleware/logging');
const path = require('path');
const merge = require('lodash/merge');
const helmet = require('helmet');
const plugins = require('./services/plugins');
const { HELMET_CONFIGURATION } = require('./config');
const { MOUNT_PATH } = require('./url');
const routes = require('./routes');
const debug = require('debug')('talk:app');
const { ENABLE_TRACING, APOLLO_ENGINE_KEY, PORT } = require('./config');
const app = express();
// Add the trace middleware first, it will create a request ID for each request
// downstream.
app.use(trace);
//==============================================================================
// PLUGIN PRE APPLICATION MIDDLEWARE
//==============================================================================
// Inject server route plugins.
plugins.get('server', 'app').forEach(({ plugin, app: callback }) => {
debug(`added plugin '${plugin.name}'`);
// Pass the app to the plugin to mount it's routes.
callback(app);
});
//==============================================================================
// APPLICATION WIDE MIDDLEWARE
//==============================================================================
// Add the logging middleware only if we aren't testing.
if (process.env.NODE_ENV !== 'test') {
app.use(logging.log);
}
if (ENABLE_TRACING && APOLLO_ENGINE_KEY) {
const { Engine } = require('apollo-engine');
const engine = new Engine({
engineConfig: {
apiKey: APOLLO_ENGINE_KEY,
},
graphqlPort: PORT,
endpoint: `${MOUNT_PATH}api/v1/graph/ql`,
});
engine.start();
app.use(engine.expressMiddleware());
}
// Trust the first proxy in front of us, this will enable us to trust the fact
// that SSL was terminated correctly.
app.set('trust proxy', 1);
// Enable a suite of security good practices through helmet. We disable
// frameguard to allow crossdomain injection of the embed.
app.use(
helmet(
merge(HELMET_CONFIGURATION, {
frameguard: false,
})
)
);
//==============================================================================
// VIEW CONFIGURATION
//==============================================================================
// configure the default views directory.
const views = path.join(__dirname, 'views');
app.set('views', views);
// reconfigure nunjucks.
cons.requires.nunjucks = nunjucks.configure(views, {
autoescape: true,
trimBlocks: true,
lstripBlocks: true,
watch: process.env.NODE_ENV === 'development',
});
// assign the nunjucks engine to .njk files.
app.engine('njk', cons.nunjucks);
// assign the ejs engine to .ejs and .html files.
app.engine('ejs', cons.ejs);
app.engine('html', cons.ejs);
// set .ejs as the default extension.
app.set('view engine', 'ejs');
//==============================================================================
// ROUTES
//==============================================================================
debug(`mounting routes on the ${MOUNT_PATH} path`);
// Actually apply the routes.
app.use(MOUNT_PATH, routes);
module.exports = app;
+37 -38
View File
@@ -1,41 +1,40 @@
{
"name": "The Coral Project: Talk",
"env": {
"TALK_JWT_SECRET": {
"description": "The session secret",
"generator": "secret"
},
"TALK_ROOT_URL": {
"description": "Please copy the App Name you choose above. If you did not choose one, please do so now and copy it here. Talk on Heroku will not work without this setting.",
"value":"https://<COPY APP NAME HERE>.herokuapp.com",
"required": true
},
"TALK_FACEBOOK_APP_ID": {
"value": "",
"required": true
},
"TALK_FACEBOOK_APP_SECRET": {
"value": "",
"required": true
},
"MAILGUN_SMTP_PASSWORD": {
"value": "",
"required": true
},
"NODE_ENV": "production",
"REWRITE_ENV": "TALK_MONGO_URL:MONGO_URI,TALK_REDIS_URL:REDIS_URL,TALK_SMTP_HOST:MAILGUN_SMTP_SERVER,TALK_SMTP_PORT:MAILGUN_SMTP_PORT,TALK_SMTP_USERNAME:MAILGUN_SMTP_LOGIN,TALK_SMTP_PASSWORD:MAILGUN_SMTP_PASSWORD",
"NPM_CONFIG_PRODUCTION": "false"
"name": "Talk",
"description": "A better commenting experience from Vox Media.",
"env": {
"REWRITE_ENV": {
"description": "Used to rewrite the environment variables set by Heroku.",
"value": "REDIS_URI:REDIS_URL,MONGODB_URI:MONGO_URI"
},
"addons": [{
"plan": "mongolab:sandbox",
"as": "MONGO"
}, {
"plan": "rediscloud:30",
"as": "REDIS"
}, {
"plan": "mailgun:starter",
"as": "MAILGUN"
}],
"image": "heroku/nodejs",
"success_url": "/admin/install"
"SIGNING_SECRET": {
"description":
"The shared secret to use to sign JSON Web Tokens (JWT) with the selected signing algorithm.",
"generator": "secret"
},
"CONCURRENCY": {
"description": "The number of worker nodes to spawn to handle traffic.",
"value": "1"
},
"LOCALE": {
"description":
"Specify the default locale to use for all requests without a locale specified",
"value": "en-US"
},
"ENABLE_GRAPHIQL": {
"description": "When true, this will enable the GraphiQL routes",
"value": "false"
}
},
"addons": [
{
"plan": "mongolab:sandbox",
"as": "MONGO"
},
{
"plan": "rediscloud:30",
"as": "REDIS"
}
],
"success_url": "/install",
"website": "https://github.com/coralproject/talk"
}
+30
View File
@@ -0,0 +1,30 @@
/**
* This is a project wide babel configuration.
* https://babeljs.io/docs/en/config-files#project-wide-configuration
*
* We use this file to apply babel configuration to packages in `node_modules`
*/
const lodashOptimizations =
process.env.WEBPACK === "true" ? ["use-lodash-es", "lodash"] : [];
module.exports = {
env: {
production: {
plugins: [...lodashOptimizations],
},
development: {
plugins: [...lodashOptimizations],
},
test: {
presets: [
[
"@babel/env",
{ targets: "last 2 versions, ie 11", modules: "commonjs" },
],
"@babel/react",
],
plugins: ["dynamic-import-node"],
},
},
};
-24
View File
@@ -1,24 +0,0 @@
#!/usr/bin/env node
const program = require('commander');
// We're requiring this here so it'll setup some promise rejection hooks to log
// out.
require('./util');
// Setup the program.
program
.command('serve', 'serve the application')
.command('db', 'run database commands')
.command('settings', 'interact with the application settings')
.command('assets', 'interact with assets')
.command('setup', 'setup the application')
.command('jobs', 'work with the job queues')
.command('token', 'work with the access tokens')
.command('users', 'work with the application auth')
.command('migration', 'provides utilities for migrating the database')
.command(
'plugins',
'provides utilities for interacting with the plugin system'
)
.parse(process.argv);
-297
View File
@@ -1,297 +0,0 @@
#!/usr/bin/env node
/**
* Module dependencies.
*/
const util = require('./util');
const program = require('commander');
const parseDuration = require('ms');
const Table = require('cli-table2');
const AssetModel = require('../models/asset');
const CommentModel = require('../models/comment');
const AssetsService = require('../services/assets');
const mongoose = require('../services/mongoose');
const scraper = require('../services/scraper');
const Context = require('../graph/context');
const inquirer = require('inquirer');
const { URL } = require('url');
// Register the shutdown criteria.
util.onshutdown([() => mongoose.disconnect()]);
/**
* Lists all the assets registered in the database.
*/
async function listAssets(opts) {
try {
let assets = await AssetModel.find({}).sort({ created_at: 1 });
switch (opts.format) {
case 'json': {
console.log(JSON.stringify(assets, null, 2));
break;
}
default: {
let table = new Table({
head: ['ID', 'Title', 'URL'],
});
assets.forEach(asset => {
table.push([
asset.id,
asset.title ? asset.title : '',
asset.url ? asset.url : '',
]);
});
console.log(table.toString());
break;
}
}
util.shutdown();
} catch (e) {
console.error(e);
util.shutdown(1);
}
}
async function refreshAssets(ageString) {
try {
const query = AssetModel.find({}, { id: 1 });
if (ageString) {
// An age was specified, so filter only those assets.
const ageMs = parseDuration(ageString);
const age = new Date(Date.now() - ageMs);
query.merge({
$or: [
{
scraped: {
$lte: age,
},
},
{
scraped: null,
},
],
});
}
// Create a graph context.
const ctx = Context.forSystem();
// Load the assets.
const cursor = query.cursor();
// Queue all the assets for scraping.
const promises = [];
let asset = await cursor.next();
while (asset) {
promises.push(scraper.create(ctx, asset.id));
asset = await cursor.next();
}
await Promise.all(promises);
console.log(`${promises.length} Assets were queued to be scraped.`);
util.shutdown();
} catch (e) {
console.error(e);
util.shutdown(1);
}
}
async function updateURL(assetID, assetURL) {
try {
await AssetsService.updateURL(assetID, assetURL);
console.log(`Asset ${assetID} was updated to have url ${assetURL}.`);
util.shutdown();
} catch (e) {
console.error(e);
util.shutdown(1);
}
}
async function merge(srcID, dstID) {
try {
// Grab the assets...
let [srcAsset, dstAsset] = await AssetsService.findByIDs([srcID, dstID]);
if (!srcAsset || !dstAsset) {
throw new Error('Not all assets indicated by id exist, cannot merge');
}
// Count the affected resources...
let srcCommentCount = await CommentModel.find({ asset_id: srcID }).count();
console.log(
`Now going to update ${srcCommentCount} comments and delete the source Asset[${srcID}].`
);
let { confirm } = await inquirer.prompt([
{
type: 'confirm',
name: 'confirm',
message: 'Proceed with merge',
default: false,
},
]);
if (confirm) {
// Perform the merge!
await AssetsService.merge(srcID, dstID);
} else {
console.warn('Aborting merge');
}
util.shutdown(0);
} catch (e) {
console.error(e);
util.shutdown(1);
}
}
async function rewrite(search, replace, options) {
try {
search = new RegExp(search);
const assets = await AssetModel.find({
url: { $regex: search },
});
if (assets.length === 0) {
console.log(`No assets found with the pattern: ${search}`);
return util.shutdown(0);
}
let opts = [];
assets.forEach(({ id, url: oldURL }) => {
// Replace the url.
const newURL = oldURL.replace(search, replace);
// Try to validate that the new url is valid.
try {
new URL(newURL);
} catch (err) {
throw new Error(
`Rewrite would have replaced the valid URL ${oldURL} with an invalid one ${newURL}`
);
}
opts.push({
find: { id },
updateOne: { $set: { url: newURL } },
id,
oldURL,
newURL,
});
});
if (opts.length > 0) {
if (options.dryRun) {
const table = new Table({ head: ['ID', 'Old URL', 'New URL'] });
opts.forEach(({ id, oldURL, newURL }) => {
table.push([id, oldURL, newURL]);
});
console.log(table.toString());
} else {
const bulk = AssetModel.collection.initializeUnorderedBulkOp();
opts.forEach(({ find, updateOne, oldURL, newURL }) => {
// If the url was updated with the operation, then queue up the update op.
if (newURL !== oldURL) {
bulk.find(find).updateOne(updateOne);
}
});
await bulk.execute();
console.log(`${opts.length} assets had their url's updated`);
}
}
util.shutdown(0);
} catch (err) {
console.error(err);
util.shutdown(1);
}
}
/**
* debugAssetURL will scrape the given URL and print it's scraped values.
*/
async function debugAssetURL(url) {
try {
const meta = await scraper.scrape(url);
const table = new Table({ head: ['Property', 'Value'] });
for (const [property, value] of Object.entries(meta)) {
table.push([property, value]);
}
console.log(table.toString());
util.shutdown(0);
} catch (err) {
console.error(err);
util.shutdown(1);
}
}
//==============================================================================
// Setting up the program command line arguments.
//==============================================================================
program
.command('list')
.option(
'--format <type>',
'Specify the output format [table]',
/^(table|json)$/i,
'table'
)
.description('list all the assets in the database')
.action(listAssets);
program
.command('debug [url]')
.description(
'prints the scraped metadata that would be added to the given asset'
)
.action(debugAssetURL);
program
.command('refresh [age]')
.description('queues the assets that exceed the age requested')
.action(refreshAssets);
program
.command('update-url <assetID> <url>')
.description('update the URL of an asset')
.action(updateURL);
program
.command('merge <srcID> <dstID>')
.description(
'merges two assets together by moving comments from src to dst and deleting the src asset'
)
.action(merge);
program
.command('rewrite <search> <replace>')
.option('-d, --dry-run', 'enables dry run of the replacement')
.description(
"rewrites asset url's using the provided regex replacement pattern"
)
.action(rewrite);
program.parse(process.argv);
// If there is no command listed, output help.
if (!process.argv.slice(2).length) {
program.outputHelp();
util.shutdown();
}
-53
View File
@@ -1,53 +0,0 @@
#!/usr/bin/env node
const util = require('./util');
const program = require('commander');
const config = require('../config');
async function createIndexes() {
try {
// Ensure we enable the index creation.
config.CREATE_MONGO_INDEXES = true;
// TODO: handle the plugin index creation?
// Let's register the shutdown hooks.
util.onshutdown([() => require('../services/mongoose').disconnect()]);
// Lets create all the database indexes for the application and wait for all
// them to finish their indexing.
const models = [
require('../models/action'),
require('../models/asset'),
require('../models/comment'),
require('../models/setting'),
require('../models/user'),
require('../models/migration'),
];
// Call the `.init()` method to setup all the indexes on each model.
// `init()` returns a promise that resolves when the indexes have finished
// building successfully. The `init()` function is idempotent, so we don't
// have to worry about triggering an index rebuild.
await Promise.all(models.map(Model => Model.init()));
console.log('Indexes created');
util.shutdown(0);
} catch (err) {
console.error(err);
util.shutdown(1);
}
}
program
.command('createIndexes')
.description('creates the database indexes and waits until they are created')
.action(createIndexes);
program.parse(process.argv);
// If there is no command listed, output help.
if (process.argv.length <= 2) {
program.outputHelp();
util.shutdown();
}
-130
View File
@@ -1,130 +0,0 @@
#!/usr/bin/env node
/**
* Module dependencies.
*/
const util = require('./util');
const program = require('commander');
const jobs = require('../jobs');
const mongoose = require('../services/mongoose');
const kue = require('../services/kue');
util.onshutdown([() => mongoose.disconnect()]);
/**
* Starts the job processor.
*/
function processJobs() {
// The scraper only needs to shutdown when the scraper has actually been
// started.
util.onshutdown([() => kue.Task.shutdown()]);
// Start the jobs processor.
jobs.process();
}
/**
* Removes a single job.
* @param {Object} job the job to be removed
* @return {Promise}
*/
function removeJob(job) {
return new Promise((resolve, reject) =>
job.remove(err => {
if (err) {
return reject(err);
}
return resolve(job);
})
);
}
/**
* Get the top n jobs with a specific state.
* @param {String} [state='complete'] state to list jobs by
* @param {Number} limit limit of jobs to load
* @return {Promise}
*/
function rangeJobsByState(state, limit) {
return new Promise((resolve, reject) => {
kue.Job.rangeByState(state, 0, limit, 'asc', (err, jobs) => {
if (err) {
return reject(err);
}
resolve(jobs);
});
});
}
async function getJobBatch(n, includeStuck) {
let jobs = [];
jobs = await rangeJobsByState('complete', n);
if (includeStuck) {
jobs = jobs.concat(await rangeJobsByState('failed', n));
}
return jobs;
}
/**
* Cleans up the jobs that are in the queue.
*/
async function cleanupJobs(options) {
// The scraper only needs to shutdown when the scraper has actually been
// started.
util.onshutdown([() => kue.Task.shutdown()]);
const n = 100;
try {
// Connect to redis by establishing a queue.
kue.Task.connect();
let jobCount = 0;
let jobs = await getJobBatch(n, options.stuck);
while (jobs.length > 0) {
// Remove all the jobs.
await Promise.all(jobs.map(job => removeJob(job)));
jobCount += jobs.length;
// Get the next batch of jobs.
jobs = await getJobBatch(n, options.stuck);
}
util.shutdown();
console.log(`Removed ${jobCount} jobs`);
} catch (err) {
console.error(err);
util.shutdown(1);
}
}
//==============================================================================
// Setting up the program command line arguments.
//==============================================================================
program
.command('process')
.description('starts job processing')
.action(processJobs);
program
.command('cleanup')
.option('-s, --stuck', 'cleans up jobs that have been stuck', false)
.description('cleans up inactive jobs')
.action(cleanupJobs);
program.parse(process.argv);
// If there is no command listed, output help.
if (process.argv.length <= 2) {
program.outputHelp();
util.shutdown();
}
-129
View File
@@ -1,129 +0,0 @@
#!/usr/bin/env node
/**
* Module dependencies.
*/
const util = require('./util');
const _ = require('lodash');
const program = require('commander');
const inquirer = require('inquirer');
const mongoose = require('../services/mongoose');
const MigrationService = require('../services/migration');
// Register shutdown hooks.
util.onshutdown([() => mongoose.disconnect()]);
async function createMigration(name) {
try {
// Create the migration.
await MigrationService.create(name);
util.shutdown();
} catch (e) {
console.error(e);
util.shutdown(1);
}
}
async function runMigrations(options) {
const { yes, queryBatchSize, updateBatchSize } = options;
try {
if (!yes) {
const { backedUp } = await inquirer.prompt([
{
type: 'confirm',
name: 'backedUp',
message: 'Did you perform a database backup',
default: false,
},
]);
if (!backedUp) {
throw new Error(
'Please backup your databases prior to migrations occuring'
);
}
}
// Get the migrations to run.
const migrations = await MigrationService.listPending();
console.log('Now going to run the following migrations:\n');
for (const { filename } of migrations) {
console.log(`\tmigrations/${filename}`);
}
if (!yes) {
const { confirm } = await inquirer.prompt([
{
type: 'confirm',
name: 'confirm',
message: 'Proceed with migrations',
default: false,
},
]);
if (confirm) {
// Run the migrations.
await MigrationService.run(migrations, {
queryBatchSize,
updateBatchSize,
});
} else {
console.warn('Skipping migrations');
}
} else {
// Run the migrations.
await MigrationService.run(migrations, {
queryBatchSize,
updateBatchSize,
});
}
util.shutdown();
} catch (e) {
console.error(e);
util.shutdown(1);
}
}
//==============================================================================
// Setting up the program command line arguments.
//==============================================================================
program
.command('create <name>')
.description('creates a new migration')
.action(createMigration);
// Bypasses issue that defaults + coercion doesn't work well together.
// Ref: https://github.com/tj/commander.js/issues/400#issuecomment-310860869
const parse10 = _.ary(_.partialRight(parseInt, 10), 1);
program
.command('run')
.option(
'-q, --query-batch-size <n>',
'change the size of queried documents that are batched at a time',
parse10,
10000
)
.option(
'-u, --update-batch-size <n>',
'change the size of documents that are batched before the update is sent',
parse10,
20000
)
.option('-y, --yes', 'will answer yes to all questions')
.description('runs all pending migrations')
.action(runMigrations);
program.parse(process.argv);
// If there is no command listed, output help.
if (process.argv.length <= 2) {
program.outputHelp();
util.shutdown();
}
-406
View File
@@ -1,406 +0,0 @@
#!/usr/bin/env node
/**
* Module dependencies.
*/
// Interface heavily inspired by the yarn package manager:
// https://yarnpkg.com/
require('./util');
const program = require('commander');
const inquirer = require('inquirer');
// Make things colorful!
require('colors');
const emoji = require('node-emoji');
const fs = require('fs-extra');
const path = require('path');
const dir = path.resolve(__dirname, '..');
const spawn = require('cross-spawn');
const semver = require('semver');
const resolve = require('resolve');
const { plugins, iteratePlugins, isInternal } = require('../plugins');
function existsInNodeModules(name) {
try {
resolve.sync(name, { basedir: dir });
return true;
} catch (e) {
return false;
}
}
function versionMatch(name, version) {
try {
let matched = false;
resolve.sync(name, {
basedir: dir,
packageFilter: pkg => {
if (pkg && pkg.version && semver.satisfies(pkg.version, version)) {
matched = true;
}
return pkg;
},
});
return matched;
} catch (e) {
return false;
}
}
const EXTERNAL = /^\w[a-z\-0-9.]+$/; // Match "react", "path", "fs", "lodash.random", etc.
function reconcilePackages({ quiet = false, upgradeRemote = false }) {
const fetchable = [];
const local = [];
const upgradable = [];
if (!quiet) {
console.log();
console.log(' +local (l) packages in your project');
console.log(' +external (e) packages are external');
console.log(' +outofdate (oe) packages are external but are out of date');
console.log(' +missing (m) packages are not found');
console.log();
}
for (let i in plugins) {
let section = iteratePlugins(plugins[i]);
for (let j in section) {
let { name, version } = section[j];
let namespaced = name.charAt(0) === '@';
let dep = name
.split('/')
.slice(0, namespaced ? 2 : 1)
.join('/');
// Ignore relative modules, which aren't installed by NPM
if (!dep.match(EXTERNAL) && !namespaced) {
return;
}
if (isInternal(dep)) {
if (!quiet) {
console.log(` l ${name}`);
}
local.push({ name, version });
continue;
}
if (!existsInNodeModules(dep)) {
if (!quiet) {
console.log(` m ${name}`);
}
fetchable.push({ name, version });
} else if (!versionMatch(dep, version)) {
// A plugin was found, yet the current version does not match the
// current version installed. We should warn if upgradeRemote is
// not enabled that it is currently not supported.
if (!upgradeRemote) {
if (!quiet) {
console.warn(` oe ${name} (package upgrade may be required)`.bgRed);
}
continue;
}
console.log(` oe ${name} (package upgrade may be required)`);
upgradable.push({ name, version });
} else {
if (!quiet) {
console.log(` e ${name}`);
}
if (upgradeRemote) {
upgradable.push({ name, version });
}
}
}
}
if (!quiet) {
console.log();
}
return { local, fetchable, upgradable };
}
async function reconcileRemotePlugins({ dryRun, upgradeRemote }) {
console.log(`\n['1/2'] ${emoji.get('mag')} Reconciling plugins...`.yellow);
const { fetchable, upgradable } = reconcilePackages({ upgradeRemote });
console.log(`['2/2'] ${emoji.get('truck')} Fetching plugins...\n`.yellow);
if (fetchable.length > 0) {
console.log(
`$ yarn add --ignore-scripts --ignore-workspace-root-check ${fetchable
.map(({ name, version }) => `${name}@${version}`.cyan)
.join(' ')}`
);
if (!dryRun) {
let args = [
'add',
'--ignore-scripts',
'--ignore-workspace-root-check',
...fetchable.map(({ name, version }) => `${name}@${version}`),
];
let output = spawn.sync('yarn', args, {
stdio: ['ignore', 'pipe', 'inherit'],
});
if (output.status) {
throw new Error(
'Could not install external plugins, errors occurred during install'
);
}
console.log(output.stdout.toString());
}
}
if (upgradable.length > 0) {
console.log(
`$ yarn upgrade ${upgradable.map(
({ name, version }) => `${name}@${version}`.cyan
)}`
);
if (!dryRun) {
let args = [
'upgrade',
...upgradable.map(({ name, version }) => `${name}@${version}`),
];
let output = spawn.sync('yarn', args, {
stdio: ['ignore', 'pipe', 'inherit'],
});
if (output.status) {
throw new Error(
'Could not install external plugins, errors occurred during install'
);
}
console.log(output.stdout.toString());
}
}
return { upgradable, fetchable };
}
// This traverses the local plugins and installs any dependencies listed there,
// this only is really needed for plugins that are installed via docker because
// core plugins will have their dependencies already included in core.
async function reconcilePluginDeps({ dryRun, upgradeRemote }) {
try {
let startTime = new Date();
// Locate any external plugins and install them.
const results = await reconcileRemotePlugins({
dryRun,
upgradeRemote,
});
let status;
if (dryRun) {
status = '[dry-run] success'.green;
} else {
status = 'success'.green;
}
let message;
if (results.upgradable.length === 0 && results.fetchable.length === 0) {
message = 'Already up-to-date.';
} else if (results.upgradable.length === 0) {
message = `Fetched ${results.fetchable.length} new plugins.`;
} else if (results.fetchable.length === 0) {
message = `Upgraded ${results.upgradable.length} new plugins.`;
} else {
message = `Fetched ${results.fetchable.length} new plugins, upgraded ${
results.upgradable.length
} plugins.`;
}
console.log(`\n${status} ${message}`);
let endTime = new Date();
let totalTime = ((endTime.getTime() - startTime.getTime()) / 1000).toFixed(
2
);
console.log(`✨ Done in ${totalTime}s.`);
} catch (err) {
console.error(err);
process.exit(1);
}
}
async function createSeedPlugin() {
const pluginsDir = path.resolve(__dirname, '..', 'plugins');
function pluginNameExists(pluginName) {
const pluginNames = fs.readdirSync(pluginsDir);
return !!pluginNames.filter(pn => pn === pluginName).length;
}
let answers = await inquirer.prompt([
{
type: 'input',
name: 'pluginName',
message: 'Plugin Name:',
validate: input => {
if (pluginNameExists(input)) {
return 'Please, choose another name. That name already exists';
}
if (input && input.length > 0) {
return true;
}
return 'Plugin Name is required.';
},
},
{
type: 'confirm',
name: 'server',
message: 'Is this plugin extending the server capabilities?',
},
{
type: 'confirm',
name: 'client',
message: 'Is this plugin extending the client capabilities?',
},
{
type: 'confirm',
name: 'addPluginsJson',
message: 'Should we add it to the plugins.json?',
},
]);
//==============================================================================
// Creating plugin seed
//==============================================================================
const seedPlugin = path.join(__dirname, 'templates/plugin');
const newPluginPath = path.join(pluginsDir, answers.pluginName);
if (fs.existsSync(seedPlugin)) {
if (answers.server && answers.client) {
// This is a server-side and client-side plugin!, let's copy the template
fs.copySync(seedPlugin, newPluginPath);
} else {
fs.copySync(seedPlugin, newPluginPath, {
filter: p => {
// Allowing plugin folder and files with no subfolders
const rootRx = /plugin$|plugin\/[^/]*(\.).{2,3}/gim;
if (
rootRx.test(p) &&
(fs.lstatSync(p).isDirectory() || fs.lstatSync(p).isFile())
) {
return true;
}
// If it's a client-side plugin, copying client folder
if (answers.client) {
return /client/.test(p);
}
// If it's a server-side plugin, copying server folder
if (answers.server) {
return /server/.test(p);
}
},
});
}
// Let's add this to the plugins.json
if (answers.addPluginsJson) {
const pluginsJson = path.resolve(__dirname, '..', 'plugins.json');
let j;
try {
j = await fs.readJson(pluginsJson);
} catch (err) {
// Fallback to plugins.default.json if the plugins.json file does not
// exist.
const defaultPluginsJson = path.resolve(
__dirname,
'..',
'plugins.default.json'
);
try {
j = await fs.readJson(defaultPluginsJson);
} catch (err) {
// Fallback to an empty one if that also, doesn't exist.
j = { client: [], server: [] };
}
}
// This is a client-side plugin, let's push this.
if (answers.client) {
j.client.push(answers.pluginName);
const output = JSON.stringify(j, null, 2);
fs.writeFileSync(pluginsJson, output);
}
// This is a server-side plugin, let's push this.
if (answers.server) {
j.server.push(answers.pluginName);
const output = JSON.stringify(j, null, 2);
fs.writeFileSync(pluginsJson, output);
}
}
console.log(
`✨ Yay! Plugin created! Find your plugin: ${
answers.pluginName
} in the ./plugins folder`
);
}
}
//==============================================================================
// Setting up the program command line arguments.
//==============================================================================
program
.command('create')
.description('creates a seed plugin')
.action(createSeedPlugin);
program
.command('list')
.description('')
.action(reconcilePackages);
program
.command('reconcile')
.description('reconciles dependencies by downloading external plugins')
.option('-u, --upgrade-remote', 'upgrades remote dependencies')
.option(
'-d, --dry-run',
'does not actually change anything on the filesystem acts only as a simulation'
)
.action(reconcilePluginDeps);
program.parse(process.argv);
// If there is no command listed, output help.
if (!process.argv.slice(2).length) {
program.outputHelp();
}
-41
View File
@@ -1,41 +0,0 @@
#!/usr/bin/env node
const throng = require('throng');
const { CONCURRENCY } = require('../config');
const { logger } = require('../services/logging');
const util = require('./util');
const program = require('commander');
//==============================================================================
// Setting up the program command line arguments.
//==============================================================================
program
.option('-j, --jobs', 'enable job processing on this thread')
.option(
'--disabled-jobs <jobs>',
'disable jobs specified if the -j option is passed, specified as a comma separated list',
val => val.split(','),
[]
)
.option(
'-w, --websockets',
'enable the websocket (subscriptions) handler on this thread'
)
.parse(process.argv);
throng({
workers: CONCURRENCY,
start: i => {
logger.info({ workerID: i }, 'started worker');
// Load in the serve.
const serve = require('../serve');
// Start serving.
serve(program).catch(err => {
console.error(err);
util.shutdown(1);
});
},
});
-62
View File
@@ -1,62 +0,0 @@
#!/usr/bin/env node
const util = require('./util');
const program = require('commander');
const inquirer = require('inquirer');
const mongoose = require('../services/mongoose');
const Settings = require('../services/settings');
const cache = require('../services/cache');
// Register the shutdown criteria.
util.onshutdown([() => mongoose.disconnect()]);
/**
* Change the organization name
*/
async function changeOrgName() {
try {
await cache.init();
// Get the original settings.
const settings = await Settings.select('organizationName');
const { organizationName } = await inquirer.prompt([
{
name: 'organizationName',
message: 'Organization Name',
default: settings.organizationName,
},
]);
if (settings.organizationName !== organizationName) {
// Set the organization name if there was a mutation to it.
await Settings.update({ organizationName });
console.log('Settings were updated.');
} else {
console.log('No update needed, no change was made.');
}
} catch (err) {
console.error(err);
util.shutdown(1);
} finally {
util.shutdown();
}
}
//==============================================================================
// Setting up the program command line arguments.
//==============================================================================
program
.command('change-org-name')
.description('change the organization name')
.action(changeOrgName);
program.parse(process.argv);
// If there is no command listed, output help.
if (!process.argv.slice(2).length) {
program.outputHelp();
util.shutdown();
}
-222
View File
@@ -1,222 +0,0 @@
#!/usr/bin/env node
/**
* Module dependencies.
*/
const util = require('./util');
const program = require('commander');
const inquirer = require('inquirer');
const mongoose = require('../services/mongoose');
const SettingModel = require('../models/setting');
const MODERATION_OPTIONS = require('../models/enum/moderation_options');
const SettingsService = require('../services/settings');
const SetupService = require('../services/setup');
const UsersService = require('../services/users');
const MigrationService = require('../services/migration');
const { ErrSettingsInit, ErrSettingsNotInit } = require('../errors');
const Context = require('../graph/context');
// Register the shutdown criteria.
util.onshutdown([() => mongoose.disconnect()]);
//==============================================================================
// Setting up the program command line arguments.
//==============================================================================
program
.description('runs the setup wizard to setup the application')
.option('--defaults', 'apply defaults for config instead of prompting')
.parse(process.argv);
//==============================================================================
// Setup the application
//==============================================================================
const performSetup = async () => {
// Get the current settings, we are expecing an error here.
try {
// Try to get the settings.
await SettingsService.retrieve();
// We should NOT have gotten a settings object, this means that the
// application is already setup. Error out here.
throw new ErrSettingsInit();
} catch (err) {
// If the error is `not init`, then we're good, otherwise, it's something
// else.
if (!err instanceof ErrSettingsNotInit) {
throw err;
return;
}
}
if (program.defaults) {
await SettingsService.init();
// Get the migrations to run.
let migrations = await MigrationService.listPending();
// Perform all migrations.
await MigrationService.run(migrations);
console.log('Settings created.');
console.log('\nTalk is now installed!');
return;
}
// Create the base settings model.
let settings = new SettingModel();
console.log(
"\nWe'll ask you some questions in order to setup your installation of Talk.\n"
);
let answers = await inquirer.prompt([
{
type: 'input',
name: 'organizationName',
message: 'Organization Name',
default: settings.organizationName,
validate: input => {
if (input && input.length > 0) {
return true;
}
return 'Organization Name is required.';
},
},
{
type: 'list',
choices: MODERATION_OPTIONS,
name: 'moderation',
default: settings.moderation,
message: 'Select a moderation mode',
},
{
type: 'confirm',
name: 'requireEmailConfirmation',
default: settings.requireEmailConfirmation,
message: 'Should emails always be confirmed',
},
]);
// Update the settings that were changed.
Object.keys(answers).forEach(key => {
if (answers[key] !== undefined) {
settings[key] = answers[key];
}
});
answers = await inquirer.prompt([
{
type: 'confirm',
name: 'inputWhitelistedDomains',
default: true,
message: 'Would you like to specify a whitelisted domain',
},
{
type: 'input',
name: 'whitelistedDomain',
message: 'Whitelisted Domain',
when: ({ inputWhitelistedDomains }) => inputWhitelistedDomains,
validate: input => {
if (input && input.length > 0) {
return true;
}
return 'Whitelisted Domain cannot be empty.';
},
},
]);
if (answers.inputWhitelistedDomains) {
settings.domains.whitelist = [answers.whitelistedDomain];
}
console.log("\nWe'll ask you some questions about your first admin user.\n");
let { username, email } = await inquirer.prompt([
{
type: 'input',
name: 'username',
message: 'Username',
filter: username => {
return UsersService.isValidUsername(username, false).catch(err => {
throw err.message;
});
},
},
{
name: 'email',
message: 'Email',
format: 'email',
validate: value => {
if (value && value.length >= 3) {
return true;
}
return 'Email is required';
},
},
]);
let password = '';
while (!password) {
answers = await inquirer.prompt([
{
name: 'password',
message: 'Password',
type: 'password',
filter: password => {
try {
UsersService.isValidPassword(password);
} catch (err) {
throw err.message;
}
return password;
},
},
{
name: 'confirmPassword',
message: 'Confirm Password',
type: 'password',
},
]);
if (answers.password !== answers.confirmPassword) {
console.error('Passwords do not match');
} else {
password = answers.password;
}
}
const ctx = Context.forSystem();
let { user: newUser } = await SetupService.setup(ctx, {
settings: settings.toObject(),
user: {
email,
username,
password,
},
});
console.log('Settings created.');
console.log(`User ${newUser.id} created.`);
console.log('\nTalk is now installed!');
console.log(
'\nWe recommend adding TALK_INSTALL_LOCK=TRUE to your environment to turn off the dynamic setup.'
);
};
// Start the setup process.
performSetup()
.then(() => {
util.shutdown();
})
.catch(e => {
console.error(e);
util.shutdown(1);
});
-91
View File
@@ -1,91 +0,0 @@
#!/usr/bin/env node
/**
* Module dependencies.
*/
const util = require('./util');
const program = require('commander');
const mongoose = require('../services/mongoose');
const TokensService = require('../services/tokens');
const Table = require('cli-table2');
// Register the shutdown criteria.
util.onshutdown([() => mongoose.disconnect()]);
async function listTokens(userID) {
try {
let tokens = await TokensService.list(userID);
let table = new Table({
head: ['ID', 'Name', 'Status'],
});
tokens.forEach(token => {
table.push([token.id, token.name, token.active ? 'Active' : 'Revoked']);
});
console.log(table.toString());
util.shutdown();
} catch (e) {
console.error(e);
util.shutdown(1);
}
}
async function revokeToken(tokenID) {
try {
await TokensService.revoke(null, tokenID);
console.log(`Revoked Token[${tokenID}]`);
util.shutdown();
} catch (e) {
console.error(e);
util.shutdown(1);
}
}
async function createToken(userID, tokenName) {
try {
let {
pat: { id },
jwt,
} = await TokensService.create(userID, tokenName);
console.log(`Created Token[${id}] for User[${userID}] = ${jwt}`);
util.shutdown();
} catch (e) {
console.error(e);
util.shutdown(1);
}
}
//==============================================================================
// Setting up the program command line arguments.
//==============================================================================
program
.command('list <userID>')
.description('list tokens for a user')
.action(listTokens);
program
.command('revoke <tokenID>')
.description('revokes a token with a given id')
.action(revokeToken);
program
.command('create <userID> <tokenName>')
.description('create a token for a user with a given name')
.action(createToken);
program.parse(process.argv);
// If there is no command listed, output help.
if (!process.argv.slice(2).length) {
program.outputHelp();
util.shutdown();
}
-347
View File
@@ -1,347 +0,0 @@
#!/usr/bin/env node
/**
* Module dependencies.
*/
const util = require('./util');
const program = require('commander');
const inquirer = require('inquirer');
const { stripIndent } = require('common-tags');
const Table = require('cli-table2');
// Make things colorful!
require('colors');
// Register the autocomplete plugin.
inquirer.registerPrompt(
'autocomplete',
require('inquirer-autocomplete-prompt')
);
const Context = require('../graph/context');
const UsersService = require('../services/users');
const UserModel = require('../models/user');
const USER_ROLES = require('../models/enum/user_roles');
const mongoose = require('../services/mongoose');
// Register the shutdown criteria.
util.onshutdown([() => mongoose.disconnect()]);
/**
* Deletes a user and cleans up their associated verifications.
*/
async function deleteUser(userID) {
try {
// Find the user we're removing.
const user = await UserModel.findOne({ id: userID });
if (!user) {
throw new Error(`user with id ${userID} not found`);
}
printUserAsTable(user);
console.warn(stripIndent`
This will delete the above user.
This might take a long time if there is a lot of data, please confirm that
you want to continue.
`);
const { confirm } = await inquirer.prompt({
type: 'confirm',
name: 'confirm',
message: 'Continue',
default: false,
});
if (!confirm) {
return util.shutdown();
}
const ctx = Context.forSystem();
const { data, errors } = await ctx.graphql(
`
mutation DeleteUser($user_id: ID!) {
delUser(id: $user_id) {
errors {
translation_key
}
}
}
`,
{ user_id: user.id }
);
if (errors) {
throw errors;
}
if (data.errors) {
throw data.errors;
}
console.log('User was deleted.');
util.shutdown();
} catch (err) {
console.error(err);
util.shutdown(1);
}
}
function printUserAsTable(user) {
let table = new Table({});
table.push(
{ ID: user.id.gray },
{ Username: user.username },
{ Emails: user.emails },
{ Tags: user.tags ? user.tags.map(({ tag: { name } }) => name) : '' },
{ Role: user.role },
{ Verified: user.hasVerifiedEmail },
{ Username: user.status.username.status },
{ Banned: user.banned },
{
Suspension: user.suspended
? `Until ${user.status.suspension.until}`
: false,
},
{ 'Always premod comments': user.alwaysPremod }
);
console.log(table.toString());
}
/**
* Searches for users based on their username and email address.
*/
async function searchUsers() {
const ctx = Context.forSystem();
const searchQuery = `
query SearchUsers($value: String) {
users(query: {value: $value}) {
nodes {
id
username
role
profiles {
id
provider
}
}
}
}
`;
try {
const answers = await inquirer.prompt({
type: 'autocomplete',
name: 'userID',
message: 'Search for a user',
source: async (answers, value) => {
if (value === null) {
value = '';
}
const { data, errors } = await ctx.graphql(searchQuery, {
value,
});
if (errors && errors.length > 0) {
throw errors[0];
}
if (data.users === null) {
return [];
}
return data.users.nodes.map(user => {
const emails = user.profiles
.filter(({ provider }) => provider === 'local')
.map(({ id }) => id)
.join(', ');
return {
name: `${user.username} (${emails}) ${user.id.gray} - ${
user.role.gray
}`,
value: user.id,
};
});
},
});
const { userID } = answers;
const user = await UserModel.findOne({ id: userID });
printUserAsTable(user);
util.shutdown(0);
} catch (err) {
console.error(err);
util.shutdown(1);
}
}
/**
* Adds a role to a user
* @param {String} userUD id of the user to add the role to
* @param {String} role the role to add
*/
async function setUserRole(userID) {
try {
const { role } = await inquirer.prompt([
{
name: 'role',
message: 'User Role',
type: 'list',
choices: USER_ROLES,
},
]);
await UsersService.setRole(userID, role);
console.log(`Set User ${userID} to the ${role} role.`);
util.shutdown();
} catch (err) {
console.error(err);
util.shutdown(1);
}
}
/**
* Verifies an email address for a user.
*
* @param userID the user's id
* @param email the user's email address to be verified, otherwise verifies the
* first email if there is one, if there are multiple, you get a
* prompt.
*/
async function verifyUserEmail(userID, email) {
try {
// Get the user.
const user = await UserModel.findOne({ id: userID });
if (!user) {
throw new Error(`user with ID ${userID} cannot be found`);
}
// Get all the user's email addresses.
const emails = user.emails;
if (emails.length === 0) {
throw new Error('user did not have any email addresses');
}
if (!email && emails.length === 1) {
// The email wasn't passed, and there is only one option.
email = emails[0];
} else if (!emails.includes(email)) {
// The email passed doesn't belong to this user.
throw new Error(`user does not have the email ${email}`);
} else if (emails.length > 1) {
// The email wasn't passed, and there is more than one choice.
const answers = await inquirer.prompt([
{
name: 'email',
message: 'Select Email to Verify',
type: 'list',
choices: emails,
},
]);
email = answers.email;
}
// Verify the email.
await UsersService.confirmEmail(userID, email);
console.log(`User ${userID} had their email ${email} verified.`);
util.shutdown();
} catch (err) {
console.error(err);
util.shutdown(1);
}
}
/**
* createUser will prompt the user for the user information when creating a
* local user.
*/
async function createUser() {
try {
const answers = await inquirer.prompt([
{
name: 'email',
message: 'Email',
},
{
name: 'username',
message: 'Username',
},
{
name: 'password',
message: 'Password',
type: 'password',
},
{
name: 'role',
message: 'Role',
type: 'list',
choices: USER_ROLES,
},
]);
const { email, username, password, role } = answers;
const ctx = Context.forSystem();
// Create the user.
const user = await UsersService.createLocalUser(
ctx,
email,
password,
username
);
// Set the role.
await UsersService.setRole(user.id, role);
console.log(`Created User[${user.id}]`);
util.shutdown(0);
} catch (err) {
console.error(err);
util.shutdown(1);
}
}
//==============================================================================
// Setting up the program command line arguments.
//==============================================================================
program
.command('create')
.description('creates a local user')
.action(createUser);
program
.command('delete <userID>')
.description('delete a user')
.action(deleteUser);
program
.command('list')
.description('searches for a user based on their stored username and email')
.action(searchUsers);
program
.command('set-role <userID>')
.description('sets the role on a user')
.action(setUserRole);
program
.command('verify <userID> <email>')
.description("verifies the given user's email address")
.action(verifyUserEmail);
program.parse(process.argv);
// If there is no command listed, output help.
if (!process.argv.slice(2).length) {
program.outputHelp();
util.shutdown();
}
@@ -1,23 +0,0 @@
{
"env": {
"browser": true,
"es6": true,
"mocha": true
},
"parserOptions": {
"sourceType": "module",
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
}
},
"parser": "babel-eslint",
"plugins": [
"react"
],
"rules": {
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"no-console": ["warn", { "allow": ["warn", "error"] }]
}
}
@@ -1,27 +0,0 @@
.myPluginContainer {
padding: 10px;
background: #f0f0f0;
border: 1px solid #d6d6d6;
margin: 10px 0;
text-align: center;
border-radius: 3px;
}
.logo {
position: block;
animation: spin 2s infinite ease;
animation-delay: 1s;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.description {
color: #444444;
}
@@ -1,25 +0,0 @@
import React from 'react';
import { CoralLogo } from 'plugin-api/beta/client/components/ui';
import styles from './MyPluginComponent.css';
class MyPluginComponent extends React.Component {
render() {
return (
<div className={styles.myPluginContainer}>
<CoralLogo className={styles.logo} />
<div className={styles.description}>
<h3>Plugin created by Talk CLI</h3>
<small>
To read more about plugins check{' '}
<a href="https://docs.coralproject.net/talk/plugins-client">
our docs and guides!
</a>
</small>
</div>
</div>
);
}
}
export default MyPluginComponent;
-25
View File
@@ -1,25 +0,0 @@
/**
This is a client index example file and it could look like this:
```
import LoveButton from './components/LoveButton';
export default {
slots: {
commentReactions: [LoveButton]
},
reducer,
translations
};
```
To read more info on how to build client plugins. Please, go to: https://docs.coralproject.net/talk/plugins-client
*/
import MyPluginComponent from './components/MyPluginComponent';
export default {
slots: {
stream: [MyPluginComponent],
},
};
@@ -1,15 +0,0 @@
#
# This file is for translations and they should look like this:
#
#
# ```
# en:
# talk-plugin-respect:
# respect: Respect
# respected: Respected
# es:
# talk-plugin-respect:
# respect: Respetar
# respected: Respetado
# ```
#
-1
View File
@@ -1 +0,0 @@
module.exports = {};
-68
View File
@@ -1,68 +0,0 @@
// Setup the environment.
require('../services/env');
const debug = require('debug')('talk:util');
const { uniq } = require('lodash');
// Setup the utilities.
const util = {};
/**
* Stores an array of functions that should be executed in the event that the
* application needs to shutdown.
* @type {Array}
*/
util.toshutdown = [];
/**
* Calls all the shutdown functions and then ends the process.
* @param {Number} [defaultCode=0] default return code upon successful shutdown.
*/
util.shutdown = (defaultCode = 0, signal = null) => {
if (signal) {
debug(`Reached ${signal} signal`);
}
debug(`${util.toshutdown.length} jobs now being called`);
Promise.all(util.toshutdown.map(func => (func ? func(signal) : null)))
.then(() => {
debug('Shutdown complete, now exiting');
process.exit(defaultCode);
})
.catch(err => {
console.error(err);
process.exit(1);
});
};
/**
* Waits until an event is triggered by the node runtime and elevates a series
* of jobs to be ran in the event we need to shutdown.
* @param {Array} jobs Array of promise capable shutdown functions that are
* executed.
*/
util.onshutdown = jobs => {
debug(`${jobs.length} jobs registered to be called during shutdown`);
// Add the new jobs to shutdown to the object reference.
util.toshutdown = uniq(util.toshutdown.concat(jobs));
};
// Attach to the SIGTERM + SIGINT handles to ensure a clean shutdown in the
// event that we have an external event. SIGUSR2 is called when the app is asked
// to be 'killed', same procedure here.
process.once('SIGTERM', () => util.shutdown(0, 'SIGTERM'));
process.once('SIGINT', () => util.shutdown(0, 'SIGINT'));
process.once('SIGUSR2', () => util.shutdown(0, 'SIGUSR2'));
// Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will
// terminate the Node.js process with a non-zero exit code.
process.on('unhandledRejection', err => {
console.error(err);
process.exit(1);
});
module.exports = util;
-3
View File
@@ -1,3 +0,0 @@
{
"extends": "@coralproject/eslint-config-talk/client"
}
-72
View File
@@ -1,72 +0,0 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Router, Route, IndexRedirect, IndexRoute } from 'react-router';
import Install from 'routes/Install';
import Stories from 'routes/Stories';
import Community from 'routes/Community';
import Configure from 'routes/Configure';
import StreamSettings from './routes/Configure/containers/StreamSettings';
import ModerationSettings from './routes/Configure/containers/ModerationSettings';
import TechSettings from './routes/Configure/containers/TechSettings';
import OrganizationSettings from './routes/Configure/containers/OrganizationSettings';
import { ModerationLayout, Moderation } from 'routes/Moderation';
import Layout from 'containers/Layout';
const routes = (
<div>
<Route exact path="/admin/install" component={Install} />
<Route path="/admin" component={Layout}>
<IndexRedirect to="/admin/moderate" />
<Route path="configure" component={Configure}>
<Route path="stream" component={StreamSettings} />
<Route path="moderation" component={ModerationSettings} />
<Route path="tech" component={TechSettings} />
<Route path="organization" component={OrganizationSettings} />
<IndexRedirect to="stream" />
</Route>
<Route path="stories" component={Stories} />
{/* Community Routes */}
<Route path="community">
<Route path="flagged" components={Community}>
<Route path=":id" components={Community} />
</Route>
<Route path="people" components={Community}>
<Route path=":id" components={Community} />
</Route>
<IndexRedirect to="flagged" />
</Route>
{/* Moderation Routes */}
<Route path="moderate" component={ModerationLayout}>
<IndexRoute components={Moderation} />
<Route path=":tabOrId" components={Moderation} />
<Route path=":tab" components={Moderation}>
<Route path=":id" components={Moderation} />
</Route>
</Route>
</Route>
</div>
);
class AppRouter extends React.Component {
static contextTypes = {
history: PropTypes.object,
};
render() {
return <Router history={this.context.history} routes={routes} />;
}
}
export default AppRouter;
@@ -1,14 +0,0 @@
import {
SHOW_ALWAYS_PREMOD_USER_DIALOG,
HIDE_ALWAYS_PREMOD_USER_DIALOG,
} from '../constants/alwaysPremodUserDialog.js';
export const showAlwaysPremodUserDialog = ({ userId, username }) => ({
type: SHOW_ALWAYS_PREMOD_USER_DIALOG,
userId,
username,
});
export const hideAlwaysPremodUserDialog = () => ({
type: HIDE_ALWAYS_PREMOD_USER_DIALOG,
});
@@ -1,19 +0,0 @@
import {
SHOW_BAN_USER_DIALOG,
HIDE_BAN_USER_DIALOG,
} from '../constants/banUserDialog';
export const showBanUserDialog = ({
userId,
username,
commentId,
commentStatus,
}) => ({
type: SHOW_BAN_USER_DIALOG,
userId,
username,
commentId,
commentStatus,
});
export const hideBanUserDialog = () => ({ type: HIDE_BAN_USER_DIALOG });
@@ -1,88 +0,0 @@
import queryString from 'querystringify';
import {
FETCH_USERS_REQUEST,
FETCH_USERS_SUCCESS,
FETCH_USERS_FAILURE,
SORT_UPDATE,
SET_PAGE,
SET_SEARCH_VALUE,
SHOW_BANUSER_DIALOG,
HIDE_BANUSER_DIALOG,
SHOW_ALWAYS_PREMOD_USER_DIALOG,
HIDE_ALWAYS_PREMOD_USER_DIALOG,
SHOW_REJECT_USERNAME_DIALOG,
HIDE_REJECT_USERNAME_DIALOG,
SET_INDICATOR_TRACK,
} from '../constants/community';
import t from 'coral-framework/services/i18n';
export const fetchUsers = (query = {}) => (dispatch, _, { rest }) => {
dispatch(requestFetchUsers());
rest(`/users?${queryString.stringify(query)}`)
.then(({ result, page, count, limit, totalPages }) => {
dispatch({
type: FETCH_USERS_SUCCESS,
users: result,
page,
count,
limit,
totalPages,
});
})
.catch(error => {
console.error(error);
const errorMessage = error.translation_key
? t(`error.${error.translation_key}`)
: error.toString();
dispatch({ type: FETCH_USERS_FAILURE, error: errorMessage });
});
};
const requestFetchUsers = () => ({
type: FETCH_USERS_REQUEST,
});
export const updateSorting = sort => ({
type: SORT_UPDATE,
sort,
});
export const setPage = page => ({
type: SET_PAGE,
page,
});
export const setSearchValue = value => ({
type: SET_SEARCH_VALUE,
value,
});
// Ban User Dialog
export const showBanUserDialog = user => ({ type: SHOW_BANUSER_DIALOG, user });
export const hideBanUserDialog = () => ({ type: HIDE_BANUSER_DIALOG });
// Always premod User Dialog
export const showAlwaysPremodUserDialog = user => ({
type: SHOW_ALWAYS_PREMOD_USER_DIALOG,
user,
});
export const hideAlwaysPremodUserDialog = () => ({
type: HIDE_ALWAYS_PREMOD_USER_DIALOG,
});
// Reject Username Dialog
export const showRejectUsernameDialog = user => ({
type: SHOW_REJECT_USERNAME_DIALOG,
user,
});
export const hideRejectUsernameDialog = () => ({
type: HIDE_REJECT_USERNAME_DIALOG,
});
// Enable or disable the activity indicator subscriptions.
export const setIndicatorTrack = track => ({
type: SET_INDICATOR_TRACK,
track,
});
@@ -1,17 +0,0 @@
import * as actions from 'constants/configure';
export const updatePending = ({ updater, errorUpdater }) => {
return { type: actions.UPDATE_PENDING, updater, errorUpdater };
};
export const clearPending = () => {
return { type: actions.CLEAR_PENDING };
};
export const showSaveDialog = () => {
return { type: actions.SHOW_SAVE_DIALOG };
};
export const hideSaveDialog = () => {
return { type: actions.HIDE_SAVE_DIALOG };
};
-162
View File
@@ -1,162 +0,0 @@
import * as actions from '../constants/install';
import validate from 'coral-framework/helpers/validate';
import errorMsj from 'coral-framework/helpers/error';
import t from 'coral-framework/services/i18n';
export const nextStep = () => ({ type: actions.NEXT_STEP });
export const previousStep = () => ({ type: actions.PREVIOUS_STEP });
export const goToStep = step => ({ type: actions.GO_TO_STEP, step });
const installRequest = () => ({ type: actions.INSTALL_REQUEST });
const installSuccess = () => ({ type: actions.INSTALL_SUCCESS });
const installFailure = error => ({ type: actions.INSTALL_FAILURE, error });
const addError = (name, error) => ({ type: actions.ADD_ERROR, name, error });
const hasError = error => ({ type: actions.HAS_ERROR, error });
const clearErrors = () => ({ type: actions.CLEAR_ERRORS });
const validation = (formData, dispatch, next) => {
if (!(formData != null)) {
dispatch(hasError());
return;
}
const validKeys = Object.keys(formData).filter(name => name !== 'domains');
// Required Validation
const empty = validKeys.filter(name => {
const cond = !formData[name].length;
if (cond) {
// Adding Error
dispatch(addError(name, 'This field is required.'));
} else {
dispatch(addError(name, ''));
}
return cond;
});
if (empty.length) {
dispatch(hasError());
return;
}
// RegExp Validation
const validation = validKeys.filter(name => {
const cond = !validate[name](formData[name]);
if (cond) {
// Adding Error
dispatch(addError(name, errorMsj[name]));
} else {
dispatch(addError(name, ''));
}
return cond;
});
if (validation.length) {
dispatch(hasError());
return;
}
// Confirm Validation
const prefixLength = 'confirm'.length;
const confirm = validKeys.filter(name => {
if (!name.startsWith('confirm')) {
return false;
}
// Check that 'confirmX' equals 'X'.
const other =
name.substr(prefixLength, 1).toLowerCase() +
name.substr(prefixLength + 1);
const cond = formData[other] !== formData[name];
if (cond) {
dispatch(addError(name, errorMsj[name]));
}
return cond;
});
if (confirm.length) {
dispatch(hasError());
return;
}
dispatch(clearErrors());
next();
};
export const submitSettings = () => (dispatch, getState) => {
const settingsFormData = getState().install.data.settings;
validation(settingsFormData, dispatch, function() {
dispatch(nextStep());
});
};
export const submitUser = () => (dispatch, getState) => {
const userFormData = getState().install.data.user;
validation(userFormData, dispatch, function() {
dispatch(nextStep());
});
};
export const finishInstall = () => (dispatch, getState, { rest }) => {
const data = getState().install.data;
dispatch(installRequest());
return rest('/setup', { method: 'POST', body: data })
.then(() => {
dispatch(installSuccess());
dispatch(nextStep());
})
.catch(error => {
console.error(error);
const errorMessage = error.translation_key
? t(`error.${error.translation_key}`)
: error.toString();
dispatch(installFailure(errorMessage));
});
};
export const updateSettingsFormData = (name, value) => ({
type: actions.UPDATE_FORMDATA_SETTINGS,
name,
value,
});
export const updateUserFormData = (name, value) => ({
type: actions.UPDATE_FORMDATA_USER,
name,
value,
});
export const updatePermittedDomains = value => ({
type: actions.UPDATE_PERMITTED_DOMAINS_SETTINGS,
value,
});
const checkInstallRequest = () => ({ type: actions.CHECK_INSTALL_REQUEST });
const checkInstallSuccess = installed => ({
type: actions.CHECK_INSTALL_SUCCESS,
installed,
});
const checkInstallFailure = error => ({
type: actions.CHECK_INSTALL_FAILURE,
error,
});
export const checkInstall = next => async (dispatch, _, { rest }) => {
dispatch(checkInstallRequest());
try {
const { installed } = await rest('/setup');
dispatch(checkInstallSuccess(installed));
if (installed) {
next();
}
} catch (error) {
console.error(error);
const errorMessage = error.translation_key
? t(`error.${error.translation_key}`)
: error.toString();
dispatch(checkInstallFailure(errorMessage));
}
};
@@ -1,39 +0,0 @@
import * as actions from 'constants/moderation';
export const toggleModal = open => ({ type: actions.TOGGLE_MODAL, open });
export const singleView = () => ({ type: actions.SINGLE_VIEW });
// hide shortcuts note
export const hideShortcutsNote = () => (dispatch, _, { localStorage }) => {
localStorage.setItem('coral:shortcutsNote', 'hide');
dispatch({ type: actions.HIDE_SHORTCUTS_NOTE });
};
export const setSortOrder = order => ({
type: actions.SET_SORT_ORDER,
order,
});
export const toggleStorySearch = active => ({
type: active ? actions.SHOW_STORY_SEARCH : actions.HIDE_STORY_SEARCH,
});
export const storySearchChange = value => ({
type: actions.STORY_SEARCH_CHANGE_VALUE,
value,
});
export const clearState = () => ({
type: actions.CLEAR_STATE,
});
export const selectCommentId = id => ({
type: actions.SELECT_COMMENT,
id,
});
// Enable or disable the activity indicator subscriptions.
export const setIndicatorTrack = track => ({
type: actions.SET_INDICATOR_TRACK,
track,
});
@@ -1,14 +0,0 @@
import {
SHOW_REJECT_USERNAME_DIALOG,
HIDE_REJECT_USERNAME_DIALOG,
} from '../constants/rejectUsernameDialog';
export const showRejectUsernameDialog = ({ userId, username }) => ({
type: SHOW_REJECT_USERNAME_DIALOG,
userId,
username,
});
export const hideRejectUsernameDialog = () => ({
type: HIDE_REJECT_USERNAME_DIALOG,
});
-78
View File
@@ -1,78 +0,0 @@
import queryString from 'querystringify';
import {
FETCH_ASSETS_REQUEST,
FETCH_ASSETS_SUCCESS,
FETCH_ASSETS_FAILURE,
SET_PAGE,
SET_SEARCH_VALUE,
SET_CRITERIA,
UPDATE_ASSET_STATE_REQUEST,
UPDATE_ASSET_STATE_SUCCESS,
UPDATE_ASSET_STATE_FAILURE,
UPDATE_ASSETS,
} from '../constants/stories';
import t from 'coral-framework/services/i18n';
/**
* Action disptacher related to assets
*/
// Fetch a page of assets
// Get comments to fill each of the three lists on the mod queue
export const fetchAssets = (query = {}) => (dispatch, _, { rest }) => {
dispatch({ type: FETCH_ASSETS_REQUEST });
return rest(`/assets?${queryString.stringify(query)}`)
.then(({ result, page, count, limit, totalPages }) =>
dispatch({
type: FETCH_ASSETS_SUCCESS,
assets: result,
page,
count,
limit,
totalPages,
})
)
.catch(error => {
console.error(error);
const errorMessage = error.translation_key
? t(`error.${error.translation_key}`)
: error.toString();
dispatch({ type: FETCH_ASSETS_FAILURE, error: errorMessage });
});
};
// Update an asset state
// Get comments to fill each of the three lists on the mod queue
export const updateAssetState = (id, closedAt) => (dispatch, _, { rest }) => {
dispatch({ type: UPDATE_ASSET_STATE_REQUEST, id, closedAt });
return rest(`/assets/${id}/status`, { method: 'PUT', body: { closedAt } })
.then(() => dispatch({ type: UPDATE_ASSET_STATE_SUCCESS }))
.catch(error => {
console.error(error);
const errorMessage = error.translation_key
? t(`error.${error.translation_key}`)
: error.toString();
dispatch({ type: UPDATE_ASSET_STATE_FAILURE, error: errorMessage });
});
};
export const updateAssets = assets => dispatch => {
dispatch({ type: UPDATE_ASSETS, assets });
};
export const setPage = page => ({
type: SET_PAGE,
page,
});
export const setSearchValue = value => ({
type: SET_SEARCH_VALUE,
value,
});
export const setCriteria = criteria => ({
type: SET_CRITERIA,
criteria,
});
@@ -1,19 +0,0 @@
import {
SHOW_SUSPEND_USER_DIALOG,
HIDE_SUSPEND_USER_DIALOG,
} from '../constants/suspendUserDialog.js';
export const showSuspendUserDialog = ({
userId,
username,
commentId,
commentStatus,
}) => ({
type: SHOW_SUSPEND_USER_DIALOG,
userId,
username,
commentId,
commentStatus,
});
export const hideSuspendUserDialog = () => ({ type: HIDE_SUSPEND_USER_DIALOG });
@@ -1,37 +0,0 @@
import * as actions from 'constants/userDetail';
export const viewUserDetail = userId => ({
type: actions.VIEW_USER_DETAIL,
userId,
});
export const hideUserDetail = () => ({ type: actions.HIDE_USER_DETAIL });
export const changeTab = tab => {
let statuses = null;
if (tab === 'rejected') {
statuses = ['REJECTED'];
}
return { type: actions.CHANGE_TAB_USER_DETAIL, tab, statuses };
};
export const clearUserDetailSelections = () => ({
type: actions.CLEAR_USER_DETAIL_SELECTIONS,
});
export const toggleSelectCommentInUserDetail = (id, active) => {
return {
type: active
? actions.SELECT_USER_DETAIL_COMMENT
: actions.UNSELECT_USER_DETAIL_COMMENT,
id,
};
};
export const toggleSelectAllCommentInUserDetail = (ids, active) => {
return {
type: active
? actions.SELECT_ALL_USER_DETAIL_COMMENT
: actions.CLEAR_USER_DETAIL_SELECTIONS,
ids,
};
};
-61
View File
@@ -1,61 +0,0 @@
import * as userTypes from '../constants/users';
import t from 'coral-framework/services/i18n';
/**
* Action disptacher related to users
*/
// change status of a user
export const userStatusUpdate = (status, userId, commentId) => {
return (dispatch, _, { rest }) => {
dispatch({ type: userTypes.UPDATE_STATUS_REQUEST });
return rest(`/users/${userId}/status`, {
method: 'POST',
body: { status: status, comment_id: commentId },
})
.then(res => dispatch({ type: userTypes.UPDATE_STATUS_SUCCESS, res }))
.catch(error => {
console.error(error);
const errorMessage = error.translation_key
? t(`error.${error.translation_key}`)
: error.toString();
dispatch({
type: userTypes.UPDATE_STATUS_FAILURE,
error: errorMessage,
});
});
};
};
// change status of a user
export const sendNotificationEmail = (userId, subject, body) => {
return (dispatch, _, { rest }) => {
return rest(`/users/${userId}/email`, {
method: 'POST',
body: { subject, body },
}).catch(error => {
console.error(error);
const errorMessage = error.translation_key
? t(`error.${error.translation_key}`)
: error.toString();
dispatch({ type: userTypes.USER_EMAIL_FAILURE, error: errorMessage });
});
};
};
// let a user edit their username
export const enableUsernameEdit = userId => {
return (dispatch, _, { rest }) => {
return rest(`/users/${userId}/username-enable`, { method: 'POST' }).catch(
error => {
console.error(error);
const errorMessage = error.translation_key
? t(`error.${error.translation_key}`)
: error.toString();
dispatch({
type: userTypes.USERNAME_ENABLE_FAILURE,
error: errorMessage,
});
}
);
};
};
@@ -1,54 +0,0 @@
.button {
-webkit-transform: scale(.8);
transform: scale(.8);
margin: 0;
}
.root {
color: black;
> :global(.mdl-menu__container) {
margin-left: 10px;
}
}
.buttonOpen {
box-shadow: none;
color: white;
background-color: #616161;
border-color: #616161;
}
.arrowIcon {
margin-left: 6px;
margin-right: 0;
vertical-align: middle;
margin-right: 0;
font-size: 14px;
}
.menu {
padding: 0;
}
.menuItem {
color: #2a2a2a;
background-color: white;
font-size: 0.95em;
&:first-child {
margin-bottom: 1px;
border-radius: 2px 2px 0px 0px;
}
&:last-child {
border-radius: 0px 0px 2px 2px;
}
&:hover, &:active, &:focus {
background-color: #e2e2e2;
border-color: #616161;
}
&[disabled], &[disabled]:hover, &[disabled]:focus, &[disabled]:active {
background-color: #262626;
color: rgba(255, 255, 255, 0.5);
}
}
@@ -1,83 +0,0 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Button, Icon } from 'coral-ui';
import ClickOutside from 'coral-framework/components/ClickOutside';
import { Menu } from 'react-mdl';
import cn from 'classnames';
import { findDOMNode } from 'react-dom';
import styles from './ActionsMenu.css';
import t from 'coral-framework/services/i18n';
let count = 0;
class ActionsMenu extends React.Component {
id = `actions-dropdown-${count++}`;
menu = null;
state = { open: false };
timeout = null;
componentWillUnmount() {
clearTimeout(this.timeout);
}
handleRef = ref => {
this.menu = ref ? findDOMNode(ref).parentNode : null;
};
syncOpenState = () => {
clearTimeout(this.timeout);
this.timeout = setTimeout(() => {
this.setState({ open: this.menu.className.indexOf('is-visible') >= 0 });
}, 150);
};
render() {
const { className = '', buttonClassNames = '', label = '' } = this.props;
return (
<ClickOutside onClickOutside={this.syncOpenState}>
<div
className={cn(styles.root, className)}
onBlur={this.syncOpenState}
onClick={this.syncOpenState}
onKeyUp={this.syncOpenState}
>
<Button
cStyle="actions"
className={cn(
styles.button,
{ [styles.buttonOpen]: this.state.open },
buttonClassNames
)}
disabled={false}
id={this.id}
onClick={this.syncOpenState}
icon={this.props.icon}
raised
>
{label ? label : t('modqueue.actions')}
<Icon
name={
this.state.open ? 'keyboard_arrow_up' : 'keyboard_arrow_down'
}
className={styles.arrowIcon}
/>
</Button>
<Menu target={this.id} className={styles.menu} ref={this.handleRef}>
{this.props.children}
</Menu>
</div>
</ClickOutside>
);
}
}
ActionsMenu.propTypes = {
icon: PropTypes.string,
children: PropTypes.node,
className: PropTypes.string,
label: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
buttonClassNames: PropTypes.string,
};
export default ActionsMenu;
@@ -1,21 +0,0 @@
import React from 'react';
import cn from 'classnames';
import { MenuItem } from 'react-mdl';
import PropTypes from 'prop-types';
import styles from './ActionsMenu.css';
import camelCase from 'lodash/camelCase';
const ActionsMenuItem = props => (
<MenuItem
className={cn(styles.menuItem, props.className, 'action-menu-item')}
{...props}
id={camelCase(props.children)}
/>
);
ActionsMenuItem.propTypes = {
className: PropTypes.string,
children: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
};
export default ActionsMenuItem;
@@ -1,142 +0,0 @@
import React from 'react';
import PropTypes from 'prop-types';
import Layout from 'coral-admin/src/components/Layout';
import styles from './NotFound.css';
import { Button, TextField, Alert, Success } from 'coral-ui';
import Recaptcha from 'react-recaptcha';
import cn from 'classnames';
import t from 'coral-framework/services/i18n';
class AdminLogin extends React.Component {
constructor(props) {
super(props);
this.state = { email: '', password: '', requestPassword: false };
}
handleSignIn = e => {
e.preventDefault();
this.props.handleLogin(this.state.email, this.state.password);
};
onRecaptchaLoad = () => {
// do something?
};
onRecaptchaVerify = recaptchaResponse => {
this.props.handleLogin(
this.state.email,
this.state.password,
recaptchaResponse
);
};
handleRequestPassword = e => {
e.preventDefault();
this.props.requestPasswordReset(this.state.email);
};
render() {
const { errorMessage, loginMaxExceeded, recaptchaPublic } = this.props;
const signInForm = (
<form className="talk-admin-login-sign-in" onSubmit={this.handleSignIn}>
{errorMessage && <Alert>{errorMessage}</Alert>}
<TextField
id="email"
label={t('login.email_address')}
value={this.state.email}
onChange={e => this.setState({ email: e.target.value })}
/>
<TextField
id="password"
label={t('login.password')}
value={this.state.password}
onChange={e => this.setState({ password: e.target.value })}
type="password"
/>
<div style={{ height: 10 }} />
<Button
className="talk-admin-login-sign-in-button"
type="submit"
cStyle="black"
full
onClick={this.handleSignIn}
>
{t('login.sign_in_button')}
</Button>
<p className={styles.forgotPasswordCTA}>
{t('login.forgot_password')}{' '}
<a
href="#"
className={styles.forgotPasswordLink}
onClick={e => {
e.preventDefault();
this.setState({ requestPassword: true });
}}
>
{t('login.request_passowrd')}
</a>
</p>
{loginMaxExceeded && (
<Recaptcha
sitekey={recaptchaPublic}
render="explicit"
theme="dark"
onloadCallback={this.onRecaptchaLoad}
verifyCallback={this.onRecaptchaVerify}
/>
)}
</form>
);
const requestPasswordForm = this.props.passwordRequestSuccess ? (
<p
className={styles.passwordRequestSuccess}
onClick={() => {
location.href = location.href;
}}
>
{this.props.passwordRequestSuccess}{' '}
<a className={styles.signInLink} href="#">
{t('login.sign_in')}
</a>
<Success />
</p>
) : (
<form onSubmit={this.handleRequestPassword}>
<TextField
label={t('login.email_address')}
value={this.state.email}
onChange={e => this.setState({ email: e.target.value })}
/>
<Button
type="submit"
cStyle="black"
full
onClick={this.handleRequestPassword}
>
{t('login.reset_password')}
</Button>
</form>
);
return (
<Layout fixedDrawer restricted={true}>
<div className={cn(styles.loginLayout, 'talk-admin-login')}>
<h1 className={styles.loginHeader}>{t('login.team_sign_in')}</h1>
<p className={styles.loginCTA}>{t('login.sign_in_message')}</p>
{this.state.requestPassword ? requestPasswordForm : signInForm}
</div>
</Layout>
);
}
}
AdminLogin.propTypes = {
loginMaxExceeded: PropTypes.bool.isRequired,
handleLogin: PropTypes.func.isRequired,
passwordRequestSuccess: PropTypes.string,
loginError: PropTypes.string,
recaptchaPublic: PropTypes.string,
requestPasswordReset: PropTypes.func,
errorMessage: PropTypes.string,
};
export default AdminLogin;
@@ -1,29 +0,0 @@
.dialog {
border: none;
box-shadow: 0 9px 46px 8px rgba(0, 0, 0, 0.14), 0 11px 15px -7px rgba(0, 0, 0, 0.12), 0 24px 38px 3px rgba(0, 0, 0, 0.2);
width: 400px;
top: 50%;
transform: translateY(-50%);
padding: 20px;
border-radius: 4px;
}
.header {
color: black;
font-size: 1.5em;
font-weight: 500;
margin: 0 0 8px 0;
}
.subheader {
color: black;
font-size: 1.3em;
font-weight: 500;
margin: 0 0 8px 0;
}
.buttons {
margin-top: 8px;
margin-bottom: 6px;
text-align: right;
}
@@ -1,68 +0,0 @@
import React from 'react';
import cn from 'classnames';
import PropTypes from 'prop-types';
import { Dialog } from 'coral-ui';
import styles from './AlwaysPremodUserDialog.css';
import Button from 'coral-ui/components/Button';
import t from 'coral-framework/services/i18n';
class AlwaysPremodUserDialog extends React.Component {
handlePerform = () => {
this.props.onPerform();
};
render() {
const { open, onCancel, username, info } = this.props;
return (
<Dialog
className={cn(styles.dialog, 'talk-always-premod-user-dialog')}
id="alwaysPremodUserDialog"
open={open}
onCancel={onCancel}
title={t('alwayspremoddialog.always_premod_user')}
>
<span className={styles.close} onClick={onCancel}>
×
</span>
<section>
<h2 className={styles.header}>
{t('alwayspremoddialog.always_premod_user')}
</h2>
<h3 className={styles.subheader}>
{t('alwayspremoddialog.are_you_sure', username)}
</h3>
<p className={styles.description}>{info}</p>
<div className={styles.buttons}>
<Button
className={cn('talk-always-premod-user-dialog-button-cancel')}
cStyle="white"
onClick={onCancel}
raised
>
{t('alwayspremoddialog.cancel')}
</Button>
<Button
className={cn('talk-always-premod-user-dialog-button-confirm')}
cStyle="black"
onClick={this.handlePerform}
raised
>
{t('alwayspremoddialog.yes_always_premod_user')}
</Button>
</div>
</section>
</Dialog>
);
}
}
AlwaysPremodUserDialog.propTypes = {
open: PropTypes.bool,
onPerform: PropTypes.func.isRequired,
onCancel: PropTypes.func.isRequired,
username: PropTypes.string,
info: PropTypes.string,
};
export default AlwaysPremodUserDialog;
-11
View File
@@ -1,11 +0,0 @@
:global {
html, body, #root, #root > div {
min-height: 100%;
}
body {
margin: 0;
background-color: #FAFAFA;
font-family: 'Roboto', sans-serif;
}
}
-17
View File
@@ -1,17 +0,0 @@
import React from 'react';
import ToastContainer from './ToastContainer';
import './App.css';
import 'material-design-lite';
import AppRouter from '../AppRouter';
export default class App extends React.Component {
render() {
return (
<div>
<ToastContainer />
<AppRouter />
</div>
);
}
}
@@ -1,43 +0,0 @@
.root {
display: block;
color: #519954;
border: solid 2px rgba(81, 153, 84, 0.75);
background: white;
padding: 10px 12px;
box-sizing: border-box;
border-radius: 3px;
text-transform: capitalize;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.03), 0 3px 1px -2px rgba(0,0,0,.2), 0 1px 5px 0 rgba(0,0,0,.09);
width: 100%;
margin: 0 0 .5em;
&:not(:disabled):hover {
box-shadow: none;
color: white;
background-color: #519954;
cursor: pointer;
}
&:disabled {
cursor: not-allowed;
}
}
.active {
box-shadow: none;
color: white;
background-color: #519954;
&:hover {
cursor: not-allowed;
}
}
.minimal {
width: 45px;
min-width: 0;
}
.icon {
margin-right: 5px;
}
@@ -1,37 +0,0 @@
import React from 'react';
import PropTypes from 'prop-types';
import cn from 'classnames';
import styles from './ApproveButton.css';
import { Icon } from 'coral-ui';
import t from 'coral-framework/services/i18n';
const ApproveButton = ({ active, minimal, onClick, className, disabled }) => {
const text = active ? t('modqueue.approved') : t('modqueue.approve');
return (
<button
className={cn(
styles.root,
{ [styles.minimal]: minimal, [styles.active]: active },
className,
'talk-admin-approve-button'
)}
onClick={onClick}
disabled={disabled || active}
>
<Icon name={'done'} className={styles.icon} />
{!minimal && text}
</button>
);
};
ApproveButton.propTypes = {
className: PropTypes.string,
active: PropTypes.bool,
minimal: PropTypes.bool,
disabled: PropTypes.bool,
onClick: PropTypes.func,
};
export default ApproveButton;
@@ -1,179 +0,0 @@
.dialog {
border: none;
box-shadow: 0 9px 46px 8px rgba(0, 0, 0, 0.14), 0 11px 15px -7px rgba(0, 0, 0, 0.12), 0 24px 38px 3px rgba(0, 0, 0, 0.2);
width: 400px;
top: 50%;
transform: translateY(-50%);
padding: 20px;
border-radius: 4px;
}
.header {
color: black;
font-size: 1.5em;
font-weight: 500;
margin: 0 0 8px 0;
}
.subheader {
color: black;
font-size: 1.3em;
font-weight: 500;
margin: 0 0 8px 0;
}
.textField {
margin-top: 15px;
}
.textField label {
font-size: 1.08em;
font-weight: bold;
margin-bottom: 5px;
}
.textField input {
width: 100%;
display: block;
border: none;
outline: none;
border: 1px solid rgba(0,0,0,.12);
padding: 10px 6px;
box-sizing: border-box;
border-radius: 2px;
margin: 5px auto;
}
.footer {
margin: 20px auto 10px;
text-align: center;
}
.footer span {
display: block;
margin-bottom: 5px;
}
.footer a {
color: #2c69b6;
cursor: pointer;
margin: 0 5px;
}
.socialConnections {
margin-bottom: 20px;
}
.signInButton {
margin-top: 10px;
}
.close {
font-size: 20px;
line-height: 14px;
top: 10px;
right: 10px;
position: absolute;
display: block;
font-weight: bold;
color: #363636;
cursor: pointer;
}
.close:hover {
color: #6b6b6b;
}
input.error{
border: solid 2px #f44336;
}
.errorMsg, .hint {
color: grey;
font-weight: 600;
padding: 3px 0 16px;
}
.alert {
padding: 10px;
margin-bottom: 20px;
border-radius: 2px;
}
.alert--success {
border: solid 1px #1ec00e;
background: #cbf1b8;
color: #006900;
}
.alert--error {
background: #FFEBEE;
color: #B71C1C;
}
.userBox a {
color: #2c69b6;
cursor: pointer;
margin: 0px;
}
.attention {
display: inline-block;
width: 15px;
height: 15px;
background: #B71C1C;
color: #FFEBEE;
font-weight: bolder;
padding: 4px;
vertical-align: middle;
border-radius: 20px;
box-sizing: border-box;
font-size: 9px;
line-height: 7px;
text-align: center;
margin-right: 5px;
}
.action {
margin-top: 15px;
}
.passwordRequestSuccess {
border: 1px solid green;
background-color: lightgreen;
padding: 10px;
}
.passwordRequestFailure {
border: 1px solid orange;
background-color: 1px solid coral;
padding: 10px;
}
.cancel {
margin-right: 10px;
width: 48%;
}
.ban {
width: 48%;
}
.buttons {
margin-top: 8px;
margin-bottom: 6px;
text-align: right;
}
.legend {
padding: 0;
font-weight: bold;
}
.messageInput {
border-radius: 3px;
width: 100%;
padding: 10px;
font-size: 14px;
box-sizing: border-box;
}
@@ -1,145 +0,0 @@
import React from 'react';
import cn from 'classnames';
import PropTypes from 'prop-types';
import { Dialog } from 'coral-ui';
import styles from './BanUserDialog.css';
import Button from 'coral-ui/components/Button';
import t from 'coral-framework/services/i18n';
const initialState = { step: 0, message: '' };
class BanUserDialog extends React.Component {
state = initialState;
componentWillReceiveProps(next) {
if (this.props.open && !next.open) {
this.setState(initialState);
}
}
handleMessageChange = e => {
const {
target: { value: message },
} = e;
this.setState({ message });
};
goToStep1 = () => {
this.setState({
step: 1,
message: t('bandialog.email_message_ban', this.props.username),
});
};
handlePerform = () => {
this.props.onPerform({
message: this.state.message,
});
};
renderStep0() {
const { onCancel, username, info } = this.props;
return (
<section>
<h2 className={styles.header}>{t('bandialog.ban_user')}</h2>
<h3 className={styles.subheader}>
{t('bandialog.are_you_sure', username)}
</h3>
<p className={styles.description}>{info}</p>
<div className={styles.buttons}>
<Button
className={cn('talk-ban-user-dialog-button-cancel')}
cStyle="white"
onClick={onCancel}
raised
>
{t('bandialog.cancel')}
</Button>
<Button
className={cn('talk-ban-user-dialog-button-confirm')}
cStyle="black"
onClick={this.goToStep1}
raised
>
{t('bandialog.yes_ban_user')}
</Button>
</div>
</section>
);
}
renderStep1() {
const { onCancel } = this.props;
const { message } = this.state;
return (
<section>
<h2 className={styles.header}>{t('bandialog.notify_ban_headline')}</h2>
<p className={styles.description}>
{t('bandialog.notify_ban_description')}
</p>
<fieldset>
<legend className={styles.legend}>
{t('bandialog.write_a_message')}
</legend>
<textarea
rows={5}
className={styles.messageInput}
value={message}
onChange={this.handleMessageChange}
/>
</fieldset>
<div className={styles.buttons}>
<Button
className={cn('talk-ban-user-dialog-button-cancel')}
cStyle="white"
onClick={onCancel}
raised
>
{t('bandialog.cancel')}
</Button>
<Button
className={cn('talk-ban-user-dialog-button-confirm')}
cStyle="black"
onClick={this.handlePerform}
raised
>
{t('bandialog.send')}
</Button>
</div>
</section>
);
}
render() {
const { step } = this.state;
const { open, onCancel } = this.props;
return (
<Dialog
className={cn(styles.dialog, 'talk-ban-user-dialog')}
id="banUserDialog"
open={open}
onCancel={onCancel}
title={t('bandialog.ban_user')}
>
<span className={styles.close} onClick={onCancel}>
×
</span>
{step === 0 && this.renderStep0()}
{step === 1 && this.renderStep1()}
</Dialog>
);
}
}
BanUserDialog.propTypes = {
open: PropTypes.bool,
onPerform: PropTypes.func.isRequired,
onCancel: PropTypes.func.isRequired,
username: PropTypes.string,
info: PropTypes.string,
};
export default BanUserDialog;
@@ -1,12 +0,0 @@
import React from 'react';
import { Button } from 'coral-ui';
import t from 'coral-framework/services/i18n';
import { withCopyToClipboard } from 'coral-framework/hocs';
class ButtonCopyToClipboard extends React.Component {
render() {
return <Button {...this.props}>{t('common.copy')}</Button>;
}
}
export default withCopyToClipboard(ButtonCopyToClipboard);
@@ -1,28 +0,0 @@
.root {
position: relative;
}
.bodyLeave {
position: absolute;
width: 100%;
top: 0;
background-color: white;
opacity: 1.0;
transition: background 400ms, opacity 800ms 1600ms;
pointer-events: none;
}
.bodyLeaveActive {
opacity: 0;
background-color: rgba(255,255,0, 0.2);
}
.bodyEnter {
opacity: 0;
pointer-events: none;
}
.bodyEnterActive {
opacity: 1.0;
transition: opacity 800ms 2400ms;
}
@@ -1,35 +0,0 @@
import React from 'react';
import { murmur3 } from 'murmurhash-js';
import { CSSTransitionGroup } from 'react-transition-group';
import styles from './CommentAnimatedEdit.css';
import PropTypes from 'prop-types';
const CommentAnimatedEdit = ({ children, body }) => {
return (
<CSSTransitionGroup
component={'div'}
className={styles.root}
transitionName={{
enter: styles.bodyEnter,
enterActive: styles.bodyEnterActive,
leave: styles.bodyLeave,
leaveActive: styles.bodyLeaveActive,
}}
transitionEnter={true}
transitionLeave={true}
transitionEnterTimeout={3600}
transitionLeaveTimeout={2800}
>
{React.cloneElement(React.Children.only(children), {
key: murmur3(body),
})}
</CSSTransitionGroup>
);
};
CommentAnimatedEdit.propTypes = {
children: PropTypes.node,
body: PropTypes.string.isRequired,
};
export default CommentAnimatedEdit;
@@ -1,5 +0,0 @@
.tombstone {
background-color: #f0f0f0;
padding: 1em;
color: #1a212f;
}
@@ -1,9 +0,0 @@
import React from 'react';
import styles from './CommentDeletedTombstone.css';
import t from 'coral-framework/services/i18n';
const CommentDeletedTombstone = () => (
<div className={styles.tombstone}>{t('framework.comment_is_deleted')}</div>
);
export default CommentDeletedTombstone;
@@ -1,18 +0,0 @@
.root {
min-height: 25px;
padding: 0 16px;
}
.moreDetail {
position: absolute;
font-size: 13px;
font-weight: 500;
color: black;
right: 16px;
&:hover {
opacity: 0.9;
cursor: pointer;
}
}
@@ -1,63 +0,0 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import styles from './CommentDetails.css';
import t from 'coral-framework/services/i18n';
import Slot from 'coral-framework/components/Slot';
import IfSlotIsNotEmpty from 'coral-framework/components/IfSlotIsNotEmpty';
class CommentDetails extends Component {
state = {
showDetail: false,
};
constructor() {
super();
this.state = {
showDetail: false,
};
}
toggleDetail = () => {
this.setState(state => ({
showDetail: !state.showDetail,
}));
this.props.clearHeightCache && this.props.clearHeightCache();
};
render() {
const { root, comment, clearHeightCache } = this.props;
const { showDetail } = this.state;
const slotPassthrough = {
clearHeightCache,
root,
comment,
more: showDetail,
};
return (
<div className={styles.root}>
<IfSlotIsNotEmpty
slot={['adminCommentMoreDetails', 'adminCommentMoreFlagDetails']}
passthrough={slotPassthrough}
>
<a onClick={this.toggleDetail} className={styles.moreDetail}>
{showDetail ? t('modqueue.less_detail') : t('modqueue.more_detail')}
</a>
</IfSlotIsNotEmpty>
<Slot fill="adminCommentDetailArea" passthrough={slotPassthrough} />
{showDetail && (
<Slot fill="adminCommentMoreDetails" passthrough={slotPassthrough} />
)}
</div>
);
}
}
CommentDetails.propTypes = {
root: PropTypes.object.isRequired,
comment: PropTypes.object.isRequired,
clearHeightCache: PropTypes.func,
};
export default CommentDetails;
@@ -1,27 +0,0 @@
.root {
display: flex;
justify-content: flex-end;
}
.coreLabels {
> *:not(:last-child) {
margin-right: 3px;
}
}
.slot {
&:not(:empty) {
padding-left: 3px;
}
> *:not(:last-child) {
margin-right: 3px;
}
}
.replyLabel {
background-color: #3D73D5;
}
.premodLabel {
background-color: #063B9A;
}
@@ -1,95 +0,0 @@
import React from 'react';
import PropTypes from 'prop-types';
import Label from 'coral-ui/components/Label';
import Slot from 'coral-framework/components/Slot';
import { t } from 'coral-framework/services/i18n';
import FlagLabel from 'coral-ui/components/FlagLabel';
import cn from 'classnames';
import styles from './CommentLabels.css';
import { ADMIN, MODERATOR, STAFF } from 'coral-framework/constants/roles';
const staffRoles = [ADMIN, MODERATOR, STAFF];
function isUserFlagged(actions) {
return actions.some(
action => action.__typename === 'FlagAction' && action.user
);
}
function getUserFlaggedType(actions) {
return actions.some(
action =>
action.__typename === 'FlagAction' &&
action.user &&
staffRoles.includes(action.user.role)
)
? 'Staff'
: 'User';
}
function hasSuspectedWords(actions) {
return actions.some(
action =>
action.__typename === 'FlagAction' && action.reason === 'SUSPECT_WORD'
);
}
function hasHistoryFlag(actions) {
return actions.some(
action => action.__typename === 'FlagAction' && action.reason === 'TRUST'
);
}
const CommentLabels = ({
comment,
comment: { className, status, actions, hasParent },
}) => {
const slotPassthrough = {
comment,
};
return (
<div className={cn(className, styles.root)}>
<div className={styles.coreLabels}>
{hasParent && (
<Label iconName="reply" className={styles.replyLabel}>
reply
</Label>
)}
{status === 'PREMOD' && (
<Label iconName="query_builder" className={styles.premodLabel}>
Pre-Mod
</Label>
)}
{isUserFlagged(actions) && (
<FlagLabel iconName="person">{getUserFlaggedType(actions)}</FlagLabel>
)}
{hasSuspectedWords(actions) && (
<FlagLabel iconName="sms_failed">
{t('flags.reasons.comment.suspect_word')}
</FlagLabel>
)}
{hasHistoryFlag(actions) && (
<FlagLabel iconName="sentiment_very_dissatisfied">
{t('flags.reasons.comment.trust')}
</FlagLabel>
)}
</div>
<Slot
className={styles.slot}
fill="adminCommentLabels"
passthrough={slotPassthrough}
/>
</div>
);
};
CommentLabels.propTypes = {
comment: PropTypes.shape({
className: PropTypes.string,
status: PropTypes.string,
actions: PropTypes.array,
hasParent: PropTypes.bool,
}),
};
export default CommentLabels;
@@ -1,16 +0,0 @@
.count {
display: inline-block;
background: #616161;
margin: 2px;
vertical-align: middle;
padding: 1px 5px;
border-radius: 2px;
margin-left: 5px;
line-height: 18px;
box-sizing: border-box;
height: 18px;
right: 0;
margin-top: 0px;
font-size: 12px;
color: white;
}
@@ -1,19 +0,0 @@
import React from 'react';
import PropTypes from 'prop-types';
import styles from './CountBadge.css';
import { humanizeNumber } from 'coral-framework/helpers/numbers';
const CountBadge = ({ count }) => {
let number = count;
// shorten large counts to abbreviations
number = humanizeNumber(number);
return <span className={styles.count}>{number}</span>;
};
CountBadge.propTypes = {
count: PropTypes.number.isRequired,
};
export default CountBadge;
@@ -1,13 +0,0 @@
@custom-media --table-viewport (max-width: 1024px);
:global {
.mdl-layout__drawer-button {
visibility: hidden;
}
@media (--table-viewport) {
.mdl-layout__drawer-button {
visibility: visible;
}
}
}
@@ -1,60 +0,0 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Navigation, Drawer } from 'react-mdl';
import { IndexLink, Link } from 'react-router';
import styles from './Drawer.css';
import t from 'coral-framework/services/i18n';
import { can } from 'coral-framework/services/perms';
import cn from 'classnames';
const CoralDrawer = ({ handleLogout, currentUser }) =>
currentUser && can(currentUser, 'ACCESS_ADMIN') ? (
<Drawer className={cn('talk-admin-drawer-nav', styles.drawer)}>
<div>
<Navigation className={styles.nav}>
{can(currentUser, 'MODERATE_COMMENTS') && (
<IndexLink
className={cn('talk-admin-nav-moderate', styles.navLink)}
to="/admin/moderate"
activeClassName={styles.active}
>
{t('configure.moderate')}
</IndexLink>
)}
<Link
className={cn('talk-admin-nav-stories', styles.navLink)}
to="/admin/stories"
activeClassName={styles.active}
>
{t('configure.stories')}
</Link>
<Link
className={cn('talk-admin-nav-community', styles.navLink)}
to="/admin/community"
activeClassName={styles.active}
>
{t('configure.community')}
</Link>
{can(currentUser, 'UPDATE_CONFIG') && (
<Link
className={cn('talk-admin-nav-configure', styles.navLink)}
to="/admin/configure"
activeClassName={styles.active}
>
{t('configure.configure')}
</Link>
)}
<a onClick={handleLogout}>{t('configure.sign_out')}</a>
<span>{`v${process.env.VERSION}`}</span>
</Navigation>
</div>
</Drawer>
) : null;
CoralDrawer.propTypes = {
handleLogout: PropTypes.func.isRequired,
restricted: PropTypes.bool, // hide app elements from a logged out user
currentUser: PropTypes.object,
};
export default CoralDrawer;
@@ -1,15 +0,0 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Card } from 'coral-ui';
const EmptyCard = props => (
<Card style={{ textAlign: 'center', maxWidth: 400, margin: '0 auto' }}>
{props.children}
</Card>
);
EmptyCard.propTypes = {
children: PropTypes.node.isRequired,
};
export default EmptyCard;
@@ -1,16 +0,0 @@
.external {
margin-bottom: 20px;
}
.separator h5 {
text-align: center;
font-size: 1.2em;
}
.slot > * {
margin-bottom: 8px;
&:last-child {
margin-bottom: 0px;
}
}
@@ -1,24 +0,0 @@
import React from 'react';
import PropTypes from 'prop-types';
import styles from './External.css';
import Slot from 'coral-framework/components/Slot';
import IfSlotIsNotEmpty from 'coral-framework/components/IfSlotIsNotEmpty';
const External = ({ slot }) => (
<IfSlotIsNotEmpty slot={slot}>
<div>
<div className={styles.external}>
<Slot fill={slot} className={styles.slot} />
</div>
<div className={styles.separator}>
<h5>Or</h5>
</div>
</div>
</IfSlotIsNotEmpty>
);
External.propTypes = {
slot: PropTypes.string.isRequired,
};
export default External;
@@ -1,34 +0,0 @@
.heading {
margin: 0;
font-size: 1.5rem;
font-weight: bold;
}
.widgetTable {
width: 100%;
border-collapse: collapse;
box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.2);
}
.widgetTable thead th {
border-bottom: 1px solid #f47e6b;
padding: 10px;
text-align: left;
}
.widgetTable tbody tr {
border-bottom: 1px solid lightgrey;
}
.widgetTable tbody tr:last-child {
border-bottom: none;
}
.widgetTable tbody td {
padding: 10px;
}
.lede {
font-size: 0.9em;
color: grey;
}
@@ -1,8 +0,0 @@
.container {
max-width: 1280px;
margin: 0 auto;
}
.copy {
padding: 20px 0;
}
@@ -1,11 +0,0 @@
import React from 'react';
import styles from './Forbidden.css';
import t from 'coral-framework/services/i18n';
const Forbidden = () => (
<div className={styles.container}>
<p className={styles.copy}>{t('error.PAGE_NOT_AVAILABLE_ROLE')}</p>
</div>
);
export default Forbidden;
@@ -1,20 +0,0 @@
.header, .cta, .success {
text-align: center;
font-size: 16px;
}
.success {
cursor: pointer;
padding: 8px 14px;
}
.signInLink {
color: blue;
font-weight: normal;
text-decoration: none;
}
.signInLink:hover {
text-decoration: underline;
}
@@ -1,82 +0,0 @@
import React from 'react';
import PropTypes from 'prop-types';
import styles from './ForgotPassword.css';
import { Button, TextField, Alert, Success } from 'coral-ui';
import t from 'coral-framework/services/i18n';
class ForgotPassword extends React.Component {
constructor(props) {
super(props);
}
handleEmailChange = e => this.props.onEmailChange(e.target.value);
handleSubmit = e => {
e.preventDefault();
this.props.onSubmit();
};
handleSignInLink = e => {
e.preventDefault();
this.props.onSignInLink();
};
renderSuccess() {
return (
<div className={styles.success} onClick={this.handleSignInLink}>
{t('password_reset.mail_sent')}{' '}
<a
className={styles.signInLink}
href="#"
onClick={this.handleSignInLink}
>
{t('login.sign_in')}
</a>
<Success />
</div>
);
}
renderForm() {
const { email, errorMessage } = this.props;
return (
<form onSubmit={this.handleSubmit}>
{errorMessage && <Alert>{errorMessage}</Alert>}
<TextField
label={t('login.email_address')}
value={email}
onChange={this.handleEmailChange}
/>
<Button type="submit" cStyle="black" full>
{t('login.reset_password_send_button')}
</Button>
<p className={styles.cta}>
{t('login.go_back')}{' '}
<a
href="#"
className={styles.signInLink}
onClick={this.handleSignInLink}
>
{t('login.sign_in')}
</a>
.
</p>
</form>
);
}
render() {
return this.props.success ? this.renderSuccess() : this.renderForm();
}
}
ForgotPassword.propTypes = {
success: PropTypes.bool.isRequired,
email: PropTypes.string.isRequired,
onEmailChange: PropTypes.func.isRequired,
onSubmit: PropTypes.func.isRequired,
errorMessage: PropTypes.string,
onSignInLink: PropTypes.func.isRequired,
};
export default ForgotPassword;
@@ -1,12 +0,0 @@
.layout {
max-width: 800px;
margin: 0 auto;
}
.layout h1 {
font-size: 40px;
}
.layout img {
width: 100%;
}
@@ -1,13 +0,0 @@
import React from 'react';
import { Layout } from 'react-mdl';
import styles from './FullLoading.css';
import { CoralLogo } from 'coral-ui';
export const FullLoading = () => (
<Layout fixedDrawer>
<div className={styles.layout}>
<h1>Loading</h1>
<CoralLogo />
</div>
</Layout>
);
@@ -1,108 +0,0 @@
@custom-media --table-viewport (max-width: 1024px);
@media (--table-viewport) {
.logo {
margin-left: 58px;
h1 {
background: #696969;
}
span {
color: #fcfcfc;
}
}
.nav {
display: none;
}
}
.headerWrapper {
background-color: #696969;
}
.header {
box-shadow: none;
min-height: 58px;
display: block;
max-width: 1280px;
margin: 0 auto;
background-color: #696969;
box-shadow: 0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.2), 0 1px 5px 0 rgba(0,0,0,.12);
}
.header > div {
position: relative;
padding: 0;
max-width: 1280px;
margin: 0 auto;
height: 58px;
}
.rightPanel {
position: absolute;
top: 0;
right: 0;
width: 170px;
height: 100%;
}
.rightPanel > ul {
list-style: none;
margin-right: 20px;
}
.rightPanel > ul > li {
display: inline-block;
float: right;
margin-left: 15px;
font-size: 15px;
font-weight: 500;
line-height: 33px;
}
.rightPanel a {
color: black;
text-decoration: none;
font-weight: 400;
}
.rightPanel .settings {
line-height: 0;
}
.rightPanel .settings > div {
position: relative;
}
.rightPanel .settings:hover {
background: rgba(158, 158, 158, 0.69);
cursor: pointer;
}
.navLink {
padding: 0 20px;
font-size: 15px;
font-weight: 500;
background-color: transparent;
transition: background-color 200ms;
font-weight: 100;
letter-spacing: .8;
&:hover {
background-color: #404040;
}
&.active {
background-color: #232323;
font-weight: 400;
}
}
.nav {
overflow: hidden;
height: 58px !important;
}
.nav .navLink {
padding: 0 20px;
letter-spacing: 0.4px;
}
-135
View File
@@ -1,135 +0,0 @@
import React from 'react';
import cn from 'classnames';
import PropTypes from 'prop-types';
import { Navigation, Header, IconButton, MenuItem, Menu } from 'react-mdl';
import { Link, IndexLink } from 'react-router';
import styles from './Header.css';
import t from 'coral-framework/services/i18n';
import { Logo } from './Logo';
import { can } from 'coral-framework/services/perms';
import CommunityIndicator from '../routes/Community/containers/Indicator';
const CoralHeader = ({
handleLogout,
showShortcuts = () => {},
currentUser,
root,
data,
}) => {
return (
<div className={styles.headerWrapper}>
<Header className={styles.header}>
<Logo className={styles.logo} />
<div>
{currentUser && can(currentUser, 'ACCESS_ADMIN') ? (
<Navigation className={styles.nav}>
{can(currentUser, 'MODERATE_COMMENTS') && (
<IndexLink
id="moderateNav"
className={cn('talk-admin-nav-moderate', styles.navLink)}
to="/admin/moderate"
activeClassName={styles.active}
>
{t('configure.moderate')}
</IndexLink>
)}
<Link
id="storiesNav"
className={cn('talk-admin-nav-stories', styles.navLink)}
to="/admin/stories"
activeClassName={styles.active}
>
{t('configure.stories')}
</Link>
<Link
id="communityNav"
className={cn('talk-admin-nav-community', styles.navLink)}
to="/admin/community"
activeClassName={styles.active}
>
{t('configure.community')}
<CommunityIndicator root={root} data={data} />
</Link>
{can(currentUser, 'UPDATE_CONFIG') && (
<Link
id="configureNav"
className={cn('talk-admin-nav-configure', styles.navLink)}
to="/admin/configure"
activeClassName={styles.active}
>
{t('configure.configure')}
</Link>
)}
</Navigation>
) : null}
<div className={styles.rightPanel}>
<ul>
<li className={cn(styles.settings, 'talk-admin-header-settings')}>
<div>
<IconButton
name="settings"
id="menu-settings"
className="talk-admin-header-settings-button"
/>
<Menu target="menu-settings" align="right">
<MenuItem onClick={() => showShortcuts(true)}>
{t('configure.shortcuts')}
</MenuItem>
<MenuItem>
<a
href="https://docs.coralproject.net/talk/how-talk-works/"
target="_blank"
rel="noopener noreferrer"
>
{t('configure.product_guide_link')}
</a>
</MenuItem>
<MenuItem>
<a
href="https://github.com/coralproject/talk/releases"
target="_blank"
rel="noopener noreferrer"
>
{t('configure.view_last_version')}
</a>
</MenuItem>
<MenuItem>
<a
href="https://support.coralproject.net"
target="_blank"
rel="noopener noreferrer"
>
{t('configure.report_bug_or_feedback')}
</a>
</MenuItem>
{currentUser && (
<MenuItem
onClick={handleLogout}
className="talk-admin-header-sign-out"
>
{t('configure.sign_out')}
</MenuItem>
)}
</Menu>
</div>
</li>
<li>{`v${process.env.VERSION}`}</li>
</ul>
</div>
</div>
</Header>
</div>
);
};
CoralHeader.propTypes = {
currentUser: PropTypes.object,
showShortcuts: PropTypes.func,
handleLogout: PropTypes.func.isRequired,
root: PropTypes.object.isRequired,
data: PropTypes.object.isRequired,
};
export default CoralHeader;
@@ -1,12 +0,0 @@
import React from 'react';
import matchLinks from 'coral-framework/utils/matchLinks';
export default ({ text, children }) => {
const hasLinks = !!matchLinks(text);
if (!hasLinks) {
return null;
}
return React.Children.only(children);
};
@@ -1,8 +0,0 @@
.indicator {
display: inline-block;
background-color: #E46D59;
border-radius: 10px;
width: 7px;
height: 7px;
margin-left: 7px;
}
@@ -1,6 +0,0 @@
import React from 'react';
import styles from './Indicator.css';
const Indicator = () => <span className={styles.indicator} />;
export default Indicator;

Some files were not shown because too many files have changed in this diff Show More