Skip to content

feat: Lean more on vue slots for state#148

Merged
paveltiunov merged 14 commits into
cube-js:masterfrom
richipargo:feature/vue-state
Jul 18, 2019
Merged

feat: Lean more on vue slots for state#148
paveltiunov merged 14 commits into
cube-js:masterfrom
richipargo:feature/vue-state

Conversation

@richipargo
Copy link
Copy Markdown
Contributor

Since Vue slots are useful to show different parts and states I'm leveraging on a better solution to how queries are loaded. Also covered some areas with unit testing

@richipargo richipargo changed the title feat: Lean more on vue slots for state WIP feat: Lean more on vue slots for state Jul 1, 2019
@richipargo
Copy link
Copy Markdown
Contributor Author

Still have to document the changes

@paveltiunov
Copy link
Copy Markdown
Member

@richipargo Hey Ricardo! This is big one! Thanks for contributing it! Could you please elaborate a little bit what problem does this PR solve?

@richipargo
Copy link
Copy Markdown
Contributor Author

Hey @paveltiunov, more than a problem the intention of this PR is to give more flexibility on the usage of the QueryBuilder and QueryRenderer component. Using more slots to differentiate between the states of the query be it loaded, error or loading.
Also to try to cover the components a bit better I implemented Jest Unit testing on top of the components.

Still i'm missing a couple of items so I would leave it open still but comments and suggestions are welcome

@richipargo richipargo changed the title WIP feat: Lean more on vue slots for state feat: Lean more on vue slots for state Jul 8, 2019
@richipargo
Copy link
Copy Markdown
Contributor Author

@paveltiunov It's ready!

@paveltiunov
Copy link
Copy Markdown
Member

@richipargo Hey Ricardo! Cool! Are these changes backward compatible with previous version?

@richipargo
Copy link
Copy Markdown
Contributor Author

richipargo commented Jul 9, 2019 via email

'div',
{
class: {
'cubejs-query-renderer': true,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you use this one for styling?

@richipargo
Copy link
Copy Markdown
Contributor Author

richipargo commented Jul 9, 2019 via email

@paveltiunov
Copy link
Copy Markdown
Member

@richipargo Is there any chance we can make it fully backward compatible? I know some guys already deployed it. It would be great if we can make every version upgrade as smooth as possible.

@richipargo
Copy link
Copy Markdown
Contributor Author

I wanted to avoid it cause it generated a lot of noise, but i've set back into the default slot the missing variables to mantain compatibility

);
slot = $scopedSlots.default ? $scopedSlots.default(slotProps) : slot;
} else if (error) {
slot = $scopedSlots.error ? $scopedSlots.error({ error, sqlQuery }) : slot;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you think we should fallback here to default if only one slot is passed for backward compatibility?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You're right i missed that one

@paveltiunov
Copy link
Copy Markdown
Member

@richipargo Hey Ricardo! Everything looks great! The only thing: is there any chance it can work without class names? Would be really great if we can maintain code to be class name free in order to prevent any class name clash.

@richipargo
Copy link
Copy Markdown
Contributor Author

@paveltiunov while i would like to keep it I agree with the possible clashing, so I removed it

@paveltiunov
Copy link
Copy Markdown
Member

@richipargo Cool! Thanks!

@paveltiunov paveltiunov merged commit e8af88d into cube-js:master Jul 18, 2019
haechangcho pushed a commit to haechangcho/heartcube that referenced this pull request May 15, 2026
* Add support for empty/error/valid states on QueryBuilder

* query testing

* adjustements on member changing and updating

* query builder timedimesions

* Query builder member changes

* changes to queryBuilder

* implement slots on query builder as well

* remove overloaded props from renderer

* change slot for empty but loaded meta

* fix duplicate dependency issue and granularity to members

* update docs

* mantain full backwards compatibility

* use only default slot if no other slot is present and add extra props

* remove classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants