From ae40ee2668930be4f1506ca9ef7084ade3c6c3fe Mon Sep 17 00:00:00 2001 From: cyril lopez Date: Wed, 11 Oct 2017 16:26:13 +0200 Subject: [PATCH 1/2] Center popupwarning and remove confirm button border --- .../lib/src/components/PopUpWarning/styles.scss | 5 +++-- .../admin/src/components/PopUpWarning/styles.scss | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/strapi-helper-plugin/lib/src/components/PopUpWarning/styles.scss b/packages/strapi-helper-plugin/lib/src/components/PopUpWarning/styles.scss index 90b97c82f9..758f64f1f9 100644 --- a/packages/strapi-helper-plugin/lib/src/components/PopUpWarning/styles.scss +++ b/packages/strapi-helper-plugin/lib/src/components/PopUpWarning/styles.scss @@ -17,8 +17,9 @@ } .modalPosition { top: 16.8rem; + left: 18.2rem; margin-top: 0 !important; - + > div { border:none; border-radius: 2px; @@ -52,7 +53,6 @@ position: relative; border-radius: 0.3rem; text-transform: capitalize; - // margin-right: 1.8rem; cursor: pointer; font-family: Lato; &:focus { @@ -81,6 +81,7 @@ background: linear-gradient(315deg, #0097F6 0%, #005EEA 100%); -webkit-font-smoothing: antialiased; color: white !important; + border: none; &:active { box-shadow: inset 1px 1px 3px rgba(0,0,0,.15); } diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/PopUpWarning/styles.scss b/packages/strapi-plugin-content-type-builder/admin/src/components/PopUpWarning/styles.scss index 4b76db73d4..a0134675b5 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/components/PopUpWarning/styles.scss +++ b/packages/strapi-plugin-content-type-builder/admin/src/components/PopUpWarning/styles.scss @@ -41,7 +41,7 @@ } .modalPosition { - // top: 16.8rem; + left: 18.2rem; > div { border:none; border-radius: 2px; @@ -80,7 +80,6 @@ position: relative; border-radius: 0.3rem; text-transform: capitalize; - // margin-right: 1.8rem; cursor: pointer; font-family: Lato; &:focus { @@ -110,6 +109,7 @@ background: linear-gradient(315deg, #0097F6 0%, #005EEA 100%); -webkit-font-smoothing: antialiased; color: white !important; + border: none; &:active { box-shadow: inset 1px 1px 3px rgba(0,0,0,.15); } From d1c18c3d8ceaeb4b5f7200904b9377854b625d97 Mon Sep 17 00:00:00 2001 From: cyril lopez Date: Wed, 11 Oct 2017 16:54:58 +0200 Subject: [PATCH 2/2] Hide content types section if there is no model, change admin left men components to stateless function instead of react class --- .../src/components/LeftMenuHeader/index.js | 18 ++- .../components/LeftMenuLinkContainer/index.js | 113 +++++++++--------- 2 files changed, 67 insertions(+), 64 deletions(-) diff --git a/packages/strapi-admin/admin/src/components/LeftMenuHeader/index.js b/packages/strapi-admin/admin/src/components/LeftMenuHeader/index.js index fc114b0593..8f0df8e829 100755 --- a/packages/strapi-admin/admin/src/components/LeftMenuHeader/index.js +++ b/packages/strapi-admin/admin/src/components/LeftMenuHeader/index.js @@ -9,16 +9,14 @@ import { Link } from 'react-router-dom'; import styles from './styles.scss'; -class LeftMenuHeader extends React.Component { // eslint-disable-line react/prefer-stateless-function - render() { - return ( -
- - - -
- ); - } +function LeftMenuHeader() { + return ( +
+ + + +
+ ); } export default LeftMenuHeader; diff --git a/packages/strapi-admin/admin/src/components/LeftMenuLinkContainer/index.js b/packages/strapi-admin/admin/src/components/LeftMenuLinkContainer/index.js index 7002ade35a..21dbb24c4f 100755 --- a/packages/strapi-admin/admin/src/components/LeftMenuLinkContainer/index.js +++ b/packages/strapi-admin/admin/src/components/LeftMenuLinkContainer/index.js @@ -7,18 +7,23 @@ import React from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; -import { map } from 'lodash'; +import { get, map, size } from 'lodash'; import LeftMenuLink from 'components/LeftMenuLink'; import styles from './styles.scss'; import messages from './messages.json'; -class LeftMenuLinkContainer extends React.Component { // eslint-disable-line react/prefer-stateless-function - render() { - // Generate the list of sections - const linkSections = map(this.props.plugins.toJS(), plugin => ( - plugin.leftMenuSections.map((leftMenuSection, j) => ( +function LeftMenuLinkContainer({ plugins }) { + // Generate the list of sections + const linkSections = map(plugins.toJS(), plugin => ( + plugin.leftMenuSections.map((leftMenuSection, j) => { + + if (size(get(leftMenuSection, 'links')) === 0) { + return
+ } + + return (

{leftMenuSection.name}

    @@ -27,57 +32,57 @@ class LeftMenuLinkContainer extends React.Component { // eslint-disable-line rea )}
- )) - )); - - // Check if the plugins list is empty or not - const pluginsLinks = this.props.plugins.size - ? this.props.plugins.valueSeq().map((plugin) => ( - - )) - : ( -
  • - . -
  • ); + }) + )); - return ( -
    - {linkSections} -
    -

    -
      - {pluginsLinks} -
    -
    -
    -

    -
      - - - -
    -
    -
    + // Check if the plugins list is empty or not + const pluginsLinks = plugins.size + ? plugins.valueSeq().map((plugin) => ( + + )) + : ( +
  • + . +
  • ); - } + + return ( +
    + {linkSections} +
    +

    +
      + {pluginsLinks} +
    +
    +
    +

    +
      + + + +
    +
    +
    + ); } LeftMenuLinkContainer.propTypes = {