Skip to content

Commit

Permalink
Merge branch 'development' into feature/save-widgets-reload
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvandervegt committed Jul 15, 2020
2 parents ef23212 + bbb3d82 commit 7c03913
Show file tree
Hide file tree
Showing 148 changed files with 19,818 additions and 3,094 deletions.
18 changes: 16 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,20 @@ env:
- DOCKER_IMAGE_NAME=frontend
- K8S_DEPLOYMENT_NAME=openstad-frontend
- K8S_NAMESPACE=openstad

- FRONTED_PORT=4444
- FRONTEND_MONGO_SCHEME=mongodb://mongo
- FRONTEND_MONGO_DB_HOST=mongo
- FRONTEND_MONGO_PORT=27017
- FRONTEND_MINIFY_JS=ON
- COOKIE_SECURE_OFF=yes
- API=http://localhost:8111
- IMAGE_API_URL=http://localhost:3333
- IMAGE_API_ACCESS_TOKEN=xxxx
- IMAGE_API_ACCESS_TOKEN=xxxx
- SITE_API_KEY=xxxx
- DEFAULT_DB=localhost2
- DEFAULT_HOST=localhost:4444
- APP_URL=http://localhost:4444
services:
- docker

Expand All @@ -16,6 +29,7 @@ before_install:

script:
- docker run -e CI=true ${DOCKER_PUBLIC_USERNAME}/${DOCKER_IMAGE_NAME}:${TRAVIS_BUILD_ID} npm run test -- --coverage
- docker-compose -f docker-compose.travis.yml run frontend node apostrophe.js apostrophe:generation

deploy:
# what branches to deploy automatically
Expand All @@ -28,7 +42,7 @@ deploy:
# Either Create different config in travis to deploy to different cluster
# Or add a different namespace for ACC
# condition: $TRAVIS_BRANCH =~ ^(development|release)$
condition: $TRAVIS_BRANCH =~ ^(feature/docker-travis|development)$
condition: $TRAVIS_BRANCH =~ ^(feature/docker-travis)$
# master automatically pushes new docker container with latest tag to docker
- provider: script
#script not yet tested
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ENV DB_HOST=""
ENV DEFAULT_DB=""

# Install all base dependencies.
RUN apk add --no-cache --update openssl g++ make python musl-dev git
RUN apk add --no-cache --update openssl g++ make python musl-dev git bash

# Set the working directory to the root of the container
WORKDIR /home/app
Expand All @@ -50,6 +50,7 @@ RUN mkdir -p /home/app/public/css
RUN mkdir -p /home/app/public/js
RUN mkdir -p /home/app/public/img
RUN mkdir -p /home/app/public/apos-minified
RUN mkdir -p /home/app/data

# Set node ownership to/home/app
RUN chown -R node:node /home/app
Expand Down
48 changes: 48 additions & 0 deletions docker-compose.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#
# Docker Compose file for Openstad app
#
---
version: '3.1'
services:
frontend:
command: npm run dev
image: ${DOCKER_PUBLIC_USERNAME}/${DOCKER_IMAGE_NAME}:${TRAVIS_BUILD_ID}
ports:
- ${FRONTED_PORT}:${FRONTED_PORT}
environment:
PORT: "${FRONTED_PORT}"
DB_HOST: "${FRONTEND_MONGO_DB_HOST}"
DB_PORT: "${FRONTEND_MONGO_PORT}"
MONGO_DB_HOST: "${FRONTEND_MONGO_DB_HOST}"
MINIFY_JS: "${FRONTEND_MINIFY_JS}"
COOKIE_SECURE_OFF: "${COOKIE_SECURE_OFF}"
DOCKER_PUBLIC_USERNAME: "openstad"
DOCKER_IMAGE_NAME: "frontend"
K8S_DEPLOYMENT_NAME: "openstad-frontend"
K8S_NAMESPACE: "openstad"
FRONTED_PORT: "4444"
FRONTEND_MONGO_SCHEME: "mongodb://mongo"
FRONTEND_MONGO_DB_HOST: "mongo"
FRONTEND_MONGO_PORT: "27017"
FRONTEND_MINIFY_JS: "ON"
COOKIE_SECURE_OFF: "yes"
API: "http://localhost:8111"
IMAGE_API_URL: "http://localhost:3333"
IMAGE_API_ACCESS_TOKEN: "xxxx"
IMAGE_API_ACCESS_TOKEN: "xxxx"
SITE_API_KEY: "xxxx"
DEFAULT_DB: "localhost2"
DEFAULT_HOST: "localhost:4444"
APP_URL: "http://localhost:4444"
restart: always"

