Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Adding possibility to export hypercube data and copy hypercube def to clipboard #232

Merged
merged 8 commits into from Apr 16, 2019

Conversation

hrigner
Copy link

@hrigner hrigner commented Apr 16, 2019

Fixes #222

@hrigner hrigner requested a review from peol April 16, 2019 07:50
@netlify
Copy link

netlify bot commented Apr 16, 2019

Deploy preview for catwalk-qlikcore ready!

Built with commit 4cee72c

https://deploy-preview-232--catwalk-qlikcore.netlify.com

Copy link
Contributor

@peol peol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really good, just minor comments.

In addition, I think the icons are a bit too small (16px) in the hyper cube box, in my opinion actionable items should be around 24px so it's easier to hit :)

src/components/cube.jsx Outdated Show resolved Hide resolved
],
},
};
if (dimensions && dimensions.length > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for > 0

@@ -73,11 +142,12 @@ export default function Cube({ app, tableData: { initialColumns }, closeOnClickO
<div role="button" title="Add another column" tabIndex="-1" className={`column-add-button ${isEmpty ? 'empty' : ''}`} onClick={e => toggleAdd(e)}>
<span className="text">+</span>
</div>
{!isEmpty ? <HypercubeTable app={app} onHeaderClick={data => onHeaderClick(data)} dimensions={dimensions} measures={measures} height={28 * 8} maxWidth={100 * 8} /> : null}
{!isEmpty ? <HypercubeTable model={model} onHeaderClick={data => onHeaderClick(data)} dimensions={dimensions} measures={measures} height={28 * 8} maxWidth={100 * 8} /> : null}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

}

function openColumnChooser() {
addOpen.current = true;
forceUpdate();
}

function copyToClipboard(id) {
if (refs.current && refs.current[id] && refs.current[id].current) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does our babel implementation allow optional chaining? https://github.com/tc39/proposal-optional-chaining

E.g. refs.current?[id]?.current

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly not, seems to be in the proposal phase still..

}

const exportHypercube = async (id) => {
if (refs.current && refs.current[id] && refs.current[id].current) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above ⬆️

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g data-name="Layer 2"><g data-name="alert-triangle"><rect width="24" height="24" transform="rotate(90 12 12)" opacity="0"/><path d="M22.56 16.3L14.89 3.58a3.43 3.43 0 0 0-5.78 0L1.44 16.3a3 3 0 0 0-.05 3A3.37 3.37 0 0 0 4.33 21h15.34a3.37 3.37 0 0 0 2.94-1.66 3 3 0 0 0-.05-3.04zm-1.7 2.05a1.31 1.31 0 0 1-1.19.65H4.33a1.31 1.31 0 0 1-1.19-.65 1 1 0 0 1 0-1l7.68-12.73a1.48 1.48 0 0 1 2.36 0l7.67 12.72a1 1 0 0 1 .01 1.01z"/><circle cx="12" cy="16" r="1"/><path d="M12 8a1 1 0 0 0-1 1v4a1 1 0 0 0 2 0V9a1 1 0 0 0-1-1z"/></g></g></svg>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we create these ourselves?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All icons in catwalk are from the eva icon set, https://akveo.github.io/eva-icons/#/?type=outline

src/components/app.jsx Outdated Show resolved Hide resolved
@@ -50,6 +51,14 @@ export default function App() {
);
}

const engineUrl = new URLSearchParams(document.location.search).get('engine_url');
if (!engineUrl && engineUrl !== '') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps if (engineUrl) instead of the double condition?


.hidden {
bottom: -15%;
transition: bottom 0.8s ease-in-out;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a tiiny bit too slow for my liking, I think I read somewhere that around 300-500ms is max before people start noticing the animation instead of the content :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decreasing to 0.5!

@hrigner hrigner merged commit c87e2c5 into master Apr 16, 2019
@shaun-hope
Copy link
Contributor

Thank you! Great addition!

@hrigner hrigner deleted the hypercube-builder2-0 branch April 17, 2019 14:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow export from the hypercube (enhancement)
3 participants