From 6dfab1d9a9b81565a408d8da48c40b2f6daa20c7 Mon Sep 17 00:00:00 2001 From: thecalcc Date: Wed, 1 Nov 2023 16:33:07 +0200 Subject: [PATCH] Fix v2. Remove absolute elements --- .../TargetedPublishing/MetaData.jsx | 44 +++++---- .../TargetedPublishing/MetaDataOverlay.jsx | 21 +---- .../RelatedArticlesStatus.jsx | 66 ++++++------- .../TargetedPublishing/TargetedPublishing.jsx | 94 ++++++++++--------- client/extensions/Publishing.jsx | 3 + 5 files changed, 113 insertions(+), 115 deletions(-) diff --git a/client/components/TargetedPublishing/MetaData.jsx b/client/components/TargetedPublishing/MetaData.jsx index 2e709a42..649b3ec1 100644 --- a/client/components/TargetedPublishing/MetaData.jsx +++ b/client/components/TargetedPublishing/MetaData.jsx @@ -115,26 +115,30 @@ class MetaData extends Component { render() { return ( <> - -
- this.toggleOverlay("Facebook")} - label="Facebook" - /> - this.toggleOverlay("Twitter")} - label="Twitter" - /> - this.toggleOverlay("SEO")} - label="SEO" - /> -
-
+ { + this.props.overlayOpen === false && ( + +
+ this.toggleOverlay("Facebook")} + label="Facebook" + /> + this.toggleOverlay("Twitter")} + label="Twitter" + /> + this.toggleOverlay("SEO")} + label="SEO" + /> +
+
+ ) + } this.toggleOverlay("")} diff --git a/client/components/TargetedPublishing/MetaDataOverlay.jsx b/client/components/TargetedPublishing/MetaDataOverlay.jsx index f0a2c374..6c5e5d35 100644 --- a/client/components/TargetedPublishing/MetaDataOverlay.jsx +++ b/client/components/TargetedPublishing/MetaDataOverlay.jsx @@ -1,5 +1,4 @@ import React, { Component } from "react"; -import classNames from "classnames"; import PropTypes from "prop-types"; import { IconButton } from "superdesk-ui-framework/react"; @@ -44,20 +43,8 @@ class MetaDataOverlay extends Component { : ""; } - const styles = this.props.isOpen ? {} : {zIndex: '-1'} - const widthHeightPersistentStyle = {width: '100%', height: '100%'}; - - return ( -
-
+ return this.props.isOpen && ( +
@@ -117,8 +104,7 @@ class MetaDataOverlay extends Component {
-
- ); + ); } } @@ -130,6 +116,7 @@ MetaDataOverlay.propTypes = { setMetaData: PropTypes.func.isRequired, uploadImage: PropTypes.func.isRequired, isUploadingInProgress: PropTypes.bool, + isOpen: PropTypes.bool, }; export default MetaDataOverlay; diff --git a/client/components/TargetedPublishing/RelatedArticlesStatus.jsx b/client/components/TargetedPublishing/RelatedArticlesStatus.jsx index fbf71c56..5026e741 100644 --- a/client/components/TargetedPublishing/RelatedArticlesStatus.jsx +++ b/client/components/TargetedPublishing/RelatedArticlesStatus.jsx @@ -42,39 +42,41 @@ class RelatedArticlesStatus extends React.Component { } return ( - - {this.state.loading && } -
    - {this.state.relatedArticles.map(article => ( -
  • -

    {article.title}

    - {this.props.rules.map(rule => { - let index = article.tenants.findIndex( - t => t && t.code === rule.tenant.code - ); - let siteDomain = rule.tenant.subdomain - ? rule.tenant.subdomain + "." + rule.tenant.domain_name - : rule.tenant.domain_name; +
  • + ))} +
+
+
); } } diff --git a/client/components/TargetedPublishing/TargetedPublishing.jsx b/client/components/TargetedPublishing/TargetedPublishing.jsx index 9bf4d84a..449d0b26 100644 --- a/client/components/TargetedPublishing/TargetedPublishing.jsx +++ b/client/components/TargetedPublishing/TargetedPublishing.jsx @@ -23,55 +23,57 @@ class TargetedPublishing extends React.Component { render() { return ( - - {!this.props.rules.length && ( -
- No websites have been set, this article won't show up on any - website. It will go to:
- - Publisher > Output Control > Incoming list - -
- )} - {this.props.rules.map((rule, index) => ( - this.setNewDestination({})} - reload={this.props.reload} - /> - ))} + ); } } diff --git a/client/extensions/Publishing.jsx b/client/extensions/Publishing.jsx index fc637ff7..bc616682 100644 --- a/client/extensions/Publishing.jsx +++ b/client/extensions/Publishing.jsx @@ -101,6 +101,7 @@ class Publishing extends React.Component { }; render() { + console.log(this.state.item) return ( {this.state.ninjsError && ( @@ -124,6 +125,7 @@ class Publishing extends React.Component { !this.state.ninjsError && !this.state.evaluateError && (