links:
- mongo:localhost
depends_on:
- mongo

mongo:
image: 'mongo:4.0'
ports:
- '127.0.0.1:27018:27017'
restart: always
4 changes: 3 additions & 1 deletion locales/default-draft.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"Server error, please try again.": "Server error, please try again.",
"Use the Add Content button to get started.": "Use the Add Content button to get started.",
"You may be editing that document in another tab or window.\nIf you take control, you could lose work in that tab or window.\nDo you want to take control?": "You may be editing that document in another tab or window.\nIf you take control, you could lose work in that tab or window.\nDo you want to take control?",
"Control of this document has been taken by another user.": "Control of this document has been taken by another user."
"Control of this document has been taken by another user.": "Control of this document has been taken by another user.",
"You are now editing this document in another tab or window.": "You are now editing this document in another tab or window.",
"Legacy Trash": "Legacy Trash"
}
262 changes: 261 additions & 1 deletion locales/default.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Openstad frontent project including openstad frontend packages\"",
"main": "index.js",
"scripts": {
"start": "node index.js",
"start": "node apostrophe.js apostrophe:generation && node index.js",
"dev": "nodemon index.js"
},
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions packages/cms/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function serveSites (req, res, next) {
* Fetch the config for site by making a call with the domain
*/
const apiUrl = process.env.INTERNAL_API_URL ? process.env.INTERNAL_API_URL : process.env.API;

const siteOptions = {
uri:`${apiUrl}/api/site/${thisHost}`, //,
headers: {
Expand All @@ -81,7 +81,7 @@ function serveSites (req, res, next) {

rp(siteOptions)
.then((siteConfig) => {
console.info('Caching config for site: %s -> %j:', thisHost, siteConfig);
console.info('Caching config for site: %s -> %j:', thisHost);

configForHosts[thisHost] = siteConfig;
serveSite(req, res, siteConfig, true);
Expand Down
29 changes: 13 additions & 16 deletions packages/cms/config/contentWidgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,8 @@
// can be turned on per key, or per deprecated/beta flag
// this is just for showing, widgets are still loaded even if they are not visible, this is necessary for asset loading
// all shared within one multisite installation
//
const objectClone = function() {
var newObj = (this instanceof Array) ? [] : {};
for (var i in this) {
if (i == 'clone') continue;
if (this[i] && typeof this[i] == "object") {
newObj[i] = this[i].clone();
} else newObj[i] = this[i]
} return newObj;
};

const contentWidgets = {
'admin': {
adminOnly: true,
hideByDefault: false
},
'agenda': {},
'accordeon': {},
'arguments': {
Expand Down Expand Up @@ -47,15 +33,19 @@ const contentWidgets = {
'date-bar': {},
'idea-form': {
adminOnly: true,
hideByDefault: false
hideByDefault: true,
deprecated: true
},
'idea-map': {
adminOnly: true
},
'idea-overview': {
hideByDefault: true,
addLabel: 'Idea overiew (deprecated, use resource overview)',
},
'idea-single': {
adminOnly: true,
hideByDefault: true,
},
'ideas-on-map': {
addLabel: 'Ideeen op een kaart',
Expand Down Expand Up @@ -138,7 +128,14 @@ const contentWidgets = {
position: 'top-left'
},
},
'title': {},
'title': {
label: 'Title again',
testData: 'test1144441',
options: {
testData: 'test11333344441',

}
},
'user-form': {
adminOnly: true,
hideByDefault: true,
Expand Down
Loading

0 comments on commit 7c03913

Please sign in to comment.