mirror of
https://github.com/wassname/talk.git
synced 2026-09-13 13:10:43 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b7137fbcd4 | ||
|
|
4089d09681 | ||
|
|
a7eb588f7f | ||
|
|
cd92dbf682 | ||
|
|
89ab71eb1d | ||
|
|
c1cfe3b200 | ||
|
|
d7ed679384 | ||
|
|
59acdc5c02 | ||
|
|
b06ae9001e | ||
|
|
1f170c1dca | ||
|
|
9217239caf | ||
|
|
fac028c22b |
+11
-4
@@ -1,11 +1,18 @@
|
||||
FROM coralproject/talk:latest
|
||||
|
||||
# Setup the build arguments
|
||||
ONBUILD ARG TALK_THREADING_LEVEL=3
|
||||
ONBUILD ARG TALK_DEFAULT_STREAM_TAB=all
|
||||
ONBUILD ARG TALK_DEFAULT_LANG=en
|
||||
ONBUILD ARG TALK_PLUGINS_JSON
|
||||
|
||||
# Bundle app source
|
||||
ONBUILD COPY . /usr/src/app
|
||||
|
||||
# At this stage, we need to install the development dependancies again because
|
||||
# we need to have webpack available. We then build the new dependancies and
|
||||
# clear out the development dependancies again. After this we of course need to
|
||||
# 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 build
|
||||
yarn build && \
|
||||
yarn cache clean
|
||||
@@ -5,14 +5,15 @@ 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, auth = {}}) => (
|
||||
<Drawer className={styles.drawer}>
|
||||
<Drawer className={cn('talk-admin-drawer-nav', styles.drawer)}>
|
||||
{ auth && auth.user && can(auth.user, 'ACCESS_ADMIN') ?
|
||||
<div>
|
||||
<Navigation className={styles.nav}>
|
||||
<IndexLink
|
||||
className={styles.navLink}
|
||||
className={cn('talk-admin-nav-dashboard', styles.navLink)}
|
||||
to="/admin/dashboard"
|
||||
activeClassName={styles.active}>
|
||||
{t('configure.dashboard')}
|
||||
@@ -20,19 +21,21 @@ const CoralDrawer = ({handleLogout, auth = {}}) => (
|
||||
{
|
||||
can(auth.user, 'MODERATE_COMMENTS') && (
|
||||
<Link
|
||||
className={styles.navLink}
|
||||
className={cn('talk-admin-nav-moderate', styles.navLink)}
|
||||
to="/admin/moderate"
|
||||
activeClassName={styles.active}>
|
||||
{t('configure.moderate')}
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
<Link className={styles.navLink}
|
||||
<Link
|
||||
className={cn('talk-admin-nav-stories', styles.navLink)}
|
||||
to="/admin/stories"
|
||||
activeClassName={styles.active}>
|
||||
{t('configure.stories')}
|
||||
</Link>
|
||||
<Link className={styles.navLink}
|
||||
<Link
|
||||
className={cn('talk-admin-nav-community', styles.navLink)}
|
||||
to="/admin/community"
|
||||
activeClassName={styles.active}>
|
||||
{t('configure.community')}
|
||||
@@ -41,7 +44,7 @@ const CoralDrawer = ({handleLogout, auth = {}}) => (
|
||||
can(auth.user, 'UPDATE_CONFIG') &&
|
||||
(
|
||||
<Link
|
||||
className={styles.navLink}
|
||||
className={cn('talk-admin-nav-configure', styles.navLink)}
|
||||
to="/admin/configure"
|
||||
activeClassName={styles.active}>
|
||||
{t('configure.configure')}
|
||||
|
||||
@@ -95,10 +95,12 @@ FROM coralproject/talk:latest-onbuild
|
||||
And running the following to build the docker image:
|
||||
|
||||
```bash
|
||||
docker build -t my-awesome-talk-image .
|
||||
docker build -t my-awesome-talk-image --build-arg TALK_DEFAULT_LANG=es .
|
||||
```
|
||||
|
||||
Don't forget to replace `my-awesome-talk-image` with your own image name.
|
||||
Don't forget to replace `my-awesome-talk-image` with your own image name, and
|
||||
specify your build variables with the `--build-arg`. Refer to [Dockerfile.onbuild](https://github.com/coralproject/talk/blob/master/Dockerfile.onbuild){:target="_blank"} for the
|
||||
available build variables.
|
||||
{: .code-aside}
|
||||
|
||||
This accomplishes a lot:
|
||||
@@ -108,6 +110,9 @@ This accomplishes a lot:
|
||||
2. Installs any new dependencies that were required by any new plugins.
|
||||
3. Builds the new static bundles so that they are ready to serve when the image
|
||||
is running.
|
||||
4. Specifies a build time variable [TALK_DEFAULT_LANG]({{ "/advanced-configuration/#talk_default_lang" | relative_url }}){:.param}. Refer
|
||||
to [Dockerfile.onbuild](https://github.com/coralproject/talk/blob/master/Dockerfile.onbuild){:target="_blank"} for the
|
||||
available build variables.
|
||||
|
||||
This means that you can create a repository for your organization that simply
|
||||
includes the above `Dockerfile`, a directory of `plugins`, and a `plugins.json`
|
||||
|
||||
@@ -26,10 +26,18 @@ Configure the duration for which comment counts are cached for, parsed by
|
||||
|
||||
## TALK_DEFAULT_LANG
|
||||
|
||||
This is a **Build Variable** and must be consumed during build. If using the
|
||||
[Docker-onbuild]({{ "/installation-from-docker/#onbuild" | relative_url }})
|
||||
image you can specify it with `--build-arg TALK_DEFAULT_LANG=en`.
|
||||
|
||||
Specify the default translation language. (Default `en`)
|
||||
|
||||
## TALK_DEFAULT_STREAM_TAB
|
||||
|
||||
This is a **Build Variable** and must be consumed during build. If using the
|
||||
[Docker-onbuild]({{ "/installation-from-docker/#onbuild" | relative_url }})
|
||||
image you can specify it with `--build-arg TALK_DEFAULT_STREAM_TAB=all`.
|
||||
|
||||
Specify the default stream tab in the admin. (Default `all`)
|
||||
|
||||
## TALK_DISABLE_AUTOFLAG_SUSPECT_WORDS
|
||||
@@ -397,6 +405,10 @@ CDN/Storage url. (Defaults to value of
|
||||
|
||||
## TALK_THREADING_LEVEL
|
||||
|
||||
This is a **Build Variable** and must be consumed during build. If using the
|
||||
[Docker-onbuild]({{ "/installation-from-docker/#onbuild" | relative_url }})
|
||||
image you can specify it with `--build-arg TALK_THREADING_LEVEL=3`.
|
||||
|
||||
Specify the maximum depth of the comment thread. (Default `3`)
|
||||
|
||||
**Note that a high value for `TALK_THREADING_LEVEL` will result in large
|
||||
|
||||
@@ -273,7 +273,8 @@ pre {
|
||||
p a:not(.plain-link) {
|
||||
@extend .coral-link;
|
||||
}
|
||||
ul:not(.toc__menu) li a {
|
||||
ul:not(.toc__menu) li a,
|
||||
ol li a {
|
||||
@extend .coral-link;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,9 +15,13 @@ module.exports = {
|
||||
'passwordInput': '.talk-admin-login-sign-in #password',
|
||||
'signInButton': '.talk-admin-login-sign-in-button',
|
||||
'storiesNav': '.talk-admin-nav-stories',
|
||||
'storiesDrawerNav': '.talk-admin-drawer-nav .talk-admin-nav-stories',
|
||||
'storiesSection': '.talk-admin-stories',
|
||||
'communityNav': '.talk-admin-nav-community',
|
||||
'communityDrawerNav': '.talk-admin-drawer-nav .talk-admin-nav-community',
|
||||
'communitySection': '.talk-admin-community',
|
||||
'moderationContainer': '.talk-admin-moderation-container'
|
||||
'moderationContainer': '.talk-admin-moderation-container',
|
||||
'drawerButton': '.mdl-layout__drawer-button',
|
||||
'drawerOverlay': 'div.mdl-layout__obfuscator.is-visible',
|
||||
}
|
||||
};
|
||||
|
||||
+18
-10
@@ -1,10 +1,9 @@
|
||||
module.exports = {
|
||||
'@tags': ['admin', 'login'],
|
||||
beforeEach: (client) => {
|
||||
|
||||
// Testing Desktop
|
||||
client.resizeWindow(1280, 800);
|
||||
},
|
||||
beforeEach: (client) => {
|
||||
|
||||
client.resizeWindow(1024, 800);
|
||||
},
|
||||
'Admin logs in': (client) => {
|
||||
const adminPage = client.page.admin();
|
||||
const {testData: {admin}} = client.globals;
|
||||
@@ -29,9 +28,14 @@ module.exports = {
|
||||
|
||||
adminPage
|
||||
.navigate()
|
||||
.waitForElementVisible('@storiesNav')
|
||||
.click('@storiesNav')
|
||||
.waitForElementVisible('@drawerButton')
|
||||
.click('@drawerButton')
|
||||
.waitForElementVisible('@storiesDrawerNav')
|
||||
.click('@storiesDrawerNav')
|
||||
.waitForElementVisible('@drawerOverlay')
|
||||
.click('@drawerOverlay')
|
||||
.waitForElementVisible('@storiesSection');
|
||||
|
||||
},
|
||||
|
||||
'Admin goes to Community': (client) => {
|
||||
@@ -39,9 +43,13 @@ module.exports = {
|
||||
|
||||
adminPage
|
||||
.navigate()
|
||||
.waitForElementVisible('@communityNav')
|
||||
.click('@communityNav')
|
||||
.waitForElementVisible('@communitySection');
|
||||
.waitForElementVisible('@drawerButton')
|
||||
.click('@drawerButton')
|
||||
.waitForElementVisible('@communityDrawerNav')
|
||||
.click('@communityDrawerNav')
|
||||
.waitForElementVisible('@drawerOverlay')
|
||||
.click('@drawerOverlay')
|
||||
.waitForElementVisible('@communitySection');
|
||||
},
|
||||
after: (client) => {
|
||||
client.end();
|
||||
|
||||
Reference in New Issue
Block a user