-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test(ui): fixes default values not set TCTC-4635 #1602
Conversation
vue-class-component is not really active anymore it has a problem with setting the default prop value
Your Render PR Server URL is https://weaverbird-playground-pr-1602.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cdp3g3qen0hivi1oo8h0. |
}, | ||
|
||
availableVariables: { | ||
type: Array as PropType<VariablesBucket>, |
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.
those are required or default to undefined
? In which case `as PropType< VariablesBucket | undefined>
Same for above
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.
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.
ah ok cool! It has been improved then! It used to be a problem
@@ -97,91 +96,161 @@ type OperatorOption = { | |||
|
|||
export const DEFAULT_FILTER = { column: '', value: '', operator: 'eq' }; | |||
|
|||
@Component({ | |||
const nullOperators: Readonly<OperatorOption[]> = [ |
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.
👍
Can probably be in a registry util
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.
What do you mean by a registry util?
In a dedicated file with constants (outside the component file)?
(If yes, I agree!)
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.
yes
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.
OK! If it's OK, I prefer to do this later on, to first unblock Tucana's testswith the new version of weaverbird
Same problem of default value
Doesn't solve our pbs though
It's already run by yarn format: ci, so we can speed up eslint
@@ -412,7 +412,7 @@ describe.skip('Widget FilterSimpleCondition', () => { | |||
it('should not pass the variables props if hideColumnVariables is true', () => { | |||
const customProps = { | |||
availableVariables: ['test'], | |||
variableDelimiters: ['test'], | |||
variableDelimiters: {start:'te', end: 'st'}, |
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.
Bien vu!
@@ -255,7 +259,7 @@ export default defineComponent({ | |||
created() { | |||
// In absence of condition, emit directly to the parent the default value | |||
if (isEqual(this.value, DEFAULT_FILTER)) { | |||
this.$emit('input', DEFAULT_FILTER); | |||
this.$emit('input', { ...DEFAULT_FILTER }); |
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.
Une raison de pas faire this.value plutôt? Ca éviterait de faire deux spread operator et la value est déjà isolée non 🤔 ?
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.
Tu as raison, mieux vaut ne pas changer l'existant - ce n'est pas le but de cette PR. Je remet!
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.
LGTM!
For an unknown reason, the default value of a prop seemed never applied.
We found some issues about this in vue-class-component's repo, but non e of the solutions worked.
So I switched to
defineComponent
, which works like a charm.