Conversation
* Fixes for location * Location fixes * Prehydrate to prevent duplicate requests * Fix issue with event subscriber
There was a problem hiding this comment.
Few small changes.
Also, in order to make this change, the docs need to be updated. Mostly Sharing data with teams on the docs/Web-Version.md page needs to mention this new tab. The way you create shares is the same, but there should be a mention of where to find the items shared with you.
| offset, | ||
| sort, | ||
| sortDir, | ||
| published: false, |
There was a problem hiding this comment.
might want to add this as an optional param?
There was a problem hiding this comment.
Updated all params to be optional to match server-side.
| { | ||
| path: 'shared', | ||
| name: 'shared', | ||
| component: DataShared, |
There was a problem hiding this comment.
need to add beforeEnter to this route as well, or possible just on the parent or grandparent?
There was a problem hiding this comment.
Would it make sense to do a global beforeEach here?
There was a problem hiding this comment.
I don't think it makes a difference. You can either put a beforeEnter in 2 places or you can check inside of a global beforeEach that the next route isn't the login route to prevent an infinite redirect.
I kinda prefer beforeEnter because if you do the beforeEach thing, you're sorta migrating some of the scope of the router config into function logic, but that's just me.
There was a problem hiding this comment.
OK that makes sense. I don't personally have a preference so I will add the beforeEnter. It does look as though it needs to be added to each individual route, not the parent.
| const newPath = getPathFromLocation(location); | ||
| if (newPath !== router.currentRoute.path) { | ||
| router.push(newPath); | ||
| async hydrate({ commit }, location: LocationType) { |
There was a problem hiding this comment.
Add a comment that explains that hydrate populates the full girder model on location change if it's missing.
| } | ||
|
|
||
| function isAnnotationFolder(item: GirderModel) { | ||
| // TODO: update to check for other info |
There was a problem hiding this comment.
Is this todo still valid? What else would we check for?
| watch(tableOptions, updateOptions, { | ||
| deep: true, | ||
| }); | ||
|
|
||
| updateOptions(); |
There was a problem hiding this comment.
edit: removed suggestion.
You'll have to merge main again and run yarn to install latest dependeicies.
There was a problem hiding this comment.
I retract this comment, watchEffect is still behaving unpredictably and is probably unsafe here. Please leave as-is.
| } | ||
|
|
||
| onBeforeUnmount(() => { | ||
| onBeforeUnmount(async () => { |
There was a problem hiding this comment.
this function does not need to be async.
| const { getters } = store; | ||
|
|
||
| const clearSelected = () => { | ||
| locationStore.selected = []; |
There was a problem hiding this comment.
Do not mutate store from outside module definition. Use commit to invoke mutation. Vuex's typescript definitions are still really lacking.
store.commit('Location/setSelected', [])
There was a problem hiding this comment.
I've had success in a few projects now using https://github.com/paroi-tech/direct-vuex. In my iterated experience, the strong typing overrides concerns about the wrapperness or the non-standardness of the library. Something to think about. I can hook you up with the engineers who actually were managing its usage, just let me know.
There was a problem hiding this comment.
I like the looks of that (though I still generally dislike vuex). Any refactoring to use a new library like this should probably be a separate PR, but we should look into direct-vuex.
| Browse Data | ||
| </v-tab> | ||
| <v-tab :to="{name: 'shared'}"> | ||
| <v-icon class="mr-2"> |
There was a problem hiding this comment.
There's a problem here where the width of the icon is dynamic, which causes a race condition with the calcuation of the underline active tab style. Soemtimes it ends up in the wrong place because the icon hasn't rendered yet.
You can solve this by forcing a fixed with on the icon. replace class="mr-2" with class="tab-icon" and define the new style as scoped.
<style scoped>
.tab-icon {
width: 28px;
margin-right: 10px;
}
</style>
subdavis
left a comment
There was a problem hiding this comment.
Looks awesome!
- One other small comment about adding a more helpful message for the case where there's no data
- A simple documentation update
After those two small things, I think we should be good to merge.
| Launch Annotator | ||
| </v-btn> | ||
| </template> | ||
| </v-data-table> |
There was a problem hiding this comment.
There was a problem hiding this comment.
Definitely. I think this is a great idea.

fixes #837