Skip to content

Commit

Permalink
Element hide add divs
Browse files Browse the repository at this point in the history
  • Loading branch information
SvenAlHamad committed Mar 17, 2019
2 parents 5c86e25 + 780cd7b commit 9d98e44
Show file tree
Hide file tree
Showing 15 changed files with 86 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"webiny-app": "^1",
"webiny-app-cms": "^1",
"webiny-app-security": "^1",
"webiny-form": "^1",
"webiny-integration-cookie-policy": "^1",
"webiny-integration-google-tag-manager": "^1",
"webiny-integration-mailchimp": "^1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ export default [
resolvers: {},
security: {
shield: {
SettingsQuery: {
googleTagManager: hasScope("cms:settings")
},
SettingsMutation: {
googleTagManager: hasScope("cms:settings")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ export default [
},
MailchimpQuery: {
listLists: hasScope("cms:editor")
},
MailchimpMutation: {
addToList: hasScope("cms:editor")
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/demo-api/src/configs/development.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default async () => {
}
},
security: {
enabled: false,
enabled: true,
token: {
secret: process.env.WEBINY_JWT_SECRET,
expiresOn: () => addDays(new Date(), 30)
Expand Down
2 changes: 1 addition & 1 deletion packages/demo-api/src/configs/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default async (context: Object) => {
}
},
security: {
enabled: false,
enabled: true,
token: {
secret: context.jwtSecret,
expiresOn: () => addDays(new Date(), 30)
Expand Down
10 changes: 6 additions & 4 deletions packages/webiny-admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,15 @@
"emotion": "^9.2.5",
"invariant": "^2.2.4",
"is-hotkey": "^0.1.3",
"react": "^16.4.0",
"react-dom": "^16.4.0",
"react-emotion": "^9.2.5",
"react-transition-group": "^2.5.1",
"recompose": "^0.27.1",
"shortid": "^2.2.12",
"store": "^2.0.12",
"@svgr/webpack": "^4.1.0",
"webiny-app": "0.0.0",
"webiny-ui": "0.0.0",
"webiny-plugins": "0.0.0"
"webiny-plugins": "0.0.0",
"webiny-ui": "0.0.0"
},
"devDependencies": {
"@babel/cli": "^7.0.0",
Expand All @@ -40,6 +38,10 @@
"babel-plugin-module-resolver": "^3.1.1",
"babel-plugin-named-asset-import": "^1.0.0-next.3e165448"
},
"peerDependencies": {
"react": "^16.6.0",
"react-dom": "^16.6.0"
},
"scripts": {
"build": "babel src -d ${DEST:-build} --source-maps --copy-files",
"flow-copy-source": "flow-copy-source src ${DEST:-build}",
Expand Down
3 changes: 0 additions & 3 deletions packages/webiny-api-cms/src/plugins/graphql.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ export default {
updateElement: hasScope("cms:element:crud"),
deleteElement: hasScope("cms:element:crud")
},
SettingsQuery: {
cms: hasScope("cms:settings")
},
SettingsMutation: {
cms: hasScope("cms:settings")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default async ({ entity: menu, context: graphqlContext }: Object) => {
const ids = Object.keys(context.distinctParents.data);

const { Page, Category } = graphqlContext.cms.entities;
listPublishedPages({
await listPublishedPages({
args: { parent: ids },
Page,
Category
Expand Down
14 changes: 7 additions & 7 deletions packages/webiny-app-cms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@
"slugify": "^1.2.9",
"timeago-react": "^2.0.0",
"uniqid": "^5.0.3",
"webfontloader": "^1.6.28"
"webfontloader": "^1.6.28",
"webiny-app": "0.0.0",
"webiny-app-security": "0.0.0",
"webiny-form": "0.0.0",
"webiny-plugins": "0.0.0",
"webiny-ui": "0.0.0"
},
"devDependencies": {
"@babel/cli": "^7.0.0",
Expand All @@ -66,12 +71,7 @@
},
"peerDependencies": {
"react": "^16.6.0",
"react-dom": "^16.6.0",
"react-helmet": "^5.2.0",
"webiny-app": "0.0.0",
"webiny-app-security": "0.0.0",
"webiny-plugins": "0.0.0",
"webiny-ui": "0.0.0"
"react-dom": "^16.6.0"
},
"scripts": {
"build": "babel src -d ${DEST:-build} --source-maps --copy-files",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,31 +111,6 @@ export const ElementContainer = pure(
backgroundColor: color
}
}
},
">.add-element": {
position: "absolute",
left: "50%",
backgroundColor: color,
color: "white",
width: "22px",
height: "22px",
borderRadius: "50%",
display: active || highlight ? "flex" : "none",
justifyContent: "center",
alignItems: "center",
transform: "scale(0.5)",
cursor: "pointer",
zIndex: 15,
transition: "transform 0.2s",
"&--above": {
top: -12
},
"&--below": {
bottom: -10
},
"&:hover": {
transform: "scale(1)"
}
}
};
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const PagesList = pure((props: Object = {}) => {

let sort = null;
if (vars.sortBy) {
// $FlowFixMe
sort = { [vars.sortBy]: vars.sortDirection || -1 };
}

Expand Down
16 changes: 8 additions & 8 deletions packages/webiny-app-security/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@
"dependencies": {
"@babel/runtime": "^7.0.0",
"dot-prop-immutable": "^1.4.0",
"graphql-tag": "^2.8.0",
"lodash": "^4.17.11",
"react-apollo": "^2.2.4",
"recompose": "^0.27.1"
"react-helmet": "^5.2.0",
"recompose": "^0.27.1",
"webiny-app": "0.0.0",
"webiny-form": "0.0.0",
"webiny-plugins": "0.0.0",
"webiny-ui": "0.0.0"
},
"devDependencies": {
"@babel/cli": "^7.0.0",
Expand All @@ -34,14 +40,8 @@
"babel-plugin-named-asset-import": "^1.0.0-next.3e165448"
},
"peerDependencies": {
"graphql-tag": "^2.8.0",
"react": "^16.6.0",
"react-dom": "^16.6.0",
"react-helmet": "^5.2.0",
"webiny-app": "0.0.0",
"webiny-form": "0.0.0",
"webiny-plugins": "0.0.0",
"webiny-ui": "0.0.0"
"react-dom": "^16.6.0"
},
"scripts": {
"build": "babel src -d ${DEST:-build} --source-maps --copy-files",
Expand Down
4 changes: 2 additions & 2 deletions packages/webiny-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"is-hotkey": "^0.1.4",
"js-cookie": "^2.2.0",
"lodash": "^4.17.4",
"react": "^16.4.0",
"react-dom": "^16.4.0",
"react": "^16.6.0",
"react-dom": "^16.6.0",
"react-error-boundary": "^1.2.3",
"react-apollo": "^2.3.2",
"recompose": "^0.30.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/webiny-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@
"react-spinner-material": "^1.0.19",
"react-transition-group": "^2.5.1",
"react-visibility-sensor": "^5.0.2",
"webiny-form": "0.0.0",
"webiny-storybook-utils": "0.0.0",
"withinviewport": "^2.1.0"
},
"devDependencies": {
Expand All @@ -80,7 +78,9 @@
"babel-plugin-emotion": "^9.2.8",
"node-sass": "^4.9.3",
"raw-loader": "^0.5.1",
"sass-loader": "^7.1.0"
"sass-loader": "^7.1.0",
"webiny-form": "0.0.0",
"webiny-storybook-utils": "0.0.0"
},
"peerDependencies": {
"react": "^16.4.0",
Expand Down
55 changes: 55 additions & 0 deletions patches/Add_above_below_element_concept.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
Index: packages/webiny-app-cms/src/editor/components/Element.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- packages/webiny-app-cms/src/editor/components/Element.js (revision bad3c4cbdfdb295d048c67b7370fe8f7e8b9c0d6)
+++ packages/webiny-app-cms/src/editor/components/Element.js (revision 0e2c33e57a38eba37bdf270b828c647453f1288a)
@@ -75,6 +75,8 @@
</Draggable>
{plugin.render({ element })}
</div>
+ <div className="add-element add-element--above">+</div>
+ <div className="add-element add-element--below">+</div>
</ElementContainer>
)}
</Transition>
Index: packages/webiny-app-cms/src/editor/components/Element/ElementStyled.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- packages/webiny-app-cms/src/editor/components/Element/ElementStyled.js (revision bad3c4cbdfdb295d048c67b7370fe8f7e8b9c0d6)
+++ packages/webiny-app-cms/src/editor/components/Element/ElementStyled.js (revision 0e2c33e57a38eba37bdf270b828c647453f1288a)
@@ -111,6 +111,31 @@
backgroundColor: color
}
}
+ },
+ ">.add-element": {
+ position: "absolute",
+ left: "50%",
+ backgroundColor: color,
+ color: "white",
+ width: "22px",
+ height: "22px",
+ borderRadius: "50%",
+ display: active || highlight ? "flex" : "none",
+ justifyContent: "center",
+ alignItems: "center",
+ transform: "scale(0.5)",
+ cursor: "pointer",
+ zIndex: 15,
+ transition: "transform 0.2s",
+ "&--above": {
+ top: -12
+ },
+ "&--below": {
+ bottom: -10
+ },
+ "&:hover": {
+ transform: "scale(1)"
+ }
}
};
})

0 comments on commit 9d98e44

Please sign in to comment.