Skip to content

Commit

Permalink
Remove sources from schema
Browse files Browse the repository at this point in the history
  • Loading branch information
dana-cfc4 committed Jan 12, 2023
1 parent bc65898 commit 0d2b862
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 113 deletions.
11 changes: 6 additions & 5 deletions src/Blocks/EmbedEEATableauBlock/View.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import ConnectedTableau from '../../ConnectedTableau/ConnectedTableau';

import { Sources } from '../../Sources';
import { getContent } from '@plone/volto/actions';

import { connect } from 'react-redux';
Expand All @@ -10,7 +9,7 @@ import { compose } from 'redux';
const View = (props) => {
const { data } = props || {};
const { vis_url = '' } = data;
const with_sources = data?.with_sources ?? false;
const show_sources = data?.show_sources ?? false;

React.useEffect(() => {
if (vis_url) {
Expand All @@ -24,12 +23,14 @@ const View = (props) => {
{data?.vis_url ? (
<>
<ConnectedTableau {...props.tableau_visualization} id={props.id} />
{with_sources &&
{show_sources &&
data.tableauSources &&
props.tableau_visualization ? (
<Sources data={data.tableauSources} />
) : (
''
) : show_sources ? (
<div>Data provenance is not set in the visualization</div>
) : (
''
)}
</>
) : (
Expand Down
40 changes: 0 additions & 40 deletions src/Blocks/EmbedEEATableauBlock/schema.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
const sourceSchema = {
title: 'Source',

fieldsets: [
{
id: 'default',
title: 'Default',
fields: ['source', 'source_link'],
},
],

properties: {
source: {
title: 'Source',
widget: 'textarea',
},
source_link: {
title: 'Link',
type: 'string',
},
},

required: ['source'],
};

const Schema = (props) => {
return {
title: 'Embed EEA Tableau',
Expand All @@ -32,11 +7,6 @@ const Schema = (props) => {
title: 'Default',
fields: ['vis_url', 'height', 'show_sources'],
},
{
id: 'sources',
title: 'Sources',
fields: ['tableauSources', 'with_sources'],
},
],
properties: {
vis_url: {
Expand All @@ -48,20 +18,10 @@ const Schema = (props) => {
type: 'number',
default: 450,
},
tableauSources: {
widget: 'object_list',
title: 'Sources',
schema: sourceSchema,
},
show_sources: {
title: 'Toggle sources',
type: 'boolean',
},
with_sources: {
title: 'Sources visible',
type: 'boolean',
defaultValue: true,
},
},

required: ['vis_url'],
Expand Down
46 changes: 0 additions & 46 deletions src/Sources/Sources.jsx

This file was deleted.

3 changes: 0 additions & 3 deletions src/Sources/index.js

This file was deleted.

7 changes: 0 additions & 7 deletions src/Sources/style.css

This file was deleted.

24 changes: 12 additions & 12 deletions src/less/tableau.less
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
}

.not_displayed_tableau {
min-width: 633px;
width: 100%;
min-height: 200px;
min-width: 633px;
height: 100%;
min-height: 200px;
background-color: #ebebeb;
}

Expand All @@ -63,18 +63,16 @@
padding: 10px;
}
}

.tableau-loader {
margin: auto;
display: flex;
overflow: hidden;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
border-radius: 5px;
align-items: center;
height: 100%;
overflow: hidden;
background-size: 100px 100px;
justify-content: center;
margin: auto;
animation: anim 1s linear infinite;
background-image: linear-gradient(
-45deg,
#5ac5f1 25%,
Expand All @@ -84,21 +82,23 @@
#5ac5f1 75%,
#96bbde 75%
);
animation: anim 1s linear infinite;
background-size: 100px 100px;
border-radius: 5px;
}
}

.tableau-loader span {
margin: 6px auto;
text-align: center;
color: white;
font-weight: bold;
text-align: center;
}

@keyframes anim {
0% {
background-position: 0 0;
}

100% {
background-position: 50px 50px;
}
Expand Down

0 comments on commit 0d2b862

Please sign in to comment.