Skip to content

Commit

Permalink
Merge d99c6a1 into d606631
Browse files Browse the repository at this point in the history
  • Loading branch information
bloodbare committed Sep 28, 2018
2 parents d606631 + d99c6a1 commit 1402cf1
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ api/.Python
api/include
api/lib
api/pip-selfcheck.json
/bin
/lib

# Tests
/tests/bin
Expand All @@ -42,3 +44,4 @@ log.html
output.xml
report.html
selenium-screenshot-*.png
/selenium/
4 changes: 2 additions & 2 deletions g-api/config-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ static:
root_user:
password: root
auth_extractors:
- guillotina_cms.extractors.CookiePolicy
- guillotina.auth.extractors.CookiePolicy
- guillotina.auth.extractors.BearerAuthPolicy
- guillotina.auth.extractors.BasicAuthPolicy
- guillotina.auth.extractors.WSTokenAuthPolicy
auth_token_validators:
- guillotina.auth.validators.SaltedHashPasswordValidator
- guillotina_cms.validator.CMSJWTValidator
- guillotina.auth.validators.JWTValidator
redis:
host: "redis"
port: 6379
Expand Down
4 changes: 2 additions & 2 deletions g-api/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ static:
root_user:
password: root
auth_extractors:
- guillotina_cms.extractors.CookiePolicy
- guillotina.auth.extractors.CookiePolicy
- guillotina.auth.extractors.BearerAuthPolicy
- guillotina.auth.extractors.BasicAuthPolicy
- guillotina.auth.extractors.WSTokenAuthPolicy
auth_token_validators:
- guillotina.auth.validators.SaltedHashPasswordValidator
- guillotina_cms.validator.CMSJWTValidator
- guillotina.auth.validators.JWTValidator
redis:
host: "redis"
port: 6380
Expand Down
12 changes: 6 additions & 6 deletions src/components/manage/Form/Form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,12 @@ class Form extends Component {
* @returns {undefined}
*/
onChangeTile(id, value) {
const tilesFieldname = getTilesFieldname(this.state.formData);
this.setState({
formData: {
...this.state.formData,
[getTilesFieldname(this.state.formData)]: {
...this.state.formData.tiles,
...this.state.formData[tilesFieldname],
[id]: value || null,
},
},
Expand Down Expand Up @@ -237,7 +238,7 @@ class Form extends Component {
[tilesLayoutFieldname]: {
items: without(this.state.formData[tilesLayoutFieldname].items, id),
},
tiles: omit(this.state.formData[tilesFieldname], [id]),
[tilesFieldname]: omit(this.state.formData[tilesFieldname], [id]),
},
selected: selectPrev
? this.state.formData[tilesLayoutFieldname].items[
Expand All @@ -264,14 +265,14 @@ class Form extends Component {
this.setState({
formData: {
...this.state.formData,
tiles_layout: {
[tilesLayoutFieldname]: {
items: [
...this.state.formData[tilesLayoutFieldname].items.slice(0, insert),
id,
...this.state.formData[tilesLayoutFieldname].items.slice(insert),
],
},
tiles: {
[tilesFieldname]: {
...this.state.formData[tilesFieldname],
[id]: {
'@type': type,
Expand Down Expand Up @@ -350,7 +351,7 @@ class Form extends Component {
this.setState({
formData: {
...this.state.formData,
tiles_layout: {
[tilesLayoutFieldname]: {
items: move(
this.state.formData[tilesLayoutFieldname].items,
dragIndex,
Expand All @@ -373,7 +374,6 @@ class Form extends Component {
const tilesLayoutFieldname = getTilesLayoutFieldname(formData);
const renderTiles = formData[tilesLayoutFieldname].items;
const tilesDict = formData[tilesFieldname];

return this.props.visual ? (
<div className="ui wrapper">
{map(renderTiles, (tile, index) => (
Expand Down
4 changes: 2 additions & 2 deletions src/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export default defaults(
{
host: 'localhost',
port: '4300',
apiPath: 'http://localhost:8080/Plone', // for Plone
// apiPath: 'http://localhost:8080/Plone', // for Plone
publicUrl: '',
// apiPath: 'http://localhost:8081/db/web', // for guillotina
apiPath: 'http://localhost:8081/db/container', // for guillotina
},
);
1 change: 1 addition & 0 deletions src/server.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export default parameters => {
res.set({
'Cache-Control': 'public, max-age=60, no-transform',
});
console.log(error.stack);
res
.status(500)
.send(`<!doctype html> ${renderToStaticMarkup(errorPage)}`);
Expand Down
24 changes: 23 additions & 1 deletion tests/GuillotinaLibrary.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import logging
from time import sleep
import requests

HEADERS = {
Expand All @@ -18,7 +19,6 @@ def setup_guillotina(self, base_url):
for i in range(10):
resp = s.get(base_url)
if resp.status_code != 200:
logger.warn('Waiting')
sleep(2)
else:
break
Expand All @@ -43,3 +43,25 @@ def setup_guillotina(self, base_url):
raise Exception('Warning, could not install cms {}: {}'.format(
resp.status_code,
resp.content))
resp = s.post(
os.path.join(base_url, 'container/@sharing'),
json={
"roleperm":
[
{
"setting": "AllowSingle",
"role": "guillotina.Anonymous",
"permission": "guillotina.ViewContent"
},
{
"setting": "AllowSingle",
"role": "guillotina.Anonymous",
"permission": "guillotina.AccessContent"
}
]
})
if resp.status_code not in (200, 201):
raise Exception('Warning, could not publish site {}: {}'.format(
resp.status_code,
resp.content))

0 comments on commit 1402cf1

Please sign in to comment.