Adding possibility to export hypercube data and copy hypercube def to clipboard #232
Conversation
Deploy preview for catwalk-qlikcore ready! Built with commit 4cee72c |
There was a problem hiding this 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
], | ||
}, | ||
}; | ||
if (dimensions && dimensions.length > 0) { |
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
@@ -50,6 +51,14 @@ export default function App() { | |||
); | |||
} | |||
|
|||
const engineUrl = new URLSearchParams(document.location.search).get('engine_url'); | |||
if (!engineUrl && engineUrl !== '') { |
There was a problem hiding this comment.
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?
src/components/info-box.pcss
Outdated
|
||
.hidden { | ||
bottom: -15%; | ||
transition: bottom 0.8s ease-in-out; |
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decreasing to 0.5!
Thank you! Great addition! |
Fixes #222