-
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
Add a isUniqueValuesLoading
key to columns in the vuex state
#499
Conversation
7723379
to
ca9872d
Compare
Codecov Report
@@ Coverage Diff @@
## master #499 +/- ##
=======================================
Coverage 97.77% 97.78%
=======================================
Files 128 128
Lines 2925 2933 +8
Branches 410 410
=======================================
+ Hits 2860 2868 +8
Misses 65 65
Continue to review full report at Codecov.
|
I'm not that sure it's such a good idea to introduce an enumeration here. |
The idea is to limit the number of state properties and to keep inside the name |
ca9872d
to
ab4db9f
Compare
ab4db9f
to
bdbb3a1
Compare
bdbb3a1
to
2184c98
Compare
46b80db
to
09b18d0
Compare
09b18d0
to
4b06e07
Compare
c3d7d57
to
fd991cb
Compare
isUniqueValuesLoading
key to columns in the vuex state
isUniqueValuesLoading
key to columns in the vuex stateisUniqueValuesLoading
key to columns in the vuex state
fd991cb
to
63ab186
Compare
src/store/mutations.ts
Outdated
state.dataset.headers[ | ||
state.dataset.headers.map(col => col.name).indexOf(column) | ||
].isUniqueValuesLoading = isLoading; | ||
} |
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.
state.dataset.headers[ | |
state.dataset.headers.map(col => col.name).indexOf(column) | |
].isUniqueValuesLoading = isLoading; | |
} | |
state.dataset.headers.find(hdr => hdr.name === column).isUniqueValuesLoading = isLoading; |
src/store/getters.ts
Outdated
* helper that is True if unique values are loading | ||
*/ | ||
isUniqueValuesLoading: (state: VQBState) => (column: string) => | ||
state.dataset.headers[state.dataset.headers.map(col => col.name).indexOf(column)] |
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.
state.dataset.headers[state.dataset.headers.map(col => col.name).indexOf(column)] | |
state.dataset.headers.find(hdr => hdr.name === column).isUniqueValuesLoading |
4cde97d
to
03ea30b
Compare
@adimasci I push changes you ask for, can you have a look please ? |
tests/unit/plugins.spec.ts
Outdated
]); | ||
const wrapper = mount(PipelineComponent, { store, localVue }); | ||
wrapper.find('.query-pipeline-queue__dot').trigger('click'); | ||
await flushPromises(); |
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.
Genuine question: is there a reason why $nextTick()
would not work here? Idem for other flushPromises()
occurrences?
afbd51e
to
96ce88a
Compare
`state.dataset.headers` contains elements like: Before: `{name: 'col1', type: 'number'}` Now: `{name: 'col1', type: 'number', isUniqueValuesLoading: false}` Also, add the corresponding getter and mutation
96ce88a
to
a2926c7
Compare
* helper that is True if unique values are loading | ||
*/ | ||
isUniqueValuesLoading: (state: VQBState) => (column: string) => | ||
(state.dataset.headers.find(hdr => hdr.name === column) as DataSetColumn).isUniqueValuesLoading, |
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.
I'm surprised that the explicit type annotation is necessary 🤔
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.
The column names are not explicitly listed for typescript. Consequently, the .find()
method may return an undefined
value...
const shallowMountWrapper = ( | ||
filterValue: string[] = ['France', 'Spain'], | ||
operator: 'in' | 'nin' = 'in', | ||
// eslint-disable-next-line @typescript-eslint/no-inferrable-types |
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.
Thanks for this work!
I've added 2 questions but I would be ok to merge the code as is.
- Add a spinner when colunm unique values are loading - Emit an event at click on "Load All Values" button
It must register `vqb` module and not setup directly the store This fix allow us make the storybook of ListUniqueValues
form-renam-step is removed because it was not working since a long time, implementation of this step has changed a lot
a2926c7
to
d24ac3c
Compare
state.dataset.headers
contains elements like:Before:
{name: 'col1', type: 'number'}
Now:
{name: 'col1', type: 'number', isUniqueValuesLoading: false}
Also, add the corresponding getter and mutation
Please read commit by commit.
NB:
This PR also fix story of DataViewer and remove the broken story of
RenameStep
. An issue has been written to create stories for the form steps: #501